Merge release-5-0 into master
authorRoland Schulz <roland@utk.edu>
Thu, 12 Feb 2015 18:38:31 +0000 (13:38 -0500)
committerRoland Schulz <roland@utk.edu>
Thu, 12 Feb 2015 18:38:51 +0000 (13:38 -0500)
Change-Id: I23579c289b8a057a94cf64b142759934b9402ee5

2873 files changed:
.gitattributes
.gitignore
.travis.yml [new file with mode: 0644]
CMakeLists.txt
COPYING
CPackInit.cmake
admin/copyright.py
admin/git-pre-commit
admin/iwyu.imp [new file with mode: 0644]
admin/iwyu.sh [new file with mode: 0755]
admin/reformat_all.sh
admin/uncrustify.sh
cmake/FindNVML.cmake [new file with mode: 0644]
cmake/Platform/Linux-Intel-C-XeonPhi.cmake [new file with mode: 0644]
cmake/Platform/Linux-Intel-CXX-XeonPhi.cmake [new file with mode: 0644]
cmake/Platform/XeonPhi.cmake
cmake/VersionInfo.cmake.cmakein [new file with mode: 0644]
cmake/gmxBuildTypeProfile.cmake [moved from docs/doxygen/getInstalledHeaders.cmake with 65% similarity]
cmake/gmxCFlags.cmake
cmake/gmxCPackUtilities.cmake [new file with mode: 0644]
cmake/gmxConfigureVersionInfo.cmake [new file with mode: 0644]
cmake/gmxCustomCommandUtilities.cmake [new file with mode: 0644]
cmake/gmxDetectSimd.cmake
cmake/gmxGCC44O3BugWorkaround.cmake
cmake/gmxGenerateVersionInfo.cmake
cmake/gmxManageGPU.cmake
cmake/gmxManageMPI.cmake
cmake/gmxManageNvccConfig.cmake
cmake/gmxManageOpenMP.cmake
cmake/gmxManageSharedLibraries.cmake
cmake/gmxManageSuffixes.cmake
cmake/gmxOptionUtilities.cmake
cmake/gmxSetBuildInformation.cmake
cmake/gmxTestCXX11.cmake
cmake/gmxTestCompilerProblems.cmake
cmake/gmxTestSimd.cmake
cmake/gmxVersionInfo.cmake [new file with mode: 0644]
cmake/legacy_and_external.supp
docs/.gitattributes [new file with mode: 0644]
docs/CMakeLists.txt
docs/configure-markdown.cmake.in
docs/dev-manual/dev-manual.md [new file with mode: 0644]
docs/dev-manual/formatting.md [new file with mode: 0644]
docs/dev-manual/gmxtree.md [new file with mode: 0644]
docs/dev-manual/includestyle.md [new file with mode: 0644]
docs/dev-manual/style.md [new file with mode: 0644]
docs/dev-manual/tools.md [new file with mode: 0644]
docs/dev-manual/uncrustify.md [new file with mode: 0644]
docs/doxygen/CMakeLists.txt
docs/doxygen/Doxyfile-common.cmakein
docs/doxygen/Doxyfile-user.cmakein
docs/doxygen/Doxyfile-version.cmakein
docs/doxygen/Doxyfile-xml.cmakein
docs/doxygen/RunDoxygen.cmake.cmakein
docs/doxygen/check-source.py [new file with mode: 0755]
docs/doxygen/cycle-suppressions.txt [new file with mode: 0644]
docs/doxygen/directories.cpp
docs/doxygen/doxygen-check.py [deleted file]
docs/doxygen/doxygenxml.py
docs/doxygen/generateGraphs.cmake
docs/doxygen/gmxtree.py
docs/doxygen/graphbuilder.py
docs/doxygen/includesorter.py [new file with mode: 0755]
docs/doxygen/lib/doxygen.md [moved from docs/doxygen/doxygen.md with 74% similarity]
docs/doxygen/lib/modulegraph.md [new file with mode: 0644]
docs/doxygen/lib/simd.md [moved from docs/doxygen/simd.md with 100% similarity]
docs/doxygen/lib/unittesting.md [moved from docs/doxygen/unittesting.md with 100% similarity]
docs/doxygen/lib/wrapperbinary.md [moved from docs/doxygen/wrapperbinary.md with 81% similarity]
docs/doxygen/misc.cpp
docs/doxygen/reporter.py
docs/doxygen/suppressions.txt
docs/doxygen/user/analysisdata.md [moved from docs/doxygen/analysisdata.md with 100% similarity]
docs/doxygen/user/analysisframework.md [moved from docs/doxygen/analysisframework.md with 100% similarity]
docs/doxygen/user/analysistemplate.md [moved from docs/doxygen/analysistemplate.md with 100% similarity]
docs/doxygen/user/codelayout.md [moved from docs/doxygen/codelayout.md with 92% similarity]
docs/doxygen/user/mainpage.md [moved from docs/doxygen/mainpage.md with 93% similarity]
docs/doxygen/user/selections.md [moved from docs/doxygen/selections.md with 100% similarity]
docs/doxygen/user/usinglibrary.md [new file with mode: 0644]
docs/doxygen/usinglibrary.md [deleted file]
docs/index.md
docs/install-guide/CMakeLists.txt
docs/install-guide/install-guide.md
docs/man/BuildManPages.cmake [new file with mode: 0644]
docs/man/CMakeLists.txt
docs/manual/CMakeLists.txt
docs/manual/README
docs/manual/algorithms.tex
docs/manual/analyse.tex
docs/manual/defunits.tex
docs/manual/files.tex
docs/manual/forcefield.tex
docs/manual/gromacs.tex
docs/manual/install.tex [deleted file]
docs/manual/macros.tex
docs/manual/mkmdp [deleted file]
docs/manual/monster.bib
docs/manual/programs.tex
docs/manual/special.tex
docs/old-html/BuildHtmlHelp.cmake
docs/old-html/CMakeLists.txt
docs/old-html/links.dat
docs/old-html/online.html
docs/old-html/online/dlg.html
docs/old-html/online/files.html
docs/old-html/online/flow.html
docs/old-html/online/getting_started.html [deleted file]
docs/old-html/online/mdp.html
docs/old-html/online/mdp_opt.html [deleted file]
docs/old-html/online/mtx.html
docs/old-html/online/options.html [deleted file]
docs/old-html/online/top.html
docs/old-html/online/tpa.html [deleted file]
docs/old-html/online/tpb.html [deleted file]
docs/old-html/online/trj.html [deleted file]
docs/user-guide/CMakeLists.txt
docs/user-guide/cutoff-schemes.md [new file with mode: 0644]
docs/user-guide/environment-variables.md [new file with mode: 0644]
docs/user-guide/file-formats.md [new file with mode: 0644]
docs/user-guide/getting-started.md [new file with mode: 0644]
docs/user-guide/main.md
docs/user-guide/mdp-options.md [new file with mode: 0644]
docs/user-guide/mdrun-features.md [new file with mode: 0644]
docs/user-guide/mdrun-performance.md [new file with mode: 0644]
docs/user-guide/references.md [new file with mode: 0644]
docs/user-guide/tools.md [new file with mode: 0644]
scripts/GMXRC.bash.cmakein
scripts/GMXRC.csh.cmakein
share/template/CMakeLists.txt
share/template/CMakeLists.txt.template
share/template/README
share/template/cmake/FindGROMACS.cmake [new file with mode: 0644]
share/template/cmake/FindGROMACS.cmakein [deleted file]
share/top/gurgle.dat
share/top/oplsaa.ff/atomtypes.atp
share/top/oplsaa.ff/ffnonbonded.itp
share/top/oplsaa.ff/tip4pew.itp [new file with mode: 0644]
share/top/oplsaa.ff/watermodels.dat
share/top/residuetypes.dat
src/CMakeLists.txt
src/config.h.cmakein
src/contrib/anaf.c
src/contrib/calcfdev.c
src/contrib/compnl.c
src/contrib/do_multiprot.c
src/contrib/do_shift.c
src/contrib/ehanal.c
src/contrib/ehdata.c
src/contrib/ehole.c
src/contrib/g_anavel.c
src/contrib/gen_table.c
src/contrib/gmx_sdf.c
src/contrib/gmx_stats_test.c
src/contrib/hexamer.c
src/contrib/hrefify.c
src/contrib/mkice.c
src/contrib/test.c
src/contrib/test_fatal.c
src/contrib/testfft.c
src/contrib/testlr.c
src/contrib/timefft.c
src/external/.gitattributes
src/external/Random123-1.08/include/Random123/features/compilerfeatures.h
src/external/boost/README
src/external/fftpack/fftpack.h
src/external/gmock-1.7.0/CMakeLists.txt
src/external/gmock-1.7.0/gtest/include/gtest/gtest.h
src/external/lmfit/README [new file with mode: 0644]
src/external/lmfit/lmcurve.c [new file with mode: 0644]
src/external/lmfit/lmcurve.h [new file with mode: 0644]
src/external/lmfit/lmmin.c [new file with mode: 0644]
src/external/lmfit/lmmin.h [new file with mode: 0644]
src/external/lmfit/lmstruct.h [new file with mode: 0644]
src/external/thread_mpi/include/thread_mpi/mpi_bindings.h
src/external/thread_mpi/src/pthreads.c
src/external/tng_io/CMakeLists.txt
src/external/tng_io/include/tng/tng_io.h
src/external/tng_io/src/lib/md5.c
src/external/tng_io/src/lib/tng_io.c
src/gmxpre-config.h.cmakein [moved from src/gromacs/legacyheaders/gmx_fatal_collective.h with 58% similarity]
src/gmxpre.h [new file with mode: 0644]
src/gromacs/CMakeLists.txt
src/gromacs/InstallLibInfo.cmake [new file with mode: 0644]
src/gromacs/analysisdata.h
src/gromacs/analysisdata/CMakeLists.txt
src/gromacs/analysisdata/abstractdata.cpp
src/gromacs/analysisdata/abstractdata.h
src/gromacs/analysisdata/analysisdata.cpp
src/gromacs/analysisdata/analysisdata.h
src/gromacs/analysisdata/arraydata.cpp
src/gromacs/analysisdata/arraydata.h
src/gromacs/analysisdata/dataframe.cpp
src/gromacs/analysisdata/dataframe.h
src/gromacs/analysisdata/datamodule.cpp
src/gromacs/analysisdata/datamodule.h
src/gromacs/analysisdata/datamodulemanager.cpp
src/gromacs/analysisdata/datamodulemanager.h
src/gromacs/analysisdata/dataproxy.cpp
src/gromacs/analysisdata/dataproxy.h
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/analysisdata/datastorage.h
src/gromacs/analysisdata/framelocaldata.h [new file with mode: 0644]
src/gromacs/analysisdata/modules/CMakeLists.txt
src/gromacs/analysisdata/modules/average.cpp
src/gromacs/analysisdata/modules/average.h
src/gromacs/analysisdata/modules/displacement.cpp
src/gromacs/analysisdata/modules/displacement.h
src/gromacs/analysisdata/modules/frameaverager.cpp
src/gromacs/analysisdata/modules/frameaverager.h
src/gromacs/analysisdata/modules/histogram.cpp
src/gromacs/analysisdata/modules/histogram.h
src/gromacs/analysisdata/modules/lifetime.cpp
src/gromacs/analysisdata/modules/lifetime.h
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/analysisdata/modules/plot.h
src/gromacs/analysisdata/tests/analysisdata.cpp
src/gromacs/analysisdata/tests/arraydata.cpp
src/gromacs/analysisdata/tests/average.cpp
src/gromacs/analysisdata/tests/datatest.cpp
src/gromacs/analysisdata/tests/datatest.h
src/gromacs/analysisdata/tests/histogram.cpp
src/gromacs/analysisdata/tests/lifetime.cpp
src/gromacs/analysisdata/tests/mock_datamodule.cpp
src/gromacs/analysisdata/tests/mock_datamodule.h
src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ComputesCumulativeHistogram.xml [new file with mode: 0644]
src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ResamplesAtDoubleBinWidth.xml
src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ResamplesAtDoubleBinWidthWithIntegerBins.xml
src/gromacs/commandline.h
src/gromacs/commandline/CMakeLists.txt
src/gromacs/commandline/cmdlinehelpcontext.cpp
src/gromacs/commandline/cmdlinehelpcontext.h
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinehelpmodule.h
src/gromacs/commandline/cmdlinehelpwriter.cpp
src/gromacs/commandline/cmdlinehelpwriter.h
src/gromacs/commandline/cmdlineinit.cpp
src/gromacs/commandline/cmdlineinit.h
src/gromacs/commandline/cmdlinemodule.cpp [moved from src/gromacs/utility/gmx_header_config.h with 56% similarity]
src/gromacs/commandline/cmdlinemodule.h
src/gromacs/commandline/cmdlinemodulemanager-impl.h
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlinemodulemanager.h
src/gromacs/commandline/cmdlineoptionsmodule.cpp [new file with mode: 0644]
src/gromacs/commandline/cmdlineoptionsmodule.h [new file with mode: 0644]
src/gromacs/commandline/cmdlineparser.cpp
src/gromacs/commandline/cmdlineparser.h
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/cmdlineprogramcontext.h
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/pargs.h
src/gromacs/commandline/shellcompletions.cpp
src/gromacs/commandline/shellcompletions.h
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/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml
src/gromacs/correlationfunctions/CMakeLists.txt [new file with mode: 0644]
src/gromacs/correlationfunctions/autocorr.c [moved from src/gromacs/gmxana/autocorr.c with 71% similarity]
src/gromacs/correlationfunctions/autocorr.h [new file with mode: 0644]
src/gromacs/correlationfunctions/crosscorr.c [new file with mode: 0644]
src/gromacs/correlationfunctions/crosscorr.h [new file with mode: 0644]
src/gromacs/correlationfunctions/expfit.c [new file with mode: 0644]
src/gromacs/correlationfunctions/expfit.h [new file with mode: 0644]
src/gromacs/correlationfunctions/integrate.c [new file with mode: 0644]
src/gromacs/correlationfunctions/integrate.h [new file with mode: 0644]
src/gromacs/correlationfunctions/manyautocorrelation.c [new file with mode: 0644]
src/gromacs/correlationfunctions/manyautocorrelation.h [new file with mode: 0644]
src/gromacs/correlationfunctions/polynomials.c [moved from src/gromacs/gmxana/polynomials.c with 75% similarity]
src/gromacs/correlationfunctions/polynomials.h [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/autocorr.cpp [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/correlationdataset.cpp [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/correlationdataset.h [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/expfit.cpp [new file with mode: 0755]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacCos.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacNormal.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP0.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP1.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP2.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP3.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP4.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacRcross.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacVector.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnERF.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnERREST.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP1.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP2.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP3.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP5.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP7.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP9.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnPRES.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnVAC.xml [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/testCOS3.xvg [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/testEXP.xvg [new file with mode: 0644]
src/gromacs/correlationfunctions/tests/testINVEXP.xvg [new file with mode: 0755]
src/gromacs/correlationfunctions/tests/testPRES.xvg [new file with mode: 0644]
src/gromacs/domdec/CMakeLists.txt [new file with mode: 0644]
src/gromacs/domdec/domdec.cpp [moved from src/gromacs/mdlib/domdec.c with 96% similarity]
src/gromacs/domdec/domdec.h [moved from src/gromacs/legacyheaders/domdec.h with 63% similarity]
src/gromacs/domdec/domdec_box.cpp [moved from src/gromacs/mdlib/domdec_box.c with 91% similarity]
src/gromacs/domdec/domdec_constraints.cpp [new file with mode: 0644]
src/gromacs/domdec/domdec_constraints.h [new file with mode: 0644]
src/gromacs/domdec/domdec_internal.h [moved from src/gromacs/gmxlib/minvert.h with 69% similarity]
src/gromacs/domdec/domdec_network.cpp [moved from src/gromacs/mdlib/domdec_network.c with 96% similarity]
src/gromacs/domdec/domdec_network.h [moved from src/gromacs/legacyheaders/domdec_network.h with 59% similarity]
src/gromacs/domdec/domdec_setup.cpp [moved from src/gromacs/mdlib/domdec_setup.c with 84% similarity]
src/gromacs/domdec/domdec_specatomcomm.cpp [new file with mode: 0644]
src/gromacs/domdec/domdec_specatomcomm.h [new file with mode: 0644]
src/gromacs/domdec/domdec_topology.cpp [moved from src/gromacs/mdlib/domdec_top.c with 87% similarity]
src/gromacs/domdec/domdec_vsite.cpp [new file with mode: 0644]
src/gromacs/domdec/domdec_vsite.h [moved from src/gromacs/utility/gmx_header_config_gen.h.cmakein with 64% similarity]
src/gromacs/essentialdynamics/edsam.c
src/gromacs/essentialdynamics/edsam.h
src/gromacs/ewald/CMakeLists.txt [new file with mode: 0644]
src/gromacs/ewald/ewald.c [moved from src/gromacs/mdlib/ewald.c with 86% similarity]
src/gromacs/ewald/ewald.h [new file with mode: 0644]
src/gromacs/ewald/long-range-correction.c [moved from src/gromacs/gmxlib/ewald_util.c with 90% similarity]
src/gromacs/ewald/long-range-correction.h [moved from src/gromacs/legacyheaders/coulomb.h with 68% similarity]
src/gromacs/ewald/pme-internal.h [new file with mode: 0644]
src/gromacs/ewald/pme-load-balancing.c [moved from src/programs/mdrun/pme_loadbal.c with 93% similarity]
src/gromacs/ewald/pme-load-balancing.h [moved from src/programs/mdrun/pme_loadbal.h with 72% similarity]
src/gromacs/ewald/pme-pp.c [moved from src/gromacs/mdlib/pme_pp.c with 98% similarity]
src/gromacs/ewald/pme-simd4.h [moved from src/gromacs/mdlib/pme_simd4.h with 100% similarity]
src/gromacs/ewald/pme.c [moved from src/gromacs/mdlib/pme.c with 99% similarity]
src/gromacs/ewald/pme.h [moved from src/gromacs/legacyheaders/pme.h with 63% similarity]
src/gromacs/fft/CMakeLists.txt
src/gromacs/fft/fft.cpp [moved from src/gromacs/fft/fft.c with 98% similarity]
src/gromacs/fft/fft.h
src/gromacs/fft/fft5d.cpp
src/gromacs/fft/fft5d.h
src/gromacs/fft/fft_fftpack.cpp [moved from src/gromacs/fft/fft_fftpack.c with 98% similarity]
src/gromacs/fft/fft_fftw3.cpp
src/gromacs/fft/fft_mkl.cpp [moved from src/gromacs/fft/fft_mkl.c with 99% similarity]
src/gromacs/fft/parallel_3dfft.cpp [moved from src/gromacs/fft/parallel_3dfft.c with 97% similarity]
src/gromacs/fft/parallel_3dfft.h
src/gromacs/fft/tests/fft.cpp
src/gromacs/fileio/CMakeLists.txt
src/gromacs/fileio/confio.c
src/gromacs/fileio/confio.h
src/gromacs/fileio/enxio.c
src/gromacs/fileio/enxio.h
src/gromacs/fileio/filenm.c
src/gromacs/fileio/filenm.h
src/gromacs/fileio/futil.h [deleted file]
src/gromacs/fileio/gmx_system_xdr.c
src/gromacs/fileio/gmxfio.c
src/gromacs/fileio/gmxfio.h
src/gromacs/fileio/gmxfio_asc.c
src/gromacs/fileio/gmxfio_bin.c
src/gromacs/fileio/gmxfio_int.h
src/gromacs/fileio/gmxfio_rw.c
src/gromacs/fileio/gmxfio_xdr.c
src/gromacs/fileio/libxdrf.c
src/gromacs/fileio/matio.cpp
src/gromacs/fileio/matio.h
src/gromacs/fileio/md5.c
src/gromacs/fileio/mdoutf.c
src/gromacs/fileio/mdoutf.h
src/gromacs/fileio/mtxio.c [moved from src/gromacs/linearalgebra/mtxio.c with 97% similarity]
src/gromacs/fileio/mtxio.h [moved from src/gromacs/linearalgebra/mtxio.h with 94% similarity]
src/gromacs/fileio/pdbio.c
src/gromacs/fileio/pdbio.h
src/gromacs/fileio/strdb.c
src/gromacs/fileio/strdb.h
src/gromacs/fileio/tests/tngio.cpp
src/gromacs/fileio/timecontrol.c
src/gromacs/fileio/timecontrol.h
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tngio.h
src/gromacs/fileio/tngio_for_tools.cpp
src/gromacs/fileio/tngio_for_tools.h
src/gromacs/fileio/tpxio.c
src/gromacs/fileio/tpxio.h
src/gromacs/fileio/trajectory_writing.c
src/gromacs/fileio/trajectory_writing.h
src/gromacs/fileio/trnio.c
src/gromacs/fileio/trnio.h
src/gromacs/fileio/trx.h
src/gromacs/fileio/trxio.c
src/gromacs/fileio/trxio.h
src/gromacs/fileio/vmdio.c
src/gromacs/fileio/vmdio.h
src/gromacs/fileio/writeps.c
src/gromacs/fileio/writeps.h
src/gromacs/fileio/xdrd.c
src/gromacs/fileio/xdrf.h
src/gromacs/fileio/xtcio.c
src/gromacs/fileio/xtcio.h
src/gromacs/fileio/xvgr.cpp [moved from src/gromacs/gmxlib/xvgr.cpp with 96% similarity]
src/gromacs/fileio/xvgr.h [moved from src/gromacs/legacyheaders/xvgr.h with 96% similarity]
src/gromacs/gmxana/CMakeLists.txt
src/gromacs/gmxana/anadih.c
src/gromacs/gmxana/binsearch.c
src/gromacs/gmxana/binsearch.h
src/gromacs/gmxana/cmat.c
src/gromacs/gmxana/cmat.h
src/gromacs/gmxana/correl.c [deleted file]
src/gromacs/gmxana/dens_filter.c
src/gromacs/gmxana/dens_filter.h
src/gromacs/gmxana/dlist.c
src/gromacs/gmxana/edittop.c
src/gromacs/gmxana/eigio.c
src/gromacs/gmxana/eigio.h
src/gromacs/gmxana/expfit.c [deleted file]
src/gromacs/gmxana/fitahx.c
src/gromacs/gmxana/fitahx.h
src/gromacs/gmxana/geminate.c
src/gromacs/gmxana/geminate.h
src/gromacs/gmxana/gmx_ana.h
src/gromacs/gmxana/gmx_anadock.c
src/gromacs/gmxana/gmx_anaeig.c
src/gromacs/gmxana/gmx_analyze.c
src/gromacs/gmxana/gmx_angle.c
src/gromacs/gmxana/gmx_bar.c
src/gromacs/gmxana/gmx_bundle.c
src/gromacs/gmxana/gmx_chi.c
src/gromacs/gmxana/gmx_cluster.c
src/gromacs/gmxana/gmx_clustsize.c
src/gromacs/gmxana/gmx_confrms.c
src/gromacs/gmxana/gmx_covar.c
src/gromacs/gmxana/gmx_current.c
src/gromacs/gmxana/gmx_density.c
src/gromacs/gmxana/gmx_densmap.c
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dielectric.c
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.c
src/gromacs/gmxana/gmx_do_dssp.c
src/gromacs/gmxana/gmx_dos.c
src/gromacs/gmxana/gmx_dyecoupl.c
src/gromacs/gmxana/gmx_dyndom.c
src/gromacs/gmxana/gmx_editconf.c
src/gromacs/gmxana/gmx_eneconv.c
src/gromacs/gmxana/gmx_enemat.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_filter.c
src/gromacs/gmxana/gmx_genion.c
src/gromacs/gmxana/gmx_genpr.c
src/gromacs/gmxana/gmx_gyrate.c
src/gromacs/gmxana/gmx_h2order.c
src/gromacs/gmxana/gmx_hbond.c
src/gromacs/gmxana/gmx_helix.c
src/gromacs/gmxana/gmx_helixorient.c
src/gromacs/gmxana/gmx_hydorder.c
src/gromacs/gmxana/gmx_lie.c
src/gromacs/gmxana/gmx_make_edi.c
src/gromacs/gmxana/gmx_make_ndx.c
src/gromacs/gmxana/gmx_mdmat.c
src/gromacs/gmxana/gmx_mindist.c
src/gromacs/gmxana/gmx_mk_angndx.c
src/gromacs/gmxana/gmx_morph.c
src/gromacs/gmxana/gmx_msd.c
src/gromacs/gmxana/gmx_nmeig.c
src/gromacs/gmxana/gmx_nmens.c
src/gromacs/gmxana/gmx_nmtraj.c
src/gromacs/gmxana/gmx_options.c [deleted file]
src/gromacs/gmxana/gmx_order.c
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_polystat.c
src/gromacs/gmxana/gmx_potential.c
src/gromacs/gmxana/gmx_principal.c
src/gromacs/gmxana/gmx_rama.c
src/gromacs/gmxana/gmx_rdf.c [deleted file]
src/gromacs/gmxana/gmx_rms.c
src/gromacs/gmxana/gmx_rmsdist.c
src/gromacs/gmxana/gmx_rmsf.c
src/gromacs/gmxana/gmx_rotacf.c
src/gromacs/gmxana/gmx_rotmat.c
src/gromacs/gmxana/gmx_saltbr.c
src/gromacs/gmxana/gmx_sans.c
src/gromacs/gmxana/gmx_saxs.c
src/gromacs/gmxana/gmx_sham.c
src/gromacs/gmxana/gmx_sigeps.c
src/gromacs/gmxana/gmx_sorient.c
src/gromacs/gmxana/gmx_spatial.c
src/gromacs/gmxana/gmx_spol.c
src/gromacs/gmxana/gmx_tcaf.c
src/gromacs/gmxana/gmx_traj.c
src/gromacs/gmxana/gmx_trjcat.c
src/gromacs/gmxana/gmx_trjconv.c
src/gromacs/gmxana/gmx_trjorder.c
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxana/gmx_vanhove.c
src/gromacs/gmxana/gmx_velacc.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_wheel.c
src/gromacs/gmxana/gmx_xpm2ps.c
src/gromacs/gmxana/gstat.h
src/gromacs/gmxana/hxprops.c
src/gromacs/gmxana/hxprops.h
src/gromacs/gmxana/interf.h
src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp
src/gromacs/gmxana/levenmar.c [deleted file]
src/gromacs/gmxana/nrama.c
src/gromacs/gmxana/nrama.h
src/gromacs/gmxana/nsfactor.c
src/gromacs/gmxana/nsfactor.h
src/gromacs/gmxana/powerspect.c
src/gromacs/gmxana/powerspect.h
src/gromacs/gmxana/pp2shift.c
src/gromacs/gmxana/princ.c [moved from src/gromacs/gmxlib/princ.c with 98% similarity]
src/gromacs/gmxana/princ.h [moved from src/gromacs/legacyheaders/princ.h with 94% similarity]
src/gromacs/gmxana/sfactor.c [moved from src/gromacs/gmxlib/sfactor.c with 95% similarity]
src/gromacs/gmxana/sfactor.h [moved from src/gromacs/legacyheaders/sfactor.h with 90% similarity]
src/gromacs/gmxlib/CMakeLists.txt
src/gromacs/gmxlib/calcgrid.c
src/gromacs/gmxlib/chargegroup.c
src/gromacs/gmxlib/checkpoint.cpp [moved from src/gromacs/gmxlib/checkpoint.c with 97% similarity]
src/gromacs/gmxlib/cinvsqrtdata.c [deleted file]
src/gromacs/gmxlib/conformation-utilities.c
src/gromacs/gmxlib/conformation-utilities.h
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/gmxlib/cuda_tools/CMakeLists.txt
src/gromacs/gmxlib/cuda_tools/copyrite_gpu.cu
src/gromacs/gmxlib/cuda_tools/cudautils.cu
src/gromacs/gmxlib/cuda_tools/cudautils.cuh
src/gromacs/gmxlib/cuda_tools/pmalloc_cuda.cu
src/gromacs/gmxlib/cuda_tools/pmalloc_cuda.h [moved from src/gromacs/legacyheaders/pmalloc_cuda.h with 89% similarity]
src/gromacs/gmxlib/disre.c
src/gromacs/gmxlib/gmx_cpuid.c
src/gromacs/gmxlib/gmx_detect_hardware.cpp [moved from src/gromacs/gmxlib/gmx_detect_hardware.c with 82% similarity]
src/gromacs/gmxlib/gmx_omp_nthreads.c
src/gromacs/gmxlib/gmx_thread_affinity.c
src/gromacs/gmxlib/gpu_utils/CMakeLists.txt
src/gromacs/gmxlib/gpu_utils/gpu_utils.cu
src/gromacs/gmxlib/gpu_utils/gpu_utils.h [moved from src/gromacs/legacyheaders/gpu_utils.h with 87% similarity]
src/gromacs/gmxlib/gpu_utils/memtestG80_core.cu [deleted file]
src/gromacs/gmxlib/gpu_utils/memtestG80_core.h [deleted file]
src/gromacs/gmxlib/ifunc.c
src/gromacs/gmxlib/inputrec.c
src/gromacs/gmxlib/main.cpp
src/gromacs/gmxlib/md_logging.c
src/gromacs/gmxlib/names.c
src/gromacs/gmxlib/network.c
src/gromacs/gmxlib/nonbonded/nb_free_energy.c
src/gromacs/gmxlib/nonbonded/nb_free_energy.h
src/gromacs/gmxlib/nonbonded/nb_generic.c
src/gromacs/gmxlib/nonbonded/nb_generic.h
src/gromacs/gmxlib/nonbonded/nb_generic_adress.c
src/gromacs/gmxlib/nonbonded/nb_generic_adress.h
src/gromacs/gmxlib/nonbonded/nb_generic_cg.c
src/gromacs/gmxlib/nonbonded/nb_generic_cg.h
src/gromacs/gmxlib/nonbonded/nb_kernel.c
src/gromacs/gmxlib/nonbonded/nb_kernel.h
src/gromacs/gmxlib/nonbonded/nb_kernel_adress_c/make_nb_kernel_adress_c.py
src/gromacs/gmxlib/nonbonded/nb_kernel_adress_c/nb_kernel_adress_template_c.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/kernelutil_x86_avx_128_fma_double.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_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_avx_128_fma_double.h
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_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_avx_128_fma_single.h
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/kernelutil_x86_avx_256_double.h
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_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_avx_256_double.h
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_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_avx_256_single.h
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_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_c.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_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_sparc64_hpc_ace_double.h
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/kernelutil_x86_sse2_double.h
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_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_sse2_double.h
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_template_sse2_double.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/kernelutil_x86_sse2_single.h
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_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_sse2_single.h
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_template_sse2_single.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/kernelutil_x86_sse4_1_double.h
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_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_sse4_1_double.h
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/kernelutil_x86_sse4_1_single.h
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_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_sse4_1_single.h
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_template_sse4_1_single.pre
src/gromacs/gmxlib/nonbonded/nonbonded.c
src/gromacs/gmxlib/nrnb.c
src/gromacs/gmxlib/oenv.cpp
src/gromacs/gmxlib/orires.c
src/gromacs/gmxlib/rbin.c
src/gromacs/gmxlib/readinp.c
src/gromacs/gmxlib/sighandler.c
src/gromacs/gmxlib/splitter.c
src/gromacs/gmxlib/txtdump.c
src/gromacs/gmxlib/typedefs.c
src/gromacs/gmxlib/viewit.c
src/gromacs/gmxlib/warninp.c
src/gromacs/gmxpreprocess/add_par.c
src/gromacs/gmxpreprocess/add_par.h
src/gromacs/gmxpreprocess/addconf.c [deleted file]
src/gromacs/gmxpreprocess/calc_verletbuf.c
src/gromacs/gmxpreprocess/calc_verletbuf.h
src/gromacs/gmxpreprocess/calch.c [moved from src/gromacs/gmxlib/calch.c with 98% similarity]
src/gromacs/gmxpreprocess/calch.h [moved from src/gromacs/legacyheaders/calch.h with 93% similarity]
src/gromacs/gmxpreprocess/compute_io.c
src/gromacs/gmxpreprocess/compute_io.h
src/gromacs/gmxpreprocess/convparm.c
src/gromacs/gmxpreprocess/convparm.h
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/fflibutil.h
src/gromacs/gmxpreprocess/gen_ad.c
src/gromacs/gmxpreprocess/gen_ad.h
src/gromacs/gmxpreprocess/gen_maxwell_velocities.c
src/gromacs/gmxpreprocess/gen_maxwell_velocities.h
src/gromacs/gmxpreprocess/gen_vsite.c
src/gromacs/gmxpreprocess/gen_vsite.h
src/gromacs/gmxpreprocess/genconf.c
src/gromacs/gmxpreprocess/genhydro.c
src/gromacs/gmxpreprocess/genhydro.h
src/gromacs/gmxpreprocess/gmxcpp.c
src/gromacs/gmxpreprocess/gpp_atomtype.c
src/gromacs/gmxpreprocess/gpp_atomtype.h
src/gromacs/gmxpreprocess/gpp_bond_atomtype.c
src/gromacs/gmxpreprocess/gpp_bond_atomtype.h
src/gromacs/gmxpreprocess/gpp_nextnb.c
src/gromacs/gmxpreprocess/gpp_nextnb.h
src/gromacs/gmxpreprocess/grompp-impl.h
src/gromacs/gmxpreprocess/grompp.c
src/gromacs/gmxpreprocess/h_db.c
src/gromacs/gmxpreprocess/h_db.h
src/gromacs/gmxpreprocess/hackblock.c
src/gromacs/gmxpreprocess/hackblock.h
src/gromacs/gmxpreprocess/hizzie.c
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/gmxpreprocess/insert-molecules.h
src/gromacs/gmxpreprocess/nm2type.c
src/gromacs/gmxpreprocess/nm2type.h
src/gromacs/gmxpreprocess/pdb2gmx.c
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pdb2top.h
src/gromacs/gmxpreprocess/pgutil.c
src/gromacs/gmxpreprocess/pgutil.h
src/gromacs/gmxpreprocess/protonate.c
src/gromacs/gmxpreprocess/read-conformation.cpp
src/gromacs/gmxpreprocess/read-conformation.h
src/gromacs/gmxpreprocess/readadress.c
src/gromacs/gmxpreprocess/readir.c
src/gromacs/gmxpreprocess/readir.h
src/gromacs/gmxpreprocess/readpull.c
src/gromacs/gmxpreprocess/readrot.c
src/gromacs/gmxpreprocess/resall.c
src/gromacs/gmxpreprocess/resall.h
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/sortwater.c
src/gromacs/gmxpreprocess/sortwater.h
src/gromacs/gmxpreprocess/specbond.c
src/gromacs/gmxpreprocess/specbond.h
src/gromacs/gmxpreprocess/ter_db.c
src/gromacs/gmxpreprocess/ter_db.h
src/gromacs/gmxpreprocess/tests/CMakeLists.txt
src/gromacs/gmxpreprocess/tests/insert-molecules.cpp
src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoEmptyBox.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoEnlargedBox.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoExistingConfiguration.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoFixedPositions.xml [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/solvate.cpp
src/gromacs/gmxpreprocess/tests/spc-and-methanol.gro
src/gromacs/gmxpreprocess/tests/x0.gro [new file with mode: 0644]
src/gromacs/gmxpreprocess/tests/x2.gro [new file with mode: 0644]
src/gromacs/gmxpreprocess/tomorse.c
src/gromacs/gmxpreprocess/tomorse.h
src/gromacs/gmxpreprocess/topdirs.c
src/gromacs/gmxpreprocess/topdirs.h
src/gromacs/gmxpreprocess/topio.c
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/toppush.c
src/gromacs/gmxpreprocess/toppush.h
src/gromacs/gmxpreprocess/topshake.c
src/gromacs/gmxpreprocess/topshake.h
src/gromacs/gmxpreprocess/toputil.c
src/gromacs/gmxpreprocess/toputil.h
src/gromacs/gmxpreprocess/vsite_parm.c
src/gromacs/gmxpreprocess/vsite_parm.h
src/gromacs/gmxpreprocess/x2top.c
src/gromacs/gmxpreprocess/xlate.c
src/gromacs/gmxpreprocess/xlate.h
src/gromacs/gromacs-config-version.cmake.cmakein [new file with mode: 0644]
src/gromacs/gromacs-config.cmake.cmakein [new file with mode: 0644]
src/gromacs/imd/imd.c
src/gromacs/imd/imd.h
src/gromacs/imd/imdsocket.c
src/gromacs/imd/imdsocket.h
src/gromacs/legacyheaders/CMakeLists.txt
src/gromacs/legacyheaders/bondf.h [deleted file]
src/gromacs/legacyheaders/calcgrid.h
src/gromacs/legacyheaders/calcmu.h
src/gromacs/legacyheaders/chargegroup.h
src/gromacs/legacyheaders/checkpoint.h
src/gromacs/legacyheaders/constr.h
src/gromacs/legacyheaders/disre.h
src/gromacs/legacyheaders/ebin.h
src/gromacs/legacyheaders/force.h
src/gromacs/legacyheaders/genborn.h
src/gromacs/legacyheaders/gmx_cpuid.h
src/gromacs/legacyheaders/gmx_detect_hardware.h
src/gromacs/legacyheaders/gmx_ga2la.h
src/gromacs/legacyheaders/gmx_hash.h
src/gromacs/legacyheaders/gmx_omp_nthreads.h
src/gromacs/legacyheaders/gmx_thread_affinity.h
src/gromacs/legacyheaders/inputrec.h
src/gromacs/legacyheaders/macros.h
src/gromacs/legacyheaders/main.h
src/gromacs/legacyheaders/md_logging.h
src/gromacs/legacyheaders/md_support.h
src/gromacs/legacyheaders/mdatoms.h
src/gromacs/legacyheaders/mdebin.h
src/gromacs/legacyheaders/mdrun.h
src/gromacs/legacyheaders/names.h
src/gromacs/legacyheaders/network.h
src/gromacs/legacyheaders/nonbonded.h
src/gromacs/legacyheaders/nrnb.h
src/gromacs/legacyheaders/ns.h
src/gromacs/legacyheaders/nsgrid.h
src/gromacs/legacyheaders/oenv.h
src/gromacs/legacyheaders/orires.h
src/gromacs/legacyheaders/perf_est.h
src/gromacs/legacyheaders/qmmm.h
src/gromacs/legacyheaders/rbin.h
src/gromacs/legacyheaders/readinp.h
src/gromacs/legacyheaders/shellfc.h
src/gromacs/legacyheaders/sighandler.h
src/gromacs/legacyheaders/sim_util.h
src/gromacs/legacyheaders/splitter.h
src/gromacs/legacyheaders/tables.h
src/gromacs/legacyheaders/tgroup.h
src/gromacs/legacyheaders/txtdump.h
src/gromacs/legacyheaders/typedefs.h
src/gromacs/legacyheaders/types/CMakeLists.txt [new file with mode: 0644]
src/gromacs/legacyheaders/types/commrec.h
src/gromacs/legacyheaders/types/commrec_fwd.h [moved from src/gromacs/gmxlib/dlb.h with 80% similarity]
src/gromacs/legacyheaders/types/energy.h
src/gromacs/legacyheaders/types/enums.h
src/gromacs/legacyheaders/types/fcdata.h
src/gromacs/legacyheaders/types/force_flags.h
src/gromacs/legacyheaders/types/forcerec.h
src/gromacs/legacyheaders/types/genborn.h
src/gromacs/legacyheaders/types/globsig.h
src/gromacs/legacyheaders/types/graph.h [deleted file]
src/gromacs/legacyheaders/types/group.h
src/gromacs/legacyheaders/types/hw_info.h
src/gromacs/legacyheaders/types/ifunc.h
src/gromacs/legacyheaders/types/inputrec.h
src/gromacs/legacyheaders/types/interaction_const.h
src/gromacs/legacyheaders/types/mdatom.h
src/gromacs/legacyheaders/types/nrnb.h
src/gromacs/legacyheaders/types/ns.h
src/gromacs/legacyheaders/types/nsgrid.h
src/gromacs/legacyheaders/types/pbc.h [deleted file]
src/gromacs/legacyheaders/types/qmmmrec.h
src/gromacs/legacyheaders/types/rgb.h [moved from src/gromacs/legacyheaders/sysstuff.h with 87% similarity]
src/gromacs/legacyheaders/types/simple.h
src/gromacs/legacyheaders/types/state.h
src/gromacs/legacyheaders/update.h
src/gromacs/legacyheaders/vcm.h
src/gromacs/legacyheaders/viewit.h
src/gromacs/legacyheaders/vsite.h
src/gromacs/legacyheaders/warninp.h
src/gromacs/libgromacs.pc.cmakein
src/gromacs/linearalgebra/CMakeLists.txt
src/gromacs/linearalgebra/eigensolver.c
src/gromacs/linearalgebra/eigensolver.h
src/gromacs/linearalgebra/gmx_arpack.c
src/gromacs/linearalgebra/gmx_arpack.h
src/gromacs/linearalgebra/gmx_blas.h
src/gromacs/linearalgebra/gmx_blas/dgemm.c
src/gromacs/linearalgebra/gmx_blas/dgemv.c
src/gromacs/linearalgebra/gmx_blas/dger.c
src/gromacs/linearalgebra/gmx_blas/dnrm2.c
src/gromacs/linearalgebra/gmx_blas/dsymv.c
src/gromacs/linearalgebra/gmx_blas/dsyr2.c
src/gromacs/linearalgebra/gmx_blas/dsyr2k.c
src/gromacs/linearalgebra/gmx_blas/dtrmm.c
src/gromacs/linearalgebra/gmx_blas/dtrmv.c
src/gromacs/linearalgebra/gmx_blas/dtrsm.c
src/gromacs/linearalgebra/gmx_blas/sgemm.c
src/gromacs/linearalgebra/gmx_blas/sgemv.c
src/gromacs/linearalgebra/gmx_blas/sger.c
src/gromacs/linearalgebra/gmx_blas/snrm2.c
src/gromacs/linearalgebra/gmx_blas/ssymv.c
src/gromacs/linearalgebra/gmx_blas/ssyr2.c
src/gromacs/linearalgebra/gmx_blas/ssyr2k.c
src/gromacs/linearalgebra/gmx_blas/strmm.c
src/gromacs/linearalgebra/gmx_blas/strmv.c
src/gromacs/linearalgebra/gmx_blas/strsm.c
src/gromacs/linearalgebra/gmx_lapack.h
src/gromacs/linearalgebra/gmx_lapack/dbdsdc.c
src/gromacs/linearalgebra/gmx_lapack/dbdsqr.c
src/gromacs/linearalgebra/gmx_lapack/dgesdd.c
src/gromacs/linearalgebra/gmx_lapack/dgetf2.c
src/gromacs/linearalgebra/gmx_lapack/dlaed6.c
src/gromacs/linearalgebra/gmx_lapack/dlaev2.c
src/gromacs/linearalgebra/gmx_lapack/dlagtf.c
src/gromacs/linearalgebra/gmx_lapack/dlagts.c
src/gromacs/linearalgebra/gmx_lapack/dlapy2.c
src/gromacs/linearalgebra/gmx_lapack/dlar1vx.c
src/gromacs/linearalgebra/gmx_lapack/dlarf.c
src/gromacs/linearalgebra/gmx_lapack/dlarfg.c
src/gromacs/linearalgebra/gmx_lapack/dlarft.c
src/gromacs/linearalgebra/gmx_lapack/dlarrbx.c
src/gromacs/linearalgebra/gmx_lapack/dlarrex.c
src/gromacs/linearalgebra/gmx_lapack/dlarrfx.c
src/gromacs/linearalgebra/gmx_lapack/dlarrvx.c
src/gromacs/linearalgebra/gmx_lapack/dlartg.c
src/gromacs/linearalgebra/gmx_lapack/dlas2.c
src/gromacs/linearalgebra/gmx_lapack/dlascl.c
src/gromacs/linearalgebra/gmx_lapack/dlasd2.c
src/gromacs/linearalgebra/gmx_lapack/dlasd4.c
src/gromacs/linearalgebra/gmx_lapack/dlasd7.c
src/gromacs/linearalgebra/gmx_lapack/dlasq1.c
src/gromacs/linearalgebra/gmx_lapack/dlasq2.c
src/gromacs/linearalgebra/gmx_lapack/dlasq3.c
src/gromacs/linearalgebra/gmx_lapack/dlasq4.c
src/gromacs/linearalgebra/gmx_lapack/dlasq6.c
src/gromacs/linearalgebra/gmx_lapack/dlasr.c
src/gromacs/linearalgebra/gmx_lapack/dlassq.c
src/gromacs/linearalgebra/gmx_lapack/dlasv2.c
src/gromacs/linearalgebra/gmx_lapack/dorml2.c
src/gromacs/linearalgebra/gmx_lapack/dstebz.c
src/gromacs/linearalgebra/gmx_lapack/dstegr.c
src/gromacs/linearalgebra/gmx_lapack/dstein.c
src/gromacs/linearalgebra/gmx_lapack/dsteqr.c
src/gromacs/linearalgebra/gmx_lapack/dsterf.c
src/gromacs/linearalgebra/gmx_lapack/dsyevr.c
src/gromacs/linearalgebra/gmx_lapack/dsytd2.c
src/gromacs/linearalgebra/gmx_lapack/dtrtri.c
src/gromacs/linearalgebra/gmx_lapack/sbdsdc.c
src/gromacs/linearalgebra/gmx_lapack/sbdsqr.c
src/gromacs/linearalgebra/gmx_lapack/sgesdd.c
src/gromacs/linearalgebra/gmx_lapack/sgetf2.c
src/gromacs/linearalgebra/gmx_lapack/slaed6.c
src/gromacs/linearalgebra/gmx_lapack/slaev2.c
src/gromacs/linearalgebra/gmx_lapack/slagtf.c
src/gromacs/linearalgebra/gmx_lapack/slagts.c
src/gromacs/linearalgebra/gmx_lapack/slapy2.c
src/gromacs/linearalgebra/gmx_lapack/slar1vx.c
src/gromacs/linearalgebra/gmx_lapack/slarf.c
src/gromacs/linearalgebra/gmx_lapack/slarfg.c
src/gromacs/linearalgebra/gmx_lapack/slarft.c
src/gromacs/linearalgebra/gmx_lapack/slarrbx.c
src/gromacs/linearalgebra/gmx_lapack/slarrex.c
src/gromacs/linearalgebra/gmx_lapack/slarrfx.c
src/gromacs/linearalgebra/gmx_lapack/slarrvx.c
src/gromacs/linearalgebra/gmx_lapack/slartg.c
src/gromacs/linearalgebra/gmx_lapack/slas2.c
src/gromacs/linearalgebra/gmx_lapack/slascl.c
src/gromacs/linearalgebra/gmx_lapack/slasd2.c
src/gromacs/linearalgebra/gmx_lapack/slasd4.c
src/gromacs/linearalgebra/gmx_lapack/slasd7.c
src/gromacs/linearalgebra/gmx_lapack/slasq1.c
src/gromacs/linearalgebra/gmx_lapack/slasq2.c
src/gromacs/linearalgebra/gmx_lapack/slasq3.c
src/gromacs/linearalgebra/gmx_lapack/slasq4.c
src/gromacs/linearalgebra/gmx_lapack/slasq6.c
src/gromacs/linearalgebra/gmx_lapack/slasr.c
src/gromacs/linearalgebra/gmx_lapack/slassq.c
src/gromacs/linearalgebra/gmx_lapack/slasv2.c
src/gromacs/linearalgebra/gmx_lapack/sorml2.c
src/gromacs/linearalgebra/gmx_lapack/sstebz.c
src/gromacs/linearalgebra/gmx_lapack/sstegr.c
src/gromacs/linearalgebra/gmx_lapack/sstein.c
src/gromacs/linearalgebra/gmx_lapack/ssteqr.c
src/gromacs/linearalgebra/gmx_lapack/ssterf.c
src/gromacs/linearalgebra/gmx_lapack/ssyevr.c
src/gromacs/linearalgebra/gmx_lapack/ssytd2.c
src/gromacs/linearalgebra/gmx_lapack/strtri.c
src/gromacs/linearalgebra/matrix.c
src/gromacs/linearalgebra/nrjac.c
src/gromacs/linearalgebra/nrjac.h
src/gromacs/linearalgebra/sparsematrix.c
src/gromacs/linearalgebra/sparsematrix.h
src/gromacs/listed-forces/CMakeLists.txt [moved from cmake/gmxTestCatamount.cmake with 75% similarity]
src/gromacs/listed-forces/bonded.cpp [moved from src/gromacs/gmxlib/bondfree.c with 79% similarity]
src/gromacs/listed-forces/bonded.h [new file with mode: 0644]
src/gromacs/listed-forces/listed-forces.cpp [new file with mode: 0644]
src/gromacs/listed-forces/listed-forces.h [new file with mode: 0644]
src/gromacs/listed-forces/listed-internal.cpp [new file with mode: 0644]
src/gromacs/listed-forces/listed-internal.h [moved from src/gromacs/gmxana/correl.h with 72% similarity]
src/gromacs/listed-forces/manage-threading.cpp [new file with mode: 0644]
src/gromacs/listed-forces/manage-threading.h [moved from src/gromacs/gmxpreprocess/addconf.h with 72% similarity]
src/gromacs/listed-forces/pairs.cpp [new file with mode: 0644]
src/gromacs/listed-forces/pairs.h [new file with mode: 0644]
src/gromacs/listed-forces/position-restraints.cpp [new file with mode: 0644]
src/gromacs/listed-forces/position-restraints.h [moved from src/gromacs/legacyheaders/types/matrix.h with 53% similarity]
src/gromacs/listed-forces/restcbt.cpp [moved from src/gromacs/gmxlib/restcbt.c with 97% similarity]
src/gromacs/listed-forces/restcbt.h [moved from src/gromacs/gmxlib/restcbt.h with 97% similarity]
src/gromacs/math/3dtransforms.cpp [new file with mode: 0644]
src/gromacs/math/3dtransforms.h [moved from src/gromacs/legacyheaders/types/nlistheuristics.h with 60% similarity]
src/gromacs/math/CMakeLists.txt
src/gromacs/math/calculate-ewald-splitting-coefficient.cpp [new file with mode: 0644]
src/gromacs/math/calculate-ewald-splitting-coefficient.h [new file with mode: 0644]
src/gromacs/math/do_fit.c
src/gromacs/math/do_fit.h
src/gromacs/math/gmxcomplex.h
src/gromacs/math/invsqrt.c [new file with mode: 0644]
src/gromacs/math/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/math/tests/vectypes.cpp [new file with mode: 0644]
src/gromacs/math/units.c [moved from src/gromacs/gmxlib/physics.c with 94% similarity]
src/gromacs/math/units.h [moved from src/gromacs/legacyheaders/physics.h with 98% similarity]
src/gromacs/math/utilities.c
src/gromacs/math/utilities.h
src/gromacs/math/vec.h [moved from src/gromacs/legacyheaders/vec.h with 91% similarity]
src/gromacs/math/vectypes.h [new file with mode: 0644]
src/gromacs/mdlib/CMakeLists.txt
src/gromacs/mdlib/adress.c
src/gromacs/mdlib/adress.h
src/gromacs/mdlib/broadcaststructs.cpp [moved from src/gromacs/gmxlib/mvdata.c with 97% similarity]
src/gromacs/mdlib/calcmu.cpp [moved from src/gromacs/mdlib/calcmu.c with 92% similarity]
src/gromacs/mdlib/calcvir.cpp [moved from src/gromacs/mdlib/calcvir.c with 92% similarity]
src/gromacs/mdlib/clincs.cpp [moved from src/gromacs/mdlib/clincs.c with 96% similarity]
src/gromacs/mdlib/constr.cpp [moved from src/gromacs/mdlib/constr.c with 91% similarity]
src/gromacs/mdlib/coupling.cpp [moved from src/gromacs/mdlib/coupling.c with 96% similarity]
src/gromacs/mdlib/csettle.cpp [moved from src/gromacs/mdlib/csettle.c with 82% similarity]
src/gromacs/mdlib/domdec_con.c [deleted file]
src/gromacs/mdlib/ebin.c
src/gromacs/mdlib/expanded.c
src/gromacs/mdlib/force.cpp [moved from src/gromacs/mdlib/force.c with 86% similarity]
src/gromacs/mdlib/forcerec-threading.h [moved from src/gromacs/legacyheaders/mvdata.h with 75% similarity]
src/gromacs/mdlib/forcerec.cpp [moved from src/gromacs/mdlib/forcerec.c with 95% similarity]
src/gromacs/mdlib/genborn.c
src/gromacs/mdlib/genborn_allvsall.c
src/gromacs/mdlib/genborn_allvsall.h
src/gromacs/mdlib/genborn_allvsall_sse2_double.c
src/gromacs/mdlib/genborn_allvsall_sse2_double.h
src/gromacs/mdlib/genborn_allvsall_sse2_single.c
src/gromacs/mdlib/genborn_allvsall_sse2_single.h
src/gromacs/mdlib/genborn_sse2_double.c
src/gromacs/mdlib/genborn_sse2_double.h
src/gromacs/mdlib/genborn_sse2_single.c
src/gromacs/mdlib/genborn_sse2_single.h
src/gromacs/mdlib/groupcoord.cpp [moved from src/gromacs/mdlib/groupcoord.c with 98% similarity]
src/gromacs/mdlib/groupcoord.h
src/gromacs/mdlib/init.c [deleted file]
src/gromacs/mdlib/iteratedconstraints.c [deleted file]
src/gromacs/mdlib/md_support.cpp [moved from src/gromacs/mdlib/md_support.c with 85% similarity]
src/gromacs/mdlib/mdatom.cpp [moved from src/gromacs/mdlib/mdatom.c with 96% similarity]
src/gromacs/mdlib/mdebin.c
src/gromacs/mdlib/mdebin_bar.c
src/gromacs/mdlib/mdebin_bar.h
src/gromacs/mdlib/minimize.cpp [moved from src/gromacs/mdlib/minimize.c with 90% similarity]
src/gromacs/mdlib/nb_verlet.h [moved from src/gromacs/legacyheaders/types/nb_verlet.h with 89% similarity]
src/gromacs/mdlib/nbnxn_atomdata.c
src/gromacs/mdlib/nbnxn_atomdata.h
src/gromacs/mdlib/nbnxn_consts.h
src/gromacs/mdlib/nbnxn_cuda/CMakeLists.txt
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h [moved from src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h with 68% similarity]
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_types.h
src/gromacs/mdlib/nbnxn_internal.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.c
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h
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_2xnn_kernel.c.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_4xn_kernel.c.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.c.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_file_generator/nbnxn_kernel_simd_template.h.pre
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.c
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.c
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_outer.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128s.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_256s.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_x86_simd128.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_x86_simd256.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJCombLB_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJCombLB_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJFSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJFSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJPSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJPSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJ_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJ_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecEw_VdwLJ_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJFSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJPSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJ_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJ_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJCombLB_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJCombLB_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJFSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJFSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJPSw_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJPSw_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJ_F_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJ_VF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_ElecRF_VdwLJ_VgrpF_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.c
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJCombLB_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJCombLB_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJFSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJFSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJPSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJPSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJ_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJ_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecEw_VdwLJ_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJFSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJPSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJ_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJ_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJCombLB_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJCombLB_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJFSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJFSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJPSw_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJPSw_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJ_F_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJ_VF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_ElecRF_VdwLJ_VgrpF_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.c
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h
src/gromacs/mdlib/nbnxn_pairlist.h [moved from src/gromacs/legacyheaders/types/nbnxn_pairlist.h with 93% similarity]
src/gromacs/mdlib/nbnxn_search.c
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_simd.h
src/gromacs/mdlib/nlistheuristics.c [deleted file]
src/gromacs/mdlib/ns.c
src/gromacs/mdlib/nsgrid.c
src/gromacs/mdlib/perf_est.c
src/gromacs/mdlib/qm_gamess.c
src/gromacs/mdlib/qm_gaussian.c
src/gromacs/mdlib/qm_mopac.c
src/gromacs/mdlib/qm_orca.c
src/gromacs/mdlib/qmmm.c
src/gromacs/mdlib/rf_util.c
src/gromacs/mdlib/shakef.c [deleted file]
src/gromacs/mdlib/shakef.cpp [new file with mode: 0644]
src/gromacs/mdlib/shellfc.cpp [moved from src/gromacs/mdlib/shellfc.c with 94% similarity]
src/gromacs/mdlib/sim_util.cpp [moved from src/gromacs/mdlib/sim_util.c with 91% similarity]
src/gromacs/mdlib/stat.cpp [moved from src/gromacs/mdlib/stat.c with 79% similarity]
src/gromacs/mdlib/tables.c
src/gromacs/mdlib/tests/CMakeLists.txt [new file with mode: 0644]
src/gromacs/mdlib/tests/shake.cpp [new file with mode: 0644]
src/gromacs/mdlib/tgroup.c
src/gromacs/mdlib/tpi.cpp [moved from src/gromacs/mdlib/tpi.c with 94% similarity]
src/gromacs/mdlib/update.cpp [moved from src/gromacs/mdlib/update.c with 93% similarity]
src/gromacs/mdlib/vcm.cpp [moved from src/gromacs/mdlib/vcm.c with 97% similarity]
src/gromacs/mdlib/vsite.cpp [moved from src/gromacs/mdlib/vsite.c with 98% similarity]
src/gromacs/mdlib/wall.c
src/gromacs/mdlib/wnblist.c
src/gromacs/onlinehelp/CMakeLists.txt
src/gromacs/onlinehelp/helpformat.cpp
src/gromacs/onlinehelp/helpformat.h
src/gromacs/onlinehelp/helpmanager.cpp
src/gromacs/onlinehelp/helpmanager.h
src/gromacs/onlinehelp/helptopic.cpp
src/gromacs/onlinehelp/helptopic.h
src/gromacs/onlinehelp/helptopicinterface.h
src/gromacs/onlinehelp/helpwritercontext.cpp
src/gromacs/onlinehelp/helpwritercontext.h
src/gromacs/onlinehelp/tests/helpformat.cpp
src/gromacs/onlinehelp/tests/helpmanager.cpp
src/gromacs/onlinehelp/tests/mock_helptopic.cpp
src/gromacs/options.h
src/gromacs/options/CMakeLists.txt
src/gromacs/options/abstractoption.cpp
src/gromacs/options/abstractoption.h
src/gromacs/options/abstractoptionstorage.h
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/filenameoptionmanager.cpp [new file with mode: 0644]
src/gromacs/options/filenameoptionmanager.h [new file with mode: 0644]
src/gromacs/options/filenameoptionstorage.h
src/gromacs/options/optionflags.h
src/gromacs/options/optionmanagercontainer.h [new file with mode: 0644]
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/optionstoragetemplate.h
src/gromacs/options/optionsvisitor.cpp
src/gromacs/options/optionsvisitor.h
src/gromacs/options/tests/CMakeLists.txt
src/gromacs/options/tests/abstractoptionstorage.cpp
src/gromacs/options/tests/filenameoption.cpp
src/gromacs/options/tests/filenameoptionmanager.cpp [new file with mode: 0644]
src/gromacs/options/tests/option.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/tests/timeunitmanager.cpp
src/gromacs/options/timeunitmanager.cpp
src/gromacs/options/timeunitmanager.h
src/gromacs/pbcutil/CMakeLists.txt [new file with mode: 0644]
src/gromacs/pbcutil/ishift.h [moved from src/gromacs/legacyheaders/types/ishift.h with 93% similarity]
src/gromacs/pbcutil/mshift.cpp [moved from src/gromacs/gmxlib/mshift.c with 97% similarity]
src/gromacs/pbcutil/mshift.h [moved from src/gromacs/legacyheaders/mshift.h with 68% similarity]
src/gromacs/pbcutil/pbc.c [moved from src/gromacs/gmxlib/pbc.c with 99% similarity]
src/gromacs/pbcutil/pbc.h [moved from src/gromacs/legacyheaders/pbc.h with 89% similarity]
src/gromacs/pbcutil/rmpbc.c [moved from src/gromacs/gmxlib/rmpbc.c with 95% similarity]
src/gromacs/pbcutil/rmpbc.h [moved from src/gromacs/legacyheaders/rmpbc.h with 84% similarity]
src/gromacs/pulling/pull.c
src/gromacs/pulling/pull.h
src/gromacs/pulling/pull_rotation.c
src/gromacs/pulling/pull_rotation.h
src/gromacs/pulling/pullutil.c
src/gromacs/random/random.c
src/gromacs/random/random.h
src/gromacs/random/tests/random.cpp
src/gromacs/selection.h
src/gromacs/selection/CMakeLists.txt
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/keywords.h
src/gromacs/selection/mempool.cpp
src/gromacs/selection/mempool.h
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/parsetree.h
src/gromacs/selection/poscalc.cpp
src/gromacs/selection/poscalc.h
src/gromacs/selection/position.cpp
src/gromacs/selection/position.h
src/gromacs/selection/regenerate_parser.sh
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.h
src/gromacs/selection/scanner.l
src/gromacs/selection/scanner_flex.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/scanner_internal.h
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/selectionfileoption.h
src/gromacs/selection/selectionfileoptionstorage.h
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoption.h
src/gromacs/selection/selectionoptionmanager.cpp
src/gromacs/selection/selectionoptionmanager.h
src/gromacs/selection/selectionoptionstorage.h
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/selhelp.h
src/gromacs/selection/selmethod.cpp
src/gromacs/selection/selmethod.h
src/gromacs/selection/selparam.h
src/gromacs/selection/selvalue.cpp
src/gromacs/selection/selvalue.h
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/symrec.h
src/gromacs/selection/tests/indexutil.cpp
src/gromacs/selection/tests/nbsearch.cpp
src/gromacs/selection/tests/poscalc.cpp
src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupAll.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupAtom.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupMolecule.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupResidue.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupSingle.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesConstantPositions.xml
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesConstantPositionsWithModifiers.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositionsInArithmetic.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesPositionModifiersForKeywords.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesPositionModifiersForMethods.xml [new file with mode: 0644]
src/gromacs/selection/tests/refdata/referencedata.xsl
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/impl_arm_neon.h [new file with mode: 0644]
src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd.h [new file with mode: 0644]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx.h
src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx.h [new file with mode: 0644]
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx.h [new file with mode: 0644]
src/gromacs/simd/impl_intel_mic/impl_intel_mic.h
src/gromacs/simd/impl_reference/impl_reference.h
src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256.h
src/gromacs/simd/impl_x86_avx_128_fma/impl_x86_avx_128_fma.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256.h
src/gromacs/simd/impl_x86_sse2/impl_x86_sse2.h
src/gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1.h
src/gromacs/simd/math_x86_avx_128_fma_double.h
src/gromacs/simd/math_x86_avx_128_fma_single.h
src/gromacs/simd/math_x86_avx_256_double.h
src/gromacs/simd/math_x86_avx_256_single.h
src/gromacs/simd/math_x86_sse2_double.h
src/gromacs/simd/math_x86_sse2_single.h
src/gromacs/simd/math_x86_sse4_1_double.h
src/gromacs/simd/math_x86_sse4_1_single.h
src/gromacs/simd/simd.h
src/gromacs/simd/simd_math.h
src/gromacs/simd/tests/base.cpp
src/gromacs/simd/tests/base.h
src/gromacs/simd/tests/bootstrap_loadstore.cpp
src/gromacs/simd/tests/simd.cpp
src/gromacs/simd/tests/simd.h
src/gromacs/simd/tests/simd4.cpp
src/gromacs/simd/tests/simd4.h
src/gromacs/simd/tests/simd4_floatingpoint.cpp
src/gromacs/simd/tests/simd4_math.cpp
src/gromacs/simd/tests/simd4_vector_operations.cpp
src/gromacs/simd/tests/simd_floatingpoint.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.c
src/gromacs/statistics/statistics.h
src/gromacs/statistics/statistics_test.c
src/gromacs/swap/CMakeLists.txt
src/gromacs/swap/swapcoords.cpp [moved from src/gromacs/swap/swapcoords.c with 97% similarity]
src/gromacs/swap/swapcoords.h
src/gromacs/timing/CMakeLists.txt
src/gromacs/timing/cyclecounter.c
src/gromacs/timing/cyclecounter.h
src/gromacs/timing/wallcycle.c
src/gromacs/timing/wallcycle.h
src/gromacs/timing/walltime_accounting.c
src/gromacs/timing/walltime_accounting.h
src/gromacs/tools/CMakeLists.txt
src/gromacs/tools/check.c
src/gromacs/tools/compare.c
src/gromacs/tools/convert_tpr.c
src/gromacs/tools/dump.c
src/gromacs/tools/dump.h
src/gromacs/topology/CMakeLists.txt [new file with mode: 0644]
src/gromacs/topology/atomprop.cpp [moved from src/gromacs/gmxlib/atomprop.c with 93% similarity]
src/gromacs/topology/atomprop.h [moved from src/gromacs/legacyheaders/atomprop.h with 92% similarity]
src/gromacs/topology/atoms.cpp [new file with mode: 0644]
src/gromacs/topology/atoms.h [moved from src/gromacs/legacyheaders/types/atoms.h with 78% similarity]
src/gromacs/topology/atomsbuilder.cpp [new file with mode: 0644]
src/gromacs/topology/atomsbuilder.h [new file with mode: 0644]
src/gromacs/topology/block.cpp [new file with mode: 0644]
src/gromacs/topology/block.h [moved from src/gromacs/legacyheaders/types/block.h with 64% similarity]
src/gromacs/topology/idef.h [moved from src/gromacs/legacyheaders/types/idef.h with 86% similarity]
src/gromacs/topology/index.cpp [moved from src/gromacs/gmxlib/index.c with 78% similarity]
src/gromacs/topology/index.h [moved from src/gromacs/legacyheaders/index.h with 70% similarity]
src/gromacs/topology/invblock.c [moved from src/gromacs/gmxlib/invblock.c with 96% similarity]
src/gromacs/topology/invblock.h [moved from src/gromacs/legacyheaders/invblock.h with 85% similarity]
src/gromacs/topology/mtop_util.c [moved from src/gromacs/gmxlib/mtop_util.c with 97% similarity]
src/gromacs/topology/mtop_util.h [moved from src/gromacs/legacyheaders/mtop_util.h with 79% similarity]
src/gromacs/topology/residuetypes.cpp [new file with mode: 0644]
src/gromacs/topology/residuetypes.h [moved from src/gromacs/legacyheaders/types/iteratedconstraints.h with 59% similarity]
src/gromacs/topology/symtab.cpp [moved from src/gromacs/gmxlib/symtab.c with 94% similarity]
src/gromacs/topology/symtab.h [moved from src/gromacs/legacyheaders/symtab.h with 92% similarity]
src/gromacs/topology/topology.cpp [new file with mode: 0644]
src/gromacs/topology/topology.h [moved from src/gromacs/legacyheaders/types/topology.h with 86% similarity]
src/gromacs/topology/topsort.c [moved from src/gromacs/gmxlib/topsort.c with 98% similarity]
src/gromacs/topology/topsort.h [moved from src/gromacs/gmxlib/topsort.h with 82% similarity]
src/gromacs/trajectoryanalysis.h
src/gromacs/trajectoryanalysis/CMakeLists.txt
src/gromacs/trajectoryanalysis/analysismodule.cpp
src/gromacs/trajectoryanalysis/analysismodule.h
src/gromacs/trajectoryanalysis/analysissettings-impl.h
src/gromacs/trajectoryanalysis/analysissettings.cpp
src/gromacs/trajectoryanalysis/analysissettings.h
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp
src/gromacs/trajectoryanalysis/cmdlinerunner.h
src/gromacs/trajectoryanalysis/modules.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/angle.h
src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/distance.h
src/gromacs/trajectoryanalysis/modules/freevolume.cpp
src/gromacs/trajectoryanalysis/modules/freevolume.h
src/gromacs/trajectoryanalysis/modules/nsc.c [deleted file]
src/gromacs/trajectoryanalysis/modules/nsc.h [deleted file]
src/gromacs/trajectoryanalysis/modules/pairdist.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/pairdist.h [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/rdf.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/rdf.h [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/trajectoryanalysis/modules/sasa.h
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/modules/select.h
src/gromacs/trajectoryanalysis/modules/surfacearea.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/modules/surfacearea.h [new file with mode: 0644]
src/gromacs/trajectoryanalysis/runnercommon.cpp
src/gromacs/trajectoryanalysis/runnercommon.h
src/gromacs/trajectoryanalysis/tests/CMakeLists.txt
src/gromacs/trajectoryanalysis/tests/angle.cpp
src/gromacs/trajectoryanalysis/tests/distance.cpp
src/gromacs/trajectoryanalysis/tests/freevolume.cpp
src/gromacs/trajectoryanalysis/tests/moduletest.cpp
src/gromacs/trajectoryanalysis/tests/moduletest.h
src/gromacs/trajectoryanalysis/tests/pairdist.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/rdf.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesAllDistances.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesAllDistancesWithCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesGroupedMaxDistanceWithCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesGroupedMinDistanceWithCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMaxDistance.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMaxDistanceWithCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMinDistanceWithCutoff.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_BasicTest.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_CalculatesSurf.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_CalculatesXY.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SasaModuleTest_BasicTest.xml
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100Points.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithRectangularPBC.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithTriclinicPBC.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints12.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints122.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints32.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints42.xml [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/sasa.cpp
src/gromacs/trajectoryanalysis/tests/select.cpp
src/gromacs/trajectoryanalysis/tests/spc216.gro [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/surfacearea.cpp [new file with mode: 0644]
src/gromacs/trajectoryanalysis/tests/test_selection.cpp
src/gromacs/utility.h
src/gromacs/utility/.gitignore
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/arrayref.h
src/gromacs/utility/basedefinitions.h [new file with mode: 0644]
src/gromacs/utility/basenetwork.cpp [new file with mode: 0644]
src/gromacs/utility/basenetwork.h [new file with mode: 0644]
src/gromacs/utility/baseversion-gen.c.cmakein
src/gromacs/utility/baseversion.cpp
src/gromacs/utility/bitmask.h [new file with mode: 0644]
src/gromacs/utility/classhelpers.h [moved from src/gromacs/utility/common.h with 82% similarity]
src/gromacs/utility/cstringutil.c
src/gromacs/utility/cstringutil.h
src/gromacs/utility/datafilefinder.cpp [new file with mode: 0644]
src/gromacs/utility/datafilefinder.h [new file with mode: 0644]
src/gromacs/utility/dir_separator.h [new file with mode: 0644]
src/gromacs/utility/directoryenumerator.cpp [new file with mode: 0644]
src/gromacs/utility/directoryenumerator.h [new file with mode: 0644]
src/gromacs/utility/errorcodes.cpp
src/gromacs/utility/errorformat.cpp
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/exceptions.h
src/gromacs/utility/fatalerror.cpp [moved from src/gromacs/gmxlib/gmx_fatal.c with 54% similarity]
src/gromacs/utility/fatalerror.h [moved from src/gromacs/legacyheaders/gmx_fatal.h with 78% similarity]
src/gromacs/utility/file.cpp
src/gromacs/utility/file.h
src/gromacs/utility/futil.cpp [moved from src/gromacs/fileio/futil.cpp with 61% similarity]
src/gromacs/utility/futil.h [new file with mode: 0644]
src/gromacs/utility/gmxassert.cpp
src/gromacs/utility/gmxassert.h
src/gromacs/utility/gmxmpi.h
src/gromacs/utility/gmxomp.cpp
src/gromacs/utility/gmxomp.h
src/gromacs/utility/gmxregex.cpp
src/gromacs/utility/gmxregex.h
src/gromacs/utility/init.cpp
src/gromacs/utility/messagestringcollector.cpp
src/gromacs/utility/messagestringcollector.h
src/gromacs/utility/path.cpp [moved from src/gromacs/fileio/path.cpp with 58% similarity]
src/gromacs/utility/path.h [moved from src/gromacs/fileio/path.h with 91% similarity]
src/gromacs/utility/programcontext.cpp
src/gromacs/utility/programcontext.h
src/gromacs/utility/qsort_threadsafe.c
src/gromacs/utility/real.h [new file with mode: 0644]
src/gromacs/utility/scoped_cptr.h [moved from src/gromacs/utility/scoped_ptr_sfree.h with 60% similarity]
src/gromacs/utility/smalloc.c
src/gromacs/utility/smalloc.h
src/gromacs/utility/snprintf.h [moved from src/gromacs/legacyheaders/shift.h with 78% similarity]
src/gromacs/utility/stringutil.cpp
src/gromacs/utility/stringutil.h
src/gromacs/utility/sysinfo.cpp [new file with mode: 0644]
src/gromacs/utility/sysinfo.h [new file with mode: 0644]
src/gromacs/utility/tests/CMakeLists.txt
src/gromacs/utility/tests/bitmask.h [new file with mode: 0644]
src/gromacs/utility/tests/bitmask128.cpp [moved from src/gromacs/gmxlib/physics_test.c with 80% similarity]
src/gromacs/utility/tests/bitmask32.cpp [moved from src/gromacs/legacyheaders/types/symtab.h with 76% similarity]
src/gromacs/utility/tests/bitmask64.cpp [new file with mode: 0644]
src/gromacs/utility/tests/stringutil.cpp
src/gromacs/utility/uniqueptr.h
src/gromacs/version.h.cmakein
src/programs/BuildCompletions.cmake [new file with mode: 0644]
src/programs/CMakeLists.txt
src/programs/CreateLinks.cmake.cmakein [deleted file]
src/programs/gmx.cpp
src/programs/legacymodules.cpp
src/programs/mdrun/deform.h
src/programs/mdrun/md.cpp [moved from src/programs/mdrun/md.c with 86% similarity]
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/membed.c
src/programs/mdrun/membed.h
src/programs/mdrun/repl_ex.cpp [moved from src/programs/mdrun/repl_ex.c with 98% similarity]
src/programs/mdrun/repl_ex.h
src/programs/mdrun/runner.cpp [moved from src/programs/mdrun/runner.c with 86% similarity]
src/programs/mdrun/tests/compressed_x_output.cpp
src/programs/mdrun/tests/interactiveMD.cpp
src/programs/mdrun/tests/moduletest.cpp
src/programs/mdrun/tests/moduletest.h
src/programs/mdrun/tests/replicaexchange.cpp
src/programs/mdrun/tests/rerun.cpp
src/programs/mdrun/tests/swapcoords.cpp
src/programs/mdrun/tests/trajectory_writing.cpp
src/programs/mdrun_main.cpp
src/programs/view/3dview.cpp [moved from src/gromacs/math/3dview.c with 51% similarity]
src/programs/view/3dview.h [moved from src/gromacs/math/3dview.h with 63% similarity]
src/programs/view/Xstuff.h
src/programs/view/buttons.cpp
src/programs/view/dialogs.cpp
src/programs/view/dialogs.h
src/programs/view/fgrid.cpp
src/programs/view/filter.cpp
src/programs/view/logo.cpp
src/programs/view/manager.cpp
src/programs/view/manager.h
src/programs/view/molps.cpp
src/programs/view/nleg.cpp
src/programs/view/nleg.h
src/programs/view/nmol.cpp
src/programs/view/nmol.h
src/programs/view/popup.cpp
src/programs/view/pulldown.cpp
src/programs/view/view.cpp
src/programs/view/x11.cpp
src/programs/view/x11.h
src/programs/view/xdlg.cpp
src/programs/view/xdlghi.cpp
src/programs/view/xdlghi.h
src/programs/view/xdlgitem.cpp
src/programs/view/xdlgitem.h
src/programs/view/xmb.cpp
src/programs/view/xmb.h
src/programs/view/xutil.cpp
src/programs/view/xutil.h
src/testutils/TestMacros.cmake
src/testutils/cmdlinetest.cpp
src/testutils/cmdlinetest.h
src/testutils/integrationtests.cpp
src/testutils/integrationtests.h
src/testutils/mpi-printer.cpp
src/testutils/refdata.cpp
src/testutils/refdata.h
src/testutils/stringtest.cpp
src/testutils/stringtest.h
src/testutils/testasserts.cpp
src/testutils/testasserts.h
src/testutils/testfilemanager.cpp
src/testutils/testfilemanager.h
src/testutils/testinit.cpp [new file with mode: 0644]
src/testutils/testinit.h [moved from src/gromacs/onlinehelp.h with 63% similarity]
src/testutils/testoptions.cpp
src/testutils/testoptions.h
src/testutils/tests/refdata_tests.cpp
src/testutils/tests/testasserts_tests.cpp
src/testutils/unittest_main.cpp
tests/CMakeLists.txt
tests/CppCheck.cmake

index 46d10516dfcbe26f3a5ca7072c04d4dd65881f82..1f069f17776485f5a38735a0ae313c9eafb2b280 100644 (file)
@@ -1,16 +1,16 @@
 # Generic rules
-*.c     filter=uncrustify
-*.cpp   filter=uncrustify
+*.c     filter=uncrustify gmx-doxygen
+*.cpp   filter=uncrustify gmx-doxygen
 *.cu    filter=uncrustify
-*.h     filter=uncrustify
+*.h     filter=uncrustify gmx-doxygen
 *.cuh   filter=uncrustify
 CMakeLists.txt  filter=copyright
 *.cmake         filter=copyright
 *.cmakein       filter=copyright
 *.py            filter=copyright
-*.l             filter=copyright
-*.y             filter=copyright
-*.pre           filter=copyright
+*.l             filter=includesort
+*.y             filter=includesort
+*.pre           filter=includesort
 *.tex           filter=copyright
 *.bm            filter=copyright
 # Exceptions: extra files to include
@@ -23,7 +23,8 @@ cmake/FindBLAS.cmake                    !filter
 cmake/FindLAPACK.cmake                  !filter
 cmake/ThreadMPI.cmake                   !filter
 cmake/Platform/BluegeneQ*.cmake         !filter
-cmake/*.c                               !filter
+cmake/*.c                               -filter -gmx-doxygen
+cmake/*.cpp                             -filter -gmx-doxygen
 cmake/*.c.cmakein                       !filter
 docs/doxygen/Doxyfile-*.cmakein         !filter
 docs/doxygen/*.cpp                      !filter
@@ -32,13 +33,27 @@ docs/doxygen/examples/*.c               filter=uncrustify_only
 docs/manual/UseLATEX.cmake              !filter
 scripts/GMXRC.*                         !filter
 scripts/make_gromos_rtp.py              !filter
-src/contrib/*                           !filter
-src/gromacs/gmxlib/gpu_utils/memtestG80_core.*             !filter
+src/contrib/*                           -filter -gmx-doxygen
 src/gromacs/gmxlib/nonbonded/preprocessor/gmxpreprocess.py !filter
 src/gromacs/linearalgebra/gmx_blas/*    !filter
 src/gromacs/linearalgebra/gmx_lapack/*  !filter
-src/gromacs/selection/parser.cpp        !filter
-src/gromacs/selection/parser.h          !filter
-src/gromacs/selection/scanner.cpp       !filter
-src/gromacs/selection/scanner_flex.h    !filter
-nb_kernel_Elec*                         filter=copyright
+src/gromacs/selection/parser.cpp        -filter -gmx-doxygen
+src/gromacs/selection/parser.h          -filter -gmx-doxygen
+src/gromacs/selection/scanner.cpp       -filter -gmx-doxygen
+src/gromacs/selection/scanner_flex.h    -filter
+nb_kernel_Elec*                         filter=copyright -gmx-doxygen
+nb_kernel*pre                           filter=copyright
+*.eps                                   binary
+*.jpg                                   binary
+*.svg                                   binary
+*.png                                   binary
+*.pdf                                   binary
+*.ogl                                   binary
+*.gif                                   binary
+*.jpg                                   binary
+*.tpr                                   binary
+*.trr                                   binary
+*.tng                                   binary
+*.xtc                                   binary
+*.edr                                   binary
+*.cpt                                   binary
index e61ec7a0094b540cbad36d63c8256bea1b8b2b1a..e2d97633276257ab0a470bbc256274048ea771c6 100644 (file)
@@ -13,3 +13,4 @@ lib*.pc
 .project
 .cproject
 CMakeLists.txt.user
+/VersionInfo*.cmake
diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..3df332a
--- /dev/null
@@ -0,0 +1,20 @@
+language: cpp
+
+before_install:
+ - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake #https://github.com/travis-ci/travis-ci/issues/2212
+ - sudo apt-get update
+ - sudo apt-get install libfftw3-dev libopenmpi-dev libx11-dev zlib1g-dev libgsl0-dev libxml2-dev libblas-dev liblapack-dev libboost-dev cmake
+
+env:
+  matrix:
+    - GMX_DOUBLE=OFF GMX_MPI=OFF
+    - GMX_DOUBLE=OFF GMX_MPI=ON
+    - GMX_DOUBLE=ON  GMX_MPI=OFF
+    - GMX_DOUBLE=ON  GMX_MPI=ON
+
+script: 
+  - mkdir build && pushd build && cmake -DGMX_DOUBLE=$GMX_DOUBLE -DGMX_MPI=$GMX_MPI .. && make -j4
+
+compiler:
+  - clang
+  - gcc
index 5daed5892c22abfba0ed100cad95fef5b8717b65..581064bb66f4b2143a942717b5f03bf5130d7f42 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,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.
@@ -48,75 +48,28 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
-# PROJECT_VERSION should have the following structure:
-# VERSION-dev[-SUFFIX] where the VERSION should have the for: vMajor.vMinor.vPatch
-#
-# The "-dev" suffix is important to keep because it makes possible to distinguish
-# between a build from official release and a build from git release branch on a
-# machine with no git.
-#
-# NOTE: when releasing the "-dev" suffix needs to be stripped off!
-# REGRESSIONTEST_VERSION and REGRESSIONTEST_BRANCH should always be
-# defined.
-set(PROJECT_VERSION "5.0.5-dev")
-# If this is a released tarball, "-dev" will not be present in
-# PROJECT_VERSION, and REGRESSIONTEST_VERSION specifies the version
-# number of the regressiontest tarball against which the code tarball
-# can be tested. This will be the version of the last patch release.
-set(REGRESSIONTEST_VERSION "5.0.5-dev")
-# The MD5 checksum of the regressiontest tarball. Only used if "-dev"
-# is not present in the PROJECT_VERSION
-set(REGRESSIONTEST_MD5SUM "81e8ff1600495ce2a57706dca9d73482")
-# If this is not a released tarball, "-dev" will be present in
-# PROJECT_VERSION, and REGRESSIONTEST_BRANCH specifies the name of the
-# gerrit.gromacs.org branch whose HEAD can test this code, *if* this
-# code contains all recent fixes from the corresponding code branch.
-set(REGRESSIONTEST_BRANCH "refs/heads/release-5-0")
-
-set(CUSTOM_VERSION_STRING ""
-    CACHE STRING "Custom version string (if empty, use hard-coded default)")
-mark_as_advanced(CUSTOM_VERSION_STRING)
-if (CUSTOM_VERSION_STRING)
-    set(PROJECT_VERSION ${CUSTOM_VERSION_STRING})
-endif()
-set(LIBRARY_SOVERSION 0)
-set(LIBRARY_VERSION ${LIBRARY_SOVERSION}.0.0)
-# It is a bit irritating, but this has to be set separately for now!
-SET(CPACK_PACKAGE_VERSION_MAJOR "5")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-#SET(CPACK_PACKAGE_VERSION_PATCH "0")
-
-# The numerical gromacs version. It is 40600 for 4.6.0.
-# The #define GMX_VERSION in gromacs/version.h is set to this value.
-math(EXPR NUM_VERSION
-    "${CPACK_PACKAGE_VERSION_MAJOR}*10000 + ${CPACK_PACKAGE_VERSION_MINOR}*100")
-if(CPACK_PACKAGE_VERSION_PATCH)
-    math(EXPR NUM_VERSION
-         "${NUM_VERSION} + ${CPACK_PACKAGE_VERSION_PATCH}")
-endif()
-
-# The API version tracks the numerical Gromacs version (for now).
-# It is potentially different from the Gromacs version in the future, if
-# the programs/libraries diverge from the presumably more stable API.
-# The #define GMX_API_VERSION in version.h is set to this value to
-# provide backward compatibility of software written against the Gromacs API.
-set(API_VERSION ${NUM_VERSION})
+# Set up common version variables, as well as general information about
+# the build tree (whether the build is from a source package or from a git
+# repository).  Also declares a few functions that will be used for generating
+# version info files later.
+include(gmxVersionInfo)
 
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND UNIX)
     set(CMAKE_INSTALL_PREFIX "/usr/local/gromacs" CACHE STRING "Installation prefix (installation will need write permissions here)" FORCE)
 endif()
 
 include(gmxBuildTypeReference)
+include(gmxBuildTypeProfile)
 include(gmxBuildTypeTSAN)
 include(gmxBuildTypeASAN)
 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." FORCE)
+    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 the possible values of build type for cmake-gui
     set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
-        "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert")
+        "MinSizeRel" "RelWithDebInfo" "Reference" "RelWithAssert" "Profile")
 endif()
 if(CMAKE_CONFIGURATION_TYPES)
     # Add appropriate GROMACS-specific build types for the Visual
@@ -128,34 +81,10 @@ if(CMAKE_CONFIGURATION_TYPES)
         "List of configuration types"
         FORCE)
 endif()
-set(build_types_with_explicit_flags RELEASE DEBUG RELWITHDEBINFO RELWITHASSERT MINSIZEREL)
+set(build_types_with_explicit_flags RELEASE DEBUG RELWITHDEBINFO RELWITHASSERT MINSIZEREL PROFILE)
 
-enable_language(C)
-enable_language(CXX)
 set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
 
-set(CPACK_PACKAGE_NAME "gromacs")
-set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
-set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
-set(CPACK_PACKAGE_VENDOR "gromacs.org")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Gromacs - a toolkit for high-performance molecular simulation")
-set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/admin/InstallWelcome.txt")
-# Its GPL/LGPL, so they do not have to agree to a license for mere usage, but some installers require this...
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
-set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/admin/InstallInfo.txt")
-set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;")
-set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackInit.cmake")
-# CPack source archives include only the directories we list here.
-# This variable is a list of pairs of names of source and destination
-# directories. Most of these are used for content GROMACS generates as
-# part of the configuration or build.
-set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/docs/man/man1;docs/man/man1;${CMAKE_BINARY_DIR}/docs/man/man7;docs/man/man7;${CMAKE_BINARY_DIR}/docs/old-html/final;docs/old-html/final;${CMAKE_BINARY_DIR}/docs/install-guide/final;/")
-set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org")
-set(CPACK_GMX_BUILD_HELP "${GMX_BUILD_HELP}") #Works even though GMX_BUILD_HELP is defined later because it is off by default.
-
-#must come after all cpack settings!
-include(CPack)
-
 # Set a default valgrind suppression file.
 # This unfortunately needs to duplicate information from CTest to work as
 # expected...
@@ -165,14 +94,12 @@ set(MEMORYCHECK_SUPPRESSIONS_FILE
     "File that contains suppressions for the memory checker")
 include(CTest)
 
-set(SOURCE_IS_GIT_REPOSITORY OFF)
-set(SOURCE_IS_SOURCE_DISTRIBUTION OFF)
-if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
-    set(SOURCE_IS_GIT_REPOSITORY ON)
-endif()
-if(NOT EXISTS "${CMAKE_SOURCE_DIR}/admin/.isreposource")
-    set(SOURCE_IS_SOURCE_DISTRIBUTION ON)
-endif()
+include(gmxCPackUtilities)
+gmx_cpack_init()
+
+# Variables that accumulate stuff influencing the installed headers
+set(INSTALLED_HEADER_INCLUDE_DIRS "")
+set(INSTALLED_HEADER_DEFINITIONS "")
 
 ########################################################################
 # Check and warn if cache generated on a different host is being reused
@@ -245,30 +172,25 @@ endif()
 set(REQUIRED_CUDA_COMPUTE_CAPABILITY 2.0)
 include(gmxManageGPU)
 
-if(GMX_CPU_ACCELERATION)
-    # Stay compatible with old Jenkins command line options for specific SIMD acceleration
-    set(GMX_SIMD "${GMX_CPU_ACCELERATION}" CACHE STRING "SIMD instruction set level and compiler optimization" FORCE)
-    message("You set GMX_CPU_ACCELERATION, which is deprecated, and will be removed in a later version of GROMACS. It is replaced by GMX_SIMD. For now, copying the value from GMX_CPU_ACCELERATION to GMX_SIMD.")
-    # TODO remove all references to GMX_CPU_ACCELERATION in master branch
-endif()
-
-if(NOT GMX_TARGET_MIC)
-    include(gmxDetectSimd)
-    gmx_detect_simd(GMX_SUGGESTED_SIMD)
-else()
-    set(GMX_SUGGESTED_SIMD "None")
-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 IBM_QPX Sparc64_HPC_ACE Reference)
+    None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 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")
+else()
+    set(GMX_FFT_LIBRARY_DEFAULT "fftw3")
+endif()
 
 gmx_option_multichoice(
     GMX_FFT_LIBRARY
     "FFT library"
-    "fftw3"
+    "${GMX_FFT_LIBRARY_DEFAULT}"
     fftw3 mkl "fftpack[built-in]")
 gmx_dependent_option(
     GMX_BUILD_OWN_FFTW
@@ -304,12 +226,6 @@ option(GMX_OPENMP "Enable OpenMP-based multithreading" ON)
 
 option(GMX_USE_TNG "Use the TNG library for trajectory I/O" ON)
 
-option(GMX_GIT_VERSION_INFO "Generate git version information" ${SOURCE_IS_GIT_REPOSITORY})
-mark_as_advanced(GMX_GIT_VERSION_INFO)
-
-if(UNIX)
-    option(GMX_SYMLINK_OLD_BINARY_NAMES "Create symbolic links for pre-5.0 binary names" ON)
-endif()
 option(GMX_BUILD_MDRUN_ONLY "Build and install only the mdrun binary" OFF)
 
 option(GMX_CYCLE_SUBCOUNTERS "Enable cycle subcounters to get a more detailed cycle timings" OFF)
@@ -380,20 +296,18 @@ if(GMX_SIMD STREQUAL "AVX_256"
 endif()
 
 
-
-set(PKG_CFLAGS "")
 if(GMX_DOUBLE)
     add_definitions(-DGMX_DOUBLE)
-    set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_DOUBLE")
+    list(APPEND INSTALLED_HEADER_DEFINITIONS "-DGMX_DOUBLE")
     if(GMX_RELAXED_DOUBLE_PRECISION)
         add_definitions(-DGMX_RELAXED_DOUBLE_PRECISION)
     endif()
 endif()
 if(GMX_SOFTWARE_INVSQRT)
-  set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_SOFTWARE_INVSQRT")
+    list(APPEND INSTALLED_HEADER_DEFINITIONS "-DGMX_SOFTWARE_INVSQRT")
 endif()
 
-if(WIN32 AND NOT CYGWIN)
+if(WIN32)
     list(APPEND GMX_EXTRA_LIBRARIES "wsock32")
     add_definitions(-DGMX_HAVE_WINSOCK)
 endif()
@@ -432,10 +346,12 @@ check_function_exists(sysconf           HAVE_SYSCONF)
 check_function_exists(rsqrt             HAVE_RSQRT)
 check_function_exists(rsqrtf            HAVE_RSQRTF)
 check_function_exists(sqrtf             HAVE_SQRTF)
+check_function_exists(nice              HAVE_NICE)
 
 include(CheckLibraryExists)
 check_library_exists(m sqrt "" HAVE_LIBM)
 check_library_exists(rt clock_gettime "" HAVE_CLOCK_GETTIME)
+check_library_exists(m feenableexcept "" HAVE_FEENABLEEXCEPT)
 
 include(TestSchedAffinity)
 test_sched_affinity(HAVE_SCHED_AFFINITY)
@@ -443,6 +359,11 @@ test_sched_affinity(HAVE_SCHED_AFFINITY)
 include(TestBigEndian)
 test_big_endian(GMX_INTEGER_BIG_ENDIAN)
 
+set(GMX_USE_NICE 0)
+if (HAVE_UNISTD_H AND HAVE_NICE)
+    set(GMX_USE_NICE 1)
+endif()
+
 # Management of GROMACS options for specific toolchains should go
 # here. Because the initial settings for some of the main options have
 # already happened, but things like library detection and MPI compiler
@@ -531,7 +452,6 @@ tmpi_enable_cxx()
 if(GMX_THREAD_MPI)
     # enable MPI functions
     tmpi_enable()
-    set(GMX_MPI 1)
     set(MPI_IN_PLACE_EXISTS 1)
 endif()
 # If atomics are manually disabled a define is needed because atomics.h doesn't depend on config.h
@@ -548,35 +468,19 @@ if(CYGWIN)
     set(GMX_CYGWIN 1)
 endif()
 
-if(WIN32 AND NOT CYGWIN)
+if(WIN32)
     set(GMX_NATIVE_WINDOWS 1)
     # This makes windows.h not declare min/max as macros that would break
     # C++ code using std::min/std::max.
     add_definitions(-DNOMINMAX)
 endif()
 
-# only bother with finding git and using version.h if the source is a git repo
-if(GMX_GIT_VERSION_INFO)
-    if (NOT SOURCE_IS_GIT_REPOSITORY)
-        message(FATAL_ERROR
-            "Cannot generate git version information from source tree not under git. "
-            "Set GMX_GIT_VERSION_INFO=OFF to proceed.")
-    endif()
-    # We need at least git v1.5.3 be able to parse git's date output. If not
-    # found or the version is too small, we can't generate version information.
-    find_package(Git)
-
-    if(NOT GIT_FOUND OR GIT_VERSION_STRING VERSION_LESS "1.5.3")
-        message(FATAL_ERROR
-            "No compatible git version found (>= 1.5.3 required). "
-            "Won't be able to generate development version information. "
-            "Set GMX_GIT_VERSION_INFO=OFF to proceed.")
-    endif()
-endif()
-
 # Detect boost unless GMX_EXTERNAL_BOOST is explicitly OFF
 # Used for default if GMX_EXTERNAL_BOOST is not defined (first CMake pass)
 if(NOT DEFINED GMX_EXTERNAL_BOOST OR GMX_EXTERNAL_BOOST)
+    if(DEFINED Boost_INCLUDE_DIR)
+        set(Boost_FIND_QUIETLY TRUE)
+    endif()
     find_package(Boost 1.44.0)
     if(Boost_FOUND AND Boost_VERSION VERSION_LESS "104400")
         set(Boost_FOUND FALSE)
@@ -616,12 +520,6 @@ if(GMX_USE_TNG AND NOT GMX_EXTERNAL_TNG)
     gmx_test_zlib(HAVE_ZLIB)
 endif()
 
-########################################################################
-# Generate development version info for cache
-########################################################################
-# set(GEN_VERSION_INFO_INTERNAL "ON")
-# include(gmxGenerateVersionString)
-
 ########################################################################
 # Our own GROMACS tests
 ########################################################################
@@ -631,10 +529,6 @@ include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src)
 include_directories(BEFORE ${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)
-# Required for gmx_header_config_gen.h to be found before installation
-include_directories(BEFORE ${CMAKE_BINARY_DIR}/src/gromacs/utility)
-# Required for now to make old code compile
-include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders)
 
 include(gmxTestInlineASM)
 gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
@@ -744,15 +638,14 @@ include(gmxManageLinearAlgebraLibraries)
 set(GMX_USE_PLUGINS OFF)
 
 if(GMX_LOAD_PLUGINS)
-  if(CYGWIN OR NOT WIN32)
+  if(NOT WIN32)
     # Native Windows does not have, nor need dlopen
-    # Note that WIN32 is set with Cygwin, but Cygwin needs dlopen to use plug-ins
     include(gmxTestdlopen)
     gmx_test_dlopen(HAVE_DLOPEN)
   endif()
 
   # so, should we use plug-ins?
-  if((WIN32 AND NOT CYGWIN) OR (HAVE_DLOPEN AND BUILD_SHARED_LIBS))
+  if(WIN32 OR (HAVE_DLOPEN AND BUILD_SHARED_LIBS))
     if(NOT VMD_QUIETLY)
       MESSAGE(STATUS "Using dynamic plugins (e.g VMD-supported file formats)")
     endif()
@@ -783,7 +676,8 @@ option(GMX_NACL "Configure for Native Client builds" OFF)
 if (GMX_NACL)
   list(APPEND GMX_EXTRA_LIBRARIES nosys)
   set(GMX_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lnosys")
-  set(GMX_NO_NICE 1)
+  # TODO: Is this still necessary with the check for its presence?
+  set(GMX_USE_NICE 0)
   set(GMX_NO_RENAME 1)
 endif()
 mark_as_advanced(GMX_NACL)
@@ -794,14 +688,18 @@ if(GMX_FAHCORE)
   include_directories(${COREWRAP_INCLUDE_DIR})
 endif()
 
-option(GMX_BUILD_HELP "Build man pages, HTML help, and completions automatically (requires that compiled binaries can be executed on the build host)" OFF)
+# Value of AUTO tries to generate things, but will only produce warnings if
+# that fails.
+set(build_help_default AUTO)
+if (SOURCE_IS_SOURCE_DISTRIBUTION)
+    set(build_help_default OFF)
+endif()
+gmx_option_trivalue(GMX_BUILD_HELP "Build man pages, HTML help, and completions automatically (requires that compiled binaries can be executed on the build host)" ${build_help_default})
 mark_as_advanced(GMX_BUILD_HELP)
-if (GMX_BUILD_HELP AND SOURCE_IS_SOURCE_DISTRIBUTION AND
-    "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
-
+if (GMX_BUILD_HELP AND SOURCE_IS_SOURCE_DISTRIBUTION AND BUILD_IS_INSOURCE)
     message(FATAL_ERROR
-        "Rebuilding HTML and man pages is not supported for in-source "
-        "builds from a source distribution. "
+        "Rebuilding HTML and man pages or shell completions is not supported "
+        "for in-source builds from a source distribution. "
         "Set GMX_BUILD_HELP=OFF or do an out-of-source build to proceed.")
 endif()
 
@@ -833,7 +731,6 @@ else()
     set(GMX_EXE_LINKER_FLAGS ${GMX_EXE_LINKER_FLAGS} ${OpenMP_LINKER_FLAGS})
     set(GMX_SHARED_LINKER_FLAGS ${GMX_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS})
 endif()
-set(PKG_CFLAGS "${PKG_CFLAGS} ${OpenMP_C_FLAGS}")
 
 ########################################################################
 # Specify install locations
@@ -850,16 +747,20 @@ mark_as_advanced(GMX_LIB_INSTALL_DIR GMX_DATA_INSTALL_DIR)
 
 # These variables are used internally to provide a central location for
 # customizing the install locations.
-set(LIB_INSTALL_DIR  ${GMX_LIB_INSTALL_DIR})
-set(BIN_INSTALL_DIR  bin)
-set(DATA_INSTALL_DIR share/${GMX_DATA_INSTALL_DIR})
-set(MAN_INSTALL_DIR  share/man)
-set(INCL_INSTALL_DIR include)
-
-# These variables get written into config.h for use in finding the data
+set(LIB_INSTALL_DIR       ${GMX_LIB_INSTALL_DIR})
+set(BIN_INSTALL_DIR       bin)
+# This variable also gets written into config.h for use in finding the data
 # directories.
-set(GMXLIB_SEARCH_DIR share/${GMX_DATA_INSTALL_DIR}/top)
-set(GMXLIB_FALLBACK   ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/top)
+set(DATA_INSTALL_DIR      share/${GMX_DATA_INSTALL_DIR})
+set(MAN_INSTALL_DIR       share/man)
+# If the nesting level wrt. the installation root is changed,
+# gromacs-config.cmake.cmakein needs to be adapted.
+set(CMAKE_INSTALL_DIR     share/cmake)
+# TODO: Make GMXRC adapt if this is changed
+set(PKGCONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig)
+set(INCL_INSTALL_DIR      include)
+
+list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${INCL_INSTALL_DIR})
 
 # Binary and library suffix options
 include(gmxManageSuffixes)
@@ -906,15 +807,14 @@ install(FILES COPYING DESTINATION ${DATA_INSTALL_DIR} COMPONENT data)
 
 if(GMX_EXTERNAL_BOOST)
     include_directories(${Boost_INCLUDE_DIRS})
-    set(PKG_CFLAGS "${PKG_CFLAGS} -I${Boost_INCLUDE_DIRS}")
+    list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
 else()
     include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/external/boost)
+    list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${INCL_INSTALL_DIR}/gromacs/external/boost)
+    list(APPEND INSTALLED_HEADED_DEFINITIONS "-DBOOST_NO_TYPEID")
     # typeid not supported for minimal internal version
     # (would add significant amount of code)
     add_definitions(-DBOOST_NO_TYPEID)
-    # TODO: Propagate the above settings to the installed CMakeFiles.txt template
-    # (from share/template/)
-    set(PKG_CFLAGS "${PKG_CFLAGS} -DBOOST_NO_TYPEID -I${CMAKE_INSTALL_PREFIX}/${INCL_INSTALL_DIR}/gromacs/external/boost")
     if (NOT GMX_BUILD_MDRUN_ONLY)
         install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/external/boost/boost
                 DESTINATION ${INCL_INSTALL_DIR}/gromacs/external/boost
@@ -957,6 +857,8 @@ if (BUILD_TESTING)
     add_subdirectory(tests)
 endif()
 
+gmx_cpack_write_config()
+
 # Issue a warning if NVIDIA GPUs were detected, but CUDA was not found.
 # Don't bother the user after the first configure pass.
 if ((CUDA_NOTFOUND_AUTO AND GMX_DETECT_GPU_AVAILABLE) AND NOT GMX_GPU_DETECTION_DONE)
diff --git a/COPYING b/COPYING
index 2bf46507345155c7bfef3f6167fca73458a7cab1..e2737f31982168c1f06adf4897400208fe093149 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -11,16 +11,16 @@ This file contains the licenses for the following bodies of code:
 1. GROMACS
 2. Trajectory file reading using VMD plugins
 3. Internal FFT (fftpack)
-4. The memtestG80 library
-5. thread_mpi
-6. Blas
-7. Lapack
-8. Subset of Boost C++ library
-9. Google Test and Google Mock
-10. Sun XDR implementation (External Data Representation)
-11. Sun FDLIBM (Freely Distributable Maths Library)
-12. Random123
-13. md5
+4. thread_mpi
+5. Blas
+6. Lapack
+7. Subset of Boost C++ library
+8. Google Test and Google Mock
+9. Sun XDR implementation (External Data Representation)
+10. Sun FDLIBM (Freely Distributable Maths Library)
+11. Random123
+12. md5
+13. lmfit
 
 Our chosen method for packaging distributions (CPack) only permits a
 package to have a single license file, so we are unfortunately forced
@@ -964,37 +964,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 fftpack.c : A set of FFT routines in C.
 Algorithmically based on Fortran-77 FFTPACK by Paul N. Swarztrauber (Version 4, 1985).
 
-4. The memtestG80 library
-=========================
-
-   Files: src/gromacs/gmxlib/gpu_utils/memtestG80_core.*
-
-The memtestG80 library, written by Imran Haque, is Copyright 2009 Stanford University,
-covered by the LGPL license. It may be used under the following terms:
-
-IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 
-SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF
-THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF STANFORD UNIVERSITY HAS BEEN 
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-STANFORD UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
-THE SOFTWARE AND ACCOMPANYING DOCUMENTATION PROVIDED HEREUNDER IS PROVIDED "AS IS". 
-Folding@home HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, 
-OR MODIFICATIONS.
-
-Restrictions:
-
-You may use this software on a computer system only if you own the system or have the 
-written permission of the owner.
-
-You may not alter the software or associated data files. 
-
-Certain builds of this software incorporate by linkage code from the libintl
-and libiconv libraries, which are covered by the Library GNU Public License,
-available at http://www.gnu.org/licenses/lgpl-3.0.txt.
-
-5. thread_mpi
+4. thread_mpi
 =============
 
    Files: src/external/thread_mpi/
@@ -1030,7 +1000,7 @@ bugs must be traceable. We will be happy to consider code for
 inclusion in the official distribution, but derived work should not
 be called official thread_mpi.
 
-6. Blas
+5. Blas
 =======
 
 These files are semi-automatic translations by f2c from the original netlib BLAS library.
@@ -1054,7 +1024,7 @@ better idea to use the full reference implementation.
 
 Erik Lindahl, 2008-10-07.
 
-7. Lapack
+6. Lapack
 =========
 
 These files are semi-automatic translations by f2c from the original netlib LAPACK library.
@@ -1079,7 +1049,7 @@ better idea to use the full reference implementation.
 
 Erik Lindahl, 2008-10-07.
 
-8. Subset of Boost C++ library
+7. Subset of Boost C++ library
 ==============================
 
    Files: src/external/boost/boost/*
@@ -1108,7 +1078,7 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 DEALINGS IN THE SOFTWARE.
 
-9. Google Test and Google Mock
+8. Google Test and Google Mock
 ===============================
 
    Files: src/external/gmock-1.7.0/*
@@ -1143,7 +1113,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-10. Sun Extensible Data Representation routines (XDR)
+9. Sun Extensible Data Representation routines (XDR)
 =====================================================
 
     Files: src/gromacs/fileio/gmx_system_xdr.c
@@ -1176,7 +1146,7 @@ Sun Microsystems, Inc.
 Mountain View, California  94043
 
 
-11. Sun FDLIBM (Freely Distributable Maths Library)
+10. Sun FDLIBM (Freely Distributable Maths Library)
 ===================================================
 
     Files: src/gromacs/math/utilities.c
@@ -1189,7 +1159,7 @@ software is freely granted, provided that this notice
 is preserved.
 
 
-12. Random123
+11. Random123
 ============================================
 
 Copyright 2010-2012, D. E. Shaw Research.
@@ -1223,7 +1193,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-13. md5
+12. md5
 ============================================
 
 Copyright (C) 1999, 2002 Aladdin Enterprises.  All rights reserved.
@@ -1246,3 +1216,36 @@ freely, subject to the following restrictions:
 
 L. Peter Deutsch
 ghost@aladdin.com
+
+13. lmfit
+============================================
+The package lmfit is distributed under the FreeBSD License:
+
+--
+  Copyright (c) 1980-1999 University of Chicago,
+                          as operator of Argonne National Laboratory
+  Copyright (c) 2004-2013 Joachim Wuttke, Forschungszentrum Juelich GmbH
+
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+
+  - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+  This software is provided by the copyright holders and contributors "as is"
+  and any express or implied warranties, including, but not limited to, the
+  implied warranties of merchantability and fitness for a particular purpose
+  are disclaimed. In no event shall the copyright holder or contributors
+  be liable for any direct, indirect, incidental, special, exemplary, or
+  consequential damages (including, but not limited to, procurement of
+  substitute goods or services; loss of use, data, or profits; or business
+  interruption) however caused and on any theory of liability, whether in
+  contract, strict liability, or tort (including negligence or otherwise)
+  arising in any way out of the use of this software, even if advised of the
+  possibility of such damage.
+--
index 498b034306f05bcd4f03dbda8f664ffd538e7e92..c7e7e3cc07064e64c671600f6a804dd0482ec34e 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.
 
-#TODO: add check that source doesn't contain any untracked files
-if(NOT CPACK_INSTALL_CMAKE_PROJECTS) #building source package
+set(BUILDING_SOURCE_PACKAGE OFF)
+# The essential difference in building a source package is that install() rules
+# from the CMake project are not considered when deciding what to package.
+# Instead, only the listed directories are packaged (and the listed directories
+# contain the source tree).
+if (NOT CPACK_INSTALL_CMAKE_PROJECTS)
+    set(BUILDING_SOURCE_PACKAGE ON)
+endif()
+
+if (BUILDING_SOURCE_PACKAGE)
+    # TODO: add check that source doesn't contain any untracked files
     get_filename_component(CMAKE_BINARY_DIR ${CPACK_OUTPUT_CONFIG_FILE} PATH)
+    # TODO: The list could be generated at the same time as the list of
+    # directories to include to keep the probe file names at the same place.
+    # And this does not detect if things have been built in the past, but are
+    # outdated.
     if (NOT EXISTS "${CMAKE_BINARY_DIR}/docs/man/man1/gmx-view.1" OR
         NOT EXISTS "${CMAKE_BINARY_DIR}/docs/install-guide/final/INSTALL" OR
         NOT EXISTS "${CMAKE_BINARY_DIR}/docs/old-html/final/online.html" OR
@@ -48,6 +61,11 @@ if(NOT CPACK_INSTALL_CMAKE_PROJECTS) #building source package
             "GMX_BUILD_HELP=ON to automatically build the HTML parts.")
     endif()
 else()
+    # TODO: If GMX_BUILD_HELP is AUTO, it may happen that the generation fails,
+    # and things are silently left out.
+    # Also, it is currently impossible to get these files into the binary
+    # package for cross-compilation.  However, binary packages are not
+    # currently used much, either...
     if (NOT CPACK_GMX_BUILD_HELP)
         message(WARNING
             "To create a complete binary package, bash completions, and "
index 24191e30e9b5cccc158ee68ec7844542a58581bb..86b45abb4fcb4d1424db7b4d6d685fe07e16b085 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013, by the GROMACS development team, led by
+# Copyright (c) 2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
+"""Checks and/or updates copyright headers in GROMACS source files.
+
+It is used internally by several bash scripts to do copyright-relates tasks,
+but can also be invoked directly for some rare use cases.
+
+See docs/dev-manual/uncrustify.md for more details.
+"""
+
 import datetime
 import os.path
 import re
index ea17bc9019fcd4c925c8c03da0a472180a1c62b0..54da585017d109675964e5fc6b81a0052324ab21 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013, by the GROMACS development team, led by
+# Copyright (c) 2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # changes through some formatting check.  Currently, it runs uncrustify and
 # checks copyright headers.
 #
-# By default, it does nothing.  To enable the script after copying it to
-# .git/hooks/pre-commit, you need to set
-#   git config hooks.uncrustifymode check
+# It needs to be copied as .git/hooks/pre-commit and configured with
 #   git config hooks.uncrustifypath /path/to/uncrustify
-# With this configuration, all source files modified in the commit are run
-# through uncrustify and checked for correct copyright headers
-# (see admin/uncrustify.sh for how this set of files is determined).
-# If any file is changed by uncrustify or has other problems, the names of
-# those files are reported and the commit is prevented.  The issues can be
-# fixed by running admin/uncrustify.sh manually.
+#   git config hooks.uncrustifymode check
+#   git config hooks.copyrightmode update
 #
-# To disable the hook, you can set
-#   git config hooks.uncrustifymode off
-# To disable it temporarily for a commit, set NO_FORMAT_CHECK environment
+# To disable the hook temporarily for a commit, set NO_FORMAT_CHECK environment
 # variable.  For example,
 #   NO_FORMAT_CHECK=1 git commit -a
 # You can also run git commit --no-verify, but that also disables other hooks,
-# such as the Change-Id hook used by gerrit.
+# such as the Change-Id hook used by Gerrit.
 #
-# The actual work is done by the admin/uncrustify.sh script, which gets
-# run with the 'check-index' action.
-# See the comments in that script for more information.
+# See docs/dev-manual/uncrustify.md for more details.
 
 if [ ! -z "$NO_FORMAT_CHECK" ]
 then
diff --git a/admin/iwyu.imp b/admin/iwyu.imp
new file mode 100644 (file)
index 0000000..2c33b8c
--- /dev/null
@@ -0,0 +1,13 @@
+[
+{ include: ["<boost/smart_ptr/shared_ptr.hpp>", "private", "<boost/shared_ptr.hpp>", "public"] },
+{ include: ["<xmmintrin.h>", "public", "<emmintrin.h>", "public"] },
+{ include: ["<emmintrin.h>", "public", "<pmmintrin.h>", "public"] },
+{ include: ["<pmmintrin.h>", "public", "<smmintrin.h>", "public"] },
+{ include: ["<smmintrin.h>", "public", "<immintrin.h>", "public"] },
+{ include: ["<avxintrin.h>", "private", "<immintrin.h>", "public"] },
+{ include: ['"mpi.h"', "private", '"gromacs/utility/gmxmpi.h"', "public"] },
+{ include: ['"thread_mpi/atomic/gcc_x86.h"', "private", '"thread_mpi/atomic.h"', "public"] },
+{ include: ['<immintrin.h>', "public", '"gromacs/simd/simd.h"', "public"] },
+{ include: ['"gromacs/simd/impl_x86_avx_256/impl_x86_avx_256.h"', "private", '"gromacs/simd/simd.h"', "public"] },
+{ symbol: ["M_SQRT2", "private", '"gromacs/math/utilities.h"', "public"] }
+]
\ No newline at end of file
diff --git a/admin/iwyu.sh b/admin/iwyu.sh
new file mode 100755 (executable)
index 0000000..3d2fce6
--- /dev/null
@@ -0,0 +1,108 @@
+#!/bin/bash
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+# The build and source folder can be specified with -B and -S respectively.
+# By default it assume "-B. -S..".
+# include-what-you-use needs to be in the path. Add --apply if you want
+# changes to be applied.  Any extra arguments are added as is to the
+# command (can be used for extra defines or include paths).
+
+filename=
+build_path=.
+src_path=..
+cmd="include-what-you-use -DHAVE_CONFIG_H -mavx"
+
+# Read all special arguments and add others to the command
+apply=0
+for arg in "$@"; do
+    if [ $arg == "--apply" ]; then
+       apply=1
+    elif [[ $arg == -[SB] ]]; then
+       echo -S and -B require an argument
+       exit 1
+    elif [[ $arg == -B* ]]; then
+       build_path=${arg:2}
+    elif [[ $arg == -S* ]]; then
+       src_path=${arg:2}
+    elif [[ $arg != -* ]]; then
+       if [ "$filename" == "" ]; then
+           filename=$arg
+       else
+           echo "This script can only be run on one file at a time"
+           exit 1
+       fi
+    else
+       cmd="$cmd $arg"
+    fi
+done
+
+if [ "$filename" == "" ]; then
+    echo "No file specified"
+    exit 1
+fi
+
+# We cannot detect wether it is a C++ or C header. Should be fine to always use C++
+if [ "${filename##*.}" == "h" ]; then
+    cmd="$cmd -x c++"
+fi
+
+cmd="$cmd $filename"
+
+# Always use C++11.
+if [ "${filename##*.}" == "cpp" -o "${filename##*.}" == "h" ]; then
+    cmd="$cmd -std=c++11"
+fi
+
+# keep gmxpre.h for source files
+if [ "${filename##*.}" == "cpp" -o "${filename##*.}" == "c" ]; then
+    cmd="$cmd  -Xiwyu --pch_in_code -Xiwyu --prefix_header_includes=keep"
+fi
+
+if [ $src_path == "." ]; then
+    src_folder="src" # ./src confuses IWYU
+else
+    src_folder="$src_path/src"
+fi
+
+cmd="$cmd -I${src_folder} -I${src_folder}/external/thread_mpi/include
+     -I$build_path/src -I${src_folder}/external/boost
+     -Xiwyu --mapping_file=${src_path}/admin/iwyu.imp"
+
+if [ $apply -eq 1 ] ; then
+    cmd="$cmd 2>&1 | fix_includes.py --nosafe_headers ||
+         ${src_path}/docs/doxygen/includesorter.py $filename -B$build_path -S$src_path"
+fi
+
+eval $cmd
index 23611ea70ad589fb787e00e1348aabebb4d4b2c5..1102ef19e35919ffcd201af1f2261ee3d0d12166 100755 (executable)
 # 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 script runs uncrustify, copyright header checks, or include sorter on
+# all applicable files in the source tree.
+#
+# See `reformat_all.sh -h` for a brief usage, and docs/dev-manual/uncrustify.md
+# for more details (docs/dev-manual/gmxtree.md for include sorter).
+
 function usage() {
     echo "usage: reformat_all.sh [-f|--force]"
-    echo "           [--filter=(uncrustify|copyright)] [<action>]"
-    echo "<action>: (list-files|uncrustify*|copyright) (*=default)"
+    echo "           [--filter=(uncrustify|copyright|includesort)]"
+    echo "           [--pattern=<pattern>] [<action>] [-B=<build dir>]"
+    echo "<action>: (list-files|uncrustify*|copyright|includesort) (*=default)"
 }
 
 filter=default
 force=
+patterns=()
 action=uncrustify
 for arg in "$@" ; do
     if [[ "$arg" == "list-files" || "$arg" == "uncrustify" ||
-          "$arg" == "copyright" ]] ; then
+          "$arg" == "copyright" || "$arg" == "includesort" ]] ; then
         action=$arg
     elif [[ "$arg" == --filter=* ]] ; then
         filter=${arg#--filter=}
+    elif [[ "$arg" == --pattern=* ]] ; then
+        patterns[${#patterns[@]}]=${arg#--pattern=}
+    elif [[ "$arg" == -B=* ]] ; then
+        builddir=${arg#-B=}
     elif [[ "$arg" == "-f" || "$arg" == "--force" ]] ; then
         force=1
+    elif [[ "$arg" == "-h" || "$arg" == "--help" ]] ; then
+        usage
+        exit 0
     else
         echo "Unknown option: $arg"
         echo
@@ -86,6 +101,13 @@ case "$action" in
     copyright)
         command="xargs admin/copyright.py --check"
         ;;
+    includesort)
+        if [ -z "${builddir}" ] ; then
+            echo "Build directory must be set with -B for includesort."
+            exit 2
+        fi
+        command="docs/doxygen/includesorter.py -S . -B ${builddir} -F -"
+        ;;
     *)
         echo "Unknown action: $action"
         exit 2
@@ -96,11 +118,14 @@ if [[ "$filter" == "default" ]] ; then
 fi
 
 case "$filter" in
+    includesort)
+        filter_re="(uncrustify|includesort)"
+        ;;
     uncrustify)
         filter_re="(uncrustify|uncrustify_only)"
         ;;
     copyright)
-        filter_re="(uncrustify|copyright)"
+        filter_re="(uncrustify|copyright|includesort)"
         ;;
     *)
         echo "Unknown filter mode: $filter"
@@ -111,7 +136,7 @@ esac
 
 cd `git rev-parse --show-toplevel`
 
-if ! git ls-tree -r --name-only HEAD | git check-attr --stdin filter | \
+if ! git ls-files "${patterns[@]}" | git check-attr --stdin filter | \
     sed -nEe "/${filter_re}$/ {s/:.*//;p;}" | $command ; then
     echo "The reformatting command failed! Please check the output."
     exit 1
index c683163076da1a59fff37254b7a853a7c283cbe8..4c2d0f4cf9ea2e5ff5f88b78423f13b2f36ea6b6 100755 (executable)
@@ -2,7 +2,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,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.
 # 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 script runs uncrustify on modified files and reports/applies the
-# results.  It also checks for outdated copyright years or headers.
-# By default, the current HEAD commit is compared to the work tree,
-# and files that
-#  1. are different between these two trees and
-#  2. change under uncrustify and/or have outdated copyright header
-# are reported.  This behavior can be changed by
-#  1. Specifying an --rev=REV argument, which uses REV instead of HEAD as
-#     the base of the comparison.
-#  2. Specifying an action:
-#       check-*:   reports the files that uncrustify changes
-#       diff-*:    prints the actual diff of what would change
-#       update-*:  applies the changes to the repository
-#       *-workdir: operates on the working directory (files on disk)
-#       *-index:   operates on the index of the repository
-#     For convenience, if you omit the workdir/index suffix, workdir is assumed
-#     (i.e., diff equals diff-workdir).
-#  3. Specifying --uncrustify=off, which does not run uncrustify.
-#  4. Specifying --copyright=<mode>, which alters the level of copyright
-#     checking is done:
-#       off:     does not check copyright headers at all
-#       year:    only update copyright year in new-format copyright headers
-#       add:     in addition to 'year', add copyright headers to files that
-#                don't have any
-#       update:  in addition to 'year' and 'add', also update new-format
-#                copyright headers if they are broken or outdated.
-#       replace: replace any copyright header with a new-format copyright
-#                header
-#       full:    do all of the above
-# By default, update-* refuses to update "dirty" files (i.e., that differ
-# between the disk and the index) to make it easy to revert the changes.
-# This can be overridden by adding a -f/--force option.
+# This script runs uncrustify and copyright header checks on modified files and
+# reports/applies the necessary changes.
 #
-# The location of the uncrustify executable must be specified using an
-# environment variable UNCRUSTIFY.  Note that to produce the indentation used
-# in the source tree, you need a custom version of uncrustify.
-# To get and configure the currently used version, you can do the following:
-#  1. Run
-#       git clone -b gromacs git://github.com/rolandschulz/uncrustify.git
-#       cd uncrustify
-#       ./configure
-#       make
-#  2. Copy the binary src/uncrustify into a directory of your choice.
-#  3. Set the UNCRUSTIFY environment variable to point to the copied binary.
-#
-# To identify which files to run through uncrustify, the script uses git
-# filters, specified in .gitattributes files.  Only files that have the filter
-# set as "uncrustify" (or something ending in "uncrustify") are processed: if
-# other files have been changed, they are ignored by the script.  Files passed
-# to uncrustify, as well as files with filter "copyright", get their copyright
-# header checked.  To only run uncrustify for a file, set the filter to
-# "uncrustify_only".
-#
-# If you want to run uncrustify automatically for changes you make, there are
-# two options:
-#  1. Copy the git-pre-commit script in this directory to .git/hooks/pre-commit
-#     and set
-#       git config hooks.uncrustifymode check
-#       git config hooks.uncrustifypath /path/to/uncrustify
-#     See comments in the hook script for more information.
-#  2. Configure a git filter (doesn't require this script, only the
-#     .gitattributes files):
-#       git config filter.uncrustify.clean \
-#           "/path/to/uncrustify -c admin/uncrustify.cfg -q -l cpp"
-# The pre-commit hook + manually running the script gives better/more intuitive
-# control (with the filter, it is possible to have a work tree that is
-# different from HEAD and still have an empty 'git diff') and provides better
-# performance for changes that modify many files.  It is the only way that
-# currently also checks the copyright headers.
-# The filter allows one to transparently merge branches that have not been run
-# through uncrustify, and is applied more consistently (the pre-commit hook is
-# not run for every commit, e.g., during a rebase).
+# See `uncrustify.sh -h` for a brief usage, and docs/dev-manual/uncrustify.md
+# for more details.
 
 # Parse command-line arguments
 function usage() {
@@ -144,7 +77,7 @@ for arg in "$@" ; do
         force=1
     elif [[ "$arg" == --rev=* ]] ; then
         baserev=${arg#--rev=}
-    elif [[ "$arg" == "-h" ]] ; then
+    elif [[ "$arg" == "-h" || "$arg" == "--help" ]] ; then
         usage
         exit 0
     else
@@ -160,9 +93,14 @@ if [[ "$uncrustify_mode" != "off" ]]
 then
     if [ -z "$UNCRUSTIFY" ]
     then
-        echo "Please set the path to uncrustify using UNCRUSTIFY."
+        UNCRUSTIFY=`git config hooks.uncrustifypath`
+    fi
+    if [ -z "$UNCRUSTIFY" ]
+    then
+        echo "Please set the path to uncrustify using UNCRUSTIFY or"
+        echo "git config hooks.uncrustifypath."
         echo "Note that you need a custom version of uncrustify."
-        echo "See comments in the script file for how to get one."
+        echo "See docs/dev-manual/uncrustify.md for how to get one."
         exit 2
     fi
     if ! which "$UNCRUSTIFY" 1>/dev/null
@@ -198,11 +136,11 @@ cut -f2 <$tmpdir/difflist | \
     git check-attr --stdin filter | \
     sed -e 's/.*: filter: //' | \
     paste $tmpdir/difflist - | \
-    grep -E '(uncrustify|uncrustify_only|copyright)$' >$tmpdir/filtered
+    grep -E '(uncrustify|uncrustify_only|copyright|includesort)$' >$tmpdir/filtered
 cut -f2 <$tmpdir/filtered >$tmpdir/filelist_all
 grep -E '(uncrustify|uncrustify_only)$' <$tmpdir/filtered | \
     cut -f2 >$tmpdir/filelist_uncrustify
-grep -E '(uncrustify|copyright)$' <$tmpdir/filtered | \
+grep -E '(uncrustify|copyright|includesort)$' <$tmpdir/filtered | \
     cut -f2 >$tmpdir/filelist_copyright
 git diff-files --name-only | grep -Ff $tmpdir/filelist_all >$tmpdir/localmods
 
@@ -286,10 +224,10 @@ if [[ $action == diff-* ]] ; then
 fi
 
 # Find the changed files
+git diff --no-index --name-only --exit-code org/ new/ | \
+    sed -e 's#new/##' > $tmpdir/changed
 changes=
-set -o pipefail
-if ! git diff --no-index --name-only --exit-code org/ new/ | \
-         sed -e 's#new/##' > $tmpdir/changed
+if [[ -s $tmpdir/changed ]]
 then
     changes=1
 fi
diff --git a/cmake/FindNVML.cmake b/cmake/FindNVML.cmake
new file mode 100644 (file)
index 0000000..6a2340c
--- /dev/null
@@ -0,0 +1,115 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+#.rst:
+# FindNVML
+# --------
+#
+# Find the NVIDIA Management Library (NVML) includes and library. NVML documentation
+# is available at: http://docs.nvidia.com/deploy/nvml-api/index.html 
+#
+# NVML is part of the GPU Deployment Kit (GDK) and GPU_DEPLOYMENT_KIT_ROOT_DIR can
+# be specified if the GPU Deployment Kit is not installed in a default location.
+#
+# FindNVML defines the following variables: 
+#
+#   NVML_INCLUDE_DIR, where to find nvml.h, etc.
+#   NVML_LIBRARY, the libraries needed to use NVML.
+#   NVML_FOUND, If false, do not try to use NVML.
+#
+
+#   Jiri Kraus, NVIDIA Corp (nvidia.com - jkraus)
+#
+#   Copyright (c) 2008 - 2014 NVIDIA Corporation.  All rights reserved.
+#
+#   This code is licensed under the MIT License.  See the FindNVML.cmake script
+#   for the text of the license.
+
+# The MIT License
+#
+# License for the specific language governing rights and limitations under
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+###############################################################################
+
+if( CMAKE_SYSTEM_NAME STREQUAL "Windows"  )
+  set( NVML_LIB_PATHS "C:/Program Files/NVIDIA Corporation/GDK/nvml/lib" )
+  if(GPU_DEPLOYMENT_KIT_ROOT_DIR)
+    list(APPEND NVML_LIB_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}/nvml/lib")
+  endif()
+  set(NVML_NAMES nvml)
+  
+  set( NVML_INC_PATHS "C:/Program Files/NVIDIA Corporation/GDK/nvml/include" )
+  if(GPU_DEPLOYMENT_KIT_ROOT_DIR)
+    list(APPEND NVML_INC_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}/nvml/include")
+  endif()
+else()
+  set( NVML_LIB_PATHS /usr/lib64 )
+  if(GPU_DEPLOYMENT_KIT_ROOT_DIR)
+    list(APPEND NVML_LIB_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}/src/gdk/nvml/lib")
+  endif()
+  set(NVML_NAMES nvidia-ml)
+  
+  set( NVML_INC_PATHS /usr/include/nvidia/gdk/ /usr/include )
+  if(GPU_DEPLOYMENT_KIT_ROOT_DIR)
+    list(APPEND NVML_INC_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}/include/nvidia/gdk")
+  endif()
+endif()
+
+find_library(NVML_LIBRARY NAMES ${NVML_NAMES} PATHS ${NVML_LIB_PATHS} )
+
+find_path(NVML_INCLUDE_DIR nvml.h PATHS ${NVML_INC_PATHS})
+
+# handle the QUIETLY and REQUIRED arguments and set NVML_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NVML DEFAULT_MSG NVML_LIBRARY NVML_INCLUDE_DIR)
+
+mark_as_advanced(NVML_LIBRARY NVML_INCLUDE_DIR)
diff --git a/cmake/Platform/Linux-Intel-C-XeonPhi.cmake b/cmake/Platform/Linux-Intel-C-XeonPhi.cmake
new file mode 100644 (file)
index 0000000..a08c513
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+set(CMAKE_C_FLAGS_INIT "-mmic")
diff --git a/cmake/Platform/Linux-Intel-CXX-XeonPhi.cmake b/cmake/Platform/Linux-Intel-CXX-XeonPhi.cmake
new file mode 100644 (file)
index 0000000..98d843f
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+set(CMAKE_CXX_FLAGS_INIT "-mmic")
index 3e7956a83c73d4bf773af0f3394682136ef53455..a23feaf9f84947085f3baff62e3ddaedb8fd0e10 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,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.
 #
 # 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(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_SYSTEM_PROCESSOR XeonPhi)
 if(NOT GMX_MPI)
     set(CMAKE_C_COMPILER "icc")
     set(CMAKE_CXX_COMPILER "icpc")
 else()
-    set(CMAKE_C_COMPILER "mpiicc")
+    set(CMAKE_C_COMPILER "mpiicc") #FindMPI doesn't work (#14991)
     set(CMAKE_CXX_COMPILER "mpiicpc")
-    set(GMX_PREFER_STATIC_LIBS ON CACHE BOOL "Shared libraries on Xeon Phi with MPI don't work.")
 endif()
-set(CMAKE_CXX_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.")
-set(CMAKE_C_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.")
-set(GMX_FFT_LIBRARY "mkl" CACHE STRING "FFT library")
diff --git a/cmake/VersionInfo.cmake.cmakein b/cmake/VersionInfo.cmake.cmakein
new file mode 100644 (file)
index 0000000..b3f81b4
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+set(GMX_VERSION                   "@GMX_VERSION@")
+set(GMX_VERSION_MAJOR             "@GMX_VERSION_MAJOR@")
+set(GMX_VERSION_MINOR             "@GMX_VERSION_MINOR@")
+set(GMX_VERSION_PATCH             "@GMX_VERSION_PATCH@")
+set(GMX_VERSION_STRING            "@GMX_VERSION_STRING@")
+
+set(GMX_VERSION_STRING_FULL       "@GMX_VERSION_STRING_FULL@")
+set(GMX_VERSION_FULL_HASH         "@GMX_VERSION_FULL_HASH@")
+set(GMX_VERSION_CENTRAL_BASE_HASH "@GMX_VERSION_CENTRAL_BASE_HASH@")
similarity index 65%
rename from docs/doxygen/getInstalledHeaders.cmake
rename to cmake/gmxBuildTypeProfile.cmake
index 60fe80559651957744d0ba900ea2b5387b6a8c0b..b752bf45f48293f2c86fe28e04e6a46a7c79a3fb 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.
 
-function (generate_installed_file_list SRCDIR BUILDDIR OUTFILE)
-    file(GLOB_RECURSE INSTALL_FILE_LIST "${BUILDDIR}/cmake_install.cmake")
-    set(MATCH_REGEX "(${SRCDIR}|${BUILDDIR})/.*\\.h")
-    set(HEADER_LIST)
-    foreach (INSTALL_FILE ${INSTALL_FILE_LIST})
-        file(STRINGS ${INSTALL_FILE} HEADER_LINES REGEX "${MATCH_REGEX}")
-        foreach (HEADER_LINE ${HEADER_LINES})
-            string (REGEX MATCH "${MATCH_REGEX}" HEADER "${HEADER_LINE}")
-            list(APPEND HEADER_LIST "${HEADER}")
-        endforeach ()
-    endforeach ()
-    string(REPLACE ";" "\n" HEADER_LIST "${HEADER_LIST}")
-    file(WRITE ${OUTFILE} "${HEADER_LIST}")
-endfunction ()
+# Custom build type "Profile", based on "RelWithAssert".
+set( CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE_INIT} -pg" CACHE STRING "C flags for profile builds.")
+set( CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE_INIT} -pg" CACHE STRING "C++ flags for profile builds.")
+set( CMAKE_LD_FLAGS_PROFILE "${CMAKE_LD_FLAGS_RELEASE_INIT} -pg" CACHE STRING "Linking flags for profile builds.")
+mark_as_advanced( CMAKE_CXX_FLAGS_PROFILE CMAKE_C_FLAGS_PROFILE CMAKE_LD_FLAGS_PROFILE)
 
-if (NOT DEFINED SRCDIR OR NOT DEFINED BUILDDIR OR NOT DEFINED OUTFILE)
-    message(FATAL_ERROR "Required input variable (SRCDIR, BUILDDIR, OUTFILE) not set")
-endif ()
-generate_installed_file_list(${SRCDIR} ${BUILDDIR} ${OUTFILE})
index cb35166cd7c27eb9f76f809720f48afbca5bd4f3..47f596ab9d55bace50b3d4f0b593cacb9d4972ef 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,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.
@@ -64,7 +64,7 @@ function(gmx_set_cmake_compiler_flags)
         # be set up elsewhere and passed to this function, but it is
         # inconvenient in CMake to pass more than one list, and such a
         # list is only used here.
-        foreach(build_type RELWITHDEBINFO RELWITHASSERT MINSIZEREL)
+        foreach(build_type RELWITHDEBINFO RELWITHASSERT MINSIZEREL PROFILE)
             set(GMXC_${language}FLAGS_${build_type} "${GMXC_${language}FLAGS_RELEASE}")
         endforeach()
         # Copy the flags that are only used by the real Release build
@@ -113,14 +113,12 @@ MACRO(gmx_c_flags)
         # Since 4.8 on by default. For previous version disabling is a no-op. Only disabling for Release because with assert
         # the warnings are OK.
         GMX_TEST_CFLAG(CFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CFLAGS_RELEASE_ONLY)
-        # Since gcc 4.8 strict - false postives with old gmx_fatal. TODO: Remove in master
-        GMX_TEST_CFLAG(CFLAGS_WARN_UNINIT "-Wno-maybe-uninitialized" GMXC_CFLAGS)
         if(CYGWIN)
             GMX_TEST_CFLAG(CFLAGS_WARN_SUBSCRIPT "-Wno-char-subscripts" GMXC_CFLAGS)
         endif()
         # new in gcc 4.5
         GMX_TEST_CFLAG(CFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CFLAGS_RELEASE)
-        GMX_TEST_CFLAG(CFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
+        GMX_TEST_CFLAG(CFLAGS_COPT "-funroll-all-loops"
                        GMXC_CFLAGS_RELEASE)
         GMX_TEST_CFLAG(CFLAGS_NOINLINE "-fno-inline" GMXC_CFLAGS_DEBUG)
     endif()
@@ -136,7 +134,7 @@ MACRO(gmx_c_flags)
         GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
         # new in gcc 4.5
         GMX_TEST_CXXFLAG(CXXFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CXXFLAGS_RELEASE)
-        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
+        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-funroll-all-loops"
                          GMXC_CXXFLAGS_RELEASE)
         GMX_TEST_CXXFLAG(CXXFLAGS_NOINLINE "-fno-inline" GMXC_CXXFLAGS_DEBUG)
     endif()
@@ -153,9 +151,7 @@ MACRO(gmx_c_flags)
                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd161" GMXC_CFLAGS)
                 endif()
             endif()
-# 111: statement is unreachable
-# 177: function ".." was declared but never referenced
-# 181: argument of type ".." is incompatible with format "..", expecting argument of type ".."
+# 177: function/variable ".." was declared but never referenced
 # 193: zero used for undefined preprocessing identifier ".."
 # 271: trailing comma is nonstandard
 # 304: access control not specified ("public" by default)
@@ -178,9 +174,11 @@ MACRO(gmx_c_flags)
 #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 -wd111 -wd177 -wd181 -wd193 -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 -wd193 -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_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_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)
@@ -189,7 +187,7 @@ MACRO(gmx_c_flags)
                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd161" GMXC_CFLAGS)
                 endif()
             endif()
-            GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /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 /wd193 /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_OPT "/Qip" GMXC_CFLAGS_RELEASE)
         endif()
     endif()
@@ -206,8 +204,10 @@ MACRO(gmx_c_flags)
 #All but the following warnings are identical for the C-compiler (see above)
 #1782: #pragma once is obsolete
 #2282: unrecognized GCC pragma
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -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 -wd193 -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_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" 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)
@@ -216,7 +216,7 @@ MACRO(gmx_c_flags)
                     GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd161" GMXC_CXXFLAGS)
                 endif()
             endif()
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd177 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_OPT "/Qip" GMXC_CXXFLAGS_RELEASE)
         endif()
     endif()
diff --git a/cmake/gmxCPackUtilities.cmake b/cmake/gmxCPackUtilities.cmake
new file mode 100644 (file)
index 0000000..bf22099
--- /dev/null
@@ -0,0 +1,134 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+# Helper functions to encapsulate and modularize usage of CPack
+#
+# This file is intended to be the only place that directly sets CPack variables
+# (in gmx_cpack_write_config()), and other parts of the build system should
+# only call the functions declared here to set up the packaging.
+
+# Initialize the machinery that collects CPack information during other
+# build system generation
+#
+# This function should be called before other functions from this file.
+function (gmx_cpack_init)
+    # Add the source tree to the source package.
+    # If we would not set CPACK_SOURCE_INSTALLED_DIRECTORIES, this is what
+    # CPack would set as default.
+    set_property(GLOBAL PROPERTY GMX_CPACK_SOURCE_INSTALLED_DIRECTORIES
+        ${PROJECT_SOURCE_DIR} /)
+endfunction()
+
+# Add a generated directory to be included in the source package.
+#
+# Usage:
+#   gmx_cpack_add_generated_source_directory(<dir> [DESTINATION <dest>])
+#
+#   <dir>   Name of directory to include.
+#           Relative paths are interpreted relative to current build dir.
+#   <dest>  Path in the source package where files from <dir> will be put.
+#           If not set, the files are put in the corresponding location in
+#           the source tree.
+#
+# By default, CPack source archives includes all files from the source tree.
+# This function adds a directory from the build tree to be packaged into the
+# source archive.  These are used for content GROMACS generates as part of the
+# configuration or build.
+# The values end up in CPACK_SOURCE_INSTALLED_DIRECTORIES, which is a list of
+# pairs of names of source and destination directories.
+function (gmx_cpack_add_generated_source_directory DIR)
+    include(CMakeParseArguments)
+    set(_one_value_args DESTINATION)
+    cmake_parse_arguments(ARG "" "${_one_value_args}" "" ${ARGN})
+    if (ARG_UNPARSED_ARGUMENTS)
+        message(FATAL_ERROR "Unknown arguments: ${ARG_UNPARSED_ARGUMENTS}")
+    endif()
+    set(_dir ${DIR})
+    if (NOT IS_ABSOLUTE ${_dir})
+        set(_dir ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
+    endif()
+    if (ARG_DESTINATION)
+        set(_dest ${ARG_DESTINATION})
+    else()
+        file(RELATIVE_PATH _dest ${PROJECT_BINARY_DIR} ${_dir})
+    endif()
+    set_property(GLOBAL APPEND PROPERTY GMX_CPACK_SOURCE_INSTALLED_DIRECTORIES
+        ${_dir} ${_dest})
+endfunction()
+
+# Write CPack configuration files
+#
+# This function should be called at the end of the main CMakeLists.txt, after
+# all other calls to functions in this file.
+# CPack also automatically populates the list of components based on components
+# used in installation rules, so it should come after all install() commands.
+function (gmx_cpack_write_config)
+    # Set basic package information.
+    set(CPACK_PACKAGE_NAME    "gromacs")
+    set(CPACK_PACKAGE_VENDOR  "gromacs.org")
+    set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org")
+    set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
+        "Gromacs - a toolkit for high-performance molecular simulation")
+    # Set version info.
+    set(CPACK_PACKAGE_VERSION_MAJOR ${GMX_VERSION_MAJOR})
+    set(CPACK_PACKAGE_VERSION_MINOR ${GMX_VERSION_MINOR})
+    set(CPACK_PACKAGE_VERSION_PATCH ${GMX_VERSION_PATCH})
+    set(CPACK_PACKAGE_VERSION       ${GMX_VERSION_STRING})
+    # Add various text resources for some installers.
+    set(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/admin/InstallWelcome.txt")
+    # Its GPL/LGPL, so they do not have to agree to a license for mere usage,
+    # but some installers require this...
+    set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
+    set(CPACK_RESOURCE_FILE_README  "${PROJECT_SOURCE_DIR}/admin/InstallInfo.txt")
+
+    # Our custom config file that is run by CPack for each generator, used to
+    # check for prerequisites of the packaging.
+    set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_SOURCE_DIR}/CPackInit.cmake")
+
+    # Settings specific to source packages.
+    set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
+    set(CPACK_SOURCE_IGNORE_FILES
+        "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;")
+    # 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)
+
+    # Propagate additional values for CPackInit.cmake to use.
+    # CPack includes all variables starting with CPACK_ into the generated
+    # config files that are included by CPack.
+    set(CPACK_GMX_BUILD_HELP "${GMX_BUILD_HELP}")
+
+    # Generate the CPack configuration files.
+    include(CPack)
+endfunction()
diff --git a/cmake/gmxConfigureVersionInfo.cmake b/cmake/gmxConfigureVersionInfo.cmake
new file mode 100644 (file)
index 0000000..a00e2c3
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+include(${VERSION_VARIABLES})
+configure_file(${VERSION_CMAKEIN} ${VERSION_OUT} @ONLY)
diff --git a/cmake/gmxCustomCommandUtilities.cmake b/cmake/gmxCustomCommandUtilities.cmake
new file mode 100644 (file)
index 0000000..ae3279a
--- /dev/null
@@ -0,0 +1,282 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+# Helper functions for creating custom commands
+#
+# CMake semantics of add_custom_command() and add_custom_target() are not
+# always very convenient or intuitive for creating commands that do not always
+# run.  This file provides a gmx_add_custom_output_target() to simplify the
+# task.  The function also provides some convenience features to remove code
+# duplication in some parts of the GROMACS build system.
+#
+# Additionally, gmx_get_stamp_filename() and gmx_get_files_with_gitattribute()
+# are provided independently to help in creating custom commands.
+
+# Helper function to create a stamp file name for a target.
+#
+# Usage:
+#   gmx_get_stamp_filename(<variable> <targetname>)
+#
+#   <variable>   - name of variable to receive the stamp name
+#   <targetname> - name of target for which to generate the stamp name
+#
+# This is used internally by gmx_add_custom_target(... OUTPUT STAMP ...), but
+# can also be called directly to create uniform stamp file names throughout the
+# build system.
+# <targetname> can be any string that is a part of a valid file name; it does
+# not need to name an existing or to-be-created target.
+function (gmx_get_stamp_filename variable targetname)
+    set(_filename "${targetname}")
+    if (NOT "${targetname}" MATCHES "stamp$")
+        set(_filename "${targetname}-timestamp")
+    endif()
+    set(${variable} "${CMAKE_CURRENT_BINARY_DIR}/${_filename}.txt"
+        PARENT_SCOPE)
+endfunction()
+
+# Helper function to tell gmx_add_custom_output_target() the name of an output
+# file for a custom target.
+#
+# Usage:
+#   gmx_set_custom_target_output(<targetname> <output>)
+#
+#   <targetname> - name of an existing custom target
+#   <output>     - path to the output file produced by the custom target
+#
+# This is used internally by gmx_add_custom_output_target(), but can also be
+# called for targets created with add_custom_target() to make them work with
+# the dependency resolution mechanism in gmx_add_custom_output_target() if
+# those targets for some reason cannot be created with that command.
+function (gmx_set_custom_target_output targetname output)
+    # Store the output file name in a custom property to be used in dependency
+    # resolution later.
+    if (NOT IS_ABSOLUTE ${output})
+        set(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
+    endif()
+    set_property(TARGET ${targetname}
+        PROPERTY GMX_CUSTOM_TARGET_OUTPUT_FILE ${output})
+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
+#     dependency has been updated.
+#   - Support for creating custom targets that produce stamp files whenever
+#     they run successfully, so that other targets can depend on those stamp
+#     files.
+#
+# Usage:
+#   gmx_add_custom_output_target(<target> [RUN_ALWAYS] [ADD_FAST_TARGET]
+#                                OUTPUT <STAMP | <output> >
+#                                [COMMAND <command1> [<args1...>]]
+#                                [COMMAND <command2> [<args2...>]]
+#                                [WORKING_DIRECTORY <dir>]
+#                                [DEPENDS <deps...>]
+#                                [DEPENDS_FILE_LIST <list>]
+#                                [COMMENT <comment>])
+#
+#   <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.
+#       The dependencies listed with DEPENDS are ignored in this case.
+#   ADD_FAST_TARGET
+#     - In addition to creating <target>, create a secondary target
+#       <target>-fast that always runs the same commands, but does not have
+#       any dependencies.  Desired dependencies can be added separately using
+#       add_dependencies().  This supports cases where some of the dependencies
+#       are time-consuming to build, and it is possible to build the target
+#       even without up-to-date dependencies for testing only that part of the
+#       build.
+#   OUTPUT
+#     - Sets the name of the output file from this custom target.
+#       Can be set to STAMP, in which case a stamp file name is automatically
+#       generated and commands to touch that stamp whenever the target is made
+#       are added.
+#   COMMAND
+#     - Passed to add_custom_command()/add_custom_target().
+#       If OUTPUT STAMP is used, then a command to touch the stamp is
+#       automatically added.  In this case, it is allowed to not specify any
+#       commands explicitly.
+#   WORKING_DIRECTORY
+#     - Passed to add_custom_command()/add_custom_target()
+#   COMMENT
+#     - 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
+#       automatically expanded such that the custom command always runs if the
+#       output of the dependent target changes.  It is not necessary to list
+#       those output files here explicitly.
+#   DEPENDS_FILE_LIST
+#     - Names of variables from which dependencies are added verbatim.
+#       The target expansion described above is not performed for these
+#       dependencies, and the value passed to the function is the name of a
+#       list variable, not the list itself.  This provides much better
+#       performance if the dependency list is a long list of source files.
+#
+# This function does not need a VERBATIM argument; that is always used when
+# creating the underlying custom commands/targets.
+function (gmx_add_custom_output_target targetname)
+    # Parse the arguments
+    # CMakeParseArguments is not suitable, since it does not support the use of
+    # multiple COMMAND parameters that add_custom_target/command() supports.
+    set(_option "")
+    set(_command_args "")
+    set(_deps "")
+    set(_output "")
+    set(_stamp OFF)
+    set(_always OFF)
+    set(_add_fast OFF)
+    foreach (_arg ${ARGN})
+        if ("x${_arg}" STREQUAL "xRUN_ALWAYS")
+            set(_always ON)
+        elseif ("x${_arg}" STREQUAL "xADD_FAST_TARGET")
+            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)$")
+            set(_option "PASS")
+            list(APPEND _command_args "${_arg}")
+        elseif ("x${_option}" STREQUAL "xDEPENDS")
+            list(APPEND _deps "${_arg}")
+            # If the dependency is a target created with this command, also add
+            # the output file as a dependency.
+            if (TARGET "${_arg}")
+                get_property(_target_output
+                    TARGET "${_arg}" PROPERTY GMX_CUSTOM_TARGET_OUTPUT_FILE)
+                if (_target_output)
+                    list(APPEND _deps ${_target_output})
+                endif()
+            endif()
+        elseif ("x${_option}" STREQUAL "xPASS")
+            list(APPEND _command_args "${_arg}")
+        elseif ("x${_option}" STREQUAL "xDEPENDS_FILE_LIST")
+            list(APPEND _deps ${${_arg}})
+        elseif ("x${_option}" STREQUAL "xOUTPUT")
+            if (_output)
+                message(FATAL_ERROR "Multiple OUTPUTs not supported")
+            endif()
+            if ("x${_arg}" STREQUAL "xSTAMP")
+                gmx_get_stamp_filename(_output ${targetname})
+                set(_stamp ON)
+            else()
+                set(_output ${_arg})
+            endif()
+        else()
+            message(FATAL_ERROR "Unknown option ${_arg}")
+        endif()
+    endforeach()
+    # Add automatically a command to update the stamp if requested
+    if (_stamp)
+        list(APPEND _command_args COMMAND ${CMAKE_COMMAND} -E touch ${_output})
+    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)
+    endif()
+    # Store the output file name in a custom property to be used in dependency
+    # resolution later.
+    gmx_set_custom_target_output(${targetname} ${_output})
+    # Create the fast target if requested.
+    if (_add_fast)
+        add_custom_target(${targetname}-fast ${_command_args} VERBATIM)
+    endif()
+endfunction()
+
+# Gets list of files in the source tree with the given git attribute set
+#
+# Usage:
+#   gmx_get_files_with_gitattribute(<variable> <attribute>)
+#
+#   <variable>  - name of variable to receive the file list
+#   <attribute> - name of git attribute to use
+#
+# This is useful to generate a list of dependencies for custom commands when
+# there is a long list of files that cannot be easily just globbed.
+# Using git attributes allows keeping complicated logic out of the build
+# system, as expressing such logic in a CMake script that would be reasonably
+# fast to evaluate for a long file list is convenient or easy.
+function (gmx_get_files_with_gitattribute variable attribute)
+    execute_process(
+        COMMAND ${GIT_EXECUTABLE} ls-files
+        COMMAND ${GIT_EXECUTABLE} check-attr ${attribute} --stdin
+        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+        OUTPUT_VARIABLE _files)
+    string(REGEX MATCHALL "[^\n]*: ${attribute}: set\n"
+           _files_with_attr "${_files}")
+    string(REGEX REPLACE "([^;]*): ${attribute}: set\n" "${PROJECT_SOURCE_DIR}/\\1"
+           _files "${_files_with_attr}")
+    set(${variable} ${_files} PARENT_SCOPE)
+endfunction()
index 199c4c3cde9469c0c3ee3872a4f256bef265344b..881086d63a5f2c9acf7affab0f2d4a2a7e541cdf 100644 (file)
@@ -62,7 +62,7 @@ function(gmx_suggest_x86_simd _suggested_simd)
     message(STATUS "Detecting best SIMD instructions for this CPU")
 
     # Get CPU SIMD properties information
-    set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders -DGMX_CPUID_STANDALONE")
+    set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUID_STANDALONE")
     if(GMX_TARGET_X86)
         set(_compile_definitions "${_compile_definitions} -DGMX_TARGET_X86")
     endif()
@@ -98,6 +98,8 @@ function(gmx_detect_simd _suggested_simd)
             # HPC-ACE is always present. In the future we
             # should add detection for HPC-ACE2 here.
             set(${_suggested_simd} "Sparc64_HPC_ACE")
+        elseif(GMX_TARGET_MIC)
+            set(${_suggested_simd} "MIC")
         elseif(GMX_TARGET_X86)
             gmx_suggest_x86_simd(${_suggested_simd})
         else()
index 0d6a42da70fb8c2e9b01c5f8acfa2b4e31aac18f..a71d88f99b476158900073b11a6a004b81ceb1ea 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -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.
 
-# Due to a bug, gcc 4.4.x crashes when compiling bondfree.c with -O3 and
+# Due to a bug, gcc 4.4.x crashes when compiling listed-forces/bonded.cpp with -O3 and
 # -fopenmp, but strangely it does not crash with -O2 + all additional options.
 # -O3 uses. Therefore, for the affected files, when compiling in release mode,
 # we override -O3 with -O2 and add the additional option.
index 8db1e10400d878cb679d0a653d8e271a7abe02e8..9c64eb580c95588f6504df61123d2fce7e8947f7 100644 (file)
 # PROJECT_SOURCE_DIR     - top level source directory (which has to be in git)
 # VERSION_CMAKEIN        - path to an input template file
 # VERSION_OUT            - path to the output file
-# VERSION_NO_REMOTE_HASH - if set, GMX_GIT_REMOTE_HASH is not generated
 #
 # Output:
-# i)  Script mode: VERSION_OUT is configured from the input VERSION_CMAKEIN
+# VERSION_OUT is configured from the input VERSION_CMAKEIN
 # using the variables listed below.
-# ii) Cache variable mode: the variables below are set in cache.
 #
-# GMX_PROJECT_VERSION_STR   - version string
-# GMX_GIT_HEAD_HASH         - git hash of current local HEAD
-# GMX_GIT_REMOTE_HASH       - git hash of the first ancestor commit from the
-#                             main Gromacs repository
+# GMX_VERSION_STRING_FULL       - version string
+# GMX_VERSION_FULL_HASH         - git hash of current local HEAD
+# GMX_VERSION_CENTRAL_BASE_HASH - git hash of the first ancestor commit from the
+#                                 main Gromacs repository
 #
 # Szilard Pall (pszilard@cbr.su.se)
 # Teemu Murtola (teemu.murtola@gmail.com)
 
+# Check input variables.
 if("${PROJECT_VERSION}" STREQUAL "")
     message(FATAL_ERROR "PROJECT_VERSION undefined!")
 endif()
-
-# if we're generating variables for cache unset the variables
-if(GEN_VERSION_INFO_INTERNAL)
-    set(GMX_PROJECT_VERSION_STR)
-    set(GMX_GIT_HEAD_HASH)
-    set(GMX_GIT_REMOTE_HASH)
+if (NOT EXISTS "${GIT_EXECUTABLE}")
+    message(FATAL_ERROR "Git executable is not set correctly")
 endif()
-
-# bail if the source tree is not in a git repository
-if(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
+if (NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
     message(FATAL_ERROR "Project source directory ${PROJECT_SOURCE_DIR} not in git")
 endif()
+if ("${VERSION_CMAKEIN}" STREQUAL "")
+    message(FATAL_ERROR "Missing input parameter VERSION_CMAKEIN!")
+endif()
+if ("${VERSION_OUT}" STREQUAL "")
+    message(FATAL_ERROR "Missing input parameter VERSION_OUT!")
+endif()
 
-# If git executable exists, build the development version string.
-if(EXISTS "${GIT_EXECUTABLE}")
-    # refresh git index
-    execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
-        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-        TIMEOUT 5
-        OUTPUT_QUIET
-        ERROR_VARIABLE EXEC_ERR
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
+# refresh git index
+execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    TIMEOUT 5
+    OUTPUT_QUIET
+    ERROR_VARIABLE EXEC_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
 
-    # get the full hash of the current HEAD
-    execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
-        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-        OUTPUT_VARIABLE HEAD_HASH
-        ERROR_VARIABLE EXEC_ERR
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-    set(GMX_GIT_HEAD_HASH ${HEAD_HASH})
-    # extract the shortened hash (7 char)
-    execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
-        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-        OUTPUT_VARIABLE HEAD_HASH_SHORT
-        ERROR_VARIABLE EXEC_ERR
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
+# get the full hash of the current HEAD
+execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    OUTPUT_VARIABLE HEAD_HASH
+    ERROR_VARIABLE EXEC_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+set(GMX_VERSION_FULL_HASH ${HEAD_HASH})
 
-    # if there are local uncommitted changes, the build gets labeled "dirty"
-    execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD
-        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-        OUTPUT_VARIABLE SRC_LOCAL_CHANGES
-        ERROR_VARIABLE EXEC_ERR
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-    if(NOT "${SRC_LOCAL_CHANGES}" STREQUAL "")
-        set(DIRTY_STR "-dirty")
-        set(GMX_GIT_HEAD_HASH "${GMX_GIT_HEAD_HASH} (dirty)")
-    endif()
+# extract the shortened hash (7 char)
+execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    OUTPUT_VARIABLE HEAD_HASH_SHORT
+    ERROR_VARIABLE EXEC_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
 
-    # get the date of the HEAD commit
-    execute_process(COMMAND ${GIT_EXECUTABLE} rev-list -n1 "--pretty=format:%ci" HEAD
-        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-        OUTPUT_VARIABLE HEAD_DATE
-        ERROR_VARIABLE EXEC_ERR
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-    string(REGEX REPLACE "\n| " ";" HEAD_DATE "${HEAD_DATE}")
-    list(GET HEAD_DATE 2 HEAD_DATE)
-    string(REGEX REPLACE "-" "" HEAD_DATE "${HEAD_DATE}")
+# if there are local uncommitted changes, the build gets labeled "dirty"
+execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    OUTPUT_VARIABLE SRC_LOCAL_CHANGES
+    ERROR_VARIABLE EXEC_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+if(NOT "${SRC_LOCAL_CHANGES}" STREQUAL "")
+    set(DIRTY_STR "-dirty")
+    set(GMX_VERSION_FULL_HASH "${GMX_VERSION_FULL_HASH} (dirty)")
+endif()
 
-    # compile the version string suffix
-    set(VERSION_STR_SUFFIX "${HEAD_DATE}-${HEAD_HASH_SHORT}${DIRTY_STR}")
+# get the date of the HEAD commit
+execute_process(COMMAND ${GIT_EXECUTABLE} rev-list -n1 "--pretty=format:%ci" HEAD
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    OUTPUT_VARIABLE HEAD_DATE
+    ERROR_VARIABLE EXEC_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+string(REGEX REPLACE "\n| " ";" HEAD_DATE "${HEAD_DATE}")
+list(GET HEAD_DATE 2 HEAD_DATE)
+string(REGEX REPLACE "-" "" HEAD_DATE "${HEAD_DATE}")
 
-    if (DEFINED VERSION_NO_REMOTE_HASH)
-        set(GMX_REMOTES "")
-    else()
-        # find the names of remotes that are located on the official gromacs
-        # git/gerrit servers
-        execute_process(COMMAND ${GIT_EXECUTABLE} config --get-regexp
-                        "remote\\..*\\.url" "\\.gromacs\\.org[:/].*gromacs(\\.git)?$"
-            WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-            OUTPUT_VARIABLE GMX_REMOTES
-            ERROR_VARIABLE EXEC_ERR
-            OUTPUT_STRIP_TRAILING_WHITESPACE
-        )
-    endif()
+# compile the version string suffix
+set(VERSION_STR_SUFFIX "${HEAD_DATE}-${HEAD_HASH_SHORT}${DIRTY_STR}")
 
-    # if there are remotes from the gromacs git servers, try to find ancestor
-    # commits of the current HEAD from this remote;
-    # otherwise, label the build "unknown"
-    if("${GMX_REMOTES}" STREQUAL "")
-        if (NOT DEFINED VERSION_NO_REMOTE_HASH)
-            set(VERSION_STR_SUFFIX "${VERSION_STR_SUFFIX}-unknown")
-        endif()
-        set(GMX_GIT_REMOTE_HASH "unknown")
-    else()
-        string(REPLACE "\n" ";" GMX_REMOTES ${GMX_REMOTES})
-        # construct a command pipeline that produces a reverse-time-ordered
-        # list of commits and their annotated names in GMX_REMOTES
-        # the max-count limit is there to put an upper bound on the execution time
-        set(BASEREVCOMMAND "COMMAND ${GIT_EXECUTABLE} rev-list --max-count=1000 HEAD")
-        foreach(REMOTE ${GMX_REMOTES})
-            string(REGEX REPLACE "remote\\.(.*)\\.url.*" "\\1" REMOTE ${REMOTE})
-            set(BASEREVCOMMAND "${BASEREVCOMMAND} COMMAND ${GIT_EXECUTABLE} name-rev --stdin --refs=refs/remotes/${REMOTE}/*")
-        endforeach(REMOTE)
-        # this is necessary for CMake to properly split the variable into
-        # parameters for execute_process().
-        string(REPLACE " " ";" BASEREVCOMMAND ${BASEREVCOMMAND})
-        # find the first ancestor in the list provided by rev-list (not
-        # necessarily the last though) which is in GMX_REMOTE, extract the
-        # hash and the number of commits HEAD is ahead with
-        execute_process(${BASEREVCOMMAND}
-            WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-            OUTPUT_VARIABLE ANCESTOR_LIST
-        )
-        string(REGEX REPLACE "\n" ";" ANCESTOR_LIST "${ANCESTOR_LIST}")
+# find the names of remotes that are located on the official gromacs
+# git/gerrit servers
+execute_process(COMMAND ${GIT_EXECUTABLE} config --get-regexp
+                "remote\\..*\\.url" "\\.gromacs\\.org[:/].*gromacs(\\.git)?$"
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    OUTPUT_VARIABLE GMX_REMOTES
+    ERROR_VARIABLE EXEC_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
 
-        set(AHEAD 0)
-        set(GMX_GIT_REMOTE_HASH "")
-        foreach(ANCESTOR ${ANCESTOR_LIST})
-            string(REPLACE "\n" "" HASH_AND_REVNAMES "${ANCESTOR}")
-            string(REPLACE " " ";" HASH_AND_REVNAMES "${HASH_AND_REVNAMES}")
-            list(LENGTH HASH_AND_REVNAMES COUNT)
-            # stop and set the hash if we have a hit, otherwise loop and count
-            # how far ahead is the local repo
-            if(COUNT GREATER 1)
-                LIST(GET HASH_AND_REVNAMES 0 GMX_GIT_REMOTE_HASH)
-                break()
-            endif()
-            math(EXPR AHEAD ${AHEAD}+1)
-        endforeach(ANCESTOR)
-        # mark the build "local" if didn't find any commits that are from
-        # remotes/${GMX_REMOTE}/*
-        if("${GMX_GIT_REMOTE_HASH}" STREQUAL "")
-            set(GMX_GIT_REMOTE_HASH "unknown")
-            set(VERSION_STR_SUFFIX "${VERSION_STR_SUFFIX}-local")
-        # don't print the remote hash if there are no local commits
-        elseif("${GMX_GIT_REMOTE_HASH}" STREQUAL "${HEAD_HASH}")
-            set(GMX_GIT_REMOTE_HASH "")
-        else()
-            set(GMX_GIT_REMOTE_HASH "${GMX_GIT_REMOTE_HASH} (${AHEAD} newer local commits)")
-        endif()
+# if there are remotes from the gromacs git servers, try to find ancestor
+# commits of the current HEAD from this remote;
+# otherwise, label the build "unknown"
+if("${GMX_REMOTES}" STREQUAL "")
+    if (NOT DEFINED VERSION_NO_REMOTE_HASH)
+        set(VERSION_STR_SUFFIX "${VERSION_STR_SUFFIX}-unknown")
     endif()
-
-    # compile final version string
-    set(GMX_PROJECT_VERSION_STR "${PROJECT_VERSION}-${VERSION_STR_SUFFIX}")
+    set(GMX_VERSION_CENTRAL_BASE_HASH "unknown")
 else()
-    # the version has to be defined
-    # set the GIT related information to "unknown"
-    message(WARNING "Source tree seems to be a repository, but no compatible git is available, using hard-coded version string")
-    set(GMX_PROJECT_VERSION_STR "${PROJECT_VERSION}")
-    set(GMX_GIT_HEAD_HASH "unknown")
-    set(GMX_GIT_REMOTE_HASH "unknown")
-endif()
+    string(REPLACE "\n" ";" GMX_REMOTES ${GMX_REMOTES})
+    # construct a command pipeline that produces a reverse-time-ordered
+    # list of commits and their annotated names in GMX_REMOTES
+    # the max-count limit is there to put an upper bound on the execution time
+    set(BASEREVCOMMAND "COMMAND ${GIT_EXECUTABLE} rev-list --max-count=1000 HEAD")
+    foreach(REMOTE ${GMX_REMOTES})
+        string(REGEX REPLACE "remote\\.(.*)\\.url.*" "\\1" REMOTE ${REMOTE})
+        set(BASEREVCOMMAND "${BASEREVCOMMAND} COMMAND ${GIT_EXECUTABLE} name-rev --stdin --refs=refs/remotes/${REMOTE}/*")
+    endforeach(REMOTE)
+    # this is necessary for CMake to properly split the variable into
+    # parameters for execute_process().
+    string(REPLACE " " ";" BASEREVCOMMAND ${BASEREVCOMMAND})
+    # find the first ancestor in the list provided by rev-list (not
+    # necessarily the last though) which is in GMX_REMOTE, extract the
+    # hash and the number of commits HEAD is ahead with
+    execute_process(${BASEREVCOMMAND}
+        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+        OUTPUT_VARIABLE ANCESTOR_LIST
+    )
+    string(REGEX REPLACE "\n" ";" ANCESTOR_LIST "${ANCESTOR_LIST}")
 
-# if we're generating cache variables set these
-# otherwise it's assumed that it's called in script mode to generate a file
-if(GEN_VERSION_INFO_INTERNAL)
-    set(GMX_PROJECT_VERSION_STR ${GMX_PROJECT_VERSION_STR}
-        CACHE STRING "Gromacs version string" FORCE)
-    set(GMX_GIT_HEAD_HASH ${GMX_GIT_HEAD_HASH}${DIRTY_STR}
-        CACHE STRING "Current git HEAD commit object" FORCE)
-    set(GMX_GIT_REMOTE_HASH ${GMX_GIT_REMOTE_HASH}
-        CACHE STRING "Commmit object of the nearest ancestor present in the Gromacs git repository" FORCE)
-    mark_as_advanced(GMX_GIT_HEAD_HASH GMX_GIT_REMOTE_HASH)
-else()
-    if("${VERSION_CMAKEIN}" STREQUAL "")
-        message(FATAL_ERROR "Missing input parameter VERSION_CMAKEIN!")
-    endif()
-    if("${VERSION_OUT}" STREQUAL "")
-        message(FATAL_ERROR "Missing input parameter VERSION_OUT!")
+    set(AHEAD 0)
+    set(GMX_VERSION_CENTRAL_BASE_HASH "")
+    foreach(ANCESTOR ${ANCESTOR_LIST})
+        string(REPLACE "\n" "" HASH_AND_REVNAMES "${ANCESTOR}")
+        string(REPLACE " " ";" HASH_AND_REVNAMES "${HASH_AND_REVNAMES}")
+        list(LENGTH HASH_AND_REVNAMES COUNT)
+        # stop and set the hash if we have a hit, otherwise loop and count
+        # how far ahead is the local repo
+        if(COUNT GREATER 1)
+            LIST(GET HASH_AND_REVNAMES 0 GMX_VERSION_CENTRAL_BASE_HASH)
+            break()
+        endif()
+        math(EXPR AHEAD ${AHEAD}+1)
+    endforeach(ANCESTOR)
+    # mark the build "local" if didn't find any commits that are from
+    # remotes/${GMX_REMOTE}/*
+    if("${GMX_VERSION_CENTRAL_BASE_HASH}" STREQUAL "")
+        set(GMX_VERSION_CENTRAL_BASE_HASH "unknown")
+        set(VERSION_STR_SUFFIX "${VERSION_STR_SUFFIX}-local")
+    # don't print the remote hash if there are no local commits
+    elseif("${GMX_VERSION_CENTRAL_BASE_HASH}" STREQUAL "${HEAD_HASH}")
+        set(GMX_VERSION_CENTRAL_BASE_HASH "")
+    else()
+        set(GMX_VERSION_CENTRAL_BASE_HASH "${GMX_VERSION_CENTRAL_BASE_HASH} (${AHEAD} newer local commits)")
     endif()
-    # Generate the output file.
-    configure_file(${VERSION_CMAKEIN} ${VERSION_OUT})
 endif()
+
+# Compile final version string.
+set(GMX_VERSION_STRING_FULL "${PROJECT_VERSION}-${VERSION_STR_SUFFIX}")
+
+# Generate the output file.
+configure_file(${VERSION_CMAKEIN} ${VERSION_OUT})
index b8fce34c9d8d3bfe82568cfdbe2e4152677e0658..f7c79471d365763c2c322f336104bf134fce7c7b 100644 (file)
@@ -151,6 +151,17 @@ ${_msg}")
         endif()
     endif() # NOT CUDA_FOUND
 endif()
+
+# Try to find NVML if a GPU accelerated binary should be build.
+if (GMX_GPU)
+    find_package(NVML)
+    if(NVML_FOUND)
+        include_directories(${NVML_INCLUDE_DIR})
+        set(HAVE_NVML 1)
+        list(APPEND GMX_EXTRA_LIBRARIES ${NVML_LIBRARY})
+    endif(NVML_FOUND)
+endif()
+
 # Annoyingly enough, FindCUDA leaves a few variables behind as non-advanced.
 # 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
index 5adc2627cdf2f49f17237a8d209ce3c7ee4575a7..50bbe80034253131b6c1484e2d19d077c4f71e4e 100644 (file)
@@ -153,14 +153,5 @@ if(GMX_MPI)
         "or set the variables reported missing for MPI_C above.")
   endif()
 
-  include(gmxTestCatamount)
-  gmx_test_catamount(GMX_CRAY_CATAMOUNT)
-  if(GMX_CRAY_CATAMOUNT)
-    set(GMX_NO_SYSTEM 1)
-    set(GMX_NO_NICE 1)
-    set(HAVE_PWD_H 0)
-  endif()
-
   set(GMX_LIB_MPI 1)
-  set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_LIB_MPI")
 endif()
index e0a7728221a600049d7990b5f1f8b892ddf952de..261b91d38e1662b4dd75eae68cc655ccb45e6ba1 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,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.
@@ -74,10 +74,8 @@ if (NOT DEFINED CUDA_NVCC_FLAGS_SET)
             setting CUDA_HOST_COMPILER to the full path of a compatible compiler.
             ")
         else()
-            # do not use MPI compiler wrappers, as these are prone to brake nvcc
-            if (GMX_MPI AND
-                NOT "${${MPI_PREFIX}_FOUND}" AND # FindMPI-based detection
-                NOT GMX_THREAD_MPI)
+            # do not use MPI compiler wrappers, as these are prone to break nvcc
+            if (GMX_MPI AND NOT "${${MPI_PREFIX}_FOUND}") # FindMPI-based detection
                 message(WARNING "
             Will not set the nvcc host compiler because the current C compiler is an MPI
             compiler wrapper: ${CMAKE_C_COMPILER}
@@ -131,15 +129,6 @@ if (NOT DEFINED CUDA_NVCC_FLAGS_SET)
         set(CUDA_HOST_COMPILER_OPTIONS "${CUDA_HOST_COMPILER_OPTIONS}-D__STRICT_ANSI__;")
     endif()
 
-    # on Linux we need to add -fPIC when building shared gmx libs
-    # Note: will add -fPIC for any compiler that supports it as it shouldn't hurt
-    if(BUILD_SHARED_LIBS)
-        GMX_TEST_CXXFLAG(CXXFLAG_FPIC "-fPIC" _FPIC_NVCC_FLAG)
-        if(_FPIC_NVCC_FLAG)
-            set(CUDA_HOST_COMPILER_OPTIONS "${CUDA_HOST_COMPILER_OPTIONS}-Xcompiler;${_FPIC_NVCC_FLAG}")
-        endif()
-    endif()
-
     # the legacy CUDA kernels have been dropped, warn with CUDA 4.0
     if (CUDA_VERSION VERSION_EQUAL "4.0")
         message(WARNING "The legacy GPU kernels optimized for older CUDA compilers, including the detected version 4.0, have been removed. To avoid performance loss, we strongly recommend upgrading to a newer CUDA toolkit.
@@ -148,17 +137,24 @@ if (NOT DEFINED CUDA_NVCC_FLAGS_SET)
 
     # Set the CUDA GPU architectures to compile for:
     # - with CUDA >v4.2 compute capability 2.0, 2.1 is, but 3.0 is not supported:
-    #     => compile sm_20, sm_21 cubin, and compute_20 PTX
-    # - with CUDA >=4.2 compute capability <=3.0 is supported:
-    #     => compile sm_20, sm_21, sm_30 cubin, and compute_30 PTX
-    # - with CUDA 5.0 and later compute capability 3.5 is supported
-    #     => compile sm_20, sm_21, sm_30, sm_35 cubin, and compute_35 PTX
+    #     => compile sm_20 cubin, and compute_20 PTX
+    # - with CUDA >=4.2 CC <=3.0 is supported:
+    #     => compile sm_20, sm_30 cubin, and compute_30 PTX
+    # - with CUDA 5.0 and later CC <=3.5 is supported
+    #     => compile sm_20, sm_30, sm_35 cubin, and compute_35 PTX
+    # - with CUDA 6.5 and later compute capability <=3.5 and 5.0 are supported
+    #     => compile sm_20, sm_30, sm_35, sm_5.0, cubin, and compute_50 PTX
+    #   Note that CUDA 6.5.19 second patch release supports cc 5.2 too, but
+    #   CUDA_VERSION does not contain patch version and having PTX 5.0 JIT-ed is
+    #   equally fast anyway.
     if(CUDA_VERSION VERSION_LESS "4.2")
-        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_20,code=compute_20")
+        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=compute_20")
     elseif(CUDA_VERSION VERSION_LESS "5.0")
-        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_30,code=compute_30")
+        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_30,code=compute_30")
+    elseif(CUDA_VERSION VERSION_LESS "6.5")
+        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_35,code=compute_35")
     else()
-        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_35,code=compute_35")
+        set(_CUDA_ARCH_STR "-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_50,code=compute_50;")
     endif()
 
     # finally set the damn flags
index cbad40bc671e1eb9a3867c4c7f5042ac28117248..ddcf7c4c9f42599037daf028cda8739aab4ed0aa 100644 (file)
@@ -56,7 +56,7 @@ if(GMX_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 CYGWIN AND NOT MINGW))
+            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 "")
@@ -81,3 +81,11 @@ if(GMX_OPENMP)
         endif()
     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)
+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)
+    message(FATAL_ERROR "Only 32 or multiples of 64 supported for GMX_OPENMP_MAX_THREADS.")
+endif()
index 0cfab0ce68c2c876b9b810c9961a6f0fbba7e781..75bb7c80802c2a3b5f53f2b290e9dbf078beb8e2 100644 (file)
@@ -60,7 +60,7 @@ if (GMX_PREFER_STATIC_LIBS)
     set(SHARED_LIBS_DEFAULT OFF)
 endif()
 set(GMX_PREFER_STATIC_LIBS_DEFAULT OFF)
-if (WIN32 AND NOT CYGWIN AND NOT BUILD_SHARED_LIBS)
+if (WIN32 AND NOT BUILD_SHARED_LIBS)
     set(GMX_PREFER_STATIC_LIBS_DEFAULT ON)
 endif()
 
@@ -73,7 +73,7 @@ endif()
 if (UNIX)
     set(GMX_PREFER_STATIC_LIBS_DESCRIPTION
         "When finding libraries prefer static archives (it will only work if static versions of external dependencies are available and found)")
-elseif (WIN32 AND NOT CYGWIN)
+elseif (WIN32)
     set(GMX_PREFER_STATIC_LIBS_DESCRIPTION
         "When finding libraries prefer static system libraries (MT instead of MD)")
 endif()
@@ -112,7 +112,7 @@ function(gmx_manage_prefer_static_libs_flags build_type)
     endforeach()
 endfunction()
 
-IF( WIN32 AND NOT CYGWIN)
+IF( WIN32)
   if (NOT BUILD_SHARED_LIBS)
       if(NOT GMX_PREFER_STATIC_LIBS)
           message(WARNING "Shared system libraries requested, and static Gromacs libraries requested.")
@@ -127,8 +127,9 @@ IF( WIN32 AND NOT CYGWIN)
           #this combination segfaults (illegal passing of file handles)
           message(FATAL_ERROR "Static system libraries requested, and shared Gromacs libraries requested.")
       endif()
-      add_definitions(-DUSE_VISIBILITY -DTMPI_USE_VISIBILITY)
-      set(PKG_CFLAGS "$PKG_CFLAGS -DUSE_VISIBILITY -DTMPI_USE_VISIBILITY")
+      # Visibility not yet implemented
+      # add_definitions(-DUSE_VISIBILITY -DTMPI_USE_VISIBILITY)
+      # set(PKG_CFLAGS "$PKG_CFLAGS -DUSE_VISIBILITY -DTMPI_USE_VISIBILITY")
   endif()
 
   IF (GMX_PREFER_STATIC_LIBS)
index 6d4eb672e0191c5c9cca06affc2be18edcd6180c..1783f7f20d980b08188121653c282084351ed1e5 100644 (file)
@@ -68,6 +68,9 @@ if (GMX_DEFAULT_SUFFIX)
         message(STATUS "Using default library suffix: \"${GMX_LIBS_SUFFIX}\"")
     endif()
 else()
+    if ("${GMX_LIBS_SUFFIX}" MATCHES "^_mdrun")
+        message(FATAL_ERROR "Library suffix (GMX_LIBS_SUFFIX) cannot start with '_mdrun', as that is reserved for internal use")
+    endif()
     gmx_check_if_changed(SUFFIXES_CHANGED
                          GMX_DEFAULT_SUFFIX GMX_BINARY_SUFFIX GMX_LIBS_SUFFIX)
     if (SUFFIXES_CHANGED)
index a6f045b857183b929c082b67cea10a4eeeb23b4e..ca1fac39a095cdaeca3df74188a1314694d193f5 100644 (file)
@@ -67,7 +67,7 @@ function(GMX_OPTION_MULTICHOICE NAME DESCRIPTION DEFAULT)
     string(REPLACE "[built-in]" "" _allowed "${ARGN}")
 
     # Set the cache properties
-    set(${NAME} ${DEFAULT} CACHE STRING ${_description})
+    set(${NAME} ${DEFAULT} CACHE STRING "${_description}")
     set_property(CACHE ${NAME} PROPERTY STRINGS ${_allowed})
 
     # Check that the value is one of the allowed
@@ -88,6 +88,39 @@ function(GMX_INVALID_OPTION_VALUE NAME)
     message(FATAL_ERROR "Invalid value for ${NAME}: ${${NAME}}")
 endfunction()
 
+# Declares a cache variable with ON/OFF/AUTO values
+#
+# Usage:
+#   gmx_option_trivalue(VAR "Description" DEFAULT)
+#
+# Output:
+#   VAR is created in the cache, and the caller can assume that the value is
+#   always one of ON/OFF/AUTO.  Additionally, VAR_AUTO is set if value is AUTO,
+#   and VAR_FORCE is set if value is ON.
+#   These make it convenient to check for any combination of states with simple
+#   if() statements (simple if(VAR) matches AUTO and ON).
+function(GMX_OPTION_TRIVALUE NAME DESCRIPTION DEFAULT)
+    set(_description "${DESCRIPTION}. ON/OFF/AUTO")
+    set(${NAME} ${DEFAULT} CACHE STRING "${_description}")
+    set_property(CACHE ${NAME} PROPERTY STRINGS ON OFF AUTO)
+
+    set(${NAME}_AUTO OFF)
+    set(${NAME}_FORCE OFF)
+    string(TOUPPER "${${NAME}}" ${NAME})
+    if ("${${NAME}}" STREQUAL "AUTO")
+        set(${NAME}_AUTO ON)
+    elseif (${NAME})
+        set(${NAME}_FORCE ON)
+        set(${NAME} ON)
+    else()
+        set(${NAME} OFF)
+    endif()
+    # Always provide the sanitized value to the caller
+    set(${NAME}       "${${NAME}}"       PARENT_SCOPE)
+    set(${NAME}_AUTO  "${${NAME}_AUTO}"  PARENT_SCOPE)
+    set(${NAME}_FORCE "${${NAME}_FORCE}" PARENT_SCOPE)
+endfunction()
+
 # Hides or shows a cache value based on conditions
 #
 # Usage:
index d7add47d207b812a449633f708a9559f3438fe83..7565410844fef9f73ab6f3b5e52f50cbea2fe026 100644 (file)
@@ -83,7 +83,7 @@ macro(gmx_set_build_information)
 
     if(NOT CMAKE_CROSSCOMPILING)
         # Get CPU information, e.g. for deciding what SIMD support exists
-        set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders -DGMX_CPUID_STANDALONE")
+        set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUID_STANDALONE")
         if(GMX_TARGET_X86)
             set(_compile_definitions "${_compile_definitions} -DGMX_TARGET_X86")
         endif()
index eaa8888e48adaac75fec32ac6e292130000ceccb..41e84c1d4eb9552633fdf873fae6a0ac2850604e 100644 (file)
@@ -34,7 +34,7 @@
 
 include(CheckCXXSourceCompiles)
 MACRO(GMX_TEST_CXX11 VARIABLE FLAG)
-    if(WIN32)
+    if(WIN32 AND NOT MINGW)
         set(CXX11_FLAG "/Qstd=c++0x")
     elseif(CYGWIN)
         set(CXX11_FLAG "-std=gnu++0x") #required for strdup
@@ -59,6 +59,7 @@ struct VarList {
   typedef VarList<Tail...> VarListTail;
   typedef std::pair<Head, typename VarListTail::ListType> ListType;
 };
+class a { explicit operator bool() {return true;} };
 int main() {
   typedef std::unique_ptr<int> intPointer;
   intPointer p(new int(10));
index a8cdb870df10e7f0cfbebe22e6928e79ef0f41f7..2748a2a4041c34bac9fc84f7b2f909ce0ce32314 100644 (file)
@@ -87,7 +87,7 @@ macro(gmx_test_compiler_problems)
         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 AND NOT CYGWIN)
+    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()
index 3dd7407e4e7a74b0535e11accbc3a6c58ad699db..0c215cb9df98d9f543ca8ef379bb7b0d3c2c064f 100644 (file)
@@ -249,6 +249,62 @@ elseif(${GMX_SIMD} STREQUAL "AVX2_256")
     set(GMX_SIMD_X86_AVX2_256 1)
     set(SIMD_STATUS_MESSAGE "Enabling 256-bit AVX2 SIMD instructions")
 
+elseif(${GMX_SIMD} 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 "ARM_NEON")
+
+    gmx_find_cflag_for_source(CFLAGS_ARM_NEON "C compiler 32-bit ARM NEON flag"
+                              "#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;}"
+                              SIMD_C_FLAGS
+                              "-mfpu=neon" "")
+    gmx_find_cxxflag_for_source(CXXFLAGS_ARM_NEON "C++ compiler 32-bit ARM NEON flag"
+                                "#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;}"
+                                SIMD_CXX_FLAGS
+                                "-mfpu=neon" "-D__STDC_CONSTANT_MACROS" "")
+
+    if(NOT CFLAGS_ARM_NEON OR NOT CXXFLAGS_ARM_NEON)
+        message(FATAL_ERROR "Cannot find ARM 32-bit NEON compiler flag. Use a newer compiler, or disable NEON SIMD.")
+    endif()
+
+    set(GMX_SIMD_ARM_NEON 1)
+    set(SIMD_STATUS_MESSAGE "Enabling 32-bit ARM NEON SIMD instructions")
+
+elseif(${GMX_SIMD} STREQUAL "ARM_NEON_ASIMD")
+    # Gcc-4.8.1 appears to have a bug where the c++ compiler requires
+    # -D__STDC_CONSTANT_MACROS if we include arm_neon.h
+
+    gmx_find_cflag_for_source(CFLAGS_ARM_NEON_ASIMD "C compiler ARM NEON Advanced SIMD flag"
+                              "#include<arm_neon.h>
+                              int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);return vgetq_lane_f64(x,0)>0;}"
+                              SIMD_C_FLAGS
+                              "")
+    gmx_find_cxxflag_for_source(CXXFLAGS_ARM_NEON_ASIMD "C++ compiler ARM NEON Advanced SIMD flag"
+                                "#include<arm_neon.h>
+                                int main(){float64x2_t x=vdupq_n_f64(0.5);x=vfmaq_f64(x,x,x);return vgetq_lane_f64(x,0)>0;}"
+                                SIMD_CXX_FLAGS
+                                "-D__STDC_CONSTANT_MACROS" "")
+
+    if(NOT CFLAGS_ARM_NEON_ASIMD OR NOT CXXFLAGS_ARM_NEON_ASIMD)
+        message(FATAL_ERROR "Cannot find ARM (AArch64) NEON Advanced SIMD compiler flag. Use a newer compiler, or disable SIMD.")
+    endif()
+
+    if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.9")
+        message(WARNING "At least gcc-4.8.1 has many bugs for ARM (AArch64) NEON Advanced SIMD compilation. You might need gcc version 4.9 or later.")
+    endif()
+
+    if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "3.4")
+        message(FATAL_ERROR "Clang version 3.4 or later is required for ARM (AArch64) NEON Advanced SIMD.")
+    endif()
+
+    set(GMX_SIMD_ARM_NEON_ASIMD 1)
+    set(SIMD_STATUS_MESSAGE "Enabling ARM (AArch64) NEON Advanced SIMD instructions")
+
 elseif(${GMX_SIMD} STREQUAL "IBM_QPX")
 
     try_compile(TEST_QPX ${CMAKE_BINARY_DIR}
@@ -263,6 +319,46 @@ elseif(${GMX_SIMD} STREQUAL "IBM_QPX")
         message(FATAL_ERROR "Cannot compile the requested IBM QPX intrinsics. If you are compiling for BlueGene/Q with the XL compilers, use 'cmake .. -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-XL-C' to set up the tool chain.")
     endif()
 
+elseif(${GMX_SIMD} STREQUAL "IBM_VMX")
+
+    gmx_find_cflag_for_source(CFLAGS_IBM_VMX "C compiler IBM VMX SIMD flag"
+                              "#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);}"
+                              SIMD_C_FLAGS
+                              "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
+    gmx_find_cxxflag_for_source(CXXFLAGS_IBM_VMX "C++ compiler IBM VMX SIMD flag"
+                                "#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);}"
+                                SIMD_CXX_FLAGS
+                                "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
+
+    if(NOT CFLAGS_IBM_VMX OR NOT CXXFLAGS_IBM_VMX)
+        message(FATAL_ERROR "Cannot find IBM VMX SIMD compiler flag. Use a newer compiler, or disable VMX SIMD.")
+    endif()
+
+    set(GMX_SIMD_IBM_VMX 1)
+    set(SIMD_STATUS_MESSAGE "Enabling IBM VMX SIMD instructions")
+
+elseif(${GMX_SIMD} STREQUAL "IBM_VSX")
+
+    gmx_find_cflag_for_source(CFLAGS_IBM_VSX "C compiler IBM VSX SIMD flag"
+                              "#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);}"
+                              SIMD_C_FLAGS
+                              "-mvsx" "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
+    gmx_find_cxxflag_for_source(CXXFLAGS_IBM_VSX "C++ compiler IBM VSX SIMD flag"
+                                "#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);}"
+                                SIMD_CXX_FLAGS
+                                "-mvsx" "-maltivec -mabi=altivec" "-qarch=auto -qaltivec")
+
+    if(NOT CFLAGS_IBM_VSX OR NOT CXXFLAGS_IBM_VSX)
+        message(FATAL_ERROR "Cannot find IBM VSX SIMD compiler flag. Use a newer compiler, or disable VSX SIMD.")
+    endif()
+
+    set(GMX_SIMD_IBM_VSX 1)
+    set(SIMD_STATUS_MESSAGE "Enabling IBM VSX SIMD instructions")
+
 elseif(${GMX_SIMD} STREQUAL "SPARC64_HPC_ACE")
 
     # Note that GMX_RELAXED_DOUBLE_PRECISION is enabled by default in the top-level CMakeLists.txt
diff --git a/cmake/gmxVersionInfo.cmake b/cmake/gmxVersionInfo.cmake
new file mode 100644 (file)
index 0000000..c37b8ca
--- /dev/null
@@ -0,0 +1,386 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+# Sets version information variables and provides CMake functions for
+# generating files based on them
+#
+# This script provides the following basic version variables that need to be
+# maintained manually:
+#   GMX_VERSION_MAJOR      Major version number.
+#   GMX_VERSION_MINOR      Minor version number.
+#   GMX_VERSION_PATCH      Patch version number.
+#       Should always be defined: zero for, e.g., 5.0.
+#   GMX_VERSION_SUFFIX     String suffix to add to numeric version string.
+#       "-dev" is automatically added when not building from a source package,
+#       and does not need to be kept here.
+#   LIBRARY_SOVERSION      so version for the built libraries.
+#       Should be increased for each binary incompatible release (in GROMACS,
+#       the typical policy is to increase it for each major/minor version
+#       change, but not for patch releases, even if the latter may not always
+#       be fully binary compatible).
+#   LIBRARY_VERSION        Full library version.
+#   REGRESSIONTEST_BRANCH  For builds not from source packages, name of the
+#       regressiontests branch at gerrit.gromacs.org whose HEAD can test this
+#       code, *if* this code is recent enough (i.e., contains all changes from
+#       the corresponding code branch that affects the regression test
+#       results).
+#   REGRESSIONTEST_MD5SUM
+#       The MD5 checksum of the regressiontest tarball. Only used when building
+#       from a source package.
+# They are collected into a single section below.
+# The following variables are set based on these:
+#   GMX_VERSION            String composed from GMX_VERSION_* numeric variables
+#       above. Example: 4.6.1, 5.0
+#   GMX_VERSION_STRING     String with GMX_VERSION suffixed with the given
+#       suffix and possibly "-dev" for builds not from a source package.
+#   GMX_VERSION_NUMERIC    Numeric version number (e.g., 40601 for 4.6.1).
+#   GMX_API_VERSION        Numeric API version.
+#       This is currently set automatically to GMX_VERSION_NUMERIC, but may
+#       become manually maintained in the future if there will be releases
+#       where the API does not change, but programs/libraries do.
+#       In such a case, this should be the first version where the current API
+#       appeared.
+#   REGRESSIONTEST_VERSION For source packages, version number of the
+#       matching regressiontests tarball.  Not used for builds not from source
+#       packages.
+# The latter two are used to generate gromacs/version.h to allow software
+# written against the GROMACS API to provide some #ifdef'ed code to support
+# multiple GROMACS versions.
+#
+# The following variables are defined without manual intervention:
+#   SOURCE_IS_SOURCE_DISTRIBUTION  The source tree is from a source tarball.
+#   SOURCE_IS_GIT_REPOSITORY       The source tree is a git repository.
+# Note that both can be false if the tree has been extracted, e.g., as a
+# tarball directly from git.
+# Additionally, the following variable is defined:
+#   BUILD_IS_INSOURCE              The build is happening in-source.
+#
+# This script also declares machinery to generate and obtain version
+# information from a git repository.  This is enabled by default if the source
+# tree is a git, but can be disabled with
+#   GMX_GIT_VERSION_INFO           Advanced CMake variable to disable git
+#                                  version info generation.
+# 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]
+#                              [TARGET <target>]
+#                              [COMMENT <comment>])
+#   <input>      Specify the input and output files as for configure_file().
+#   <output>     The configuration is done with configure_file(... @ONLY) with
+#                the following variables defined (as well as all the
+#                GMX_VERSION* variables from above):
+#                  GMX_VERSION_STRING_FULL
+#                  GMX_VERSION_FULL_HASH
+#                  GMX_VERSION_CENTRAL_BASE_HASH
+#                The output file is created during build time, so any dependent
+#                targets should specify it as a dependency.
+#   REMOTE_HASH  Currently, this has no effect, but it signifies that the
+#                <input> file is using the CENTRAL_BASE_HASH variable.
+#                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
+#                name <target> that runs this custom command.  Use this if
+#                the same file will be used for multiple downstream targets,
+#                or if the explicit target for the file is otherwise
+#                necessary.
+#   COMMENT      Set a custom comment to be shown when building the rule
+#                (see add_custom_command(... COMMENT <comment>)).
+# As an alternative to using this script, also the following variables are
+# provided (can be useful when generating more complex CMake scripts that do
+# build-time tasks):
+#   VERSION_INFO_CMAKE_SCRIPT
+#       Absolute path to a CMake script that can be included using include()
+#       to declare the GMX_VERSION_* variables documented for
+#       gmx_configure_version_file().
+#   VERSION_INFO_DEPS
+#       If a custom command depends on VERSION_INFO_CMAKE_SCRIPT, then it
+#       should add ${VERSION_INFO_DEPS} to its DEPENDS list to get the
+#       appropriate dependencies.
+# TODO: If someone wants to add a custom target that depends on
+# VERSION_INFO_CMAKE_SCRIPT, a separate variable may be needed for those
+# dependencies.
+#
+# The version string printed by 'gmx -version' (and also printed in the startup
+# header) can provide useful information for, e.g., diagnosing bug reports and
+# identifying what exact version the user was using.  The following formats are
+# possible (with examples given for a particular version):
+#   4.6.1       Plain version number without any suffix signifies a build from
+#               a released source tarball.
+#   4.6.1-dev   '-dev' suffix signifies all other builds. If there is no other
+#               information, either the user built the code outside any git
+#               repository, or disabled the version info generation.
+#   4.6.1-dev-YYYYMMDD-1234abc
+#               The YYYYMMDD part shows the commit date (not author date) of
+#               the HEAD commit from which the code was built.  The abbreviated
+#               hash is the hash of that commit (the full hash is available in
+#               'gmx -version' output).
+#               If the HEAD hash is not identified as coming from branches in
+#               "authoritative" GROMACS repositories, 'gmx -version' will show
+#               the nearest ancestor commit that is identified as such (but see
+#               the '-local' and '-unknown' suffixes below).
+#   4.6.1-dev-YYYYMMDD-1234abc-dirty
+#               As above, but there were local modifications in the source tree
+#               when the code was built.
+#   4.6.1-dev-YYYYMMDD-1234abc-unknown
+#               As above, but there were no remotes in the repository that
+#               could be identified as "authoritative" GROMACS repositories.
+#               This happens if the code is not cloned from git.gromacs.org
+#               or gerrit.gromacs.org.
+#   4.6.1-dev-YYYYMMDD-1234abc-local
+#               As above, but there were no commits in the recent history of
+#               the branch that could be identified as coming from
+#               "authoritative" GROMACS repositories.  This should be
+#               relatively rare.
+#
+# Other variables set here are not intended for use outside this file.
+# The scripts gmxGenerateVersionInfo.cmake and gmxConfigureVersionInfo.cmake
+# are used internally by this machinery, as well as VersionInfo.cmake.cmakein.
+
+#####################################################################
+# Basic nature of the source tree
+
+set(SOURCE_IS_GIT_REPOSITORY OFF)
+set(SOURCE_IS_SOURCE_DISTRIBUTION OFF)
+if (EXISTS "${PROJECT_SOURCE_DIR}/.git")
+    set(SOURCE_IS_GIT_REPOSITORY ON)
+endif()
+# This file is excluded from CPack source packages, but part of the repository,
+# so it should get included everywhere else.
+if (NOT EXISTS "${PROJECT_SOURCE_DIR}/admin/.isreposource")
+    set(SOURCE_IS_SOURCE_DISTRIBUTION ON)
+endif()
+set(BUILD_IS_INSOURCE OFF)
+if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
+    set(BUILD_IS_INSOURCE ON)
+endif()
+
+#####################################################################
+# Manually maintained version info
+
+# 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 5)
+set(GMX_VERSION_MINOR 1)
+set(GMX_VERSION_PATCH 0)
+# The suffix, on the other hand, is used mainly for betas and release
+# candidates, where it signifies the last such release from this branch;
+# it will be empty before the first such release, as well as after the
+# final release is out.
+set(GMX_VERSION_SUFFIX "")
+
+set(LIBRARY_SOVERSION 1)
+set(LIBRARY_VERSION ${LIBRARY_SOVERSION}.0.0)
+
+set(REGRESSIONTEST_BRANCH "refs/heads/master")
+set(REGRESSIONTEST_MD5SUM "a07524afebca5013540d4f2f72df2dce")
+
+#####################################################################
+# General version management based on manually set numbers
+
+if (GMX_VERSION_PATCH)
+    set(GMX_VERSION "${GMX_VERSION_MAJOR}.${GMX_VERSION_MINOR}.${GMX_VERSION_PATCH}")
+else()
+    set(GMX_VERSION "${GMX_VERSION_MAJOR}.${GMX_VERSION_MINOR}")
+endif()
+set(GMX_VERSION_STRING "${GMX_VERSION}${GMX_VERSION_SUFFIX}")
+if (NOT SOURCE_IS_SOURCE_DISTRIBUTION)
+    set(GMX_VERSION_STRING "${GMX_VERSION_STRING}-dev")
+endif()
+
+set(REGRESSIONTEST_VERSION "${GMX_VERSION_STRING}")
+
+math(EXPR GMX_VERSION_NUMERIC
+     "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_MINOR}*100 + ${GMX_VERSION_PATCH}")
+set(GMX_API_VERSION ${NUM_VERSION})
+
+#####################################################################
+# git version info management
+
+# There can be clusters where git and CMake can run on nodes where the other is
+# not available, accessing the same source tree.
+# Should be unlikely, but doesn't hurt to check.
+set(_git_info_default OFF)
+if (SOURCE_IS_GIT_REPOSITORY)
+    find_package(Git)
+    if (GIT_FOUND)
+        set(_git_info_default ON)
+    endif()
+endif()
+option(GMX_GIT_VERSION_INFO "Generate git version information" ${_git_info_default})
+mark_as_advanced(GMX_GIT_VERSION_INFO)
+# Detect preconditions for version info generation if it is requested.
+if (GMX_GIT_VERSION_INFO)
+    if (NOT SOURCE_IS_GIT_REPOSITORY)
+        message(FATAL_ERROR
+            "Cannot generate git version information from source tree not under git. "
+            "Set GMX_GIT_VERSION_INFO=OFF to proceed.")
+    endif()
+    # We need at least git v1.5.3 be able to parse git's date output.
+    if (NOT GIT_FOUND OR GIT_VERSION_STRING VERSION_LESS "1.5.3")
+        message(FATAL_ERROR
+            "No compatible git version found (>= 1.5.3 required). "
+            "Won't be able to generate development version information. "
+            "Set GMX_GIT_VERSION_INFO=OFF to proceed.")
+    endif()
+endif()
+
+include(gmxCustomCommandUtilities)
+
+# The first two are also for use outside this file, encapsulating the details
+# of how to use the generated VersionInfo.cmake.
+set(VERSION_INFO_CMAKE_FILE   ${PROJECT_BINARY_DIR}/VersionInfo.cmake)
+set(VERSION_INFO_DEPS         ${VERSION_INFO_CMAKE_FILE})
+# Capture the location of the necessary files in internal variables for use in
+# the function below.
+set(VERSION_INFO_CMAKEIN_FILE     ${CMAKE_CURRENT_LIST_DIR}/VersionInfo.cmake.cmakein)
+set(VERSION_INFO_CONFIGURE_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/gmxConfigureVersionInfo.cmake)
+
+# Rules to create the VersionInfo.cmake file.
+# For git info, the sequence is:
+#   1. (configure time) VersionInfo.cmake.cmakein -> VersionInfo-partial.cmake.cmakein
+#        - Set all variables that are known at configure time.
+#   2. (build time)     VersionInfo-partial.cmake.cmakein -> VersionInfo.cmake
+#        - Set variables that may change as result of repository state changes
+#          (i.e., everything that requires running git).
+#        - Runs every time as a git-version-info target, but the output file
+#          timestamp only changes if its contents actually change.
+#        - Depending on the native build system, this may run once per build
+#          or once per each time it is required for step 3.
+#   3. (build time)     VersionInfo.cmake -> other files
+#        - Set variables in files specified with gmx_configure_version_file()
+#          using the values generated in step 2.
+#        - Each file runs as a custom command that depends on the previous
+#          steps, and runs only if the VersionInfo.cmake file is newer than the
+#          output file.
+# Without git info, the sequence is:
+#  1. (configure time) VersionInfo.cmake.cmakein -> VersionInfo.cmake
+#        - Everything is known at configure time, so the output is generated
+#          immediately with all variables set (git info will be empty).
+#  2. (build time)     VersionInfo.cmake -> other files
+#        - As with git info, processes files from gmx_configure_version_file().
+#        - These are again custom commands that depend on the output from
+#          step 1, so they get regenerated only when the static version info
+#          changes.
+if (GMX_GIT_VERSION_INFO)
+    # Configure information known at this time into a partially filled
+    # version info file.
+    set(VERSION_INFO_CMAKEIN_FILE_PARTIAL
+        ${PROJECT_BINARY_DIR}/VersionInfo-partial.cmake.cmakein)
+    # Leave these to be substituted by the custom target below.
+    set(GMX_VERSION_STRING_FULL       "\@GMX_VERSION_STRING_FULL\@")
+    set(GMX_VERSION_FULL_HASH         "\@GMX_VERSION_FULL_HASH\@")
+    set(GMX_VERSION_CENTRAL_BASE_HASH "\@GMX_VERSION_CENTRAL_BASE_HASH\@")
+    configure_file(${VERSION_INFO_CMAKEIN_FILE}
+                   ${VERSION_INFO_CMAKEIN_FILE_PARTIAL}
+                   @ONLY)
+    # If generating the version info, create a target that runs on every build
+    # and does the actual git calls, storing the results into a CMake script.
+    # This needs to be run at build time to update the version information
+    # properly when the git hash changes, but the build system does not.
+    # All targets added by gmx_configure_version_file() use the information
+    # from this script to get their variables from, removing the need to run
+    # git multiple times and simplifying reuse for other purposes.
+    gmx_add_custom_output_target(git-version-info RUN_ALWAYS
+        OUTPUT ${VERSION_INFO_CMAKE_FILE}
+        COMMAND ${CMAKE_COMMAND}
+            -D GIT_EXECUTABLE=${GIT_EXECUTABLE}
+            -D PROJECT_VERSION=${GMX_VERSION_STRING}
+            -D PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
+            -D VERSION_CMAKEIN=${VERSION_INFO_CMAKEIN_FILE_PARTIAL}
+            -D VERSION_OUT=${VERSION_INFO_CMAKE_FILE}
+            -P ${CMAKE_CURRENT_LIST_DIR}/gmxGenerateVersionInfo.cmake
+        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+        COMMENT "Generating git version information")
+    list(APPEND VERSION_INFO_DEPS git-version-info)
+else()
+    # If the version info is static, just generate the CMake script with the
+    # version variables during the CMake run.
+    set(GMX_VERSION_STRING_FULL       ${GMX_VERSION_STRING})
+    set(GMX_VERSION_FULL_HASH         "")
+    set(GMX_VERSION_CENTRAL_BASE_HASH "")
+    configure_file(${VERSION_INFO_CMAKEIN_FILE} ${VERSION_INFO_CMAKE_FILE})
+endif()
+unset(GMX_VERSION_STRING_FULL)
+unset(GMX_VERSION_FULL_HASH)
+unset(GMX_VERSION_CENTRAL_BASE_HASH)
+
+# The main user-visible interface to the machinery.
+# See documentation at the top of the script.
+function (gmx_configure_version_file INFILE OUTFILE)
+    include(CMakeParseArguments)
+    set(_options REMOTE_HASH SOURCE_FILE)
+    set(_one_value_args COMMENT TARGET)
+    cmake_parse_arguments(ARG "${_options}" "${_one_value_args}" "" ${ARGN})
+    if (ARG_UNPARSED_ARGUMENTS)
+        message(FATAL_ERROR "Unknown arguments: ${ARG_UNPARSED_ARGUMENTS}")
+    endif()
+    # Some callers may pass partial paths that do not really make sense,
+    # so create a default comment that only contains the actual file name.
+    get_filename_component(_basename ${OUTFILE} NAME)
+    set(_comment "Generating ${_basename}")
+    if (ARG_COMMENT)
+        set(_comment ${ARG_COMMENT})
+    endif()
+    # Mimic configure_file()
+    if (NOT IS_ABSOLUTE ${INFILE})
+        set(INFILE ${CMAKE_CURRENT_SOURCE_DIR}/${INFILE})
+    endif()
+    # The touch command is necessary to ensure that after the target is run,
+    # the timestamp is newer than in the input files.
+    add_custom_command(OUTPUT ${OUTFILE}
+        COMMAND ${CMAKE_COMMAND}
+            -D VERSION_VARIABLES=${VERSION_INFO_CMAKE_FILE}
+            -D VERSION_CMAKEIN=${INFILE}
+            -D VERSION_OUT=${OUTFILE}
+            -P ${VERSION_INFO_CONFIGURE_SCRIPT}
+        COMMAND ${CMAKE_COMMAND} -E touch ${OUTFILE}
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        DEPENDS ${INFILE} ${VERSION_INFO_DEPS} ${VERSION_INFO_CONFIGURE_SCRIPT}
+        COMMENT "${_comment}"
+        VERBATIM)
+    if (ARG_TARGET)
+        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 f2551c04da1704ca8098ac381ec90ea0715d79e8..423b6b61eb0b2afa82b86fdcf03f635140622dde 100644 (file)
@@ -3,30 +3,19 @@
 # Memory leaks in the legacy code are excluded
 # Other problems besides memory leaks should NOT be excluded for legacy code
 
-# Ugly memory leak that depends on global variables being used to pass
-# information between routines.
 {
-   nsc_dclm_pbc
+   ctime_r
    Memcheck:Leak
-   fun:calloc
-   fun:save_calloc
-   fun:ico_dot_dod
-   fun:make_unsp
-   fun:nsc_dclm_pbc
+   ...
+   fun:ctime_r
 }
+
 {
    libgomp
    Memcheck:Leak
    ...
    obj:*/libgomp.so*
 }
-{
-   ctime_r
-   Memcheck:Leak
-   ...
-   fun:ctime_r
-}
-
 {
    libz
    Memcheck:Cond
    fun:gmx_fio_fopen
 }
 {
-   new_symbuf
+   put_symtab
    Memcheck:Leak
    ...
-   fun:new_symbuf
+   fun:put_symtab
 }
 {
    bTimeSet/tMPI_Thread_mutex_init_once
    ...
    fun:__kmpc_global_thread_num
 }
+
diff --git a/docs/.gitattributes b/docs/.gitattributes
new file mode 100644 (file)
index 0000000..176513a
--- /dev/null
@@ -0,0 +1,3 @@
+dev-manual/*.md           gmx-doxygen
+doxygen/DoxygenLayout.xml gmx-doxygen
+doxygen/**/*.md           gmx-doxygen
index dd043ecd785c98214d2197e46302558158796664..c3d1cddc61e4cb65f8ef22f4b8efe86f4b706a6c 100644 (file)
@@ -56,7 +56,7 @@
 set(HTML_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
 file(MAKE_DIRECTORY ${HTML_OUTPUT_DIR})
 
-if(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+if (BUILD_IS_INSOURCE)
     set(MARKDOWN_CONFIGURE_IS_POSSIBLE off)
 else()
     set(MARKDOWN_CONFIGURE_IS_POSSIBLE on)
@@ -165,7 +165,7 @@ set(HTML_BUILD_IS_POSSIBLE OFF)
 # never need to know.
 if(GMX_BUILD_WEBPAGE AND
         GMX_BUILD_HELP AND
-        NOT ${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR} AND
+        NOT BUILD_IS_INSOURCE AND
         MARKDOWN_CONFIGURE_IS_POSSIBLE AND
         MANUAL_BUILD_IS_POSSIBLE AND
         PANDOC_EXECUTABLE AND
@@ -207,27 +207,27 @@ if(HTML_BUILD_IS_POSSIBLE)
         set(DOWNLOAD_SECTION
 "# Downloads
 
-*   Source code - [gromacs-${PROJECT_VERSION}.tar.gz](gromacs-${PROJECT_VERSION}.tar.gz)  
+*   Source code - [gromacs-${GMX_VERSION_STRING}.tar.gz](gromacs-${GMX_VERSION_STRING}.tar.gz)  
     (md5sum ${SOURCE_MD5SUM})  
     Other source code versions may be found at <ftp://ftp.gromacs.org/pub/gromacs/>
 
-*   Regression tests - [regressiontests-${PROJECT_VERSION}.tar.gz](regressiontests-${PROJECT_VERSION}.tar.gz)  
+*   Regression tests - [regressiontests-${GMX_VERSION_STRING}.tar.gz](regressiontests-${GMX_VERSION_STRING}.tar.gz)  
     (md5sum ${REGRESSIONTESTS_MD5SUM})
 ")
 
         # Copy the source tarball to the webpage output
         add_custom_command(
-            OUTPUT ${HTML_OUTPUT_DIR}/gromacs-${PROJECT_VERSION}.tar.gz
+            OUTPUT ${HTML_OUTPUT_DIR}/gromacs-${GMX_VERSION_STRING}.tar.gz
             COMMAND ${CMAKE_COMMAND}
-               -E copy ${SOURCE_TARBALL} ${HTML_OUTPUT_DIR}/gromacs-${PROJECT_VERSION}.tar.gz
+               -E copy ${SOURCE_TARBALL} ${HTML_OUTPUT_DIR}/gromacs-${GMX_VERSION_STRING}.tar.gz
             VERBATIM
             )
 
         # Copy the regressiontests tarball to the webpage output
         add_custom_command(
-            OUTPUT ${HTML_OUTPUT_DIR}/regressiontests-${PROJECT_VERSION}.tar.gz
+            OUTPUT ${HTML_OUTPUT_DIR}/regressiontests-${GMX_VERSION_STRING}.tar.gz
             COMMAND ${CMAKE_COMMAND}
-               -E copy ${REGRESSIONTESTS_TARBALL} ${HTML_OUTPUT_DIR}/regressiontests-${PROJECT_VERSION}.tar.gz
+               -E copy ${REGRESSIONTESTS_TARBALL} ${HTML_OUTPUT_DIR}/regressiontests-${GMX_VERSION_STRING}.tar.gz
             VERBATIM
             )
     else()
@@ -246,11 +246,11 @@ if(HTML_BUILD_IS_POSSIBLE)
     # Make the PDF reference guide
     # TODO Try to make the PDF arrive directly in ${HTML_OUTPUT_DIR}
     add_custom_command(
-        OUTPUT ${HTML_OUTPUT_DIR}/manual-${PROJECT_VERSION}.pdf
+        OUTPUT ${HTML_OUTPUT_DIR}/manual-${GMX_VERSION_STRING}.pdf
         COMMAND ${CMAKE_COMMAND}
-            -E remove -f ${HTML_OUTPUT_DIR}/manual-${PROJECT_VERSION}.pdf
+            -E remove -f ${HTML_OUTPUT_DIR}/manual-${GMX_VERSION_STRING}.pdf
         COMMAND ${CMAKE_COMMAND}
-            -E copy ${CMAKE_CURRENT_BINARY_DIR}/manual/gromacs.pdf ${HTML_OUTPUT_DIR}/manual-${PROJECT_VERSION}.pdf
+            -E copy ${CMAKE_CURRENT_BINARY_DIR}/manual/gromacs.pdf ${HTML_OUTPUT_DIR}/manual-${GMX_VERSION_STRING}.pdf
         # UseLATEX.cmake makes a target called pdf, not ${CMAKE_CURRENT_BINARY_DIR}/manual/gromacs.pdf
         DEPENDS pdf
         VERBATIM
@@ -283,8 +283,8 @@ if(HTML_BUILD_IS_POSSIBLE)
     # tarball
     if(BUILD_DOWNLOAD_SECTION)
         list(APPEND extra_webpage_dependencies
-            ${HTML_OUTPUT_DIR}/gromacs-${PROJECT_VERSION}.tar.gz
-            ${HTML_OUTPUT_DIR}/regressiontests-${PROJECT_VERSION}.tar.gz
+            ${HTML_OUTPUT_DIR}/gromacs-${GMX_VERSION_STRING}.tar.gz
+            ${HTML_OUTPUT_DIR}/regressiontests-${GMX_VERSION_STRING}.tar.gz
             )
     endif()
 
@@ -297,9 +297,9 @@ if(HTML_BUILD_IS_POSSIBLE)
            ${HTML_OUTPUT_DIR}/index.html
            install-guide
            user-guide
-           ${HTML_OUTPUT_DIR}/manual-${PROJECT_VERSION}.pdf
+           ${HTML_OUTPUT_DIR}/manual-${GMX_VERSION_STRING}.pdf
            ${extra_webpage_dependencies}
         VERBATIM
         )
-    add_dependencies(webpage webpage-html doc-all)
+    add_dependencies(webpage webpage-html doxygen-all)
 endif()
index 0f99002bea5fd873a2e6498484521b84b5995f9b..60a5ab4c56eb158a68a0a669e884f12c8ad16bab 100644 (file)
@@ -4,7 +4,7 @@
 
 # Now configure the values for all the variables that might later
 # configure any of the markdown files.
-set(PROJECT_VERSION "@PROJECT_VERSION@")
+set(PROJECT_VERSION "@GMX_VERSION_STRING@")
 set(GMX_CMAKE_MINIMUM_REQUIRED_VERSION "@GMX_CMAKE_MINIMUM_REQUIRED_VERSION@")
 set(REQUIRED_CUDA_VERSION "@REQUIRED_CUDA_VERSION@")
 set(REQUIRED_CUDA_COMPUTE_CAPABILITY "@REQUIRED_CUDA_COMPUTE_CAPABILITY@")
diff --git a/docs/dev-manual/dev-manual.md b/docs/dev-manual/dev-manual.md
new file mode 100644 (file)
index 0000000..edf4bcc
--- /dev/null
@@ -0,0 +1,20 @@
+Developer manual {#page_devmanual}
+================
+
+This set of pages contains guidelines, instructions, and explanations related
+to \Gromacs development.  The actual code is documented in other parts of this
+Doxygen documentation.
+
+The focus is (at least for now) on things that are tightly tied to the code
+itself, such as helper scripts that reside in the source repository, and may
+require the documentation to be updated in sync.  Wiki pages at
+<http://www.gromacs.org/Developer_Zone> contain additional information (much of
+it outdated, though), and can be linked from relevant locations in this guide.
+
+ - \subpage page_devtools <br/>
+   Documentation for tools used
+
+ - \subpage page_devstyle <br/>
+   Guidelines to follow when writing new code. For some of the guidelines,
+   scripts exist (see \ref page_devtools) to automatically reformat the code
+   and/or enforce the guidelines for each commit.
diff --git a/docs/dev-manual/formatting.md b/docs/dev-manual/formatting.md
new file mode 100644 (file)
index 0000000..039f3d8
--- /dev/null
@@ -0,0 +1,43 @@
+Guidelines for code formatting {#page_devstyle_formatting}
+==============================
+
+The following list provides the general formatting/indentation rules for
+\Gromacs code (C/C++):
+ * Basic indentation is four spaces.
+ * Keep lines at a reasonable length.  There is no hard limit, but use 80
+   characters as a guideline.  If you end up indenting very deeply,
+   consider splitting the code into functions.
+ * Do not use tabs, only spaces.  Most editors can be configured to generate
+   spaces even when pressing tab.  Tabs (in particular when mixed with spaces)
+   easily break indentation in contexts where settings are not exactly equal
+   (e.g., in `git diff` output).
+ * No trailing whitespace.
+ * Use braces always for delimiting blocks, even when there is only a single
+   statement in an `if` block or similar.
+ * Put braces on their own lines.  The only exception is short one-line inline
+   functions in C++ classes, which can be put on a single line.
+ * Use spaces liberally.
+ * `extern "C"` and `namespace` blocks are not indented, but all others
+   (including `class` and `switch` bodies) are.
+
+Additionally:
+ * All source files and other non-trivial scripts should contain a copyright
+   header with a predetermined format and license information (check existing
+   files).  Copyright holder should be "the GROMACS development team" for the
+   years where the code has been in the \Gromacs source repository, but earlier
+   years can hold other copyrights.
+ * Whenever you update a file, you should check that the current year is listed
+   as a copyright year.
+
+Most of the above guidelines are enforced using uncrustify, an automatic source
+code formatting tool.  The copyright guidelines are enforced by a separate
+Python script.  See \ref page_dev_uncrustify for details.  Note that due to the
+nature of uncrustify (it only does all-or-nothing formatting), it enforces
+several additional formatting rules in addition to those above.
+
+Enforcing a consistent formatting has a few advantages:
+ * No one needs to manually review code for most of these formatting issues,
+   and people can focus on content.
+ * A separate automatic script (see below) can be applied to re-establish the
+   formatting after refactoring like renaming symbols or changing some
+   parameters, without needing to manually do it all.
diff --git a/docs/dev-manual/gmxtree.md b/docs/dev-manual/gmxtree.md
new file mode 100644 (file)
index 0000000..41f5cca
--- /dev/null
@@ -0,0 +1,218 @@
+Source tree checker scripts {#page_dev_gmxtree}
+===========================
+
+There is a set of Python scripts, currently under `docs/doxygen/`, that check
+various aspects of the source tree for consistency.  The script is based on
+producing an abstract representation of the source tree from various sources:
+ * List of files in the source tree (for overall layout of the source tree)
+ * List of installed headers (extracted from the generated build system)
+ * git attributes (to limit the scope of some checks)
+ * Doxygen XML documentation:
+   * For tags about public/private nature of documented headers and other
+     constructs
+   * For actual documented constructs, to check them for consistency
+ * Hard-coded knowledge about the \Gromacs source tree layout
+
+This representation is then used for various purposes:
+ * Checking Doxygen documentation elements for common mistakes: missing brief
+   descriptions, mismatches in file and class visibility, etc.
+ * Checking for consistent usage and documentation of headers: e.g., a header
+   that is documented as internal to a module should not be used outside that
+   module.
+ * Checking for module-level cyclic dependencies
+ * Checking for consistent style and order of \#include directives
+   (see \ref page_devstyle_includes)
+ * Actually sorting and reformatting \#include directives to adhere to the
+   checked style
+ * Generating dependency graphs between modules and for files within modules
+
+The checks are run as part of a single `check-source` target, but are described
+in separate sections below.  In addition to printing the issues to `stderr`,
+the script also writes them into `docs/doxygen/check-source.log` for later
+inspection.  Jenkins runs the checks as part of the Documentation job, and the
+build is marked unstable if any issues are found.
+
+For correct functionality, the scripts depend on correct usage of Doxygen
+annotations described in \ref page_doxygen, in particular the visibility and
+API definitions in file-level comments.
+
+For some false positives from the script, the suppression mechanism described
+below is the easiest way to silence the script, but otherwise the goal would be
+to minimize the number of suppressions.
+
+The scripts require Python 2.7 (other versions may work, but have not been
+tested).
+
+To understand how the scripts work internally, see comments in the Python
+source files under `docs/doxygen/`.
+
+Checker details
+===============
+
+The `check-source` target currently checks for a few different types of issues.
+These are listed in detail below, mainly related to documentation and include
+dependencies.  Note in particular that the include dependency checks are much
+stricter for code in modules/directories that are documented with a
+\c \\defgroup: all undocumented code is assumed to be internal to such modules.
+The rationale is that such code has gotten some more attention, and some effort
+should also have been put into defining what is the external interface of the
+module and documenting it.
+
+* For all Doxygen documentation (currently does not apply for members that do
+  not appear in the documentation):
+   * If a member has documentation, it should have a brief description.
+   * A note is issued for in-body documentation for functions, since this is
+     ignored by our current settings.
+   * If a class has documentation, it should have public documentation only if
+     it appears in an installed header.
+   * If a class and its containing file has documentation, the class
+     documentation should not be visible if the file documentation is not.
+* For all files:
+   * Consistent usage of
+
+         #include "..." // This should be used for Gromacs headers
+
+     and
+
+         #include <...> // This should be used for system and external headers
+
+   * Installed headers must not include non-installed headers.
+   * All source files must include "gmxpre.h" as the first header.
+   * A source/header file should include "config.h" if and only if it uses a
+     macro declared there.
+   * If the file has a git attribute to identify it as a candidate for include
+     sorting, the include sorter described below should not produce any
+     changes (i.e., the file should follow \ref page_devstyle_includes).
+* For documented files:
+   * Installed headers should have public documentation, and other files should
+     not.
+   * The API level specified for a file should not be higher than where its
+     documentation is visible.  For example, only publicly documented headers
+     should be specified as part of the public API.
+   * If an \c \\ingroup `module_foo` exists, it should match the subdirectory
+     that the file is actually part of in the file system.
+   * If a \c \\defgroup `module_foo` exists for the subdirectory where the file
+     is, the file should contain \c \\ingroup `module_foo`.
+   * Files should not include other files whose documentation visibility is
+     lower (if the included file is not documented, the check is skipped).
+* For files that are part of documented modules
+  (\c \\defgroup `module_foo` exists for the subdirectory), or are explicitly
+  documented to be internal or in the library API:
+   * Such files should not be included from outside their module if they are
+     undocumented (for documented modules) or are not specified as part of
+     library or public API.
+* For all modules:
+   * There should not be cyclic include dependencies between modules.
+
+As a side effect, the XML extraction makes Doxygen parse all comments in the
+code, even if they do not appear in the documentation.  This can reveal latent
+issues in the comments, like invalid Doxygen syntax.  The messages from the XML
+parsing are stored in `docs/doxygen/doxygen-xml.log` in the build tree, similar to
+other Doxygen runs.
+
+Suppressing issues
+------------------
+
+The script is not currently perfect (either because of unfinished
+implementation, or because Doxygen bugs or incompleteness of the Doxygen XML
+output), and the current code also contains issues that the script detects, but
+the authors have not fixed.  To allow the script to still be used,
+`doxygen/suppressions.txt` contains a list of issues that are filtered out from
+the report.  The syntax is simple:
+
+    <file>: <text>
+
+where `<file>` is a path to the file that reports the message, and `<text>` is
+the text reported.  Both support `*` as a wildcard.  If `<file>` is empty, the
+suppression matches only messages that do not have an associated file.
+`<file>` is matched against the trailing portion of the file name to make it
+work even though the script reports absolute paths.
+Empty lines and lines starting with `#` are ignored.
+
+To add a suppression for an issue, the line that reports the issue can be
+copied into `suppressions.txt`, and the line number (if any) removed.  If the
+issue does not have a file name (or a pseudo-file) associated, a leading `:`
+must be added.  To cover many similar issues, parts of the line can then be
+replaced with wildcards.
+
+A separate suppression mechanism is in place for cyclic dependencies: to
+suppress a cycle between moduleA and moduleB, add a line with format
+
+    moduleA -> moduleB
+
+into `doxygen/cycle-suppressions.txt`.  This suppresses all cycles that contain
+the mentioned edge.  Since a cycle contains multiple edges, the suppression
+should be made for the edge that is determined to be an incorrect dependency.
+This also affects the layout of the include dependency graphs (see below): the
+suppressed edge is not considered when determining the dependency order, and is
+shown as invalid in the graph.
+
+Include order sorting {#section_dev_includesorter}
+=====================
+
+The script checks include ordering according to \ref page_devstyle_includes.
+If it is not obvious how the includes should be changed to make the script
+happy, or bulk changes are needed in multiple files, e.g., because of a header
+rename or making a previously public header private, it is possible to run a
+Python script that does the sorting:
+
+    docs/doxygen/includesorter.py -S . -B ../build <files>
+
+The script needs to know the location of the source tree (given with `-S`) and
+the build tree (given with `-B`), and sorts the given files.  To sort the whole
+source tree, one can also use:
+
+    admin/reformat_all.sh includesort -B=../build
+
+For the sorter to work correctly, the build tree should contain up-to-date list
+of installed files and Doxygen XML documentation.  The former is created
+automatically when `cmake` is run, and the latter can be built using the
+`doxygen-xml` target.
+
+Note that currently, the sorter script does not change between angle brackets
+and quotes in include statements.
+
+Include dependency graphs
+=========================
+
+The same set of Python scripts can also produce include dependency graphs with
+some additional annotations compared to what, e.g., Doxygen produces for a
+directory dependency graph.  Currently, a module-level graph is automatically
+built when the Doxygen documentation is built and embedded in the documentation
+(not in the public API documentation).  The graph, together with a legend, is
+on a separate page: \ref page_modulegraph.
+
+The Python script produces the graphs in a format suitable for `dot` (from the
+`graphviz` package) to lay them out.  The build system also provides a
+`dep-graphs` target that generates PNG files from the intermediate `dot` files.
+In addition to the module-level graph, a file-level graph is produced for
+each module, showing the include dependencies within that module.
+The file-level graphs can only be viewed as the PNG files, with some
+explanation of the notation below.  Currently, these are mostly for eye candy,
+but they can also be used for analyzing problematic dependencies to clean up
+the architecture.
+
+Both the intermediate `.dot` files and the final PNG files are put under
+`docs/doxygen/depgraphs/` in the build tree.
+
+File graphs
+-----------
+
+The graphs are written to <em>module_name</em>`-deps.dot.png`.
+
+Node colors:
+<dl>
+<dt>light blue</dt>
+<dd>public API (installed) headers</dd>
+<dt>dark blue</dt>
+<dd>library API headers</dd>
+<dt>gray</dt>
+<dd>source files</dd>
+<dt>light green</dt>
+<dd>test files</dd>
+<dt>white</dt>
+<dd>other files</dd>
+</dl>
+
+Each edge signifies an include dependency; there is no additional information
+currently included.
diff --git a/docs/dev-manual/includestyle.md b/docs/dev-manual/includestyle.md
new file mode 100644 (file)
index 0000000..84a4527
--- /dev/null
@@ -0,0 +1,69 @@
+Guidelines for \#include directives {#page_devstyle_includes}
+===================================
+
+The following include order is used in \Gromacs. An empty line should appear
+between each group, and headers within each group sorted alphabetically.
+
+ 1. Each _source_ file should include `gmxpre.h` first.
+ 2. If a _source_ file has a corresponding header, it should be included next.
+    If the header is in the same directory as the source, then it is included
+    without any path (i.e., relative to the source), otherwise relative to
+    `src/`.  The latter case is for headers in `legacyheaders/` and for tests.
+ 3. If the file depends on defines from `config.h`, that comes next.
+ 4. This is followed by standard C/C++ headers, grouped as follows:
+
+     1. Standard C headers (e.g., `<stdio.h>`)
+     2. C++ versions of the above (e.g., `<cstdio>`)
+     3. Standard C++ headers (e.g., `<vector>`)
+
+    Preferably, only one of the first two groups is present, but this is not
+    enforced.
+ 5. This is followed by other system headers: platform-specific headers such as
+    `<unistd.h>`, as well as external libraries such as
+    `<boost/scoped_ptr.hpp>`.
+ 6. \Gromacs-specific libraries from `src/external/`, such as
+    `"thread_mpi/threads.h"`.
+ 7. \Gromacs-specific headers that are not internal to the including module,
+    included with a path relative to `src/`.
+ 8. In _test_ files, headers not internal to the module, but specific to
+    testing code, are in a separate block at this point, paths relative to
+    `src/`.
+ 9. Finally, \Gromacs headers that are internal to the including module are
+    included using a relative path (but never with a path starting with `../`;
+    such headers go into group 7 instead).  For test files, this group contains
+    headers that are internal to tests for that module.
+
+All \Gromacs headers are included with quotes (`"gromacs/utility/path.h"`),
+other headers with angle brackets (`<stdio.h>`).  Headers under `src/external/`
+are generally included with quotes (whenever the include path is relative to
+`src/`, as well as for thread-MPI and TNG), but larger third-party entities are
+included as if they were provided by the system.  The latter group currently
+includes boost and gtest/gmock.
+
+If there are any conditionally included headers (typically, only when some
+\#defines from `config.h` are set), these should be included at the end of
+their respective group.  Note that the automatic checker/sorter script does not
+act on such headers, nor on comments that are between \#include statements; it
+is up to the author of the code to put the headers in proper order in such
+cases.  Trailing comments on the same line as \#include statements are
+preserved and do not affect the checker/sorter.
+
+The guidelines are enforced by an automatic checker script that can also
+sort/reformat include statements to follow the guidelines.
+See \ref page_dev_gmxtree for details.
+
+Enforcing a consistent order and style has a few advantages:
+ * It makes it easy at a quick glance to find the dependencies of a file,
+   without scanning through a long list of unorganized \#includes.
+ * Including the header corresponding to the source file first makes most
+   headers included first in some source file, revealing potential problems
+   where headers would not compile unless some other header would be included
+   first.  With this order, the person working on the header is most likely to
+   see these problems instead of someone else seeing them later when
+   refactoring unrelated code.
+ * Consistent usage of paths in \#include directives makes it easy to use
+   `grep` to find all uses of a header, as well as all include dependencies
+   between two modules.
+ * An automatic script can be used to re-establish clean code after
+   semi-automatic refactoring like renaming an include file with `sed`, without
+   causing other unnecessary changes.
diff --git a/docs/dev-manual/style.md b/docs/dev-manual/style.md
new file mode 100644 (file)
index 0000000..bbc6bd1
--- /dev/null
@@ -0,0 +1,14 @@
+Style guidelines {#page_devstyle}
+================
+
+ - \subpage page_devstyle_formatting <br/>
+   Guidelines for indentation and other code formatting.
+
+ - \subpage page_devstyle_includes <br/>
+   Guidelines for \#include style (ordering, paths to use, etc.).
+
+ - [Doxygen guidelines](\ref section_doxygen_guidelines) <br/>
+   Guidelines for using Doxygen to document the source code are currently in a
+   section on the page on general Doxygen usage.
+
+TODO: Add more guidelines
diff --git a/docs/dev-manual/tools.md b/docs/dev-manual/tools.md
new file mode 100644 (file)
index 0000000..ab49317
--- /dev/null
@@ -0,0 +1,203 @@
+Development-time tools {#page_devtools}
+======================
+
+TODO: Add details for most of the tools, either in the form of links to wiki,
+or to a separate page that explains more details.
+
+Change management
+=================
+
+<dl>
+
+<dt>git</dt>
+<dd>\Gromacs uses git as the version control system.
+Instructions for setting up git for \Gromacs, as well as tips and tricks for
+its use, can be found on the wiki:
+[Git Tips & Tricks](http://www.gromacs.org/index.php?title=Developer_Zone/Git/Git_Tips_%26_Tricks) <br/>
+Other basic tutorial material for `git` can be found on the web.</dd>
+
+<dt>Gerrit</dt>
+<dd>All code changes go through a code review system at
+<http://gerrit.gromacs.org>.</dd>
+
+<dt>Jenkins</dt>
+<dd>All changes pushed to Gerrit are automatically compiled and otherwise
+checked on various platforms using a continuous integration system at
+<http://jenkins.gromacs.org>.</dd>
+
+<dt>Redmine</dt>
+<dd>Bugs and issues, as well as some random features and discussions,
+are tracked at <http://redmine.gromacs.org>.</dd>
+
+</dl>
+
+Build system
+============
+
+TODO: details, ASAN, others?
+
+<dl>
+
+<dt>CMake</dt>
+<dd></dd>
+
+<dt>packaging for distribution (CPack)</dt>
+<dd></dd>
+
+<dt>unit testing (CTest)</dt>
+<dd>\Gromacs uses a unit testing framework based on Google C++ Testing
+Framework (gtest) and CTest.  All unit tests are automatically run on Jenkins
+for each commit.
+Details can be found on a separate page: \subpage page_unittesting.</dd>
+
+<dt>regression tests</dt>
+<dd></dd>
+
+<dt>cppcheck</dt>
+<dd>cppcheck (<http://cppcheck.sourceforge.net>) is used for static code
+analysis, and is run automatically on Jenkins for each commit.  Different rules
+are used for C and C++ code (with stricter checking for C++ code, as that is
+newer).  The build system provides a `cppcheck` target (produced from
+`tests/CppCheck.cmake`) to run the tool.  This target is used also by Jenkins.
+</dd>
+
+<dt>clang static analyzer</dt>
+<dd></dd>
+
+</dl>
+
+Code formatting and style {#section_dev_formattingtools}
+=========================
+
+The tools and scripts listed below are used to automatically check/apply
+formatting that follows \Gromacs style guidelines described on a separate page:
+\ref page_devstyle.
+
+<dl>
+
+<dt>uncrustify</dt>
+<dd>Uncrustify (<http://uncrustify.sourceforge.net>) is used for automatic
+indentation and other formatting of the source code to follow
+\ref page_devstyle_formatting.  All code must remain invariant under uncrustify
+with the config at `admin/uncrustify.cfg`.  A patched version of uncrustify is
+used.  See \ref page_dev_uncrustify for details.</dd>
+
+<dt>`admin/copyright.py`</dt>
+<dd>This Python script adds and formats copyright headers in source files.
+`uncrustify.sh` (see below) uses the script to check/update copyright years on
+changed files automatically.</dd>
+
+<dt>`admin/uncrustify.sh`</dt>
+<dd>This `bash` script runs uncrustify and `copyright.py` for all
+files that have local changes and checks that they conform to the prescribed
+style.  Optionally, the script can also apply changes to make the files
+conform.
+This script is automatically run by Jenkins to ensure that all commits adhere
+to \ref page_devstyle_formatting.  If the uncrustify job does not succeed, it
+means that this script has something to complain.
+See \ref page_dev_uncrustify for details.</dd>
+
+<dt>`admin/git-pre-commit`</dt>
+<dd>This sample git pre-commit hook can be used if one wants to apply
+`uncrustify.sh` automatically before every commit to check for formatting
+issues.  See \ref page_dev_uncrustify for details.</dd>
+
+<dt>`docs/doxygen/includesorter.py`</dt>
+<dd>This Python script sorts and reformats \#include directives according to
+the guidelines at \ref page_devstyle_includes.  Details are documented on a
+separate page (with the whole suite of Python scripts used for source code
+checks): \ref section_dev_includesorter.</dd>
+
+<dt>include directive checker</dt>
+<dd>In its present form, the above include sorter script cannot be conveniently
+applied in `uncrustify.sh`.  To check for issues, it is instead integrated into
+a `check-source` build target.  When this target is built, it also checks for
+include formatting issues.  Internally, it uses the sorter script.  This check
+is run in Jenkins as part of the Documentation job.
+Details for the checking mechanism are on a separate page (common for several
+checkers): \subpage page_dev_gmxtree.</dd>
+
+<dt>`admin/reformat_all.sh`</dt>
+<dd>This `bash` script runs uncrustify/`copyright.py`/include sorter
+on all relevant files in the source tree (or in a particular directory).
+The script can also produce the list of files where these scripts are applied,
+for use with other scripts.  See \ref page_dev_uncrustify for details.</dd>
+
+<dt>git attributes</dt>
+<dd>git attributes (specified in `.gitattributes` files) are used to annotate
+which files are subject to automatic formatting checks (and for automatic
+reformatting by the above scripts).  See `man gitattributes` for an overview of
+the mechanism.  We use the `filter` attribute to specify the type of automatic
+checking/formatting to apply.  Custom attributes are used for specifying some
+build system dependencies for easier processing in CMake.</dd>
+
+<dt>include-what-you-use</dt>
+<dd></dd>
+
+</dl>
+
+Documentation generation
+========================
+
+<dl>
+<dt>Doxygen</dt>
+<dd>Doxygen (<http://www.doxygen.org>) is used to extract documentation from
+source code comments.  Also this developer manual and some other overview
+content is laid out by Doxygen from Markdown source files.  Currently, version
+1.8.5 is required for a warning-free build.  Thorough explanation of the
+Doxygen setup and instructions for documenting the source code can be found on
+a separate page: \subpage page_doxygen.</dd>
+
+<dt>graphviz (dot)</dt>
+<dd>The Doxygen documentation uses `dot` from graphviz
+(<http://www.graphviz.org>) for building some graphs.  The tool is not
+mandatory, but the Doxygen build will produce warnings if it is not
+available, and the graphs are omitted from the documentation.</dd>
+
+<dt>mscgen</dt>
+<dd>The Doxygen documentation uses `mscgen`
+(<http://www.mcternan.me.uk/mscgen/>) for building some graphs.  As with `dot`,
+the tool is not mandatory, but not having it available will result in warnings
+and missing graphs.</dd>
+
+<dt>Doxygen issue checker</dt>
+<dd>Doxygen produces warnings about some incorrect uses and wrong
+documentation, but there are many common mistakes that it does not detect.
+\Gromacs uses an additional, custom Python script to check for such issues.
+This is most easily invoked through a `check-source` target in the build system.
+The script also checks that documentation for a header matches its use in the
+source code (e.g., that a header documented as internal to a module is not
+actually used from outside the module).  These checks are run in Jenkins as
+part of the Documentation job.  Details for the custom checker are on a
+separate page (common for several checkers): \subpage page_dev_gmxtree.</dd>
+
+<dt>module dependency graphs</dt>
+<dd>\Gromacs uses a custom Python script to generate an annotated dependency
+graph for the code, showing \#include dependencies between modules.
+The generated graph is embedded into the Doxygen documentation:
+\ref page_modulegraph.
+This script shares most of its implementation with the custom checkers, and is
+documented on the same page: \subpage page_dev_gmxtree.</dd>
+
+<dt>Pandoc</dt>
+<dd>Pandoc (<http://johnmacfarlane.net/pandoc/>) is used for building some
+parts of the documentation from Markdown source files.</dd>
+
+<dt>latex</dt>
+<dd></dd>
+
+<dt>linkchecker</dt>
+<dd></dd>
+
+<dt>documentation exported from source files</dt>
+<dd>For man pages, HTML documentation of command-line options for executables,
+and for shell completions, the `gmx` binary has explicit C++ code to export
+the information required.  The build system provides targets that then invoke
+the built `gmx` binary to produce these documentation items.  The generated
+items are packaged into source tarballs so that this is not necessary when
+building from a source distribution (since in general, it will not work in
+cross-compilation scenarios).  To build and install these from a git
+distribution, explicit action is required.
+See \ref page_wrapperbinary for some additional details.</dd>
+
+</dl>
diff --git a/docs/dev-manual/uncrustify.md b/docs/dev-manual/uncrustify.md
new file mode 100644 (file)
index 0000000..5461b56
--- /dev/null
@@ -0,0 +1,203 @@
+Automatic source code formatting {#page_dev_uncrustify}
+================================
+
+The source code can be automatically formatted using uncrustify, an automatic
+source code formatting tool, to follow the guidelines in
+\ref page_devstyle_formatting.
+Additionally, Python scripts are used for a few other automatic
+formatting/checking tasks.  The overview tools page contains a list of these
+tools: \ref section_dev_formattingtools.
+This page provides more details for uncrustify and copyright scripts.
+
+Jenkins uses these same scripts (in particular, `uncrustify.sh` and the
+`check-source` target) to enforce that the code stays invariant under such
+formatting.
+
+Setting up uncrustify
+=====================
+
+A patched version of uncrustify is used for \Gromacs.  To set this up, you need
+to do these (once):
+ 1. Change to a directory under which you want to build uncrustify and run:
+
+        git clone -b gromacs git://github.com/rolandschulz/uncrustify.git
+        cd uncrustify
+        ./configure
+        make
+
+ 2. Copy the binary `src/uncrustify` into a directory of your choice
+    (`/path/to/uncrustify` below).
+
+Alternatively, if you are running Linux, you can try whether the binary from
+<http://redmine.gromacs.org/issues/845> works for you.
+
+In order to use the binary for `uncrustify.sh` and for the pre-commit hook, you
+also need to run this in each of your \Gromacs repositories:
+
+    git config hooks.uncrustifypath /path/to/uncrustify
+
+Alternatively, if you just want to use `uncrustify.sh`, you can set the
+UNCRUSTIFY environment variable to `/path/to/uncrustify`.
+
+Using the pre-commit hook or git filters needs additional setup; see the
+respective sections below.
+
+What is automatically formatted?
+================================
+
+To identify which files are subject to automatic formatting, the scripts use
+git filters, specified in `.gitattributes` files.  Only files that have the
+attribute `filter` set to one of the below values are processed:
+ - `filter=uncrustify`: uncrustify is run, copyright headers are checked, and
+   include order is enforced
+ - `filter=uncrustify_only`: only uncrustify is run
+ - `filter=includesort`: include order is enforced and copyright headers are
+   checked
+ - `filter=copyright`: only copyright headers are checked
+Other files are ignored by `uncrustify.sh` and `reformat_all.sh` scripts (see
+below).
+
+
+Scripts
+=======
+
+`copyright.py`
+--------------
+
+This script provides low-level functionality to check and update copyright
+headers in C/C++ source files, as well as in several other types of files like
+CMake and Python scripts.
+
+This file is also used as a loadable Python module for kernel generators, and
+provides the functionality to generate conformant copyright headers for such
+scripts.
+
+The script is similar to uncrustify in that there is rarely need to run it
+directly, but instead the bash scripts below use it internally.  You can run
+the script with `--help` option if you want to see what all options it provides
+if you need to do some maintenance on the copyright headers themselves.
+
+`uncrustify.sh`
+---------------
+
+This script runs uncrustify and `copyright.py` on modified files and
+reports/applies the results.
+By default, the current HEAD commit is compared to the work tree,
+and files that
+
+ 1. are different between these two trees and
+ 2. change under uncrustify and/or have outdated copyright header
+
+are reported.  This behavior can be changed by
+
+ 1. Specifying an `--rev=REV` argument, which uses `REV` instead of HEAD as
+    the base of the comparison.  A typical use case is to specify `--rev=HEAD^`
+    to check the HEAD commit.
+ 2. Specifying an action:
+      - `check-*`:   reports the files that uncrustify changes
+      - `diff-*`:    prints the actual diff of what would change
+      - `update-*`:  applies the changes to the repository
+      - `*-workdir`: operates on the working directory (files on disk)
+      - `*-index`:   operates on the index of the repository
+    For convenience, if you omit the workdir/index suffix, workdir is assumed
+    (i.e., `diff` equals `diff-workdir`).
+ 3. Specifying `--uncrustify=off`, which does not run uncrustify.
+ 4. Specifying `--copyright=<mode>`, which alters the level of copyright
+    checking is done:
+      - `off`:     does not check copyright headers at all
+      - `year`:    only update copyright year in new-format copyright headers
+      - `add`:     in addition to 'year', add copyright headers to files that
+                   do not have any
+      - `update`:  in addition to 'year' and 'add', also update new-format
+                   copyright headers if they are broken or outdated.
+      - `replace`: replace any copyright header with a new-format copyright
+                   header
+      - `full`:    do all of the above
+
+By default, `update-*` refuses to update dirty files (i.e., that differ
+between the disk and the index) to make it easy to revert the changes.
+This can be overridden by adding a `-f`/`--force` option.
+
+git pre-commit hook
+-------------------
+
+If you want to run `uncrustify.sh` automatically for changes you make, you can
+configure a pre-commit hook using `admin/git-pre-commit`:
+ 1. Copy the `git-pre-commit` script to .git/hooks/pre-commit.
+ 2. Specify the path to uncrustify for the hook if you have not already done
+    so:
+        git config hooks.uncrustifypath /path/to/uncrustify
+ 3. Set the operation mode for the hook:
+        git config hooks.uncrustifymode check
+        git config hooks.copyrightmode  update
+
+With this configuration, all source files modified in the commit are run
+through uncrustify and checked for correct copyright headers.
+If any file would be changed by `uncrustify.sh`, the names of those files are
+reported and the commit is prevented.  The issues can be fixed by running
+`uncrustify.sh` manually.
+
+To disable the hook without removing the `pre-commit` file, you can set
+
+    git config hooks.uncrustifymode off
+    git config hooks.copyrightmode off
+
+To disable it temporarily for a commit, set NO_FORMAT_CHECK environment
+variable.  For example,
+
+    NO_FORMAT_CHECK=1 git commit -a
+
+You can also run `git commit --no-verify`, but that also disables other hooks,
+such as the Change-Id commit-msg hook used by Gerrit.
+
+Note that when you run `git commit --amend`, the hook is only run for the
+changes that are getting amended, not for the whole commit.  During a rebase,
+the hook is not run.
+
+The actual work is done by the admin/uncrustify.sh script, which gets
+run with the 'check-index' action, and with `--uncrustify` and `--copyright`
+getting set according to the `git config` settings.
+
+`reformat_all.sh`
+-----------------
+
+This script runs uncrustify, `copyright.py`, or the include sorter for all
+applicable files in the source tree.  See `reformat_all.sh -h` for the
+invocation.
+
+The script can also produce the list of files for which these commands would be
+run.  To do this, specify `list-files` on the command line and use
+`--filter=<type>` to specify which command to get the file list for.  This can
+be used together with, e.g., `xargs` to run other scripts on the same set of
+files.
+
+For all the operations, it is also possible to apply patters (of the same style
+that various git commands accept, i.e., `src/*.cpp` matches all `.cpp` files
+recursively under `src/`).  The patterns can be specified with
+`--pattern=<pattern>`, and multiple `--pattern` arguments can be given.
+
+As with `uncrustify.sh`, `-f`/`--force` is necessary if the working tree and
+the git index do not match.
+
+
+Using git filters
+=================
+
+An alternative to using a pre-commit hook to automatically apply uncrustify on
+changes is to use a git filter (does not require `uncrustify.sh`, only the
+`.gitattributes` file).  You can run
+
+    git config filter.uncrustify.clean \
+        "/path/to/uncrustify -c admin/uncrustify.cfg -q -l cpp"
+
+To configure a filter for all files that specify `filter=uncrustify` attribute.
+
+The pre-commit hook + manually running `uncrustify.sh` gives better/more
+intuitive control (with the filter, it is possible to have a work tree that is
+different from HEAD and still have an empty `git diff`) and provides better
+performance for changes that modify many files.  It is the only way that
+currently also checks the copyright headers.
+
+The filter allows one to transparently merge branches that have not been run
+through uncrustify, and is applied more consistently (the pre-commit hook is
+not run for every commit, e.g., during a rebase).
index 1e334a4fa8dfeb02e6d44621e70ec7cf0e1cbbe4..c42eb5ac0df83c7a9c5393a4087e8049933da238 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.
 
+include(gmxCustomCommandUtilities)
 include(gmxOptionUtilities)
 
 find_package(Doxygen QUIET)
 if (DOXYGEN_FOUND)
     # This logic closely follows that found in FindDoxygen.cmake for dot,
     # except that the PATH variable is not cached.
-    FIND_PROGRAM(DOXYGEN_MSCGEN_EXECUTABLE
+    find_program(DOXYGEN_MSCGEN_EXECUTABLE
         NAMES mscgen
         DOC "Message sequence chart renderer tool (http://www.mcternan.me.uk/mscgen/)")
     if (DOXYGEN_MSCGEN_EXECUTABLE)
@@ -61,118 +62,161 @@ if (PYTHONINTERP_FOUND AND NOT PYTHON_VERSION_STRING VERSION_LESS "2.6")
     set(USE_PYTHON_SCRIPTS ON)
 endif()
 
-add_custom_target(find-installed-headers
-    COMMAND ${CMAKE_COMMAND}
-        -D SRCDIR=${CMAKE_SOURCE_DIR}
-        -D BUILDDIR=${CMAKE_BINARY_DIR}
-        -D OUTFILE=${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt
-        -P ${CMAKE_CURRENT_SOURCE_DIR}/getInstalledHeaders.cmake
-    COMMENT "Generating installed headers list" VERBATIM)
+# Note that if you relocate this file, you also need to change gmxtree.py.
+# TODO: Try to find a solution where this would be hard-coded here, completely
+# separate from the logic that generates it.
+set(INSTALLED_HEADERS_FILE ${PROJECT_BINARY_DIR}/src/gromacs/installed-headers.txt)
 
 ########################################################################
 # Doxygen configuration
-########################################################################
+#
 if (DOXYGEN_FOUND)
-    FILE(GLOB NB_KERNEL_DIRS
+    # Generate Doxygen input configuration files
+    file(GLOB NB_KERNEL_DIRS
          ${CMAKE_SOURCE_DIR}/src/gromacs/gmxlib/nonbonded/nb_kernel_*/)
-    LIST(REMOVE_ITEM NB_KERNEL_DIRS
+    list(REMOVE_ITEM NB_KERNEL_DIRS
          ${CMAKE_SOURCE_DIR}/src/gromacs/gmxlib/nonbonded/nb_kernel_c)
-    FOREACH(NB_KERNEL_DIR ${NB_KERNEL_DIRS})
+    foreach (dir ${NB_KERNEL_DIRS})
         SET(NB_KERNEL_DIRS_TO_IGNORE_IN_DOXYGEN
-            "${NB_KERNEL_DIRS_TO_IGNORE_IN_DOXYGEN} \\\n                         ${NB_KERNEL_DIR}")
-    ENDFOREACH(NB_KERNEL_DIR)
+            "${NB_KERNEL_DIRS_TO_IGNORE_IN_DOXYGEN} \\\n                         ${dir}")
+    endforeach()
+    set(DEPGRAPH_DIR ${CMAKE_CURRENT_BINARY_DIR}/depgraphs)
     set(DOXYGEN_SECTIONS "")
-    CONFIGURE_FILE(Doxyfile-common.cmakein Doxyfile-common)
-    CONFIGURE_FILE(Doxyfile-full.cmakein Doxyfile-full)
-    CONFIGURE_FILE(Doxyfile-lib.cmakein Doxyfile-lib)
-    CONFIGURE_FILE(Doxyfile-user.cmakein Doxyfile-user)
-    CONFIGURE_FILE(Doxyfile-xml.cmakein Doxyfile-xml)
-
+    set(DOXYGEN_EXTRA_SETTINGS "")
     if (GMX_COMPACT_DOXYGEN)
-        FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-common
-             "@INCLUDE   = ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-compact\n")
+        set(DOXYGEN_EXTRA_SETTINGS "@INCLUDE   = ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-compact")
     endif()
+    configure_file(Doxyfile-common.cmakein Doxyfile-common)
+    configure_file(Doxyfile-full.cmakein Doxyfile-full)
+    configure_file(Doxyfile-lib.cmakein Doxyfile-lib)
+    configure_file(Doxyfile-user.cmakein Doxyfile-user)
+    configure_file(Doxyfile-xml.cmakein Doxyfile-xml)
 
     configure_file(RunDoxygen.cmake.cmakein RunDoxygen.cmake @ONLY)
-    add_custom_target(doc-full
-        ${CMAKE_COMMAND} -DDOCTYPE=full -P RunDoxygen.cmake
-        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-        COMMENT "Generating full documentation with Doxygen" VERBATIM)
-    add_custom_target(doc-lib
-        ${CMAKE_COMMAND} -DDOCTYPE=lib -P RunDoxygen.cmake
-        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-        COMMENT "Generating library documentation with Doxygen" VERBATIM)
-    add_custom_target(doc-user
-        ${CMAKE_COMMAND} -DDOCTYPE=user -P RunDoxygen.cmake
-        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-        COMMENT "Generating public API documentation with Doxygen" VERBATIM)
-    add_custom_target(doc-xml
-        ${CMAKE_COMMAND} -DDOCTYPE=xml -P RunDoxygen.cmake
-        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-        COMMENT "Extracting Doxygen documentation to XML" VERBATIM)
-    add_custom_target(doc-all)
-    add_dependencies(doc-all doc-full doc-lib doc-user)
+    gmx_configure_version_file(Doxyfile-version.cmakein Doxyfile-version
+                               TARGET doxygen-version)
 
-    if (GMX_GIT_VERSION_INFO)
-        add_custom_target(doxygen-version
-                COMMAND ${CMAKE_COMMAND}
-                    -D GIT_EXECUTABLE="${GIT_EXECUTABLE}"
-                    -D PROJECT_VERSION="${PROJECT_VERSION}"
-                    -D PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}"
-                    -D VERSION_CMAKEIN="${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-version.cmakein"
-                    -D VERSION_OUT="${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-version"
-                    -D VERSION_NO_REMOTE_HASH=
-                    -P ${CMAKE_SOURCE_DIR}/cmake/gmxGenerateVersionInfo.cmake
-                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-                DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile-version.cmakein
-                COMMENT "Generating version information for Doxygen")
-        add_dependencies(doc-full doxygen-version)
-        add_dependencies(doc-lib doxygen-version)
-        add_dependencies(doc-user doxygen-version)
-        add_dependencies(doc-xml doxygen-version)
+    # Add a stamp that gets updated whenever a source file that contributes to
+    # Doxygen is updated.  All Doxygen targets can then depend on this stamp,
+    # instead of each specifying this massive set of dependencies.
+    # TODO: The set of files that affects Doxygen is not exactly the same as
+    # that which affects the dependency graphs, and neither is captured
+    # perfectly with this set, but this can be improved if it becomes a real
+    # issue (the differences are mainly in the generated group kernel files,
+    # but there are some minor other differences as well).
+    if (SOURCE_IS_GIT_REPOSITORY AND GIT_FOUND)
+        gmx_get_files_with_gitattribute(doxygen_sources gmx-doxygen)
+        # Add also common configuration files that influence the generation.
+        set(doxygen_deps
+            ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-common
+            ${CMAKE_CURRENT_BINARY_DIR}/RunDoxygen.cmake)
+        if (GMX_COMPACT_DOXYGEN)
+            list(APPEND doxygen_deps ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-compact)
+        endif()
+        gmx_add_custom_output_target(doxygen-source-timestamp
+            OUTPUT STAMP
+            DEPENDS_FILE_LIST doxygen_sources
+            DEPENDS ${doxygen_deps}
+            COMMENT "Updating Doxygen source timestamp")
     else()
-        set(GMX_PROJECT_VERSION_STR ${PROJECT_VERSION})
-        configure_file(Doxyfile-version.cmakein Doxyfile-version)
+        # If there is no git, we just update the stamp every time, and the
+        # builds are triggered every time.  This should be rare enough, but
+        # this case still needs to be supported for the Jenkins job that builds
+        # the documentation for a release from the release tarball.
+        gmx_add_custom_output_target(doxygen-source-timestamp
+            RUN_ALWAYS OUTPUT STAMP
+            COMMENT "Updating Doxygen source timestamp")
     endif()
 
+    # Helper function to create a Doxygen build target
+    function (add_doxygen_target TARGET TYPE COMMENT)
+        set(_deps doxygen-source-timestamp doxygen-version
+            ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile-${TYPE})
+        set(_fast_arg "")
+        if ("${ARGN}" STREQUAL "DEPGRAPHS")
+            set(_fast_arg "ADD_FAST_TARGET")
+            if (TARGET dep-graphs-dot)
+                list(APPEND _deps dep-graphs-dot)
+            endif()
+        endif()
+        gmx_add_custom_output_target(${TARGET} OUTPUT STAMP ${_fast_arg}
+            # Ensure the directory exists to avoid spurious warnings
+            COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPGRAPH_DIR}
+            COMMAND ${CMAKE_COMMAND} -DDOCTYPE=${TYPE} -P RunDoxygen.cmake
+            DEPENDS ${_deps}
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+            COMMENT "${COMMENT}")
+        if (_fast_arg)
+            add_dependencies(${TARGET}-fast doxygen-version)
+        endif()
+    endfunction()
+
+    # The XML target is necessary for the dependency graphs
+    add_doxygen_target(doxygen-xml xml "Extracting Doxygen documentation to XML")
+
+    # Add targets for generating the dependency graphs; they are necessary for
+    # the full and lib variants of the documentation.
     if (USE_PYTHON_SCRIPTS)
-        # TODO: Consider whether this is the best name and location for this
-        # code, since not all of it is Doxygen-specific (but nearly all of it
-        # relies on the Doxygen XML documentation).
-        set(doc_check_command
-            ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen-check.py
-            -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
-            --installed ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt
-            -l ${CMAKE_CURRENT_BINARY_DIR}/doxygen-check.log
-            --ignore ${CMAKE_CURRENT_SOURCE_DIR}/suppressions.txt)
-        add_custom_target(doc-check COMMAND ${doc_check_command}
-            COMMENT "Checking Doxygen documentation" VERBATIM)
-        add_dependencies(doc-check doc-xml find-installed-headers)
+        # Add target that generates .dot files for the dependency graphs.
+        # The output also depends on the Doxygen source files, but the
+        # dependency on doxygen-xml takes care of that transitively.
+        gmx_add_custom_output_target(dep-graphs-dot ADD_FAST_TARGET
+            OUTPUT STAMP
+            COMMAND ${PYTHON_EXECUTABLE}
+                ${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
+                -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
+                --ignore-cycles ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
+                -o ${DEPGRAPH_DIR}
+            DEPENDS doxygen-xml ${INSTALLED_HEADER_FILE}
+                ${CMAKE_CURRENT_SOURCE_DIR}/doxygenxml.py
+                ${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")
 
-        set(graphdir ${CMAKE_CURRENT_BINARY_DIR}/depgraphs)
-        set(dep_graphs_command_python
-            ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
-            -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
-            --installed ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt
-            -o ${CMAKE_CURRENT_BINARY_DIR}/depgraphs)
+        # Add separate targets for converting the .dot files to .png.
+        # These are not needed by the Doxygen targets, but are useful for
+        # investigating just the graphs.
         set(dep_graphs_command_dot
-            ${CMAKE_COMMAND} -DGRAPHDIR=${graphdir}
+            ${CMAKE_COMMAND} -DGRAPHDIR=${DEPGRAPH_DIR}
             -DDOT_EXECUTABLE=${DOXYGEN_DOT_EXECUTABLE}
             -P ${CMAKE_CURRENT_SOURCE_DIR}/generateGraphs.cmake)
-        add_custom_target(dep-graphs
-            COMMAND ${dep_graphs_command_python}
-            COMMAND ${dep_graphs_command_dot}
-            COMMENT "Generating include dependency graphs" VERBATIM)
-        add_dependencies(dep-graphs doc-xml find-installed-headers)
+        add_custom_target(dep-graphs      COMMAND ${dep_graphs_command_dot}
+            COMMENT "Generating PNG include dependency graphs" VERBATIM)
+        add_custom_target(dep-graphs-fast COMMAND ${dep_graphs_command_dot}
+            COMMENT "Generating PNG include dependency graphs" VERBATIM)
+        add_dependencies(dep-graphs      dep-graphs-dot)
+        add_dependencies(dep-graphs-fast dep-graphs-dot-fast)
+    endif()
 
-        # These targets are the same as above, but they don't rerun the
-        # dependencies each time, making it faster and more convenient for
-        # testing.
-        add_custom_target(doc-check-fast COMMAND ${doc_check_command}
+    # Create the actual targets to build the documentation.
+    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")
+    # Convenience targets to build all the documentation flavors.
+    add_custom_target(doxygen-all)
+    add_custom_target(doxygen-all-fast)
+    add_dependencies(doxygen-all      doxygen-full doxygen-lib doxygen-user)
+    add_dependencies(doxygen-all-fast doxygen-full-fast doxygen-lib-fast doxygen-user)
+
+    # Finally, create the check-source target.
+    if (USE_PYTHON_SCRIPTS)
+        # TODO: Consider whether this is the best location for this code,
+        # since not all of it is Doxygen-specific (but nearly all of it
+        # relies on the Doxygen XML documentation).
+        # The output .log file currently needs to be here, since Jenkins
+        # expects that.
+        set(check_source_command
+            ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/check-source.py
+            -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}
+            -l ${CMAKE_CURRENT_BINARY_DIR}/check-source.log
+            --exitcode
+            --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 Doxygen documentation" VERBATIM)
+        add_custom_target(check-source-fast COMMAND ${check_source_command}
             COMMENT "Checking Doxygen documentation" VERBATIM)
-        add_custom_target(dep-graphs-fast
-            COMMAND ${dep_graphs_command_python}
-            COMMAND ${dep_graphs_command_dot}
-            COMMENT "Generating include dependency graphs" VERBATIM)
+        add_dependencies(check-source       doxygen-xml)
     endif()
 endif()
index 1ae0a1c340242b81558aba616fa7f089698c7b4c..08b477ed15d7e9b410627cedb7345642554f6ae1 100644 (file)
@@ -2,6 +2,7 @@ PROJECT_NAME           = @CMAKE_PROJECT_NAME@
 @INCLUDE               = Doxyfile-version
 LAYOUT_FILE            = @CMAKE_CURRENT_SOURCE_DIR@/DoxygenLayout.xml
 INPUT                  = @CMAKE_CURRENT_SOURCE_DIR@ \
+                         @CMAKE_SOURCE_DIR@/docs/dev-manual \
                          @CMAKE_SOURCE_DIR@/src \
                          @CMAKE_SOURCE_DIR@/share/template
 FILE_PATTERNS          = *.c *.cpp *.h *.md
@@ -17,16 +18,18 @@ EXCLUDE                = @CMAKE_CURRENT_SOURCE_DIR@/examples \
                          @CMAKE_SOURCE_DIR@/src/gromacs/selection/parser.h \
                          @CMAKE_SOURCE_DIR@/src/gromacs/selection/scanner.cpp @NB_KERNEL_DIRS_TO_IGNORE_IN_DOXYGEN@
 EXCLUDE_SYMBOLS        = YY* yy* _gmx_sel_yy*
+EXCLUDE_SYMBOLS       += __STDC*
 EXCLUDE_SYMBOLS       += TEST TEST_F TEST_P TYPED_TEST_CASE TYPED_TEST INSTANTIATE_TEST_CASE_P
 EXCLUDE_SYMBOLS       += MOCK_METHOD* MOCK_CONST_METHOD*
 FULL_PATH_NAMES        = YES
 STRIP_FROM_PATH        = @CMAKE_SOURCE_DIR@
 STRIP_FROM_INC_PATH    = @CMAKE_SOURCE_DIR@/src
-INCLUDE_PATH           = @CMAKE_SOURCE_DIR@/src \
-                         @CMAKE_SOURCE_DIR@/src/gromacs/legacyheaders
+INCLUDE_PATH           = @CMAKE_SOURCE_DIR@/src
 HAVE_DOT               = @DOXYGEN_DOT_FOUND@
 DOT_PATH               = @DOXYGEN_DOT_PATH@
 MSCGEN_PATH            = @DOXYGEN_MSCGEN_PATH@
+DOTFILE_DIRS           = @DEPGRAPH_DIR@
+@DOXYGEN_EXTRA_SETTINGS@
 
 ENABLED_SECTIONS       = @DOXYGEN_SECTIONS@
 
index c3ad8ad9a85c6148d84f4af87d2a84128328b681..81d170f1c0ad02d1aef17a7084f04a60c5bdb537 100644 (file)
@@ -2,10 +2,8 @@
 
 # These pages include documentation that does not belong to the public API
 # documentation; exclude them from the generated documentation
-EXCLUDE               += @CMAKE_SOURCE_DIR@/docs/doxygen/doxygen.md
-EXCLUDE               += @CMAKE_SOURCE_DIR@/docs/doxygen/unittesting.md
-EXCLUDE               += @CMAKE_SOURCE_DIR@/docs/doxygen/wrapperbinary.md
-EXCLUDE               += @CMAKE_SOURCE_DIR@/docs/doxygen/simd.md
+EXCLUDE               += @CMAKE_CURRENT_SOURCE_DIR@/lib
+EXCLUDE               += @CMAKE_SOURCE_DIR@/docs/dev-manual
 
 INTERNAL_DOCS          = NO
 HIDE_UNDOC_CLASSES     = YES
index 38549a345fdbbe990e0d3a947354a75ec44dfa56..43e374e9c02c223d491326f5d27f8a191ae864e8 100644 (file)
@@ -1 +1 @@
-PROJECT_NUMBER = @GMX_PROJECT_VERSION_STR@
+PROJECT_NUMBER = @GMX_VERSION_STRING_FULL@
index babca03873086e7471c08f1d9ea64cf362d81a97..7c100e12a102269e60601def4c8d526a642ba405 100644 (file)
@@ -2,7 +2,7 @@
 
 PREDEFINED            += F77_FUNC(name,NAME)=name
 
-ENABLED_SECTIONS      += libapi internal
+ENABLED_SECTIONS      += libapi internal xml
 INTERNAL_DOCS          = YES
 EXTRACT_LOCAL_CLASSES  = YES
 EXTRACT_ANON_NSPACES   = YES
index 4ac1f9bf619c070d7054e5461ee585953a42ee03..333f9253100e0b2e6f0d3ac32f3a76b105cf888c 100644 (file)
@@ -69,7 +69,7 @@ if (DOXYGEN_WARNINGS)
     # Add a note to the warnings that identify the documentation type that
     # produces them.  This makes it easier to see in Jenkins if a warning type
     # is produced only from some documentation types.
-    string(REGEX REPLACE "\n" " (in doc-${DOCTYPE})\n"
+    string(REGEX REPLACE "\n" " (in doxygen-${DOCTYPE})\n"
            DOXYGEN_WARNINGS "${DOXYGEN_WARNINGS}")
     file(WRITE doxygen-${DOCTYPE}.log "${DOXYGEN_WARNINGS}")
 endif ()
diff --git a/docs/doxygen/check-source.py b/docs/doxygen/check-source.py
new file mode 100755 (executable)
index 0000000..b0bb86e
--- /dev/null
@@ -0,0 +1,432 @@
+#!/usr/bin/python
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+"""Check source code and Doxygen documentation for issues
+
+This script checks for some issues in the Doxygen documentation, as well as
+general issues in the source code, mainly using Doxygen XML output and #include
+dependencies parsed from source files.  Part of the checks are generic, like
+checking that all documented entities have brief descriptions.  Other are
+specific to GROMACS, like checking that only installed headers contribute to
+the public API documentation.
+
+The checks should be self-evident from the source code of the script
+(they are also described in docs/dev-manual/gmxtree.md).
+All the logic of parsing the Doxygen XML output and creating a GROMACS-specific
+representation of the source tree is separated into separate Python modules
+(doxygenxml.py and gmxtree.py, respectively).  Similarly, logic for handling
+the output messages is in reporter.py.   This leaves only the actual checks and
+the script command-line interface in this file.
+
+The script can be run using the 'check-source' target generated by CMake.
+This target takes care of generating all the necessary input files and passing
+them to the script.
+"""
+
+import sys
+from optparse import OptionParser
+
+import gmxtree
+from gmxtree import GromacsTree, DocType
+from includesorter import IncludeSorter
+from reporter import Reporter
+
+def check_file(fileobj, reporter):
+    """Check file-level issues."""
+    if not fileobj.is_external() and fileobj.get_relpath().startswith('src/'):
+        includes = fileobj.get_includes()
+        if fileobj.is_source_file():
+            if includes:
+                firstinclude = includes[0].get_file()
+                if not firstinclude or firstinclude.get_name() != "gmxpre.h":
+                    reporter.code_issue(includes[0],
+                                        "does not include \"gmxpre.h\" first")
+            else:
+                reporter.code_issue(fileobj, "does not include \"gmxpre.h\"")
+        includes_config_h = False
+        for include in includes:
+            includedfile = include.get_file()
+            if includedfile:
+                if includedfile.get_name() == 'config.h':
+                    includes_config_h = True
+        if includes_config_h:
+            if not fileobj.get_used_config_h_defines():
+                reporter.code_issue(fileobj,
+                        "includes \"config.h\" unnecessarily")
+        else:
+            if fileobj.get_used_config_h_defines():
+                reporter.code_issue(fileobj, "should include \"config.h\"")
+
+    if not fileobj.is_documented():
+        # TODO: Add rules for required documentation
+        return
+
+    if fileobj.is_source_file():
+        # TODO: Add rule to exclude examples from this check
+        if fileobj.is_installed():
+            reporter.file_error(fileobj, "source file is installed")
+        if fileobj.get_doc_type() != DocType.internal:
+            reporter.file_error(fileobj,
+                    "source file documentation appears outside full documentation")
+        elif fileobj.get_api_type() != DocType.internal:
+            reporter.file_error(fileobj, "source file marked as non-internal")
+    elif fileobj.is_test_file() and fileobj.is_installed():
+        reporter.file_error(fileobj, "test file is installed")
+    elif fileobj.is_installed():
+        if fileobj.get_doc_type() != DocType.public:
+            reporter.file_error(fileobj,
+                    "public header has non-public documentation")
+    elif fileobj.get_doc_type() == DocType.public:
+        reporter.file_error(fileobj,
+                "non-installed header has public documentation")
+    elif fileobj.get_api_type() == DocType.public:
+        reporter.file_error(fileobj,
+                "non-installed header specified as part of public API")
+    elif fileobj.get_doc_type() < fileobj.get_api_type():
+        reporter.file_error(fileobj,
+                "API type ({0}) conflicts with documentation visibility ({1})"
+                .format(fileobj.get_api_type(), fileobj.get_doc_type()))
+
+    if not fileobj.has_brief_description():
+        reporter.file_error(fileobj,
+                "is documented, but does not have brief description")
+
+    expectedmod = fileobj.get_expected_module()
+    if expectedmod:
+        docmodules = fileobj.get_doc_modules()
+        if docmodules:
+            for module in docmodules:
+                if module != expectedmod:
+                    reporter.file_error(fileobj,
+                            "is documented in incorrect module: {0}"
+                            .format(module.get_name()))
+        elif expectedmod.is_documented():
+            reporter.file_error(fileobj,
+                    "is not documented in any module, but {0} exists"
+                    .format(expectedmod.get_name()))
+
+def check_include(fileobj, includedfile, reporter):
+    """Check an #include directive."""
+    otherfile = includedfile.get_file()
+    if includedfile.is_system():
+        if not otherfile:
+            return
+        reporter.code_issue(includedfile,
+                "includes local file as {0}".format(includedfile))
+    if not otherfile:
+        reporter.code_issue(includedfile,
+                "includes non-local file as {0}".format(includedfile))
+    # TODO: Reinstantiate a check once there is clarity on what we want
+    # to enforce.
+    #elif fileobj.is_installed() and not includedfile.is_relative():
+    #    reporter.code_issue(includedfile,
+    #            "installed header includes {0} using non-relative path"
+    #            .format(includedfile))
+    if not otherfile:
+        return
+    if fileobj.is_installed() and not otherfile.is_installed():
+        reporter.code_issue(includedfile,
+                "installed header includes non-installed {0}"
+                .format(includedfile))
+    filemodule = fileobj.get_module()
+    othermodule = otherfile.get_module()
+    if fileobj.is_documented() and otherfile.is_documented():
+        filetype = fileobj.get_doc_type()
+        othertype = otherfile.get_doc_type()
+        if filetype > othertype:
+            reporter.code_issue(includedfile,
+                    "{0} file includes {1} file {2}"
+                    .format(filetype, othertype, includedfile))
+    check_api = (otherfile.api_type_is_reliable() and filemodule != othermodule)
+    if check_api and otherfile.get_api_type() < DocType.library:
+        reporter.code_issue(includedfile,
+                "included file {0} is not documented as exposed outside its module"
+                .format(includedfile))
+
+def check_entity(entity, reporter):
+    """Check documentation for a code construct."""
+    if entity.is_documented():
+        if not entity.has_brief_description():
+            reporter.doc_error(entity,
+                    "is documented, but does not have brief description")
+
+def check_class(classobj, reporter):
+    """Check documentation for a class/struct/union."""
+    check_entity(classobj, reporter)
+    if classobj.is_documented():
+        classtype = classobj.get_doc_type()
+        filetype = classobj.get_file_doc_type()
+        if classtype == DocType.public and not classobj.is_in_installed_file():
+            reporter.doc_error(classobj,
+                    "has public documentation, but is not in installed header")
+        elif filetype is not DocType.none and classtype > filetype:
+            reporter.doc_error(classobj,
+                    "is in {0} file(s), but appears in {1} documentation"
+                    .format(filetype, classtype))
+
+def check_member(member, reporter, check_ignored):
+    """Check documentation for a generic member."""
+    check_entity(member, reporter)
+    if member.is_documented():
+        if check_ignored and not member.is_visible():
+            reporter.doc_note(member,
+                    "is documented, but is ignored by Doxygen, because its scope is not documented")
+        if member.has_inbody_description():
+            reporter.doc_note(member, "has in-body comments, which are ignored")
+
+def check_cycles(graph, reporter):
+    """Check cyclic dependencies in a dependency graph.
+
+    The graph parameter provides the graph to check.  It should be an object
+    that has three methods:
+      iternodes():
+        Return the list of nodes in the graph.
+      iteredges(node):
+        Return the list of edges from a given node.
+        The list should contain (node, edge) pairs, where node is an object
+        returned by iternodes() and edge is any object.
+      report_cycle(cycle, reporter):
+        Process a found cycle. cycle contains a list of (node, edge) pairs
+        that describe the cycle.  edge is the edge object that leads _to_
+        the node in the cycle.
+
+    This is implemented using an extended DFS-based strongly connected
+    component (SCC) search, written using a stack instead of recursion.
+    The base algorithm is Tarjan's SCC search:
+      http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm
+
+    Each back edge that is encountered during the search is reported as a
+    cycle.  Additionally, if a cross edge is encountered that is within the
+    current SCC, the target node and all its children in the current SCC will
+    be visited again to find all cycles.  All steps except cycle detection are
+    omitted for such re-traversal.
+
+    To avoid duplicates from cycles that do not include all nodes in an SCC,
+    a cycle is only reported if the target of the back edge is still active
+    in the search, i.e., all edges from it have not yet been traversed.
+    """
+    # The DFS stack; next node is always popped from the end.
+    # Stores (node, edge) pairs.
+    # edge is None for start nodes and for post-order processing.
+    dfsstack = []
+    for node in graph.iternodes():
+        dfsstack.append((node, None))
+    # Stack of visited nodes that have not yet been assigned to a strongly
+    # connected component.
+    visitstack = []
+    # List of nodes in the DFS recursion stack.
+    currlist = []
+    # Set of nodes in currlist for more efficient searching.
+    currset = set()
+    # Counter for initializing preorder.
+    visit_count = 0
+    # DFS pre-order for nodes: initialized when a node is first encountered
+    # in the search.
+    preorder = dict()
+    # Lowest pre-order index reachable from this node.
+    # Initialized to pre-order, and updated during post-order processing.
+    linkorder = dict()
+    # Set to True for a node when first encountered, and set to False when
+    # a strongly connected component has been processed.
+    in_progress = dict()
+    # The DFS search
+    while dfsstack:
+        currnode, curredge = dfsstack.pop()
+        # curredge is None if this is a start node or post-order traversal.
+        # currlist is empty if this is a start node.
+        if curredge is None and currlist:
+            # All children visited: post-order processing.
+            done = currlist.pop()[0]
+            assert done == currnode
+            currset.remove(currnode)
+            # If this is the first time this node is encountered, fill
+            # linkorder and check for strongly connected components.
+            if linkorder[currnode] == preorder[currnode]:
+                children = [x for x, dummy in graph.iteredges(currnode) if in_progress[x]]
+                if children:
+                    linkorder[currnode] = min([linkorder[x] for x in children])
+                if preorder[currnode] <= linkorder[currnode]:
+                    # This is a root of a strongly connected component.
+                    while visitstack:
+                        node = visitstack.pop()
+                        in_progress[node] = False
+                        if node == currnode:
+                            break
+                    else:
+                        assert False
+            continue
+        if currnode not in preorder:
+            # First encounter of this node: pre-order processing.
+            preorder[currnode] = visit_count
+            linkorder[currnode] = visit_count
+            visitstack.append(currnode)
+            visit_count += 1
+            in_progress[currnode] = True
+        elif not in_progress[currnode]:
+            # Do not enter processed components again.
+            continue
+        currlist.append((currnode, curredge))
+        currset.add(currnode)
+        # add entry for post-order traversal
+        dfsstack.append((currnode, None))
+        for nextnode, edge in graph.iteredges(currnode):
+            if nextnode not in preorder:
+                # Not seen previously: push
+                dfsstack.append((nextnode, edge))
+            else:
+                # If an already visited node is in the same component, it is
+                # either part of a cycle, or we need to traverse it again to
+                # find all cycles.
+                if in_progress[nextnode]:
+                    if nextnode not in currset:
+                        dfsstack.append((nextnode, edge))
+                    # Only report cycles to nodes that haven't been processed
+                    # yet to avoid duplicates.
+                    elif linkorder[nextnode] == preorder[nextnode]:
+                        for index in xrange(len(currlist)):
+                            if currlist[index][0] == nextnode:
+                                cycle = [(nextnode, edge)]
+                                cycle.extend(currlist[index+1:])
+                                graph.report_cycle(cycle, reporter)
+                                break
+                        else:
+                            assert False
+
+class ModuleDependencyGraph(object):
+
+    """Module dependency graph representation for check_cycles().
+
+    In the reported graph, the nodes are gmxtree.Module objects and the edges
+    are gmxtree.ModuleDependency objects.
+    """
+
+    def __init__(self, tree):
+        self._tree = tree
+
+    def iternodes(self):
+        return self._tree.get_modules()
+
+    def iteredges(self, module):
+        for dependency in module.get_dependencies():
+            if not dependency.is_test_only_dependency():
+                yield (dependency.get_other_module(), dependency)
+
+    def report_cycle(self, cycle, reporter):
+        if any([x[1].is_cycle_suppressed() for x in cycle]):
+            # TODO: Report unused suppressions.
+            return
+        modulelist = ' -> '.join([x[0].get_name()[7:] for x in cycle])
+        summary = 'module-level cyclic dependency: ' + modulelist
+        reporter.cyclic_issue(summary)
+
+def check_all(tree, reporter, check_ignored):
+    """Do all checks for the GROMACS tree."""
+    includesorter = IncludeSorter()
+    for fileobj in tree.get_files():
+        if isinstance(fileobj, gmxtree.GeneratorSourceFile):
+            continue
+        check_file(fileobj, reporter)
+        for includedfile in fileobj.get_includes():
+            check_include(fileobj, includedfile, reporter)
+        if fileobj.should_includes_be_sorted() \
+                and not includesorter.check_sorted(fileobj):
+            reporter.code_issue(fileobj, "include style/order is not consistent")
+
+    for classobj in tree.get_classes():
+        check_class(classobj, reporter)
+
+    for memberobj in tree.get_members():
+        check_member(memberobj, reporter, check_ignored)
+
+    check_cycles(ModuleDependencyGraph(tree), reporter)
+
+def main():
+    """Run the checking script."""
+    parser = OptionParser()
+    parser.add_option('-S', '--source-root',
+                      help='Source tree root directory')
+    parser.add_option('-B', '--build-root',
+                      help='Build tree root directory')
+    parser.add_option('-l', '--log',
+                      help='Write issues into a given log file in addition to stderr')
+    parser.add_option('--ignore',
+                      help='Set file with patterns for messages to ignore')
+    parser.add_option('--ignore-cycles',
+                      help='Set file with module dependencies to ignore in cycles')
+    parser.add_option('--check-ignored', action='store_true',
+                      help='Issue notes for comments ignored by Doxygen')
+    parser.add_option('-q', '--quiet', action='store_true',
+                      help='Do not write status messages')
+    parser.add_option('--exitcode', action='store_true',
+                      help='Return non-zero exit code if there are warnings')
+    options, args = parser.parse_args()
+
+    reporter = Reporter(options.log)
+    if options.ignore:
+        reporter.load_filters(options.ignore)
+
+    if not options.quiet:
+        sys.stderr.write('Scanning source tree...\n')
+    tree = GromacsTree(options.source_root, options.build_root, reporter)
+    tree.load_git_attributes()
+    tree.load_installed_file_list()
+    if not options.quiet:
+        sys.stderr.write('Reading source files...\n')
+    # TODO: The checking should be possible without storing everything in memory
+    tree.scan_files(keep_contents=True)
+    if not options.quiet:
+        sys.stderr.write('Finding config.h uses...\n')
+    tree.find_config_h_uses()
+    if options.ignore_cycles:
+        tree.load_cycle_suppression_list(options.ignore_cycles)
+    if not options.quiet:
+        sys.stderr.write('Reading Doxygen XML files...\n')
+    tree.load_xml()
+
+    reporter.write_pending()
+
+    if not options.quiet:
+        sys.stderr.write('Checking...\n')
+
+    check_all(tree, reporter, options.check_ignored)
+
+    reporter.write_pending()
+    reporter.report_unused_filters()
+    reporter.close_log()
+
+    if options.exitcode and reporter.had_warnings():
+        sys.exit(1)
+
+main()
diff --git a/docs/doxygen/cycle-suppressions.txt b/docs/doxygen/cycle-suppressions.txt
new file mode 100644 (file)
index 0000000..38023f9
--- /dev/null
@@ -0,0 +1,22 @@
+# Order (or more generally, edge selection) is significant (see gmxtree.md);
+# "moduleA -> moduleB" means that moduleA should not depend on moduleB, and is
+# a problem to be addressed at some point.
+fileio -> domdec
+domdec -> imd
+domdec -> ewald
+domdec -> mdlib
+domdec -> pulling
+domdec -> swap
+mdlib -> essentialdynamics
+mdlib -> imd
+mdlib -> ewald
+mdlib -> pulling
+legacyheaders -> swap
+legacyheaders -> fileio
+timing -> legacyheaders
+math -> legacyheaders
+topology -> fileio
+topology -> legacyheaders
+pbcutil -> fileio
+pbcutil -> legacyheaders
+listed-forces -> mdlib
index 13de5ee37731f3dfd33eb0f30c902e3eeb0c0a52..a98c001e3c1403911d98029131e40ddf33a7c0bf 100644 (file)
@@ -6,9 +6,12 @@ Doxygen documentation file for directories in the source tree.
 \author Teemu Murtola <teemu.murtola@gmail.com>
 */
 
-/*!
-\libinternal
-\dir doxygen
+/*! \libinternal
+\dir docs
+\brief Build system and source code for various documentation items.
+ */
+/*! \libinternal
+\dir docs/doxygen
 \brief Doxygen build system and general documentation content.
  */
 
@@ -48,7 +51,7 @@ Doxygen documentation file for directories in the source tree.
 \ingroup module_commandline
  */
 
-/*!
+/*! \libinternal
 \dir src/gromacs/onlinehelp
 \brief \ref module_onlinehelp
 
@@ -149,7 +152,6 @@ Doxygen documentation file for directories in the source tree.
 
 \ingroup module_testutils
  */
-
 /*!
 \libinternal
 \dir src/testutils/tests
@@ -166,17 +168,3 @@ Doxygen documentation file for directories in the source tree.
 \dir share/template
 \brief Template code for writing analysis programs.
  */
-
-/*!
-\file share/template/template.cpp
-\brief Template code for writing analysis programs.
-
-See \ref page_analysistemplate for more information.
- */
-
-/*!
-\example template.cpp
-\brief Template code for writing analysis programs.
-
-See \ref page_analysistemplate for more information.
- */
diff --git a/docs/doxygen/doxygen-check.py b/docs/doxygen/doxygen-check.py
deleted file mode 100755 (executable)
index f292b85..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/usr/bin/python
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2014, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-"""Check Doxygen documentation for issues that Doxygen does not warn about.
-
-This script for some issues in the Doxygen documentation, using Doxygen XML
-output.  Part of the checks are generic, like checking that all documented
-entities have brief descriptions.  Other are specific to GROMACS, like checking
-that only installed headers contribute to the public API documentation.
-
-The checks should be self-evident from the source code of the script.
-All the logic of parsing the Doxygen XML output and creating a GROMACS-specific
-representation of the source tree is separated into separate Python modules
-(doxygenxml.py and gmxtree.py, respectively).  Similarly, logic for handling
-the output messages is in reporter.py.   This leaves only the actual checks and
-the script command-line interface in this file.
-
-The script can be run using the 'doc-check' target generated by CMake.
-This target takes care of generating all the necessary input files and passing
-them to the script.
-"""
-
-import sys
-from optparse import OptionParser
-
-from gmxtree import GromacsTree, DocType
-from reporter import Reporter
-
-def check_file(fileobj, reporter):
-    """Check file-level documentation."""
-    if not fileobj.is_documented():
-        # TODO: Add rules for required documentation
-        return
-
-    if fileobj.is_source_file():
-        # TODO: Add rule to exclude examples from this check
-        if fileobj.is_installed():
-            reporter.file_error(fileobj, "source file is installed")
-        if fileobj.get_documentation_type() != DocType.internal:
-            reporter.file_error(fileobj,
-                    "source file documentation appears outside full documentation")
-        elif fileobj.get_api_type() != DocType.internal:
-            reporter.file_error(fileobj, "source file marked as non-internal")
-    elif fileobj.is_test_file() and fileobj.is_installed():
-        reporter.file_error(fileobj, "test file is installed")
-    elif fileobj.is_installed():
-        if fileobj.get_documentation_type() != DocType.public:
-            reporter.file_error(fileobj,
-                    "public header has non-public documentation")
-    elif fileobj.get_documentation_type() == DocType.public:
-        reporter.file_error(fileobj,
-                "non-installed header has public documentation")
-    elif fileobj.get_api_type() == DocType.public:
-        reporter.file_error(fileobj,
-                "non-installed header specified as part of public API")
-    elif fileobj.get_documentation_type() < fileobj.get_api_type():
-        reporter.file_error(fileobj,
-                "API type ({0}) conflicts with documentation visibility ({1})"
-                .format(fileobj.get_api_type(), fileobj.get_documentation_type()))
-
-    if not fileobj.has_brief_description():
-        reporter.file_error(fileobj,
-                "is documented, but does not have brief description")
-
-    expectedmod = fileobj.get_expected_module()
-    if expectedmod:
-        docmodules = fileobj.get_doc_modules()
-        if docmodules:
-            for module in docmodules:
-                if module != expectedmod:
-                    reporter.file_error(fileobj,
-                            "is documented in incorrect module: {0}"
-                            .format(module.get_name()))
-        elif expectedmod.is_documented():
-            reporter.file_error(fileobj,
-                    "is not documented in any module, but {0} exists"
-                    .format(expectedmod.get_name()))
-
-def check_include(fileobj, includedfile, reporter):
-    """Check an #include directive."""
-    if includedfile.is_system():
-        if includedfile.get_file():
-            reporter.code_issue(includedfile,
-                    "includes local file as {0}".format(includedfile))
-    else:
-        otherfile = includedfile.get_file()
-        if not otherfile:
-            reporter.code_issue(includedfile,
-                    "includes non-local file as {0}".format(includedfile))
-        elif fileobj.is_installed() and not includedfile.is_relative():
-            reporter.code_issue(includedfile,
-                    "installed header includes {0} using non-relative path"
-                    .format(includedfile))
-        if not otherfile:
-            return
-        if fileobj.is_installed() and not otherfile.is_installed():
-            reporter.code_issue(includedfile,
-                    "installed header includes non-installed {0}"
-                    .format(includedfile))
-        filemodule = fileobj.get_module()
-        othermodule = otherfile.get_module()
-        if fileobj.is_documented() and otherfile.is_documented():
-            filetype = fileobj.get_documentation_type()
-            othertype = otherfile.get_documentation_type()
-            if filetype > othertype:
-                reporter.code_issue(includedfile,
-                        "{0} file includes {1} file {2}"
-                        .format(filetype, othertype, includedfile))
-        check_api = (othermodule and othermodule.is_documented() and
-                filemodule != othermodule)
-        if check_api and otherfile.get_api_type() < DocType.library:
-            reporter.code_issue(includedfile,
-                    "included file {0} is not documented as exposed outside its module"
-                    .format(includedfile))
-
-def check_entity(entity, reporter):
-    """Check documentation for a code construct."""
-    if entity.is_documented():
-        if not entity.has_brief_description():
-            reporter.doc_error(entity,
-                    "is documented, but does not have brief description")
-
-def check_class(classobj, reporter):
-    """Check documentation for a class/struct/union."""
-    check_entity(classobj, reporter)
-    if classobj.is_documented():
-        classtype = classobj.get_documentation_type()
-        filetype = classobj.get_file_documentation_type()
-        if classtype == DocType.public and not classobj.is_in_installed_file():
-            reporter.doc_error(classobj,
-                    "has public documentation, but is not in installed header")
-        elif filetype is not DocType.none and classtype > filetype:
-            reporter.doc_error(classobj,
-                    "is in {0} file(s), but appears in {1} documentation"
-                    .format(filetype, classtype))
-
-def check_member(member, reporter):
-    """Check documentation for a generic member."""
-    check_entity(member, reporter)
-    if member.is_documented():
-        if not member.is_visible():
-            # TODO: This is triggered by members in anonymous namespaces.
-            reporter.doc_note(member,
-                    "is documented, but is ignored by Doxygen, because its scope is not documented")
-        if member.has_inbody_description():
-            reporter.doc_note(member, "has in-body comments, which are ignored")
-
-def main():
-    """Run the checking script."""
-    parser = OptionParser()
-    parser.add_option('-S', '--source-root',
-                      help='Source tree root directory')
-    parser.add_option('-B', '--build-root',
-                      help='Build tree root directory')
-    parser.add_option('--installed',
-                      help='Read list of installed files from given file')
-    parser.add_option('-l', '--log',
-                      help='Write issues into a given log file in addition to stderr')
-    parser.add_option('--ignore',
-                      help='Set file with patterns for messages to ignore')
-    parser.add_option('--check-ignored', action='store_true',
-                      help='Check documentation ignored by Doxygen')
-    parser.add_option('-q', '--quiet', action='store_true',
-                      help='Do not write status messages')
-    options, args = parser.parse_args()
-
-    installedlist = []
-    if options.installed:
-        with open(options.installed, 'r') as outfile:
-            for line in outfile:
-                installedlist.append(line.strip())
-
-    reporter = Reporter(options.log)
-    if options.ignore:
-        reporter.load_filters(options.ignore)
-
-    if not options.quiet:
-        sys.stderr.write('Scanning source tree...\n')
-    tree = GromacsTree(options.source_root, options.build_root, reporter)
-    tree.set_installed_file_list(installedlist)
-    if not options.quiet:
-        sys.stderr.write('Reading source files...\n')
-    tree.scan_files()
-    if not options.quiet:
-        sys.stderr.write('Reading Doxygen XML files...\n')
-    tree.load_xml()
-
-    reporter.write_pending()
-
-    if not options.quiet:
-        sys.stderr.write('Checking...\n')
-
-    for fileobj in tree.get_files():
-        check_file(fileobj, reporter)
-        for includedfile in fileobj.get_includes():
-            check_include(fileobj, includedfile, reporter)
-
-    for classobj in tree.get_classes():
-        check_class(classobj, reporter)
-
-    for memberobj in tree.get_members():
-        if memberobj.is_visible() or options.check_ignored:
-            check_member(memberobj, reporter)
-
-    reporter.write_pending()
-    reporter.report_unused_filters()
-    reporter.close_log()
-
-main()
index f26ad9cdbdf6102913fd8bed6760aefc60a9f120..b6dd5659f5e983dd15c8dd9dc1fcdd58cdeed811 100755 (executable)
@@ -370,6 +370,10 @@ class Member(Entity):
     def __init__(self, name, refid):
         Entity.__init__(self, name, refid)
         self._parents = set()
+        self._class = None
+        self._namespace = None
+        self._files = set()
+        self._group = None
         self._location = None
         self._alternates = set()
         self._loaded = False
@@ -379,38 +383,31 @@ class Member(Entity):
     def add_parent_compound(self, compound):
         """Add a compound that contains this member."""
         self._parents.add(compound)
+        if isinstance(compound, Class):
+            assert self._class is None
+            self._class = compound
+        elif isinstance(compound, Namespace):
+            assert self._namespace is None
+            self._namespace = compound
+        elif isinstance(compound, File):
+            self._files.add(compound)
+        elif isinstance(compound, Group):
+            assert self._group is None
+            self._group = compound
+        else:
+            assert False
 
-    def _get_raw_location(self):
-        """Returns the BodyLocation object associated with this member.
+    def merge_definition(self, definition):
+        """Merge another member into this.
 
-        This is necessary so that EnumValue can override it report a non-empty
-        location: Doxygen doesn't provide any location for <enumvalue>.
+        See DocumentationSet.merge_duplicates().
         """
-        return self._location
-
-    def get_parent_compounds(self):
-        return self._parents
-
-    def get_inherited_visibility(self):
-        return max([parent.get_visibility() for parent in self._parents])
-
-    def is_visible(self):
-        return self.get_inherited_visibility() != DocType.none
-
-    def has_same_body_location(self):
-        return self._get_raw_location().has_same_body_location()
-
-    def get_reporter_location(self):
-        return self._get_raw_location().get_reporter_location()
-
-    def get_location(self):
-        return self._get_raw_location().get_location()
-
-    def get_body_location(self):
-        return self._get_raw_location().get_body_location()
-
-    def merge_definition(self, definition):
+        assert self._class is None
+        assert definition._class is None
+        assert self._group == definition._group
+        assert self._namespace == definition._namespace
         self._parents.update(definition._parents)
+        self._files.update(definition._files)
         self._alternates.add(definition)
 
     def load_details_from_element(self, rootelem, xmlpath):
@@ -465,8 +462,50 @@ class Member(Entity):
         """
         return False
 
+    def _get_raw_location(self):
+        """Returns the BodyLocation object associated with this member.
+
+        This is necessary so that EnumValue can override it report a non-empty
+        location: Doxygen doesn't provide any location for <enumvalue>.
+        """
+        return self._location
+
+    def get_reporter_location(self):
+        return self._get_raw_location().get_reporter_location()
+
+    def get_location(self):
+        """Return main location for the member.
+
+        This typically corresponds to the declaration.
+        """
+        return self._get_raw_location().get_location()
+
+    def get_body_location(self):
+        """Return location of the body for the member.
+
+        Some types of members do not have a body location, in which case this
+        returns None.
+        """
+        return self._get_raw_location().get_body_location()
+
+    def has_same_body_location(self):
+        """Check whether the main location is the same as body location."""
+        return self._get_raw_location().has_same_body_location()
+
+    def get_namespace(self):
+        return self._namespace
+
+    def get_parent_compounds(self):
+        return self._parents
+
+    def get_inherited_visibility(self):
+        return max([parent.get_visibility() for parent in self._parents])
+
     def show(self):
         self.show_base()
+        if self._alternates:
+            idlist = [x.get_id() for x in self._alternates]
+            print 'Alt. IDs:   {0}'.format(', '.join(idlist))
         print 'Parent vis: {0}'.format(self.get_inherited_visibility())
         print 'Location:   {0}'.format(self.get_location().get_full_string())
         print 'Body loc:   {0}'.format(self.get_body_location().get_full_string())
@@ -539,6 +578,7 @@ class Compound(Entity):
     contains references to contained compounds, and details of all members
     within the compound.
     """
+
     def __init__(self, name, refid):
         Entity.__init__(self, name, refid)
         self._members = dict()
@@ -891,6 +931,9 @@ class Namespace(Compound):
     def get_reporter_location(self):
         return self._doclocation.get_reporter_location()
 
+    def is_anonymous(self):
+        return 'anonymous_namespace{' in self.get_name()
+
     def show(self):
         self.show_base()
         print 'Doc. loc.: {0}'.format(self._doclocation.get_full_string())
@@ -1074,13 +1117,34 @@ class DocumentationSet(object):
                 member.add_parent_compound(compound)
                 compound.add_member(member)
 
-    def load_file_details(self):
-        """Load detailed XML files for all files and possible parents of files."""
+    def load_file_details(self, filelist=None):
+        """Load detailed XML files for all files and possible parents of files.
+
+        If filelist is set, it should be a list of file paths, and details will
+        be loaded only for files in those paths.  The path format should match
+        what Doxygen writes into the files (with Gromacs setup, it seems to be
+        absolute paths)."""
         for compound in self._compounds.itervalues():
-            if isinstance(compound, (File, Directory, Group)):
+            if isinstance(compound, (Directory, Group)):
+                compound.load_details()
+            elif not filelist and isinstance(compound, File):
                 compound.load_details()
+                self._files[compound.get_path()] = compound
+        if filelist:
+            # We can't access the full path from the File object before the
+            # details are loaded, because Doxygen does not write that into
+            # index.xml.  But we can use the Directory objects (which were
+            # loaded above) to get the path.
+            for compound in self._compounds.itervalues():
                 if isinstance(compound, File):
-                    self._files[compound.get_path()] = compound
+                    dirobj = compound.get_directory()
+                    if not dirobj:
+                        continue
+                    abspath = compound.get_directory().get_path()
+                    abspath = os.path.join(abspath, compound.get_name())
+                    if abspath in filelist:
+                        compound.load_details()
+                        self._files[compound.get_path()] = compound
 
     def load_details(self):
         """Load detailed XML files for each compound."""
@@ -1093,9 +1157,9 @@ class DocumentationSet(object):
     def merge_duplicates(self):
         """Merge duplicate member definitions based on body location.
 
-        At least for functions that are declared in a header, but have their
-        body in a source file, Doxygen seems to create two different IDs, but
-        the contents of the members are the same, except for the location
+        At least for some functions that are declared in a header, but have
+        their body in a source file, Doxygen seems to create two different IDs,
+        but the contents of the members are the same, except for the location
         attribute.  This method merges members that have identical name and
         body location into a single member that keeps the information from both
         instances (they should only differ in the location attribute and in
@@ -1190,8 +1254,11 @@ class DocumentationSet(object):
     def get_groups(self, name):
         return self.get_compounds(Group, lambda x: x.get_name() in name)
 
-    def get_namespaces(self, name):
-        return self.get_compounds(Namespace, lambda x: x.get_name() in name)
+    def get_namespaces(self, name=None):
+        if name:
+            return self.get_compounds(Namespace, lambda x: x.get_name() in name)
+        else:
+            return self.get_compounds(Namespace)
 
     def get_classes(self, name=None):
         if name:
index 3006e4a83031d04ef692230abdd2e23f24883c9f..b451c9728164d2c2b35fc1b5b94e6b7eaca1c663 100644 (file)
@@ -33,7 +33,6 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 if (DOT_EXECUTABLE)
-    message("Running dot...")
     file(GLOB DOT_INPUT_FILES ${GRAPHDIR}/*.dot)
     execute_process(COMMAND ${DOT_EXECUTABLE} -Tpng -O ${DOT_INPUT_FILES})
 endif()
index c974d13a1454d3462cad74e9d46899b86a811270..a2f012a50277960078e69abc14d581bf8a7ffa9c 100644 (file)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -50,9 +50,11 @@ rules that come from GROMACS-specific knowledge.  In the future, more such
 customizations will be added.
 """
 
+import collections
 import os
 import os.path
 import re
+import subprocess
 
 import doxygenxml as xml
 import reporter
@@ -75,14 +77,15 @@ class IncludedFile(object):
 
     """Information about an #include directive in a file."""
 
-    def __init__(self, abspath, lineno, included_file, included_path, is_relative, is_system):
-        self._abspath = abspath
+    def __init__(self, including_file, lineno, included_file, included_path, is_relative, is_system, line):
+        self._including_file = including_file
         self._line_number = lineno
         self._included_file = included_file
         self._included_path = included_path
         #self._used_include_path = used_include_path
         self._is_relative = is_relative
         self._is_system = is_system
+        self._line = line
 
     def __str__(self):
         if self._is_system:
@@ -96,11 +99,49 @@ class IncludedFile(object):
     def is_relative(self):
         return self._is_relative
 
+    def get_included_path(self):
+        return self._included_path
+
+    def get_including_file(self):
+        return self._including_file
+
     def get_file(self):
         return self._included_file
 
+    def get_line_number(self):
+        return self._line_number
+
+    def get_full_line(self):
+        """Return the full source line on which this include appears.
+
+        Trailing newline is included."""
+        return self._line
+
     def get_reporter_location(self):
-        return reporter.Location(self._abspath, self._line_number)
+        return reporter.Location(self._including_file.get_abspath(), self._line_number)
+
+class IncludeBlock(object):
+
+    """Block of consequent #include directives in a file."""
+
+    def __init__(self, first_included_file):
+        self._first_line = first_included_file.get_line_number()
+        self._last_line = self._first_line
+        self._files = []
+        self.add_file(first_included_file)
+
+    def add_file(self, included_file):
+        self._files.append(included_file)
+        self._last_line = included_file.get_line_number()
+
+    def get_includes(self):
+        return self._files
+
+    def get_first_line(self):
+        return self._first_line
+
+    def get_last_line(self):
+        return self._last_line
 
 class File(object):
 
@@ -118,6 +159,11 @@ class File(object):
         self._apitype = DocType.none
         self._modules = set()
         self._includes = []
+        self._include_blocks = []
+        self._main_header = None
+        self._lines = None
+        self._filter = None
+        self._used_config_h_defines = set()
         directory.add_file(self)
 
     def set_doc_xml(self, rawdoc, sourcetree):
@@ -137,7 +183,16 @@ class File(object):
         """Mark the file installed."""
         self._installed = True
 
-    def _process_include(self, lineno, is_system, includedpath, sourcetree):
+    def set_git_filter_attribute(self, filtername):
+        """Set the git filter attribute associated with the file."""
+        self._filter = filtername
+
+    def set_main_header(self, included_file):
+        """Set the main header file for a source file."""
+        assert self.is_source_file()
+        self._main_header = included_file
+
+    def _process_include(self, lineno, is_system, includedpath, line, sourcetree):
         """Process #include directive during scan()."""
         is_relative = False
         if is_system:
@@ -150,21 +205,41 @@ class File(object):
                 fileobj = sourcetree.get_file(fullpath)
             else:
                 fileobj = sourcetree.find_include_file(includedpath)
-        self._includes.append(IncludedFile(self.get_abspath(), lineno, fileobj, includedpath,
-                is_relative, is_system))
+        included_file = IncludedFile(self, lineno, fileobj, includedpath,
+            is_relative, is_system, line)
+        self._includes.append(included_file)
+        return included_file
 
-    def scan_contents(self, sourcetree):
+    def scan_contents(self, sourcetree, keep_contents):
         """Scan the file contents and initialize information based on it."""
         # TODO: Consider a more robust regex.
-        include_re = r'^#\s*include\s+(?P<quote>["<])(?P<path>[^">]*)[">]'
+        include_re = r'^\s*#\s*include\s+(?P<quote>["<])(?P<path>[^">]*)[">]'
+        current_block = None
         with open(self._abspath, 'r') as scanfile:
-            for lineno, line in enumerate(scanfile, 1):
-                match = re.match(include_re, line)
-                if match:
-                    is_system = (match.group('quote') == '<')
-                    includedpath = match.group('path')
-                    self._process_include(lineno, is_system, includedpath,
-                            sourcetree)
+            contents = scanfile.read()
+        lines = contents.splitlines(True)
+        for lineno, line in enumerate(lines, 1):
+            match = re.match(include_re, line)
+            if match:
+                is_system = (match.group('quote') == '<')
+                includedpath = match.group('path')
+                included_file = self._process_include(lineno, is_system,
+                        includedpath, line, sourcetree)
+                if current_block is None:
+                    current_block = IncludeBlock(included_file)
+                    self._include_blocks.append(current_block)
+                else:
+                    current_block.add_file(included_file)
+            elif line and not line.isspace():
+                current_block = None
+        if keep_contents:
+            self._lines = lines
+
+    def add_used_config_h_defines(self, defines):
+        """Set config.h defines used in this file.
+
+        Used internally by find_config_h_uses()."""
+        self._used_config_h_defines.update(defines)
 
     def get_reporter_location(self):
         return reporter.Location(self._abspath, None)
@@ -181,6 +256,10 @@ class File(object):
     def is_test_file(self):
         return self._dir.is_test_directory()
 
+    def should_includes_be_sorted(self):
+        """Return whether the include directives in the file should be sorted."""
+        return self._filter in ('includesort', 'uncrustify')
+
     def is_documented(self):
         return self._rawdoc and self._rawdoc.is_documented()
 
@@ -196,7 +275,10 @@ class File(object):
     def get_name(self):
         return os.path.basename(self._abspath)
 
-    def get_documentation_type(self):
+    def get_directory(self):
+        return self._dir
+
+    def get_doc_type(self):
         if not self._rawdoc:
             return DocType.none
         return self._rawdoc.get_visibility()
@@ -204,6 +286,22 @@ class File(object):
     def get_api_type(self):
         return self._apitype
 
+    def api_type_is_reliable(self):
+        if self._apitype in (DocType.internal, DocType.library):
+            return True
+        module = self.get_module()
+        return module and module.is_documented()
+
+    def is_public(self):
+        if self.api_type_is_reliable():
+            return self.get_api_type() == DocType.public
+        return self.get_api_type() == DocType.public or self.is_installed()
+
+    def is_module_internal(self):
+        if self.is_source_file():
+            return True
+        return not self.is_installed() and self.get_api_type() <= DocType.internal
+
     def get_expected_module(self):
         return self._dir.get_module()
 
@@ -219,8 +317,60 @@ class File(object):
     def get_includes(self):
         return self._includes
 
+    def get_include_blocks(self):
+        return self._include_blocks
+
+    def get_main_header(self):
+        return self._main_header
+
+    def get_contents(self):
+        return self._lines
+
+    def get_used_config_h_defines(self):
+        """Return set of defines from config.h that are used in this file.
+
+        The return value is empty if find_config_h_uses() has not been called,
+        as well as for headers that declare these defines."""
+        return self._used_config_h_defines
+
 class GeneratedFile(File):
-    pass
+    def __init__(self, abspath, relpath, directory):
+        File.__init__(self, abspath, relpath, directory)
+        self._generator_source_file = None
+
+    def scan_contents(self, sourcetree, keep_contents):
+        if os.path.exists(self.get_abspath()):
+            File.scan_contents(self, sourcetree, keep_contents)
+
+    def set_generator_source(self, sourcefile):
+        self._generator_source_file = sourcefile
+
+    def get_reporter_location(self):
+        if self._generator_source_file:
+            return self._generator_source_file.get_reporter_location()
+        return File.get_reporter_location(self)
+
+class GeneratorSourceFile(File):
+    def __init__(self, abspath, relpath, directory):
+        File.__init__(self, abspath, relpath, directory)
+        self._defines = None
+
+    def scan_contents(self, sourcetree, keep_contents):
+        detect_defines = (self.get_name() == 'config.h.cmakein')
+        File.scan_contents(self, sourcetree, keep_contents or detect_defines)
+        if detect_defines:
+            self._defines = []
+            define_re = r'^#.*define\s+(\w*)'
+            for line in self.get_contents():
+                match = re.match(define_re, line)
+                if match:
+                    self._defines.append(match.group(1))
+
+    def get_defines(self):
+        """Return set of possible defines from config.h.cmakein.
+
+        The information is only populated for config.h.cmakein."""
+        return self._defines
 
 class Directory(object):
 
@@ -308,6 +458,53 @@ class Directory(object):
         for fileobj in self._files:
             yield fileobj
 
+    def contains(self, fileobj):
+        """Check whether file is within the directory or its subdirectories."""
+        dirobj = fileobj.get_directory()
+        while dirobj:
+            if dirobj == self:
+                return True
+            dirobj = dirobj._parent
+        return False
+
+class ModuleDependency(object):
+
+    """Dependency between modules."""
+
+    def __init__(self, othermodule):
+        """Initialize empty dependency object with given module as dependency."""
+        self._othermodule = othermodule
+        self._includedfiles = []
+        self._cyclesuppression = None
+        self._is_test_only_dependency = True
+
+    def add_included_file(self, includedfile):
+        """Add IncludedFile that is part of this dependency."""
+        assert includedfile.get_file().get_module() == self._othermodule
+        if not includedfile.get_including_file().is_test_file():
+            self._is_test_only_dependency = False
+        self._includedfiles.append(includedfile)
+
+    def set_cycle_suppression(self):
+        """Set suppression on cycles containing this dependency."""
+        self._cyclesuppression = True
+
+    def is_cycle_suppressed(self):
+        """Return whether cycles containing this dependency are suppressed."""
+        return self._cyclesuppression is not None
+
+    def is_test_only_dependency(self):
+        """Return whether this dependency is only from test code."""
+        return self._is_test_only_dependency
+
+    def get_other_module(self):
+        """Get module that this dependency is to."""
+        return self._othermodule
+
+    def get_included_files(self):
+        """Get IncludedFile objects for the individual include dependencies."""
+        return self._includedfiles
+
 class Module(object):
 
     """Code module in the GROMACS source tree.
@@ -324,6 +521,7 @@ class Module(object):
         self._rawdoc = None
         self._rootdir = rootdir
         self._group = None
+        self._dependencies = dict()
 
     def set_doc_xml(self, rawdoc, sourcetree):
         """Assiociate Doxygen documentation entity with the module."""
@@ -336,6 +534,13 @@ class Module(object):
                 if groupname.startswith('group_'):
                     self._group = groupname[6:]
 
+    def add_dependency(self, othermodule, includedfile):
+        """Add #include dependency from a file in this module."""
+        assert includedfile.get_file().get_module() == othermodule
+        if othermodule not in self._dependencies:
+            self._dependencies[othermodule] = ModuleDependency(othermodule)
+        self._dependencies[othermodule].add_included_file(includedfile)
+
     def is_documented(self):
         return self._rawdoc is not None
 
@@ -352,6 +557,18 @@ class Module(object):
     def get_group(self):
         return self._group
 
+    def get_dependencies(self):
+        return self._dependencies.itervalues()
+
+class Namespace(object):
+
+    """Namespace in the GROMACS source code."""
+
+    def __init__(self, rawdoc):
+        self._rawdoc = rawdoc
+
+    def is_anonymous(self):
+        return self._rawdoc.is_anonymous()
 
 class Class(object):
 
@@ -376,19 +593,66 @@ class Class(object):
     def has_brief_description(self):
         return self._rawdoc.has_brief_description()
 
-    def get_documentation_type(self):
+    def get_doc_type(self):
+        """Return documentation type (visibility) for the class.
+
+        In addition to the actual code, this encodes GROMACS-specific logic
+        of setting EXTRACT_LOCAL_CLASSES=YES only for the full documentation.
+        Local classes never appear outside the full documentation, no matter
+        what is their visibility.
+        """
         if not self.is_documented():
             return DocType.none
         if self._rawdoc.is_local():
             return DocType.internal
         return self._rawdoc.get_visibility()
 
-    def get_file_documentation_type(self):
-        return max([fileobj.get_documentation_type() for fileobj in self._files])
+    def get_file_doc_type(self):
+        return max([fileobj.get_doc_type() for fileobj in self._files])
 
     def is_in_installed_file(self):
         return any([fileobj.is_installed() for fileobj in self._files])
 
+class Member(object):
+
+    """Member (in Doxygen terminology) in the GROMACS source tree.
+
+    Currently, modeling is limited to the minimal set of properties that the
+    checker uses.
+    """
+
+    def __init__(self, rawdoc, namespace):
+        self._rawdoc = rawdoc
+        self._namespace = namespace
+
+    def get_name(self):
+        return self._rawdoc.get_name()
+
+    def get_reporter_location(self):
+        return self._rawdoc.get_reporter_location()
+
+    def is_documented(self):
+        return self._rawdoc.is_documented()
+
+    def has_brief_description(self):
+        return self._rawdoc.has_brief_description()
+
+    def has_inbody_description(self):
+        return self._rawdoc.has_inbody_description()
+
+    def is_visible(self):
+        """Return whether the member is visible in Doxygen documentation.
+
+        Doxygen ignores members whose parent compounds are not documented.
+        However, when EXTRACT_ANON_NPACES=ON (which is set for our full
+        documentation), members of anonymous namespaces are extracted even if
+        the namespace is the only parent and is not documented.
+        """
+        if self._namespace and self._namespace.is_anonymous():
+            return True
+        return self._rawdoc.get_inherited_visibility() != DocType.none
+
+
 class GromacsTree(object):
 
     """Root object for navigating the GROMACS source tree.
@@ -398,8 +662,11 @@ class GromacsTree(object):
     subdirectories.  At this point, only information that is accessible from
     file names and paths only is available.
 
-    set_installed_file_list() can be called to set the list of installed
-    files.
+    load_git_attributes() can be called to load attribute information from
+    .gitattributes for all the files.
+
+    load_installed_file_list() can be called to load the list of installed
+    files from the build tree (generated by CMake).
 
     scan_files() can be called to read all the files and initialize #include
     dependencies between the files based on the information.  This is done like
@@ -408,6 +675,10 @@ class GromacsTree(object):
     (Doxygen only sees those #includes that the preprocessor sees, which
     depends on what #defines it has seen).
 
+    find_config_h_uses() can be called to find all uses of defines declared in
+    config.h.  In the current implementation, scan_files() must have been
+    called earlier.
+
     load_xml() can be called to load information from Doxygen XML data in
     the build tree (the Doxygen XML data must have been built separately).
     """
@@ -423,7 +694,32 @@ class GromacsTree(object):
         self._files = dict()
         self._modules = dict()
         self._classes = set()
+        self._namespaces = set()
+        self._members = set()
         self._walk_dir(os.path.join(self._source_root, 'src'))
+        for fileobj in self.get_files():
+            if fileobj and fileobj.is_source_file() and not fileobj.is_external():
+                (basedir, name) = os.path.split(fileobj.get_abspath())
+                (basename, ext) = os.path.splitext(name)
+                header = self.get_file(os.path.join(basedir, basename + '.h'))
+                if not header and ext == '.cu':
+                    header = self.get_file(os.path.join(basedir, basename + '.cuh'))
+                if not header and fileobj.is_test_file():
+                    basedir = os.path.dirname(basedir)
+                    header = self.get_file(os.path.join(basedir, basename + '.h'))
+                    if not header:
+                        # Somewhat of a hack; currently, the tests for
+                        # analysisdata/modules/ and trajectoryanalysis/modules/
+                        # is at the top-level tests directory.
+                        # TODO: It could be clearer to split the tests so that
+                        # there would be a separate modules/tests/.
+                        header = self.get_file(os.path.join(basedir, 'modules', basename + '.h'))
+                    if not header and basename.endswith('_tests'):
+                        header = self.get_file(os.path.join(basedir, basename[:-6] + '.h'))
+                if not header and fileobj.get_relpath().startswith('src/gromacs'):
+                    header = self._files.get(os.path.join('src/gromacs/legacyheaders', basename + '.h'))
+                if header:
+                    fileobj.set_main_header(header)
         rootdir = self._get_dir(os.path.join('src', 'gromacs'))
         for subdir in rootdir.get_subdirectories():
             self._create_module(subdir)
@@ -468,10 +764,20 @@ class GromacsTree(object):
                 elif extension == '.cmakein':
                     extension = os.path.splitext(basename)[1]
                     if extension in extensions:
+                        fullpath = os.path.join(dirpath, filename)
+                        relpath = self._get_rel_path(fullpath)
+                        sourcefile = GeneratorSourceFile(fullpath, relpath, currentdir)
+                        self._files[relpath] = sourcefile
                         fullpath = os.path.join(dirpath, basename)
                         relpath = self._get_rel_path(fullpath)
-                        fullpath = os.path.join(dirpath, filename)
-                        self._files[relpath] = GeneratedFile(fullpath, relpath, currentdir)
+                        fullpath = os.path.join(self._build_root, relpath)
+                        generatedfile = GeneratedFile(fullpath, relpath, currentdir)
+                        self._files[relpath] = generatedfile
+                        generatedfile.set_generator_source(sourcefile)
+                elif extension in ('.l', '.y', '.pre'):
+                    fullpath = os.path.join(dirpath, filename)
+                    relpath = self._get_rel_path(fullpath)
+                    self._files[relpath] = GeneratorSourceFile(fullpath, relpath, currentdir)
 
     def _create_module(self, rootdir):
         """Create module for a subdirectory."""
@@ -480,13 +786,25 @@ class GromacsTree(object):
         rootdir.set_module(moduleobj)
         self._modules[name] = moduleobj
 
-    def scan_files(self):
+    def scan_files(self, only_files=None, keep_contents=False):
         """Read source files to initialize #include dependencies."""
-        for fileobj in self._files.itervalues():
+        if only_files:
+            filelist = only_files
+        else:
+            filelist = self._files.itervalues()
+        for fileobj in filelist:
             if not fileobj.is_external():
-                fileobj.scan_contents(self)
-
-    def load_xml(self, only_files=False):
+                fileobj.scan_contents(self, keep_contents)
+                module = fileobj.get_module()
+                if module:
+                    for includedfile in fileobj.get_includes():
+                        otherfile = includedfile.get_file()
+                        if otherfile:
+                            othermodule = otherfile.get_module()
+                            if othermodule and othermodule != module:
+                                module.add_dependency(othermodule, includedfile)
+
+    def load_xml(self, only_files=None):
         """Load Doxygen XML information.
 
         If only_files is True, XML data is not loaded for code constructs, but
@@ -495,7 +813,11 @@ class GromacsTree(object):
         xmldir = os.path.join(self._build_root, 'docs', 'html', 'doxygen', 'xml')
         self._docset = xml.DocumentationSet(xmldir, self._reporter)
         if only_files:
-            self._docset.load_file_details()
+            if isinstance(only_files, collections.Iterable):
+                filelist = [x.get_abspath() for x in only_files]
+                self._docset.load_file_details(filelist)
+            else:
+                self._docset.load_file_details()
         else:
             self._docset.load_details()
             self._docset.merge_duplicates()
@@ -503,7 +825,9 @@ class GromacsTree(object):
         self._load_modules()
         self._load_files()
         if not only_files:
+            self._load_namespaces()
             self._load_classes()
+            self._load_members()
 
     def _load_dirs(self):
         """Load Doxygen XML directory information."""
@@ -546,11 +870,15 @@ class GromacsTree(object):
         """Load Doxygen XML file information."""
         for filedoc in self._docset.get_files():
             path = filedoc.get_path()
+            if not path:
+                # In case of only partially loaded file information,
+                # the path information is not set for unloaded files.
+                continue
             if not os.path.isabs(path):
                 self._reporter.xml_assert(filedoc.get_xml_path(),
                         "expected absolute path in Doxygen-produced XML file")
                 continue
-            extension = os.path.splitext(filedoc.get_path())[1]
+            extension = os.path.splitext(path)[1]
             # We don't care about Markdown files that only produce pages
             # (and fail the directory check below).
             if extension == '.md':
@@ -568,6 +896,14 @@ class GromacsTree(object):
             fileobj.set_doc_xml(filedoc, self)
             self._docmap[filedoc] = fileobj
 
+    def _load_namespaces(self):
+        """Load Doxygen XML namespace information."""
+        nsdocs = self._docset.get_namespaces()
+        for nsdoc in nsdocs:
+            nsobj = Namespace(nsdoc)
+            self._docmap[nsdoc] = nsobj
+            self._namespaces.add(nsobj)
+
     def _load_classes(self):
         """Load Doxygen XML class information."""
         classdocs = self._docset.get_classes()
@@ -577,6 +913,16 @@ class GromacsTree(object):
             self._docmap[classdoc] = classobj
             self._classes.add(classobj)
 
+    def _load_members(self):
+        """Load Doxygen XML member information."""
+        memberdocs = self._docset.get_members()
+        for memberdoc in memberdocs:
+            nsdoc = memberdoc.get_namespace()
+            nsobj = self.get_object(nsdoc)
+            memberobj = Member(memberdoc, nsobj)
+            self._docmap[memberdoc] = memberobj
+            self._members.add(memberobj)
+
     def _get_dir(self, relpath):
         """Get directory object for a path relative to source tree root."""
         return self._dirs.get(relpath)
@@ -587,28 +933,95 @@ class GromacsTree(object):
 
     def find_include_file(self, includedpath):
         """Find a file object corresponding to an include path."""
-        for testdir in ('src', 'src/gromacs/legacyheaders', 'src/external/thread_mpi/include'):
+        for testdir in ('src', 'src/external/thread_mpi/include',
+                'src/external/tng_io/include'):
             testpath = os.path.join(testdir, includedpath)
             if testpath in self._files:
                 return self._files[testpath]
 
-    def set_installed_file_list(self, installedfiles):
-        """Set list of installed files."""
-        for path in installedfiles:
-            if not os.path.isabs(path):
-                self._reporter.input_error(
-                        "installed file not specified with absolute path: {0}"
-                        .format(path))
-                continue
-            relpath = self._get_rel_path(path)
-            if relpath not in self._files:
-                self._reporter.input_error(
-                        "installed file not in source tree: {0}".format(path))
-                continue
-            self._files[relpath].set_installed()
+    def load_git_attributes(self):
+        """Load git attribute information for files."""
+        args = ['git', 'check-attr', '--stdin', 'filter']
+        git_check_attr = subprocess.Popen(args, stdin=subprocess.PIPE,
+                stdout=subprocess.PIPE, cwd=self._source_root)
+        filelist = '\n'.join(map(File.get_relpath, self._files.itervalues()))
+        filters = git_check_attr.communicate(filelist)[0]
+        for fileinfo in filters.splitlines():
+            path, dummy, value = fileinfo.split(': ')
+            fileobj = self._files.get(path)
+            assert fileobj is not None
+            fileobj.set_git_filter_attribute(value)
+
+    def find_config_h_uses(self):
+        """Find files that use defines from config.h."""
+        # Executing git grep is substantially faster than using the define_re
+        # directly on the contents of the file in Python.
+        args = ['git', 'grep', '-zwIF']
+        configfile = self._files['src/config.h.cmakein']
+        for define in configfile.get_defines():
+            args.extend(['-e', define])
+        args.extend(['--', '*.cpp', '*.c', '*.cu', '*.h', '*.cuh'])
+        define_re = r'\b(?:' + '|'.join(configfile.get_defines())+ r')\b'
+        output = subprocess.check_output(args, cwd=self._source_root)
+        for line in output.splitlines():
+            (filename, text) = line.split('\0')
+            fileobj = self._files.get(filename)
+            if fileobj is not None:
+                if fileobj.get_name() not in ('config.h', 'config.h.cmakein',
+                        'gmxpre-config.h', 'gmxpre-config.h.cmakein'):
+                    defines = re.findall(define_re, text)
+                    fileobj.add_used_config_h_defines(defines)
+
+    def load_installed_file_list(self):
+        """Load list of installed files from the build tree."""
+        listpath = os.path.join(self._build_root, 'src', 'gromacs', 'installed-headers.txt')
+        with open(listpath, 'r') as installedfp:
+            for line in installedfp:
+                path = line.strip()
+                if not os.path.isabs(path):
+                    self._reporter.input_error(
+                            "installed file not specified with absolute path: {0}"
+                            .format(path))
+                    continue
+                relpath = self._get_rel_path(path)
+                if relpath not in self._files:
+                    self._reporter.input_error(
+                            "installed file not in source tree: {0}".format(path))
+                    continue
+                self._files[relpath].set_installed()
+
+    def load_cycle_suppression_list(self, filename):
+        """Load a list of edges to suppress in cycles.
+
+        These edges between modules, if present, will be marked in the
+        corresponding ModuleDependency objects.
+        """
+        with open(filename, 'r') as fp:
+            for line in fp:
+                line = line.strip()
+                if not line or line.startswith('#'):
+                    continue
+                modulenames = ['module_' + x.strip() for x in line.split('->')]
+                if len(modulenames) != 2:
+                    self._reporter.input_error(
+                            "invalid cycle suppression line: {0}".format(line))
+                    continue
+                firstmodule = self._modules.get(modulenames[0])
+                secondmodule = self._modules.get(modulenames[1])
+                if not firstmodule or not secondmodule:
+                    self._reporter.input_error(
+                            "unknown modules mentioned on cycle suppression line: {0}".format(line))
+                    continue
+                for dep in firstmodule.get_dependencies():
+                    if dep.get_other_module() == secondmodule:
+                        # TODO: Check that each suppression is actually part of
+                        # a cycle.
+                        dep.set_cycle_suppression()
 
     def get_object(self, docobj):
         """Get tree object for a Doxygen XML object."""
+        if docobj is None:
+            return None
         return self._docmap.get(docobj)
 
     def get_files(self):
@@ -625,5 +1038,4 @@ class GromacsTree(object):
 
     def get_members(self):
         """Get iterable for all members (in Doxygen terms) in the source tree."""
-        # TODO: Add wrappers to solve some issues.
-        return self._docset.get_members()
+        return self._members
index 47f1f70be8ce9c08c429e9ac3cb03353c265ff69..1df4fd9a33ecaac2d202705f3578ec1d77a9826e 100755 (executable)
@@ -2,7 +2,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,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.
@@ -97,8 +97,9 @@ EdgeType.public = EdgeType(4)
 # Intramodule dependency
 EdgeType.intramodule = EdgeType(5)
 EdgeType.legacy = EdgeType(6)
+EdgeType.cyclic = EdgeType(7)
 # Invalid dependency
-EdgeType.undocumented = EdgeType(7)
+EdgeType.undocumented = EdgeType(8)
 
 class Edge(object):
 
@@ -123,12 +124,14 @@ class Edge(object):
 
     def format(self):
         """Format this edge for 'dot'."""
+        # If you change these styles, update also the legend in modulegraph.md
         if self._fromnode.is_file_node() and self._tonode.is_file_node():
             properties = ''
         elif self._edgetype == EdgeType.intramodule:
             properties = ''
         elif self._edgetype == EdgeType.test:
-            properties = 'color=".33 .8 .8", style=dashed'
+            # TODO: Consider if only some test edges should be made non-constraints
+            properties = 'color=".33 .8 .8", style=dashed, constraint=no'
         elif self._edgetype == EdgeType.libimpl:
             properties = 'color=".66 .8 .8", style=dashed'
         elif self._edgetype == EdgeType.pubimpl:
@@ -139,6 +142,8 @@ class Edge(object):
             properties = 'color=black'
         elif self._edgetype == EdgeType.legacy:
             properties = 'color=grey75'
+        elif self._edgetype == EdgeType.cyclic:
+            properties = 'color=red, constraint=no'
         else: # undocumented
             properties = 'color=red'
         return '{0} -> {1} [{2}]'.format(self._fromnode.get_nodename(),
@@ -336,49 +341,57 @@ class GraphBuilder(object):
         filenodes[fileobj] = node
         return node
 
-    def _create_file_edge(self, fromfile, tofile, filenodes):
-        """Create edge between two file objects.
+    def _get_file_edge_type(self, fromfile, tofile):
+        """Get EdgeType for an edge between two file objects.
 
         Determines the type for the edge from the information provided by
         gmxtree.
         """
         intramodule = (fromfile.get_module() == tofile.get_module())
-        is_legacy = not tofile.get_module().is_documented()
+        is_legacy = not tofile.api_type_is_reliable()
         if fromfile.get_module() == tofile.get_module():
-            edgetype = EdgeType.intramodule
-        elif tofile.get_api_type() == DocType.internal:
+            return EdgeType.intramodule
+        elif tofile.get_api_type() == DocType.internal and not tofile.is_public():
             if is_legacy:
-                edgetype = EdgeType.legacy
+                return EdgeType.legacy
             else:
-                edgetype = EdgeType.undocumented
+                return EdgeType.undocumented
         elif fromfile.is_test_file():
-            edgetype = EdgeType.test
+            return EdgeType.test
         elif tofile.is_test_file():
-            edgetype = EdgeType.undocumented
-        elif fromfile.is_source_file() or \
-                (fromfile.get_api_type() <= DocType.internal and \
-                not fromfile.is_installed()):
-            if tofile.get_api_type() == DocType.public:
-                edgetype = EdgeType.pubimpl
+            return EdgeType.undocumented
+        elif fromfile.is_module_internal():
+            if tofile.is_public():
+                return EdgeType.pubimpl
             elif tofile.get_api_type() == DocType.library:
-                edgetype = EdgeType.libimpl
-            elif is_legacy or not tofile.is_documented():
-                edgetype = EdgeType.legacy
+                return EdgeType.libimpl
+            elif is_legacy:
+                return EdgeType.legacy
+            elif not tofile.is_documented():
+                return EdgeType.undocumented
             else:
                 raise ValueError('Unknown edge type between {0} and {1}'
-                        .format(fromfile.path, tofile.path))
+                        .format(fromfile.get_relpath(), tofile.get_relpath()))
         elif fromfile.get_api_type() == DocType.library:
-            edgetype = EdgeType.library
-        elif fromfile.get_api_type() == DocType.public or fromfile.is_installed():
-            if tofile.get_api_type() == DocType.public or \
-                    tofile.get_documentation_type() == DocType.public or \
-                    (tofile.is_installed() and not tofile.is_documented()):
-                edgetype = EdgeType.public
+            return EdgeType.library
+        elif fromfile.is_public() or fromfile.is_installed():
+            if tofile.is_public() or tofile.is_installed():
+                return EdgeType.public
             else:
-                edgetype = EdgeType.undocumented
+                return EdgeType.undocumented
+        elif is_legacy:
+            return EdgeType.legacy
         else:
             raise ValueError('Unknown edge type between {0} and {1}'
-                    .format(fromfile.path, tofile.path))
+                    .format(fromfile.get_relpath(), tofile.get_relpath()))
+
+    def _create_file_edge(self, fromfile, tofile, filenodes):
+        """Create edge between two file objects.
+
+        Determines the type for the edge from the information provided by
+        gmxtree.
+        """
+        edgetype = self._get_file_edge_type(fromfile, tofile)
         return Edge(filenodes[fromfile], filenodes[tofile], edgetype)
 
     def _create_file_edges(self, filenodes):
@@ -397,28 +410,32 @@ class GraphBuilder(object):
                     edges.append(edge)
         return edges
 
-    def _create_module_node(self, module, filenodes):
-        """Create node for a module.
-
-        The created node will have all files in the module as its child nodes.
-        All created file nodes are added to the filenodes dict.
-        """
+    def _get_module_color(self, modulegroup):
+        # If you change these styles, update also the legend in modulegraph.md
+        if modulegroup == 'legacy':
+            return 'fillcolor=grey75'
+        elif modulegroup == 'analysismodules':
+            return 'fillcolor="0 .2 1"'
+        elif modulegroup == 'utilitymodules':
+            return 'fillcolor=".08 .2 1"'
+        elif modulegroup == 'mdrun':
+            return 'fillcolor=".75 .2 1"'
+        return None
+
+    def _create_module_node(self, module):
+        """Create node for a module."""
         style = []
         properties = []
         properties.append('shape=ellipse')
-        properties.append('URL="\\ref module_{0}"'.format(module.get_name()))
+        if module.is_documented():
+            properties.append('URL="\\ref {0}"'.format(module.get_name()))
         if not module.is_documented():
+            fillcolor = self._get_module_color('legacy')
+        else:
+            fillcolor = self._get_module_color(module.get_group())
+        if fillcolor:
             style.append('filled')
-            properties.append('fillcolor=grey75')
-        elif module.get_group() == 'analysismodules':
-            style.append('filled')
-            properties.append('fillcolor="0 .2 1"')
-        elif module.get_group() == 'utilitymodules':
-            style.append('filled')
-            properties.append('fillcolor=".08 .2 1"')
-        elif module.get_group() == 'mdrun':
-            style.append('filled')
-            properties.append('fillcolor=".75 .2 1"')
+            properties.append(fillcolor)
         rootdir = module.get_root_dir()
         if rootdir.has_installed_files():
             properties.append('color=".66 .5 1"')
@@ -426,28 +443,45 @@ class GraphBuilder(object):
         nodename = 'module_' + re.subn(r'[-./]', '_', rootdir.get_relpath())[0]
         label = module.get_name()[7:]
         node = Node(nodename, label, style, properties)
-        for childfile in module.get_files():
-            node.add_child(self._create_file_node(childfile, filenodes))
         return node
 
+    def _create_module_edges(self, modulenodes):
+        """Create edges between all module nodes.
+
+        Create edges between module nodes specified in modulenodes from all
+        include dependencies.  An edge is created only if both ends of the
+        dependency are in the list of nodes.
+        """
+        edges = []
+        for moduleobj in modulenodes.iterkeys():
+            for dep in moduleobj.get_dependencies():
+                othermodule = dep.get_other_module()
+                if othermodule and othermodule in modulenodes:
+                    if dep.is_cycle_suppressed():
+                        edgetype = EdgeType.cyclic
+                    else:
+                        edgetype = max([
+                            self._get_file_edge_type(x.get_including_file(), x.get_file())
+                            for x in dep.get_included_files()])
+                    edge = Edge(modulenodes[moduleobj], modulenodes[othermodule], edgetype)
+                    edges.append(edge)
+        return edges
+
     def create_modules_graph(self):
         """Create module dependency graph."""
-        filenodes = dict()
         nodes = []
-        modulenodes = []
+        modulenodes = dict()
         libgromacsnode = Node('libgromacs', 'libgromacs')
         nodes.append(libgromacsnode)
         for moduleobj in self._tree.get_modules():
-            node = self._create_module_node(moduleobj, filenodes)
+            node = self._create_module_node(moduleobj)
             if moduleobj.get_root_dir().get_relpath().startswith('src/gromacs'):
                 libgromacsnode.add_child(node)
             else:
                 nodes.append(node)
-            modulenodes.append(node)
-        edges = self._create_file_edges(filenodes)
+            modulenodes[moduleobj] = node
+        edges = self._create_module_edges(modulenodes)
         graph = Graph(nodes, edges)
-        for node in modulenodes:
-            graph.collapse_node(node)
         graph.set_options(concentrate=False)
         return graph
 
@@ -477,29 +511,25 @@ def main():
                       help='Source tree root directory')
     parser.add_option('-B', '--build-root',
                       help='Build tree root directory')
-    parser.add_option('--installed',
-                      help='Read list of installed files from given file')
+    parser.add_option('--ignore-cycles',
+                      help='Set file with module dependencies to ignore in cycles')
     parser.add_option('-o', '--outdir', default='.',
                       help='Specify output directory for graphs')
     parser.add_option('-q', '--quiet', action='store_true',
                       help='Do not write status messages')
     options, args = parser.parse_args()
 
-    installedlist = []
-    if options.installed:
-        with open(options.installed, 'r') as outfile:
-            for line in outfile:
-                installedlist.append(line.strip())
-
     reporter = Reporter(quiet=True)
 
     if not options.quiet:
         sys.stderr.write('Scanning source tree...\n')
     tree = GromacsTree(options.source_root, options.build_root, reporter)
-    tree.set_installed_file_list(installedlist)
+    tree.load_installed_file_list()
     if not options.quiet:
         sys.stderr.write('Reading source files...\n')
     tree.scan_files()
+    if options.ignore_cycles:
+        tree.load_cycle_suppression_list(options.ignore_cycles)
     if not options.quiet:
         sys.stderr.write('Reading Doxygen XML files...\n')
     tree.load_xml(only_files=True)
diff --git a/docs/doxygen/includesorter.py b/docs/doxygen/includesorter.py
new file mode 100755 (executable)
index 0000000..7e07864
--- /dev/null
@@ -0,0 +1,380 @@
+#!/usr/bin/python
+#
+# 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.
+
+"""Include directive sorter for GROMACS.
+
+This module implements an #include directive sorter for GROMACS C/C++ files.
+It allows (in most cases) automatically sorting includes and formatting
+the paths to use either relative paths or paths relative to src/.
+It groups includes in groups of related headers, sorts the headers
+alphabetically within each block, and inserts empty lines in between.
+It can be run as a standalone script, in which case it requires an up-to-date
+list of installed headers and Doxygen XML documentation to be present in the
+build tree.  It can also be imported as a module to be embedded in other
+scripts.  In the latter case, the IncludeSorter provides the main interface.
+
+The sorting assumes some conventions (e.g., that system headers are included
+with angle brackets instead of quotes).  Generally, these conventions are
+checked by the check-source.py script.
+"""
+
+import os.path
+import re
+import sys
+
+class IncludeGroup(object):
+
+    """Enumeration type for grouping includes."""
+
+    def __init__(self, value):
+        """Initialize a IncludeGroup instance.
+
+        IncludeGroup.{main,system_c,...} should be used outside the
+        class instead of calling the constructor.
+        """
+        self._value = value
+
+    def __cmp__(self, other):
+        """Order include groups in the desired order."""
+        return cmp(self._value, other._value)
+
+# gmxpre.h is always first
+IncludeGroup.pre = IncludeGroup(0)
+# "main" include file for the source file is next
+IncludeGroup.main = IncludeGroup(1)
+# config.h is next, if present, to keep its location consistent
+IncludeGroup.config = IncludeGroup(2)
+# Followed by system headers, with C first and C++ following
+IncludeGroup.system_c = IncludeGroup(3)
+IncludeGroup.system_c_cpp = IncludeGroup(4)
+IncludeGroup.system_cpp = IncludeGroup(5)
+# System headers not in standard C/C++ are in a separate block
+IncludeGroup.system_other = IncludeGroup(6)
+# src/external/ contents that are included with quotes go here
+IncludeGroup.nonsystem_other = IncludeGroup(7)
+# Other GROMACS headers
+IncludeGroup.gmx_general = IncludeGroup(8)
+# This group is for shared (unit) testing utilities
+IncludeGroup.gmx_test = IncludeGroup(9)
+# This group is for headers local to the including file/module
+IncludeGroup.gmx_local = IncludeGroup(10)
+
+class GroupedSorter(object):
+
+    """Grouping and formatting logic for #include directives.
+
+    This class implements the actual logic that decides how includes are
+    grouped and sorted, and how they are formatted."""
+
+    # These variables contain the list of system headers for various blocks
+    _std_c_headers = ['assert.h', 'ctype.h', 'errno.h', 'float.h',
+            'inttypes.h', 'limits.h', 'math.h', 'signal.h', 'stdarg.h',
+            'stddef.h', 'stdint.h', 'stdio.h', 'stdlib.h', 'string.h',
+            'time.h']
+    _std_c_cpp_headers = ['c' + x[:-2] for x in _std_c_headers]
+    _std_cpp_headers = ['algorithm', 'deque', 'exception', 'fstream',
+            'iomanip', 'ios', 'iosfwd', 'iostream', 'istream', 'iterator',
+            'limits', 'list', 'map', 'memory', 'new', 'numeric', 'ostream',
+            'regex', 'set', 'sstream', 'stdexcept', 'streambuf', 'string', 'strstream',
+            'typeinfo', 'vector', 'utility']
+
+    def __init__(self, style='pub-priv', absolute=False):
+        """Initialize a sorted with the given style."""
+        if style == 'single-group':
+            self._local_group = 'none'
+        elif style == 'pub-priv':
+            self._local_group = 'private'
+        else:
+            self._local_group = 'local'
+        if absolute:
+            self._abspath_main = True
+            self._abspath_local = True
+        else:
+            self._abspath_main = False
+            self._abspath_local = False
+
+    def _get_path(self, included_file, group, including_file):
+        """Compute include path to use for an #include.
+
+        The path is made either absolute (i.e., relative to src/), or
+        relative to the location of the including file, depending on the group
+        the file is in.
+        """
+        use_abspath = including_file is None or group is None
+        if not use_abspath:
+            if group in (IncludeGroup.gmx_general, IncludeGroup.gmx_test):
+                use_abspath = True
+            elif group == IncludeGroup.main and self._abspath_main:
+                use_abspath = True
+            elif group == IncludeGroup.gmx_local and self._abspath_local:
+                use_abspath = True
+        if not use_abspath:
+            fromdir = os.path.dirname(including_file.get_abspath())
+            relpath = os.path.relpath(included_file.get_abspath(), fromdir)
+            if not relpath.startswith('..'):
+                return relpath
+        path = included_file.get_relpath()
+        assert path.startswith('src/')
+        return path[4:]
+
+    def _get_gmx_group(self, including_file, included_file):
+        """Determine group for GROMACS headers.
+
+        Helper function to determine the group for an #include directive
+        when the #include is in one of the gmx_* groups (or in the main group).
+        """
+        main_header = including_file.get_main_header()
+        if main_header and main_header == included_file:
+            return IncludeGroup.main
+        if included_file.get_directory().get_name() == 'testutils':
+            return IncludeGroup.gmx_test
+        if including_file.get_directory().contains(included_file):
+            if self._local_group == 'local':
+                return IncludeGroup.gmx_local
+            if self._local_group == 'private':
+                if included_file.api_type_is_reliable() \
+                        and included_file.is_module_internal():
+                    return IncludeGroup.gmx_local
+                if not included_file.api_type_is_reliable() \
+                        and including_file.get_relpath().startswith('src/programs'):
+                    return IncludeGroup.gmx_local
+        if included_file.is_test_file():
+            return IncludeGroup.gmx_test
+        return IncludeGroup.gmx_general
+
+    def get_sortable_object(self, include):
+        """Produce a sortable, opaque object for an include.
+
+        Includes are sorted by calling this function for each #include object,
+        and sorting the list made up of these objects (using the default
+        comparison operators).  Each element from the sorted list is then
+        passed to format_include(), which extracts information from the opaque
+        object and formats the #include directive for output.
+        """
+        included_file = include.get_file()
+        if not included_file:
+            path = include.get_included_path()
+            if path in self._std_c_headers:
+                group = IncludeGroup.system_c
+            elif path in self._std_c_cpp_headers:
+                group = IncludeGroup.system_c_cpp
+            elif path in self._std_cpp_headers:
+                group = IncludeGroup.system_cpp
+            else:
+                group = IncludeGroup.system_other
+        elif included_file.is_external():
+            group = IncludeGroup.nonsystem_other
+            if 'external/' in include.get_included_path():
+                path = self._get_path(included_file, group, None)
+            else:
+                path = include.get_included_path()
+        elif included_file.get_name() == 'gmxpre.h':
+            group = IncludeGroup.pre
+            path = self._get_path(included_file, group, None)
+        elif included_file.get_name() == 'config.h':
+            group = IncludeGroup.config
+            path = self._get_path(included_file, group, None)
+        else:
+            including_file = include.get_including_file()
+            group = self._get_gmx_group(including_file, included_file)
+            path = self._get_path(included_file, group, including_file)
+        return (group, os.path.split(path), include)
+
+    def format_include(self, obj, prev):
+        """Format an #include directive after sorting."""
+        result = []
+        if prev:
+            if prev[0] != obj[0]:
+                # Print empty line between groups
+                result.append('\n')
+            elif prev[1] == obj[1]:
+                # Skip duplicates
+                return result
+        include = obj[2]
+        line = include.get_full_line()
+        include_re = r'^(?P<head>\s*#\s*include\s+)["<][^">]*[">](?P<tail>.*)$'
+        match = re.match(include_re, line)
+        assert match
+        if include.is_system():
+            path = '<{0}>'.format(os.path.join(obj[1][0], obj[1][1]))
+        else:
+            path = '"{0}"'.format(os.path.join(obj[1][0], obj[1][1]))
+        result.append('{0}{1}{2}\n'.format(match.group('head'), path, match.group('tail')))
+        return result
+
+class IncludeSorter(object):
+
+    """High-level logic for sorting includes.
+
+    This class contains the high-level logic for sorting include statements.
+    The actual ordering and formatting the includes is delegated to a sort method
+    (see GroupedSorter) to keep things separated.
+    """
+
+    def __init__(self, sortmethod=None, quiet=True):
+        """Initialize the include sorter with the given sorter and options."""
+        if not sortmethod:
+            sortmethod = GroupedSorter()
+        self._sortmethod = sortmethod
+        self._quiet = quiet
+        self._changed = False
+
+    def _sort_include_block(self, block, lines):
+        """Sort a single include block.
+
+        Returns a new list of lines for the block.
+        If anything is changed, self._changed is set to True, and the caller
+        can check that."""
+        includes = map(self._sortmethod.get_sortable_object, block.get_includes())
+        includes.sort()
+        result = []
+        prev = None
+        current_line_number = block.get_first_line()-1
+        for include in includes:
+            newlines = self._sortmethod.format_include(include, prev)
+            result.extend(newlines)
+            if not self._changed:
+                for offset, newline in enumerate(newlines):
+                    if lines[current_line_number + offset] != newline:
+                        self._changed = True
+                        break
+                current_line_number += len(newlines)
+            prev = include
+        return result
+
+    def sort_includes(self, fileobj):
+        """Sort all includes in a file."""
+        lines = fileobj.get_contents()
+        # Format into a list first:
+        #  - avoid bugs or issues in the script truncating the file
+        #  - can check whether anything was changed before touching the file
+        newlines = []
+        prev = 0
+        self._changed = False
+        for block in fileobj.get_include_blocks():
+            newlines.extend(lines[prev:block.get_first_line()-1])
+            newlines.extend(self._sort_include_block(block, lines))
+            # The returned values are 1-based, but indexing here is 0-based,
+            # so an explicit +1 is not needed.
+            prev = block.get_last_line()
+        if self._changed:
+            if not self._quiet:
+                sys.stderr.write('{0}: includes reformatted\n'.format(fileobj.get_relpath()))
+            newlines.extend(lines[prev:])
+            with open(fileobj.get_abspath(), 'w') as fp:
+                fp.write(''.join(newlines))
+
+    def check_sorted(self, fileobj):
+        """Check that includes within a file are sorted."""
+        # TODO: Make the checking work without full contents of the file
+        lines = fileobj.get_contents()
+        self._changed = False
+        for block in fileobj.get_include_blocks():
+            self._sort_include_block(block, lines)
+        return not self._changed
+
+def main():
+    """Run the include sorter script."""
+    import os
+    import sys
+
+    from optparse import OptionParser
+
+    from gmxtree import GromacsTree
+    from reporter import Reporter
+
+    parser = OptionParser()
+    parser.add_option('-S', '--source-root',
+                      help='Source tree root directory')
+    parser.add_option('-B', '--build-root',
+                      help='Build tree root directory')
+    parser.add_option('-F', '--files',
+                      help='Specify files to sort')
+    parser.add_option('-q', '--quiet', action='store_true',
+                      help='Do not write status messages')
+    # This is for evaluating different options; can be removed from the final
+    # version.
+    parser.add_option('-s', '--style', type='choice', default='pub-priv',
+                      choices=('single-group', 'pub-priv', 'pub-local'),
+                      help='Style for Gromacs includes')
+    parser.add_option('--absolute', action='store_true',
+                      help='Write all include paths relative to src/')
+    options, args = parser.parse_args()
+
+    filelist = args
+    if options.files:
+        if options.files == '-':
+            lines = sys.stdin.readlines()
+        else:
+            with open(options.files, 'r') as fp:
+                lines = fp.readlines()
+        filelist.extend([x.strip() for x in lines])
+
+    reporter = Reporter(quiet=True)
+
+    if not options.quiet:
+        sys.stderr.write('Scanning source tree...\n')
+    tree = GromacsTree(options.source_root, options.build_root, reporter)
+    tree.load_installed_file_list()
+    files = []
+    for filename in filelist:
+        fileobj = tree.get_file(os.path.abspath(filename))
+        if not fileobj:
+            sys.stderr.write('warning: ignoring unknown file {0}\n'.format(filename))
+            continue
+        files.append(fileobj)
+    if not options.quiet:
+        sys.stderr.write('Reading source files...\n')
+    tree.scan_files(only_files=files, keep_contents=True)
+    extfiles = set(files)
+    for fileobj in files:
+        for included_file in fileobj.get_includes():
+            other_file = included_file.get_file()
+            if other_file:
+                extfiles.add(other_file)
+    if not options.quiet:
+        sys.stderr.write('Reading Doxygen XML files...\n')
+    tree.load_xml(only_files=extfiles)
+
+    if not options.quiet:
+        sys.stderr.write('Sorting includes...\n')
+
+    sorter = IncludeSorter(GroupedSorter(options.style, options.absolute), options.quiet)
+
+    for fileobj in files:
+        sorter.sort_includes(fileobj)
+
+if __name__ == '__main__':
+    main()
similarity index 74%
rename from docs/doxygen/doxygen.md
rename to docs/doxygen/lib/doxygen.md
index 854989caecc00c4e660cd447c8ee5ad767ab9d42..1f563c0058cd8a941e0a1f34684f7d194b29585c 100644 (file)
@@ -22,6 +22,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
 documentation:
 
@@ -88,11 +89,11 @@ 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
-`doc-user`, `doc-lib`, and `doc-full` 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 `doc-all` target builds all three
-targets with less typing.
+`doxygen-user`, `doxygen-lib`, and `doxygen-full` 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
@@ -111,7 +112,7 @@ documentation without these tools, but you will see some errors and the related
 figures will be missing from the documentation.
 
 
-General guidelines for Doxygen markup
+General guidelines for Doxygen markup {#section_doxygen_guidelines}
 =====================================
 
 Doxygen provides quite a few different alternative styles for documenting the
@@ -182,6 +183,9 @@ This section introduces \Gromacs specific constructs currently used in Doxygen
 documentation, as well as how \Gromacs uses Doxygen groups to organize the
 documentation.
 
+Some consistency checks are done automatically using custom scripts.
+See \ref page_dev_gmxtree for details.
+
 Controlling documentation visibility
 ------------------------------------
 
@@ -258,173 +262,6 @@ Note that functions, enumerations, and other entities that do not have a
 separate page in the generated documentation can only belong to one group;
 in such a case, the module group is preferred over the API group.
 
-Automatic dependency checking
------------------------------
-
-The build system provides a `doc-check` target that automatically checks some
-aspects of the documentation, as well as checking that header files are
-actually used according to their API specifications (i.e., an internal headers
-are not included from other modules).  The checks depend on correct usage of
-the commands listed above, in particular the visibility and API definitions in
-file-level comments.  These checks also provide some level of enforcement for
-rules about dependencies between the modules, but currently the checks are not
-run automatically.
-
-The checker currently checks for a few different types of issues:
-* For all Doxygen documentation (currently does not apply for members within
-  anonymous namespaces or members that do not appear in the documentation):
-   * If a member has documentation, it should have a brief description.
-   * A note is issued for in-body documentation for functions, since this is
-     ignored by our current settings.
-   * If a class has documentation, it should have public documentation only if
-     it appears in an installed header.
-   * If a class and its containing file has documentation, the class
-     documentation should not be visible if the file documentation is not.
-* For all files:
-   * Consistent usage of
-
-         #include "..." // This should be used for Gromacs headers
-
-     and
-
-         #include <...> // This should be used for system and external headers
-
-   * Installed headers must not include non-installed headers, and must include
-     all other \Gromacs headers using relative paths so that they resolve
-     correctly also when installed.
-* For documented files:
-   * Installed headers should have public documentation, and other files should
-     not.
-   * The API level specified for a file should not be higher than where its
-     documentation is visible.  For example, only publicly documented headers
-     should be specified as part of the public API.
-   * If an \c \\ingroup module_foo exists, it should match the subdirectory
-     that the file is actually part of in the file system.
-   * If a \c \\defgroup module_foo exists for the subdirectory where the file is,
-     the file should contain \c \\ingroup module_foo.
-   * Files should not include other files whose documentation visibility is
-     lower (if the included file is not documented, the check is skipped).
-* For files that are part of documented modules
-  (\c \\defgroup module_foo exists for the subdirectory):
-   * Such files should not be included from outside their module if they are
-     undocumented or are not specified as part of library or public API.
-
-The checker is based on extracting the Doxygen documentation in XML format.
-This information is then read using a Python script, and combined with
-information extracted from the file system and knowledge about the \Gromacs
-source tree layout.  The Python scripts are in the `doxygen/` folder.
-In addition to printing the issues, they are also written into
-`doxygen/doxygen-check.log` for later inspection.
-
-The script is not currently perfect (either because of unfinished
-implementation, or because Doxygen bugs or incompleteness of the Doxygen XML
-output), and the current code also contains issues that the script detects, but
-the authors have not fixed.  To allow the script to still be used,
-`doxygen/suppressions.txt` contains a list of issues that are filtered out from
-the report.  The syntax is simple:
-
-    <file>: <text>
-
-where `<file>` is a path to the file that reports the message, and `<text>` is
-the text reported.  Both support `*` as a wildcard.  If `<file>` is empty, the
-suppression matches only messages that do not have an associated file.
-`<file>` is matched against the trailing portion of the file name to make it
-work even though the script reports absolute paths.
-Empty lines and lines starting with `#` are ignored.
-
-To add suppression for an issue, the line that reports the issue can be copied
-into `suppressions.txt`, and the line number (if any) removed.  If the
-issue does not have a file name (or a pseudo-file) associated, a leading `:`
-must be added.  To cover many similar issues, parts of the line can then be
-replaced with wildcards.
-
-For some false positives from the script, the suppression mechanism is the
-easiest way to silence the script, but otherwise the goal would be to minimize
-the number of suppressions.
-
-As a side effect, the XML extraction makes Doxygen parse all comments in the
-code, even if they do not appear in the documentation.  This can reveal latent
-issues in the comments, like invalid Doxygen syntax.  The messages from the XML
-parsing are stored in `docs/doxygen/doxygen-xml.log` in the build tree, similar to
-other Doxygen runs.
-
-The `doc-check` target requires Python 2.7 (other versions may work, but have
-not been tested).
-
-Include dependency graphs
--------------------------
-
-The build system also provides an `dep-graphs` target that generates include
-dependency graphs with some additional annotations.
-One graph is produced that shows all the modules under `src/gromacs/`, and
-their include dependencies.  Additionally, a file-level graph is produced for
-each module, showing the include dependencies within that module.  Currently,
-these are mostly for eye candy, but they can also be used for analyzing
-problematic dependencies to clean up the architecture.
-The output is put in `doxygen/depgraphs/` in the build tree.
-
-As with `doc-check`, Python 2.7 is required (other versions may work, but have
-not been tested).  To get `.png` versions of the graphs, `graphviz` is
-additionally required.
-
-### Module graph ###
-
-The graph is written into `module-deps.dot.png`.
-
-Node colors:
-<dl>
-<dt>gray background</dt>
-<dd>undocumented module</dd>
-<dt>orange background</dt>
-<dd>documented utility modules</dd>
-<dt>red background</dt>
-<dd>documented analysis modules</dd>
-<dt>violet background</dt>
-<dd>documented MD execution modules</dd>
-<dt>light blue border</dt>
-<dd>module contains public API (installed) headers</dd>
-</dl>
-
-Edge colors (an edge with a certain color indicates that types above it in the
-list are not present):
-<dl>
-<dt>red</dt>
-<dd>invalid dependency</dd>
-<dt>gray</dt>
-<dd>legacy dependency
-(dependency on undocumented file, or to undocumented directories)</dd>
-<dt>solid black</dt>
-<dd>public header depends on the other module</dd>
-<dt>solid blue</dt>
-<dd>library header depends on the other module</dd>
-<dt>dashed blue</dt>
-<dd>source file depends on library header in the other module</dd>
-<dt>dashed black</dt>
-<dd>source file depends on public header in the other module</dd>
-<dt>dashed green</dt>
-<dd>test file depends on the other module</dd>
-</dl>
-
-### File graph ###
-
-The graphs are written to <em>module_name</em>`-deps.dot.png`.
-
-Node colors:
-<dl>
-<dt>light blue</dt>
-<dd>public API (installed) headers</dd>
-<dt>dark blue</dt>
-<dd>library API headers</dd>
-<dt>gray</dt>
-<dd>source files</dd>
-<dt>light green</dt>
-<dd>test files</dd>
-<dt>white</dt>
-<dd>other files</dd>
-</dl>
-
-Each edge signifies an include dependency; there is no additional information
-currently included.
 
 Documenting specific code constructs
 ====================================
@@ -447,10 +284,11 @@ placed in the page hierarchy by making it a subpage of another page, i.e., it
 should be referenced once using \c \\subpage.  `mainpage.md` is the root of the
 hierarchy.
 
-If you need to exclude a page from the public API docs, you need to add it to
-an exclude list in `Doxyfile-user.cmakein`, and ensure that there are no
-references to the page from public API documentation.  \c \\if `libapi` can be
-used to add references in content that is otherwise public.
+There are two subdirectories, `user/` and `lib/`, determining the highest
+documentation level where the page appears.  If you add pages to `lib/`, ensure
+that there are no references to the page from public API documentation.
+\c \\if `libapi` can be used to add references in content that is otherwise
+public.
 Generally, the pages should be on a high enough level and provide overview
 content that is useful enough such that it is not necessary to exclude them
 from the library API documentation.
diff --git a/docs/doxygen/lib/modulegraph.md b/docs/doxygen/lib/modulegraph.md
new file mode 100644 (file)
index 0000000..5467bed
--- /dev/null
@@ -0,0 +1,89 @@
+Module dependency graph {#page_modulegraph}
+=======================
+
+The graph below shows the dependencies between the source code modules,
+computed from include statements in the code.
+For documented modules (those that do not have a gray background), clicking on
+the module takes you to the module documentation.
+Legend for the graph can be found below the graph.
+
+\ifnot xml
+\dotfile module-deps.dot
+\endif
+
+Legend
+======
+
+The graph below annotates the colors and line styles used in the module
+dependency graph above.  More detailed textual annotation is below the graph.
+
+\dot
+digraph legend {
+    node [fontname="FreeSans",fontsize=10,height=.2,shape=box]
+    edge [fontname="FreeSans",fontsize=10]
+    rankdir = "LR"
+    subgraph cluster_nodes {
+        label = "Nodes"
+        legacy    [label="undocumented", fillcolor=grey75, style="filled"]
+        analysis  [label="analysis", fillcolor="0 .2 1", style="filled"]
+        utility   [label="utility", fillcolor=".08 .2 1", style="filled"]
+        mdrun     [label="mdrun", fillcolor=".75 .2 1", style="filled"]
+        installed [label="installed", color=".66 .5 1", penwidth=3]
+    }
+    subgraph cluster_edges {
+        label = "Edges"
+        node [label="<any>"]
+        invalid1 -> invalid2 [label="invalid", color=red]
+        legacy1 -> legacy2 [label="legacy", color=grey75]
+        legacy2 [label="undoc"]
+        public1 -> public2 [label="public", color=black]
+        public1 [label="public"]
+        public2 [label="public"]
+        library1 -> library2 [label="library", color=".66 .8 .8"]
+        library1 [label="library"]
+        pubimpl1 -> pubimpl2 [color=black, style=dashed]
+        pubimpl1 [label="internal"]
+        pubimpl2 [label="public"]
+        libimpl1 -> libimpl2 [color=".66 .8 .8", style=dashed]
+        libimpl1 [label="internal"]
+        libimpl2 [label="library"]
+        test1 -> test2 [label="test", color=".33 .8 .8", style=dashed]
+        test1 [label="test"]
+    }
+    legacy -> invalid1 [style="invis"]
+}
+\enddot
+
+Node colors:
+<dl>
+<dt>gray background</dt>
+<dd>undocumented module</dd>
+<dt>orange background</dt>
+<dd>documented utility modules</dd>
+<dt>red background</dt>
+<dd>documented analysis modules</dd>
+<dt>violet background</dt>
+<dd>documented MD execution modules</dd>
+<dt>light blue border</dt>
+<dd>module contains public API (installed) headers</dd>
+</dl>
+
+Edge colors (an edge with a certain color indicates that types above it in the
+list are not present):
+<dl>
+<dt>red</dt>
+<dd>invalid dependency</dd>
+<dt>gray</dt>
+<dd>legacy dependency
+(dependency on undocumented file, or to undocumented directories)</dd>
+<dt>solid black</dt>
+<dd>public header depends on the other module</dd>
+<dt>solid blue</dt>
+<dd>library header depends on the other module</dd>
+<dt>dashed blue</dt>
+<dd>source file depends on library header in the other module</dd>
+<dt>dashed black</dt>
+<dd>source file depends on public header in the other module</dd>
+<dt>dashed green</dt>
+<dd>test file depends on the other module</dd>
+</dl>
similarity index 81%
rename from docs/doxygen/wrapperbinary.md
rename to docs/doxygen/lib/wrapperbinary.md
index 52bf20e40faefcc7a528a6c1970d094a2453d381..f3c5402a47e0b748beb485864322de32c41d48dd 100644 (file)
@@ -25,32 +25,42 @@ tasks:
 The %main() method also catches all exceptions, and if one is caught, prints an
 error message and terminates the program cleanly.
 
-Command line manager
+Command line modules
+====================
+
+All modules within the wrapper binary are implemented as classes that implement
+the gmx::CommandLineModuleInterface interface.  There is generally some helper
+class in between:
+ * General C++ modules typically use gmx::Options for their command-line
+   handling.  Instead of each module implementing parsing and help separately
+   with identical code, they implement gmx::CommandLineOptionsModuleInterface
+   instead.  The framework then provides a bridge class that contains the
+   common code and wraps gmx::CommandLineOptionsModuleInterface into a
+   gmx::CommandLineModuleInterface.
+ * For C++ trajectory analysis modules, there is a general implementation for
+   running the gmx::TrajectoryAnalysisModule subclasses in cmdlinerunner.cpp.
+ * For old C-style %main() functions, see \ref section_wrapperbinary_cmain.
+
+Command line manager {#section_wrapperbinary_manager}
 ====================
 
 The core of the wrapper binary is the gmx::CommandLineModuleManager::run()
 method.  This method:
- 1. Checks whether the binary is invoked through a symlink.  If it is, it
-    searches the registered modules for names matching the name of the symlink
-    (with certain prefixes in the symlink name ignored).  If a match is found,
-    it continues as if the command was invoked as `gmx` _module_ `...`, where
-    _module_ is the name of the found module and `...` are the rest of the
-    arguments.
- 2. Parses the command line arguments before the module name as arguments to
+ 1. Parses the command line arguments before the module name as arguments to
     the wrapper binary.  Some arguments such as `-h` and `-version` cause rest
     of the command (the module name and all that follows) to be ignored.
3. If a module is specified, also checks the command line arguments after the
2. If a module is specified, also checks the command line arguments after the
     module name for the options understood by the wrapper binary, such as `-h`
     and `-version` (see below for details of how `-h` works).  Any such options
     are handled by the manager and removed from the command line for further
     processing.
4. Print the startup header (contents of which can be controlled by the
3. Print the startup header (contents of which can be controlled by the
     command line options).
5. If a command line option requests termination after the startup header
4. If a command line option requests termination after the startup header
     (such as `-version`), return.
6. Passes control to the selected module.  If there is no module specified,
5. Passes control to the selected module.  If there is no module specified,
     the help module is invoked (see below).
7. Print a quote at the end, and return the exit code from the module.
6. Print a quote at the end, and return the exit code from the module.
 
 Command line help
 -----------------
@@ -110,7 +120,7 @@ separate CMake script that is run by `make html` to add headers and footers to
 these partial HTML files.
 The final HTML help is produced in `share/html/final/`.
 
-Handling C %main() functions
+Handling C %main() functions {#section_wrapperbinary_cmain}
 ----------------------------
 
 Many pre-5.0 modules are still implemented as a function with a C %main()
index 895a34924ff97565060aeb3e0c8ba9f1b5fdfc1c..69f9b9e12ea3caf53eb04ccf62bd8d001de9a5ca 100644 (file)
@@ -36,7 +36,7 @@ A separate page describes the responsibilities of these modules:
 \ref page_analysisframework
 */
 
-/*!
+/*! \libinternal
 \defgroup group_mdrun Modules for simulation functionality
 \brief
 Modules used in running simulations with mdrun
@@ -59,3 +59,17 @@ This namespace is used to contain some implementation-specific functions and
 classes.  These are not meant for direct user access, but typically reside
 in public headers because of implementation reasons.
 */
+
+/*!
+\file share/template/template.cpp
+\brief Template code for writing analysis programs.
+
+See \ref page_analysistemplate for more information.
+ */
+
+/*!
+\example template.cpp
+\brief Template code for writing analysis programs.
+
+See \ref page_analysistemplate for more information.
+ */
index e541c54235f84f2fbf5c419f8d2e3397f49e6328..14e2bfbd88ef5bb55f806a5ceb1c90cc34b91b73 100644 (file)
@@ -165,6 +165,7 @@ class Reporter(object):
         self._messages = []
         self._filters = []
         self._quiet = quiet
+        self._had_warnings = False
 
     def _write(self, message):
         """Implement actual message writing."""
@@ -178,6 +179,7 @@ class Reporter(object):
         sys.stderr.write(wholemsg)
         if self._logfp:
             self._logfp.write(wholemsg)
+        self._had_warnings = True
 
     def _report(self, message):
         """Handle a single reporter message."""
@@ -215,6 +217,10 @@ class Reporter(object):
                 text = 'warning: unused filter: ' + filterobj.get_text()
                 self._write(Message(text))
 
+    def had_warnings(self):
+        """Return true if any warnings have been reported."""
+        return self._had_warnings
+
     def close_log(self):
         """Close the log file if one exists."""
         assert not self._messages
@@ -240,6 +246,10 @@ class Reporter(object):
         self._report(Message('warning: ' + message, details,
             location=entity.get_reporter_location()))
 
+    def cyclic_issue(self, message, details=None):
+        """Report a cyclic dependency issue."""
+        self._report(Message('warning: ' + message, details))
+
     def doc_error(self, entity, message):
         """Report an issue in documentation."""
         self._report(Message('error: ' + entity.get_name() + ': ' + message,
index 592505a9621365d18c49fe914f035d8ae78291a4..71d9f29d23e6ac0dedbf67ee83ac07c9ed0f61ae 100644 (file)
@@ -1,21 +1,30 @@
-# These look like bugs in Doxygen 1.8.5
-src/gromacs/gmxlib/gmx_cpuid.c: warning: duplicate declarations for a member 'gmx_cpuid_vendor'
-src/gromacs/gmxlib/gmx_cpuid.c: warning: duplicate declarations for a member 'gmx_cpuid_x86_smt'
-src/gromacs/gmxlib/gmx_cpuid.c: warning: duplicate declarations for a member 'gmx_cpuid_simd_suggest'
-
 # The script is currently a bit too eager
 share/template/template.cpp: error: source file documentation appears outside full documentation
+# The parser in the script is not clever enough
+src/gromacs/version.h: warning: includes local file as <gromacs/version.h>
+
+# These are OK
+src/gromacs/math/vec.h: warning: installed header includes non-installed "config.h"
+src/gromacs/linearalgebra/eigensolver.c: warning: should include "config.h"
+src/gromacs/linearalgebra/gmx_arpack.c: warning: should include "config.h"
+src/gromacs/linearalgebra/gmx_blas/*: warning: does not include "gmxpre.h" first
+src/gromacs/linearalgebra/gmx_blas/*: warning: should include "config.h"
+src/gromacs/linearalgebra/gmx_lapack/*: warning: does not include "gmxpre.h" first
+src/gromacs/linearalgebra/gmx_lapack/*: warning: should include "config.h"
+src/gromacs/utility/baseversion-gen.c: warning: does not include "gmxpre.h" first
 
 # This module name doesn't really fall into any currently used pattern; needs some thought
 : error: no matching directory for module: module_mdrun_integration_tests
 
 # These would be nice to fix, but can wait for later
-*: warning: includes local file as <config.h>
 src/gromacs/gmxlib/nonbonded/nb_kernel_*/*: warning: included file "gromacs/simd/math_x86_*.h" is not documented as exposed outside its module
+src/gromacs/gmxlib/nonbonded/nb_kernel_*/*: warning: includes "config.h" unnecessarily
+src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.c: warning: includes "config.h" unnecessarily
+src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref.c: warning: includes "config.h" unnecessarily
+src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.c: 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_4xn/nbnxn_kernel_simd_4xn.c: warning: includes "config.h" unnecessarily
 
 # These are specific to Folding@Home, and easiest to suppress here
 *: warning: includes non-local file as "corewrap.h"
-src/config.h.cmakein: warning: includes non-local file as "swindirect.h"
-
-# These are limitations in the current script
-src/gromacs/utility/gmx_header_config.h: warning: includes non-local file as "gmx_header_config_gen.h"
+src/gmxpre.h: warning: includes non-local file as "swindirect.h"
similarity index 92%
rename from docs/doxygen/codelayout.md
rename to docs/doxygen/user/codelayout.md
index 24bb7ae0c5737ef0b47599658dbc5ebe7f78556f..efe5a64ff577fc3088546c3f70ea839c22ae0a36 100644 (file)
@@ -38,6 +38,9 @@ not compile.  It is not included in the build.
 </dd>
 \endif
 </dl>
+\if libapi
+\subpage page_modulegraph
+\endif
 
 Organization under `src/gromacs/`
 ---------------------------------
@@ -68,7 +71,7 @@ See \ref page_unittesting for more details.
 \endif
 
 When compiling, the include search path is set to `src/`.  This means that
-source files include headers as
+files include headers as
 
     #include "gromacs/<module>/<file>.h"
 
@@ -76,23 +79,12 @@ The following is also possible for intra-module headers:
 
     #include "<file>.h"
 
-Header files include other headers using
-
-    #include "../<othermodule>/<file>.h"
-
-because relative paths work best for installed headers.  For non-installed
-headers, the path relative to `src/` is sometimes also used.
-
 For historical reasons, there are directories `src/gromacs/gmxana/`,
 `src/gromacs/gmxlib/`, `src/gromacs/mdlib/`, and `src/gromacs/gmxpreprocess/`
 that do not follow the above rules.  The installed headers for these are in
 `src/gromacs/legacyheaders/`.  The aim is to gradually get rid of these
 directories and move code into proper modules.
 
-For similar historical reasons, the include path also includes
-`src/gromacs/legacyheaders/`.  It is preferred that new code does not depend on
-this.
-
 Documentation organization
 ==========================
 
similarity index 93%
rename from docs/doxygen/mainpage.md
rename to docs/doxygen/user/mainpage.md
index 9393c835f3c479cb8439ab45dd070640d2e84e04..d14faf4eabbb625f6035c0cf581d6df6918c4e0f 100644 (file)
@@ -59,11 +59,6 @@ give an overview of some of the topics that are documented:
    Provides general guidance for writing software that uses the \Gromacs
    library.
 \if libapi
- - \subpage page_doxygen <br/>
-   Provides an overview and some instructions for using Doxygen to document the
-   source code.
- - \subpage page_unittesting <br/>
-   Provides an overview of unit testing in \Gromacs.
  - \subpage page_wrapperbinary <br/>
    Provides an overview of how the `gmx` wrapper binary is implemented.
  - \subpage page_simd <br/>
@@ -72,3 +67,9 @@ give an overview of some of the topics that are documented:
 \endif
 
 This list will hopefully expand over time.
+
+\if libapi
+Additionally, a separate section contains a \subpage page_devmanual, which provides
+resources for developers, such as and documentation for development-time tools
+and guidelines.
+\endif
diff --git a/docs/doxygen/user/usinglibrary.md b/docs/doxygen/user/usinglibrary.md
new file mode 100644 (file)
index 0000000..e8c3bdf
--- /dev/null
@@ -0,0 +1,224 @@
+Using \Gromacs as a library {#page_usinglibrary}
+===========================
+
+Getting started
+===============
+
+The \Gromacs library (`libgromacs`) provides a few different alternatives for
+using it.  These are listed here from the highest level of abstraction to the
+low-level functions.
+ - If you are writing a trajectory analysis tool, please see
+   \ref page_analysisframework.  \ref page_analysistemplate should contain
+   all the ingredients to get started.
+   If you have an existing tool written using the analysis template from 4.5 or
+   4.6 (using the selection engine added in 4.5), you need to do some
+   conversion work to get this work with the new template.  This is mostly
+   straightforward, but requires some studying to understand the new framework.
+ - If you are writing a command line tool for some other purpose, you can use
+   the facilities provided by \ref module_commandline.  There are a few
+   different alternatives, depending on how much control you want to give
+   \Gromacs:
+    - For C++ code, you can implement gmx::CommandLineOptionsModuleInterface and
+      use gmx::runCommandLineModule() to execute it.  This interface assumes
+      the use of the gmx::Options mechanism for declaring command-line options
+      (see \ref module_options).
+      For a lower-level interface, gmx::CommandLineModuleInterface can be used,
+      but this requires you to implement `-h` output and command-line parsing
+      yourself (possibly using classes that \Gromacs provides).
+    - For C code, you can use gmx_run_cmain() to wrap an existing C main
+      method.  The only constraint on the provided main method is that it
+      should use parse_common_args() for argument processing.
+      This approach should allow you to convert existing C tools written
+      against pre-5.0 \Gromacs (e.g., using the analysis template from 4.0 or
+      earlier) to the new version.
+    - If you want more control (for example, you do not want the default
+      command line options added by \Gromacs), you can directly initialize
+      \Gromacs using gmx::initForCommandLine() before calling other \Gromacs
+      routines.  This allows you to write your own handling for command line
+      options from scratch.  This is also discussed in \ref module_commandline.
+ - For most control, you can use gmx::init() to do basic initialization, create
+   your own implementation for gmx::ProgramContextInterface, and set that using
+   gmx::setProgramContext().  This allows you to customize how the \Gromacs
+   library shows the name of the program in messages, as well as how it locates
+   its own data files.
+
+If these do not fit your needs, you may need to modify the \Gromacs source code
+yourself.  In particular, it is currently relatively difficult to extend the
+functionality of `mdrun` without modifying the source code directly.
+If you think that some particular API would be necessary for your work, and
+think that it would be easy to expose, please drop a line on the
+`gmx-developers` mailing list, or contribute the necessary changes on
+http://gerrit.gromacs.org/.
+
+Linking against `libgromacs`
+============================
+
+\Gromacs is a bit picky on how the headers need to be used: depending on
+compilation options used for \Gromacs, some preprocessor defines may need to be
+set, the required include path may also depend on compilation options, and some
+extra libraries may need to be linked.  You will also likely need to use the
+same compiler (or sufficiently similar one that uses the same standard library)
+that was used to compile \Gromacs.
+
+To manage this more easily, \Gromacs provides two mechanisms for getting the
+correct flags for compilation and linking against the \Gromacs library:
+ - `pkg-config`: \Gromacs installs `libgromacs.pc` file (suffixed with the
+   library suffix) for use with `pkg-config` if that is present on the system.
+   Sourcing `GMXRC` adjusts the `pkg-config` search path such that these files
+   are found automatically.
+   See `Makefile.pkg` installed with the analysis template for one example of
+   how to use it (to use it with a differently suffixed \Gromacs, just replace
+   `libgromacs` with `libgromacs`<em>_suffix</em> in the `pkg-config` calls).
+ - CMake package configuration files and a find module that allow
+   `find_package(GROMACS)` to work.  See below for details about how to use
+   this in CMake.  Sourcing `GMXRC` sets an environment variable that allows
+   CMake to find the configuration file automatically.
+   See `CMakeLists.txt` installed with the analysis template for one example of
+   how to use it.
+
+These mechanisms are currently provided on a best-effort basis, but are not
+routinely tested on a wide range of configurations.  Please report any issues
+with details of how \Gromacs was built so that the mechanism can be improved.
+Known issues:
+ - `pkg-config` files are not relocatable, i.e., they hard-code the
+   installation prefix as an absolute path.
+ - Installing both static and shared libraries with the same suffix to the same
+   installation prefix is guaranteed to work only if both are built with
+   exactly the same configuration options (except for `BUILD_SHARED_LIBS`) from
+   exactly the same version.  There are several files that are shared between
+   the installations in such a case, and the latter installation will overwrite
+   those from the former.
+ - Further, if both static and shared libraries have been installed in the past
+   to a prefix, then future installations to the same prefix should also
+   install both static and shared libraries.  Otherwise, some obsolete CMake
+   package configuration files will be left behind which can lead to finding
+   the old library.  Alternatively, you can delete `share/cmake/` from the
+   installation directory before doing the install.
+ - If a mechanism other than the CMake-generated `install` target is used to
+   install \Gromacs over an existing installation, and the build type (e.g.,
+   Release vs.\ Debug) does not match what was previously installed, some
+   obsolete CMake import target definition files are left behind in
+   `share/cmake/`, and may cause failures whey trying to use the package
+   configuration files.
+ - If \Gromacs is built with `GMX_BUILD_OWN_FFTW=ON`, the CMake-generated
+   import definitions for `libgromacs` reference a `gmxfftw` target that was
+   used in the build to reference the `fftw` library.  As this library only
+   exists in the \Gromacs build tree, and the CMake machinery does not write
+   any import definitions for it anywhere, linking will fail with errors about
+   not being able to find a `gmxfftw` library.  So the CMake package
+   configuration files can only be used with `GMX_BUILD_OWN_FFTW=OFF`.
+
+CMake `find_package(GROMACS)` details
+-------------------------------------
+
+The CMake machinery to support `find_package(GROMACS)` has two parts: a
+`FindGROMACS.cmake` find module (found in `share/gromacs/template/cmake/` in
+the installation and `share/template/cmake/` in the source tree), and actual
+package configuration files (`gromacs-config.cmake` and supporting files
+installed to `share/cmake/` from input files in `src/gromacs/`).
+
+`FindGROMACS.cmake` is a simple wrapper over the package configuration files,
+providing a somewhat more convenient interface to the machinery that supports
+multiple suffixed \Gromacs installations in the same installation prefix (see
+`GROMACS_SUFFIX` variable below).  This file is intended to be version-agnostic
+and remain both forward- and backward-compatible even between major \Gromacs
+releases.  All version-specific information and the actual details about the
+compilation and linking settings is in the package configuration files.
+Build systems willing to utilize `FindGROMACS.cmake` can create a local copy of
+it and use it like it is used in the installed
+`share/gromacs/template/CMakeLists.txt`.
+The package configuration files can also be used directly if desired, bypassing
+`FindGROMACS.cmake`.
+
+Input options for influencing what to find:
+
+<dl>
+<dt>`GROMACS_SUFFIX` (only for `FindGROMACS.cmake`)</dt>
+<dd>This CMake variable can be set before calling `find_package(GROMACS)` to
+specify the \Gromacs suffix to search for.  If not set, an unsuffixed version
+is searched for.  If using the package configuration files directly, the suffix
+must be set using `find_package(GROMACS NAMES gromacs<suffix>)`.</dd>
+<dt>`GROMACS_PREFER_STATIC`</dt>
+<dd>This CMake variable can be set before calling `find_package(GROMACS)` to
+specify whether static or shared libraries are preferred if both are available.
+It does not affect which \Gromacs installation is chosen, but if that
+installation has both static and shared libraries available (installed from two
+different builds with the same suffix), then this chooses the library to be
+returned in `GROMACS_LIBRARIES`.</dd>
+<dt>`GROMACS_DIR`</dt>
+<dd>This CMake (cache) variable is a standard mechanism provided by
+`find_package`, and can be used to specify a hint where to search for \Gromacs.
+Also `CMAKE_PREFIX_PATH` can be used for this purpose; see CMake documentation
+for `find_package` for more details.
+`GROMACS_DIR` can also be set as an environment variable, and this is done by
+`GMXRC`.</dd>
+</dl>
+
+Output variables that specify how the found `libgromacs` and header should be
+used:
+
+<dl>
+<dt>`GROMACS_INCLUDE_DIRS`</dt>
+<dd>List of include directories necessary to compile against the \Gromacs
+headers.  Currently, this includes the path to \Gromacs headers, as well as the
+path to Boost headers that were used to compile \Gromacs.</dd>
+<dt>`GROMACS_LIBRARIES`</dt>
+<dd>List of libraries to link with to link against \Gromacs.
+Under the hood, this uses imported CMake targets to represent `libgromacs`.</dd>
+<dt>`GROMACS_DEFINITIONS`</dt>
+<dd>List of compile definitions (with `-D` in front) that are required to
+compile the \Gromacs headers.</dd>
+<dt>`GROMACS_IS_DOUBLE`</dt>
+<dd>Whether the found \Gromacs was compiled in double precision.</dd>
+</dl>
+
+Declared macros/functions that can be used for checking for correctness of some
+settings:
+
+<dl>
+<dt>`gromacs_check_double(GMX_DOUBLE)`</dt>
+<dd>Checks that the found \Gromacs is in the expected precision.
+The parameter `GMX_DOUBLE` should be the name of a cache variable that
+specified whether double-precision was requested.</dd>
+<dt>`gromacs_check_compiler(LANG)`<dt>
+<dd>Checks that the found \Gromacs was compiled with the same compiler
+that is used by the current CMake system.
+Currently only `LANG=CXX` is supported.</dd>
+</dl>
+
+Notes on \Gromacs API
+=====================
+
+The headers for the public \Gromacs API are installed in `include/gromacs/`
+under the installation directory.  The layout reflects the source code layout
+under the `src/gromacs/` directory (see \ref page_codelayout).  The headers
+directly under `include/gromacs/` do not contain any declarations, but instead
+include a collection of headers from subdirectories.
+You should prefer to include these convenience headers instead of individual
+headers from the subdirectories, since they are much more stable.  The
+individual headers in the subdirectories can be renamed or moved, but the goal
+is to only rarely change the name of these top-level headers.
+
+Pre-5.0 versions of \Gromacs installed (nearly) all headers directly under
+`include/gromacs/`.  Most of these headers still exist, but now under
+`include/gromacs/legacyheaders/`.  The long-term goal is to move these to
+proper module hierarchy or get rid of them, but unfortunately this can take a
+long time.  Thus, you should not expect much stability from the API in these
+headers.  Some have already been moved, so if you do not find your favorite
+header there, try searching for a declaration from the other subdirectories.
+
+For headers under other subdirectories, some effort has been put to design the
+API for stability.  However, with limited development resources, and the focus
+of \Gromacs being in high performance simulations, all the APIs are subject to
+change without notice.  With each new release (with possible exception of patch
+releases), you should expect incompatible API changes.  This is in particular
+true until the planned reorganization of the `legacyheaders/` subdirectory is
+complete.
+
+The header version.h (installed as `gromacs/version.h`) provides defines that
+calling code can use to check the exact (released) version of \Gromacs that
+installed the headers.
+
+This Doxygen documentation only covers part of the API.  In particular, nearly
+all of `include/gromacs/legacyheaders/` is undocumented, as well as code
+recently moved from there.
diff --git a/docs/doxygen/usinglibrary.md b/docs/doxygen/usinglibrary.md
deleted file mode 100644 (file)
index 7419b5d..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-Using \Gromacs as a library {#page_usinglibrary}
-===========================
-
-Getting started
-===============
-
-\todo
-Describe how to link against \Gromacs (pkg-config, FindGromacs.cmake, etc.)
-
-The \Gromacs library (`libgromacs`) provides a few different alternatives for
-using it.  These are listed here from the highest level of abstraction to the
-low-level functions.
- - If you are writing a trajectory analysis tool, please see
-   \ref page_analysisframework.  \ref page_analysistemplate should contain
-   all the ingredients to get started.
-   If you have an existing tool written using the analysis template from 4.5 or
-   4.6 (using the selection engine added in 4.5), you need to do some
-   conversion work to get this work with the new template.  This is mostly
-   straightforward, but requires some studying to understand the new framework.
- - If you are writing a command line tool for some other purpose, you can use
-   the facilities provided by \ref module_commandline.  There are a few
-   different alternatives, depending on how much control you want to give
-   \Gromacs:
-    - For C++ code, you can implement gmx::CommandLineModuleInterface, and
-      use gmx::runCommandLineModule() to execute it.  This requires using some
-      additional \Gromacs classes (in particular, for implementing
-      gmx::CommandLineModuleInterface::writeHelp(), if you want to support the
-      `-h` option).
-    - For C code, you can use gmx_run_cmain() to wrap an existing C main
-      method.  The only constraint on the provided main method is that it
-      should use parse_common_args() for argument processing.
-      This approach should allow you to convert existing C tools written
-      against pre-5.0 \Gromacs (e.g., using the analysis template from 4.0 or
-      earlier) to the new version.
-    - If you want more control (for example, you do not want the default
-      command line options added by \Gromacs), you can directly initialize
-      \Gromacs using gmx::initForCommandLine() before calling other \Gromacs
-      routines.  This allows you to write your own handling for command line
-      options from scratch.  This is also discussed in \ref module_commandline.
- - For most control, you can use gmx::init() to do basic initialization, create
-   your own implementation for gmx::ProgramContextInterface, and set that using
-   gmx::setProgramContext().  This allows you to customize how the \Gromacs
-   library shows the name of the program in messages, as well as how it locates
-   its own data files.
-
-If these do not fit your needs, you may need to modify the \Gromacs source code
-yourself.  In particular, it is currently relatively difficult to extend the
-functionality of `mdrun` without modifying the source code directly.
-If you think that some particular API would be necessary for your work, and
-think that it would be easy to expose, please drop a line on the
-`gmx-developers` mailing list, or contribute the necessary changes on
-http://gerrit.gromacs.org/.
-
-Notes on \Gromacs API
-=====================
-
-The headers for the public \Gromacs API are installed in `include/gromacs/`
-under the installation directory.  The layout reflects the source code layout
-under the `src/gromacs/` directory (see \ref page_codelayout).  The headers
-directly under `include/gromacs/` do not contain any declarations, but instead
-include a collection of headers from subdirectories.
-You should prefer to include these convenience headers instead of individual
-headers from the subdirectories, since they are much more stable.  The
-individual headers in the subdirectories can be renamed or moved, but the goal
-is to only rarely change the name of these top-level headers.
-
-Pre-5.0 versions of \Gromacs installed (nearly) all headers directly under
-`include/gromacs/`.  Most of these headers still exist, but now under
-`include/gromacs/legacyheaders/`.  The long-term goal is to move these to
-proper module hierarchy or get rid of them, but unfortunately this can take a
-long time.  Thus, you should not expect much stability from the API in these
-headers.  Some have already been moved, so if you do not find your favorite
-header there, try searching for a declaration from the other subdirectories.
-
-For headers under other subdirectories, some effort has been put to design the
-API for stability.  However, with limited development resources, and the focus
-of \Gromacs being in high performance simulations, all the APIs are subject to
-change without notice.  With each new release (with possible exception of patch
-releases), you should expect incompatible API changes.  This is in particular
-true until the planned reorganization of the `legacyheaders/` subdirectory is
-complete.
-
-The header version.h (installed as `gromacs/version.h`) provides defines that
-calling code can use to check the exact (released) version of \Gromacs that
-installed the headers.
-
-This Doxygen documentation only covers part of the API.  In particular, nearly
-all of `include/gromacs/legacyheaders/` is undocumented, as well as code
-recently moved from there.
index 3202891fe60249afa4edc98181ff438a222ffdf0..87f75e4c9a3da23953b8be0cbc7733c053303960 100644 (file)
   As [PDF](install-guide.pdf)
 
 * [User Guide](user-guide.html)  
+  Includes getting started, .mdp options, advice using mdrun and more.  
   As [PDF](user-guide.pdf)
 
 * [Online Reference](online.html)
 
 * [Reference manual](manual-@PROJECT_VERSION@.pdf) (PDF format)
 
+* [Doxygen public API documentation](doxygen/html-user/index.xhtml)
+
 * Answers to [Frequently Asked Questions](http://www.gromacs.org/Documentation/FAQs)
 
 * Coping with [GROMACS errors](http://www.gromacs.org/Documentation/Errors)
 
 # Documentation for developers
 
-* [Doxygen code documentation](doxygen/html-lib/index.xhtml)
-
-* Developer Guide - coming soon (in master branch)!
+* [Doxygen code documentation](doxygen/html-lib/index.xhtml)  
+  This contains the public API documentation as a subset, but also has more
+  details on the internal implementation of GROMACS.
 
-[/b/]: # (TODO in master branch: consolidate much of the wiki material into a proper developer guide, and link to it here)
+* [Developer Guide](doxygen/html-lib/page_devmanual.xhtml)--
+  Resources for developers, e.g., related to guidelines and tools used during
+  development.
index 7342ba4d7100f30a485b0400a58bcda67656c8ba..8b3eed92dba3195728a8b80e0015baee5baeb0b2 100644 (file)
@@ -60,4 +60,5 @@ if(MARKDOWN_CONFIGURE_IS_POSSIBLE AND PANDOC_EXECUTABLE)
             ${HTML_OUTPUT_DIR}/${name}.pdf
         VERBATIM
         )
+    gmx_cpack_add_generated_source_directory(final DESTINATION /)
 endif()
index 67185db2cf2768ae17549ea0490c8c4c2535377c..65e807a363583d37e7a269b793618d458ea65931 100644 (file)
@@ -75,6 +75,9 @@ architectures including x86, AMD64/x86-64, PPC, ARM v7 and SPARC VIII.
 
 Technically, GROMACS can be compiled on any platform with an ANSI C99
 and C++98 compiler, and their respective standard C/C++ libraries.
+We use only a few C99 features, but note that the C++ compiler also needs to
+support these C99 features (notably, int64_t and related things), which are not
+part of the C++98 standard.
 Getting good performance on an OS and architecture requires choosing a
 good compiler. In practice, many compilers struggle to do a good job
 optimizing the GROMACS architecture-optimized SIMD kernels.
@@ -640,7 +643,7 @@ the directories can be renamed by editing the installation paths in the main
 CMakeLists.txt.
 
 `bin/`
-  : The standard location for executables, some scripts, and some symlinks.
+  : The standard location for executables and some scripts.
     Some of the scripts hardcode the absolute installation prefix, which needs
     to be changed if the scripts are relocated.
 `include/gromacs/`
@@ -650,6 +653,13 @@ CMakeLists.txt.
     is determined by CMake.
     The name of the directory can be changed using `GMX_LIB_INSTALL_DIR` CMake
     variable.
+`lib/pkgconfig/`
+  : Information about the installed `libgromacs` library for `pkg-config` is
+    installed here.  The `lib/` part adapts to the installation location of the
+    libraries.  The installed files contain the installation prefix as absolute
+    paths.
+`share/cmake/`
+  : CMake package configuration files are installed here.
 `share/gromacs/`
   : Various data files and some documentation go here.
     The `gromacs` part can be changed using `GMX_DATA_INSTALL_DIR`. Using this
diff --git a/docs/man/BuildManPages.cmake b/docs/man/BuildManPages.cmake
new file mode 100644 (file)
index 0000000..80c5aeb
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+if (NOT DEFINED GMX_EXECUTABLE OR NOT DEFINED SOURCE_DIR)
+    message(FATAL_ERROR "Required input parameter not set")
+endif()
+
+file(MAKE_DIRECTORY man1)
+file(MAKE_DIRECTORY man7)
+file(COPY ${SOURCE_DIR}/man7/gromacs.7.in DESTINATION man7/)
+execute_process(
+    COMMAND ${GMX_EXECUTABLE} -quiet help -export man
+    RESULT_VARIABLE exitcode)
+if (exitcode)
+    # Ensure that no partial output is left behind.
+    file(REMOVE_RECURSE man1)
+    file(REMOVE man7/gromacs.7)
+    if (ERRORS_ARE_FATAL)
+        message(FATAL_ERROR
+            "Failed to generate man pages. "
+            "Set GMX_BUILD_HELP=OFF if you want to skip them.\n"
+            "Error/exit code: ${exitcode}")
+    else()
+        message(
+            "Failed to generate man pages, will build GROMACS without. "
+            "Set GMX_BUILD_HELP=OFF if you want to skip this notification and "
+            "warnings during installation.")
+    endif()
+endif()
index ffcff945a74d5fc21ffbb1157f794befb4452cfd..be9241498346e37a07c2e91c29908ec39004787a 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(SOURCE_IS_SOURCE_DISTRIBUTION)
-    # Make sure source package contains all man pages.
-    if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man1/gmx-view.1")
-        message(FATAL_ERROR "Man pages are missing from source package.")
-    endif()
-endif()
-
-add_custom_target(man
-    ${CMAKE_COMMAND} -E make_directory man1
-    COMMAND ${CMAKE_COMMAND} -E make_directory man7
-    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/man7/gromacs.7.in" man7/
-    COMMAND gmx -quiet help -export man
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    COMMENT "Generating man pages"
-    VERBATIM)
+include(gmxCustomCommandUtilities)
 
 set(MAN_PAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 if (GMX_BUILD_HELP)
+    gmx_add_custom_output_target(man OUTPUT STAMP
+        COMMAND ${CMAKE_COMMAND}
+            -D GMX_EXECUTABLE=$<TARGET_FILE:gmx>
+            -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
+            -D ERRORS_ARE_FATAL=${GMX_BUILD_HELP_FORCE}
+            -P ${CMAKE_CURRENT_SOURCE_DIR}/BuildManPages.cmake
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        DEPENDS gmx
+            ${CMAKE_CURRENT_SOURCE_DIR}/man7/gromacs.7.in
+            ${CMAKE_CURRENT_SOURCE_DIR}/BuildManPages.cmake
+        COMMENT "Generating man pages")
     set_target_properties(man PROPERTIES EXCLUDE_FROM_ALL OFF)
     set_directory_properties(PROPERTIES
         ADDITIONAL_MAKE_CLEAN_FILES "man1;man7/gromacs.7")
@@ -60,8 +57,10 @@ endif()
 if (SOURCE_IS_SOURCE_DISTRIBUTION OR GMX_BUILD_HELP)
     install(FILES ${MAN_PAGE_DIR}/man7/gromacs.7
         DESTINATION ${MAN_INSTALL_DIR}/man7
-        COMPONENT man)
+        COMPONENT man OPTIONAL)
     install(DIRECTORY ${MAN_PAGE_DIR}/man1
         DESTINATION ${MAN_INSTALL_DIR}
-        COMPONENT man)
+        COMPONENT man OPTIONAL)
 endif()
+gmx_cpack_add_generated_source_directory(man1)
+gmx_cpack_add_generated_source_directory(man7)
index 0a012e04ff9e5351bf8cfb4e6de4367933abb426..459043138241fc498fa47f83d515ab3eac575830 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,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.
@@ -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.
 
-if(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
+if (BUILD_IS_INSOURCE)
     # UseLATEX.cmake does not work with an in-source build
     message(STATUS "Cannot build the manual when building in the source directory")
     set(MANUAL_BUILD_IS_POSSIBLE OFF)
@@ -71,33 +71,18 @@ if(MANUAL_BUILD_IS_POSSIBLE)
     #
     # Only files that can be built should be listed in DEPENDS. Makefile
     # rules are generated for those files.
-    #
-    # The .mdp options section is now intended to be built directly
-    # from a GROMACS source directory. This facilitates drafting
-    # updates in that HTML file without copying files by hand.
-
-    ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/mdp_opt.tex
-        COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mkmdp ARGS ${CMAKE_CURRENT_SOURCE_DIR}/../old-html
-        DEPENDS mkmdp ${CMAKE_CURRENT_SOURCE_DIR}/../old-html/online/mdp_opt.html
-        )
 
     # Finally, the command to build the manual.
 
     ADD_LATEX_DOCUMENT(gromacs.tex
         # Normal LaTeX \included files
         INPUTS algorithms.tex  defunits.tex    implement.tex  macros.tex     special.tex
-        analyse.tex     files.tex       install.tex    topology.tex
+        analyse.tex     files.tex       topology.tex
         averages.tex    forcefield.tex  gromacs.tex    intro.tex      programs.tex
 
         # CMake does variable replacement in these files
         CONFIGURE macros.tex
 
-        # These files we're responsible for creating in the
-        # add_custom_targets() above. They should not be in the git
-        # repository, or its directory, or the dependencies will not work
-        # properly.
-        DEPENDS mdp_opt.tex
-
         BIBFILES monster.bib unpubl.bib
         IMAGE_DIRS plots
         DEFAULT_PDF
index 74bc93d515ae4378afafe80221c0983c5bae1440..38a07a50e016a1dd7102902da7d0bab36c31ad95 100644 (file)
@@ -1,7 +1,7 @@
 So, you want to build the manual? This is now easy.
 
 1. Configure the main GROMACS repo with GMX_BUILD_MANUAL=on
-2. cmake will run some detection about whetehr this is possible
+2. cmake will run some detection about whether this is possible
 3. Later, use "make manual," which will build GROMACS in the
    usual way, and use the generated binaries to build the manual.
 
index eab3d5488953fd010c866f3a08d45d1fa946af06..ac864521a44db0872ee320dc217dafe5a77cf05b 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,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.
@@ -311,7 +311,7 @@ All non-bonded interactions between pairs of energy-monitor groups can
 be excluded\index{exclusions}
 \ifthenelse{\equal{\gmxlite}{1}}
 {.}
-{(see \secref{mdpopt}).}
+{(see details in the User Guide).}
 Pairs of particles from excluded pairs of energy-monitor groups
 are not put into the pair list.
 This can result in a significant speedup
@@ -778,19 +778,6 @@ list cut-off (there are several ways to do this in {\gromacs}, see
 \secref{mod_nb_int}). One then has a buffer with the size equal to the
 neighbor list cut-off less the longest interaction cut-off.
 
-With the
-group cut-off scheme, one can also choose to let {\tt mdrun} only
-update the neighbor list when required. That is when one or more
-particles have moved more than half the buffer size from the center of
-geometry of the \swapindex{charge}{group} to which they belong (see
-\secref{chargegroup}), as determined at the previous neighbor search.
-This option guarantees that there are no cut-off artifacts.  {\bf
-  Note} that for larger systems this comes at a high computational
-cost, since the neighbor list update frequency will be determined by
-just one or two particles moving slightly beyond the half buffer
-length (which not even necessarily implies that the neighbor list is
-invalid), while 99.99\% of the particles are fine.
-
 } % Brace matches ifthenelse test for gmxlite
 
 \subsubsection{Simple search\swapindexquiet{simple}{search}}
@@ -1533,8 +1520,9 @@ every step, the extended-ensemble Parrinello-Rahman approach~\cite{Parrinello81,
 the velocity Verlet variants, the Martyna-Tuckerman-Tobias-Klein
 (MTTK) implementation of pressure
 control~\cite{Martyna1996}. Parrinello-Rahman and Berendsen can be
-combined with any of the temperature coupling methods above; MTTK can
-only be used with Nos{\'e}-Hoover temperature control.
+combined with any of the temperature coupling methods above. MTTK can
+only be used with Nos{\'e}-Hoover temperature control. From 5.1 afterwards,
+it can only used when the system does not have constraints.
 
 \subsubsection{Berendsen pressure coupling\pawsindexquiet{Berendsen}{pressure coupling}\index{weak coupling}}
 \label{sec:berendsen_pressure_coupling}
@@ -1820,12 +1808,13 @@ but the half-step-averaged kinetic energy for the temperatures, which can be wri
 &&\exp\left(iL_{\mathrm{NHC}}\dt/2\right) \exp\left(iL_{\epsilon,1}\dt\right) \exp\left(iL_1 \dt\right) \exp\left(iL_{\mathrm{NHC}}\dt/2\right) \nonumber \\
 &&\exp\left(iL_2 \dt/2\right) \exp\left(iL_{\epsilon,2}\dt/2\right) \exp\left(iL_{\mathrm{NHC-baro}}\dt/2\right) + \mathcal{O}(\dt^3)
 \eea
-With constraints, the equations become significantly more
-complicated, in that each of these equations need to be solved
-iteratively for the constraint forces.  The discussion of the details of the iteration
-is beyond the scope of this manual; readers are encouraged to see the
-implementation described in~\cite{Yu2010}.
 
+With constraints, the equations become significantly more complicated,
+in that each of these equations need to be solved iteratively for the
+constraint forces. Previous to Gromacs 5.1, these iterative
+constraints were solved as described in~\cite{Yu2010}. From Gromacs
+5.1 onward, MTTK with constraints has been removed because of
+numerical stability issues with the iterations.
 
 \subsubsection{Infrequent evaluation of temperature and pressure coupling}
 
@@ -1945,7 +1934,7 @@ lower frequencies.
 {\gromacs} can also write reduced-precision coordinates for a subset of
 the simulation system to a special compressed trajectory file
 format. All the other tools can read and write this format. See
-\secref{mdpopt} for details on how to set up your {\tt .mdp} file
+the User Guide for details on how to set up your {\tt .mdp} file
 to have {\tt mdrun} use this feature.
 
 % \ifthenelse{\equal{\gmxlite}{1}}{}{
@@ -3187,7 +3176,7 @@ but differing slightly between the three Born radii models.
 % LocalWords:  GROningen MAchine BIOSON Groningen GROMACS Berendsen der Spoel
 % LocalWords:  Drunen Comp Phys Comm ROck NS FFT pbc EM ifthenelse gmxlite ff
 % LocalWords:  octahedra triclinic Ewald PME PPPM trjconv xy solvated
-% LocalWords:  boxtypes boxshapes editconf Lennard mdpopt COM XTC TNG kT defunits
+% LocalWords:  boxtypes boxshapes editconf Lennard COM XTC TNG kT defunits
 % LocalWords:  Boltzmann's Mueller nb int mdrun chargegroup simplerc prefactor
 % LocalWords:  pme waterloops CH NH CO df com virial integrator Verlet vverlet
 % LocalWords:  integrators ref timepoint timestep timesteps mdp md vv avek NVE
index 474988727f8dcf799d6c742b816b46d2b01b2c5d..ff2a382f06e363e0e6e16755dfc1dfb4f7322994 100644 (file)
@@ -606,7 +606,7 @@ interchangeably.}
 
 \section{Radius of gyration and distances}
 \label{sec:rg}
-{\tt gmx gyrate, gmx distance, gmx mindist, gmx mdmat, gmx xpm2ps}\\
+{\tt gmx gyrate, gmx distance, gmx mindist, gmx mdmat, gmx pairdist, gmx xpm2ps}\\
 To have a rough measure for the compactness of a structure, you can calculate 
 the {\em radius of gyration} with the program {\tt \normindex{gmx gyrate}} as follows:
 \beq
@@ -628,12 +628,15 @@ The {\em distance between the geometrical centers} of two groups can be
 calculated with the program
 %\ifthenelse{\equal{\gmxlite}{1}}{
 {{\tt \normindex{gmx distance}}, as explained in \secref{bad}.}
-\item[$\bullet$] 
+\item[$\bullet$]
 The {\em minimum distance} between two groups of atoms during time 
 can be calculated with the program {\tt \normindex{gmx mindist}}. It also calculates the 
 {\em number of contacts} between these groups 
 within a certain radius $r_{max}$.
-\item[$\bullet$] 
+\item[$\bullet$]
+{\tt \normindex{gmx pairdist}} is a selection-enabled version of
+{\tt gmx mindist}.
+\item[$\bullet$]
 To monitor the {\em minimum distances between amino acid residues} 
 within a (protein) molecule, you can use 
 the program {\tt \normindex{gmx mdmat}}. This minimum distance between two residues
@@ -1071,4 +1074,4 @@ atoms across the interface.
 % LocalWords:  dssp rama xrama rg Ramachandran phipsi amphipathic HPr xvgr pvd
 % LocalWords:  Scripps RDF online usinggroups mdrun groupconcept HOH
 % LocalWords:  residuetypes determinding OpenGL traj ov rcl ij ps nm
-% LocalWords:  autocorrelation interfacial
+% LocalWords:  autocorrelation interfacial pairdist
index 41d546a859f047c20ec3a3862d5e28763c6f7078..401d3d607930e3da15a2637faafdcf9086e1897e 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,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.
@@ -217,5 +217,53 @@ Density            & $\rho^*$      & N $\sigma ^3~V^{-1}$          \\
 \end{table}
 
 
+\section{Mixed or Double precision}
+{\gromacs} can be compiled in either mixed\index{mixed
+precision|see{precision, mixed}}\index{precision, mixed} or
+\pawsindex{double}{precision}. Documentation of previous {\gromacs}
+versions referred to ``single precision'', but the implementation
+has made selective use of double precision for many years.
+Using single precision
+for all variables would lead to a significant reduction in accuracy.
+Although in ``mixed precision'' all state vectors, i.e. particle coordinates,
+velocities and forces, are stored in single precision, critical variables
+are double precision. A typical example of the latter is the virial,
+which is a sum over all forces in the system, which have varying signs.
+In addition, in many parts of the code we managed to avoid double precision
+for arithmetic, by paying attention to summation order or reorganization
+of mathematical expressions. The default configuration uses mixed precision,
+but it is easy to turn on double precision by adding the option
+{\tt -DGMX_DOUBLE=on} to {\tt cmake}. Double precision
+will be 20 to 100\% slower than mixed precision depending on the
+architecture you are running on. Double precision will use somewhat
+more memory and run input, energy and full-precision trajectory files
+will be almost twice as large.
+
+The energies in mixed precision are accurate up to the last decimal,
+the last one or two decimals of the forces are non-significant.
+The virial is less accurate than the forces, since the virial is only one
+order of magnitude larger than the size of each element in the sum over
+all atoms (\secref{virial}).
+In most cases this is not really a problem, since the fluctuations in the
+virial can be two orders of magnitude larger than the average.
+Using cut-offs for the Coulomb interactions cause large errors
+in the energies, forces, and virial.
+Even when using a reaction-field or lattice sum method, the errors
+are larger than, or comparable to, the errors due to the partial use of
+single precision.
+Since MD is chaotic, trajectories with very similar starting conditions will
+diverge rapidly, the divergence is faster in mixed precision than in double
+precision.
+
+For most simulations, mixed precision is accurate enough.
+In some cases double precision is required to get reasonable results:
+\begin{itemize}
+\item normal mode analysis,
+for the conjugate gradient or l-bfgs minimization and the calculation and
+diagonalization of the Hessian
+\item long-term energy conservation, especially for large systems
+\end{itemize}
+
+
 % LocalWords:  ij basicunits derivedunits kJ mol mV kcal consts LJ BT
 % LocalWords:  nm ps
index 1fae94e9892d6ee1bd91f5fe4db497fdc0c4a3e0..4d7228807847f48dcef4f9b7d0e293d14ebeeb40 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,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.
@@ -54,7 +54,7 @@
 \tt     conf & \tt esp & Asc & \tt -c & Coordinate file in ESPResSo format \\[-0.1ex]
 \tt     conf & \tt g96 & Asc & \tt -c & Coordinate file in Gromos-96 format \\[-0.1ex]
 \tt     conf & \tt gro & Asc & \tt -c & Coordinate file in Gromos-87 format \\[-0.1ex]
-\tt     conf & \tt gro &     & \tt -c & Structure: \tt gro g96 pdb esp tpr tpb tpa \\[-0.1ex]
+\tt     conf & \tt gro &     & \tt -c & Structure: \tt gro g96 pdb esp tpr \\[-0.1ex]
 \tt      out & \tt gro &     & \tt -o & Structure: \tt gro g96 pdb esp \\[-0.1ex]
 \tt    polar & \tt hdb & Asc & \tt    & Hydrogen data base \\[-0.1ex]
 \tt   topinc & \tt itp & Asc & \tt    & Include file for topology \\[-0.1ex]
 \tt  residue & \tt rtp & Asc & \tt    & Residue Type file used by {\tt pdb2gmx} \\[-0.1ex]
 \tt      doc & \tt tex & Asc & \tt -o & LaTeX file \\[-0.1ex]
 \tt    topol & \tt top & Asc & \tt -p & Topology file \\[-0.1ex]
-\tt    topol & \tt tpb & Bin & \tt -s & Binary run input file \\[-0.1ex]
-\tt    topol & \tt tpr &     & \tt -s & Generic run input: \tt tpr tpb tpa \\[-0.1ex]
-\tt    topol & \tt tpr &     & \tt -s & Structure+mass(db): \tt tpr tpb tpa gro g96 pdb \\[-0.1ex]
+\tt    topol & \tt tpr &     & \tt -s & Generic run input: \tt tpr \\[-0.1ex]
+\tt    topol & \tt tpr &     & \tt -s & Structure+mass(db): \tt tpr gro g96 pdb \\[-0.1ex]
 \tt    topol & \tt tpr & xdr & \tt -s & Portable xdr run input file \\[-0.1ex]
-\tt     traj & \tt trj & Bin & \tt    & Trajectory file (architecture specific) \\[-0.1ex]
-\tt     traj & \tt trr &     & \tt    & Full precision trajectory: \tt trr trj cpt \\[-0.1ex]
+\tt     traj & \tt trr &     & \tt    & Full precision trajectory: \tt trr cpt \\[-0.1ex]
 \tt     traj & \tt trr & xdr & \tt    & Trajectory in portable xdr format \\[-0.1ex]
 \tt     root & \tt xpm & Asc & \tt    & X PixMap compatible matrix file \\[-0.1ex]
-\tt     traj & \tt xtc &     & \tt -f & Trajec., input: \tt xtc trr trj cpt gro g96 pdb \\[-0.1ex]
-\tt     traj & \tt xtc &     & \tt -f & Trajectory, output: \tt xtc trr trj gro g96 pdb \\[-0.1ex]
+\tt     traj & \tt xtc &     & \tt -f & Trajec., input: \tt xtc trr tng cpt gro g96 pdb \\[-0.1ex]
+\tt     traj & \tt xtc &     & \tt -f & Trajectory, output: \tt xtc trr tng gro g96 pdb \\[-0.1ex]
 \tt     traj & \tt xtc & xdr & \tt    & Compressed trajectory (portable xdr format) \\[-0.1ex]
 \tt    graph & \tt xvg & Asc & \tt -o & xvgr/xmgr file \\[-0.1ex]
 \dline
@@ -90,6 +88,6 @@
 
 % LocalWords:  lccX atomtp atp Asc Atomtype pdb gmx eiwit brk Brookhaven cpt tm
 % LocalWords:  xdr nnnice dat dlg ngmx sam edi edo ener edr ene ent eps conf ss
-% LocalWords:  PostScript ESPResSo gtraj Gromos gro tpr tpb tpa hdb topinc itp
-% LocalWords:  grompp mdp mtx ndx rtp tex LaTeX topol traj trj trr xpm PixMap
+% LocalWords:  PostScript ESPResSo gtraj Gromos gro tpr hdb topinc itp
+% LocalWords:  grompp mdp mtx ndx rtp tex LaTeX topol traj trr xpm PixMap
 % LocalWords:  xtc Trajec xvg xvgr xmgr ps
index f20986fc617ff7547f5e8cb5dad0fd3a0ff52bb2..94c84ffeaf1c30499d5f06556f2108b32dbe24b6 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,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.
@@ -1087,9 +1087,12 @@ radius. The force acts towards the center of the sphere. The following distance
 \beq
   d_g(\ve{r}_i;\ve{R}_i) = |\ve{r}_i-\ve{R}_i|
 \eeq
-{\bfseries Cylinder} ($g=2$): The particle is kept in a cylinder of given radius
-parallel to the $z$-axis. The force from the flat-bottomed potential acts
-towards the axis of the cylinder. The $z$-component of the force is zero.
+{\bfseries Cylinder} ($g=6,7,8$): The particle is kept in a cylinder of given radius
+parallel to the $x$ ($g=6$), $y$ ($g=7$), or $z$-axis ($g=8$). For backwards compatibility, setting
+$g=2$ is mapped to $g=8$ in the code so that old {\tt .tpr} files and topologies work.  
+The force from the flat-bottomed potential acts towards the axis of the cylinder. 
+The component of the force parallel to the cylinder axis is zero.
+For a cylinder aligned along the $z$-axis:
 \beq
  d_g(\ve{r}_i;\ve{R}_i) = \sqrt{ (x_i-X_i)^2 + (y_i - Y_i)^2 }
 \eeq
@@ -1807,27 +1810,42 @@ after taking the derivative, we {\em can} insert \ve{p} = m\ve{v}, such that:
 
 \subsubsection{Constraints}
 \label{subsubsec:constraints}
-\newcommand{\clam}{C_{\lambda}}
 The constraints are formally part of the Hamiltonian, and therefore
 they give a contribution to the free energy. In {\gromacs} this can be
 calculated using the \normindex{LINCS} or the \normindex{SHAKE} algorithm.
-If we have a number of constraint equations $g_k$:
+If we have $k = 1 \ldots K$ constraint equations $g_k$ for LINCS, then
 \beq
-g_k     =       \ve{r}_{k} - d_{k}
+g_k     =       |\ve{r}_{k}| - d_{k}
 \eeq
-where $\ve{r}_k$ is the distance vector between two particles and 
-$d_k$ is the constraint distance between the two particles, we can write
-this using a $\LAM$-dependent distance as
+where $\ve{r}_k$ is the displacement vector between two particles and 
+$d_k$ is the constraint distance between the two particles. We can express
+the fact that the constraint distance has a $\LAM$ dependency by
 \beq
-g_k     =       \ve{r}_{k} - \left(\LL d_{k}^A + \LAM d_k^B\right)
+d_k     =       \LL d_{k}^A + \LAM d_k^B
 \eeq
-the contribution $\clam$ 
-to the Hamiltonian using Lagrange multipliers $\lambda$:
+
+Thus the $\LAM$-dependent constraint equation is
+\beq
+g_k     =       |\ve{r}_{k}| - \left(\LL d_{k}^A + \LAM d_k^B\right).
+\eeq
+
+The (zero) contribution $G$ to the Hamiltonian from the constraints
+(using Lagrange multipliers $\lambda_k$, which are logically distinct
+from the free-energy $\LAM$) is
 \bea
-\clam           &=&     \sum_k \lambda_k g_k    \\
-\dvdl{\clam}    &=&     \sum_k \lambda_k \left(d_k^B-d_k^A\right)
+G           &=&     \sum^K_k \lambda_k g_k    \\
+\dvdl{G}    &=&     \frac{\partial G}{\partial d_k} \dvdl{d_k} \\
+            &=&     - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)
 \eea
 
+For SHAKE, the constraint equations are
+\beq
+g_k     =       \ve{r}_{k}^2 - d_{k}^2
+\eeq
+with $d_k$ as before, so
+\bea
+\dvdl{G}    &=&     -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)
+\eea
 
 \subsection{Soft-core interactions\index{soft-core interactions}}
 \begin{figure}
@@ -2009,7 +2027,7 @@ used in the neighbor searching.
 For both Coulomb and van der Waals interactions there are interaction
 type selectors (termed {\tt vdwtype} and {\tt coulombtype}) and two
 parameters, for a total of six non-bonded interaction parameters. See
-\secref{mdpopt} for a complete description of these parameters.
+the User Guide for a complete description of these parameters.
 
 The neighbor searching (NS) can be performed using a single-range, or a twin-range 
 approach. Since the former is merely a special case of the latter, we will 
@@ -2971,7 +2989,7 @@ coarse-graining~\cite{wang_jpcb10}.  A {\gromacs} implementation can be found at
 % LocalWords:  fc ravdisre nstdisreout dipolar lll ccc orientational MSD const
 % LocalWords:  orire fitgrp nstorireout Drude intra Noskov et al fecalc coulrf
 % LocalWords:  polarizabilities parameterized sigeps Ek sc softcore GROMOS NBF
-% LocalWords:  hydrogens alkane vdwtype coulombtype mdpopt rlist rcoulomb rvdw
+% LocalWords:  hydrogens alkane vdwtype coulombtype rlist rcoulomb rvdw
 % LocalWords:  nstlist virial funcparm VdW jk jl fvsite fd vsites lcr vsitetop
 % LocalWords:  vsite lclllll lcl parameterize parameterization enercorr avcsix
 % LocalWords:  pcorr ecorr totalcoulomb dir fourierspacing ewald rtol Darden gz
index 8a496e649783c01b8be54c17c80f0cf1bed21a61..bbb018c2702e9acfbe5054bdf1c4bed0bb643247 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,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.
 
 \ifthenelse{\equal{\gmxlite}{1}}
 {
-\fcolorbox{blue}{blue}{\textcolor{white}{\fontsize{56}{64} \selectfont User Manual {\em ~Lite~}}}
+\fcolorbox{blue}{blue}{\textcolor{white}{\fontsize{56}{64} \selectfont Reference Manual {\em ~Lite~}}}
 }
 {
-\fcolorbox{blue}{blue}{\textcolor{white}{\fontsize{56}{64} \selectfont ~USER MANUAL~}}
+\fcolorbox{blue}{blue}{\textcolor{white}{\fontsize{56}{64} \selectfont ~Reference Manual~}}
 } % Brace matches ifthenelse test for gmxlite
 \vspace{4mm}
 
@@ -126,7 +126,7 @@ Uppsala University, Sweden.
 \vspace{1cm}
 {\fontsize{40}{50} \selectfont 
 GROMACS\\
-USER MANUAL\\[1cm]
+Reference Manual\\[1cm]
 }
 {\LARGE\bf Version \gmxver}\\[1cm]
 
@@ -245,7 +245,7 @@ available on our homepage, \wwwpage. Have fun.
 %       A P P E N D I C E S
 %
 \appendix
-\include{install}
+\include{technical}
 \include{implement}
 \include{averages}
 } % Brace matches ifthenelse test for gmxlite
diff --git a/docs/manual/install.tex b/docs/manual/install.tex
deleted file mode 100644 (file)
index 1db01e6..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-%
-% This file is part of the GROMACS molecular simulation package.
-%
-% Copyright (c) 2013,2014, by the GROMACS development team, led by
-% Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-% and including many others, as listed in the AUTHORS file in the
-% top-level source directory and at http://www.gromacs.org.
-%
-% GROMACS is free software; you can redistribute it and/or
-% modify it under the terms of the GNU Lesser General Public License
-% as published by the Free Software Foundation; either version 2.1
-% of the License, or (at your option) any later version.
-%
-% GROMACS is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-% Lesser General Public License for more details.
-%
-% You should have received a copy of the GNU Lesser General Public
-% License along with GROMACS; if not, see
-% http://www.gnu.org/licenses, or write to the Free Software Foundation,
-% Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-%
-% If you want to redistribute modifications to GROMACS, please
-% consider that scientific software is very special. Version
-% control is crucial - bugs must be traceable. We will be happy to
-% consider code for inclusion in the official distribution, but
-% derived work must not be called official GROMACS. Details are found
-% in the README & COPYING files - if they are missing, get the
-% official version at http://www.gromacs.org.
-%
-% To help us fund GROMACS development, we humbly ask that you cite
-% the research papers on the package. Check out http://www.gromacs.org.
-
-\chapter{Technical Details}
-
-\section{Mixed or Double precision}
-{\gromacs} can be compiled in either mixed\index{mixed
-precision|see{precision, mixed}}\index{precision, mixed} or
-\pawsindex{double}{precision}. Documentation of previous {\gromacs}
-versions referred to ``single precision'', but the implementation
-has made selective use of double precision for many years.
-Using single precision
-for all variables would lead to a significant reduction in accuracy.
-Although in ``mixed precision'' all state vectors, i.e. particle coordinates,
-velocities and forces, are stored in single precision, critical variables
-are double precision. A typical example of the latter is the virial,
-which is a sum over all forces in the system, which have varying signs.
-In addition, in many parts of the code we managed to avoid double precision
-for arithmetic, by paying attention to summation order or reorganization
-of mathematical expressions. The default configuration uses mixed precision,
-but it is easy to turn on double precision by adding the option
-{\tt -DGMX_DOUBLE=on} to {\tt cmake}. Double precision
-will be 20 to 100\% slower than mixed precision depending on the
-architecture you are running on. Double precision will use somewhat
-more memory and run input, energy and full-precision trajectory files
-will be almost twice as large.
-
-The energies in mixed precision are accurate up to the last decimal,
-the last one or two decimals of the forces are non-significant.
-The virial is less accurate than the forces, since the virial is only one
-order of magnitude larger than the size of each element in the sum over
-all atoms (\secref{virial}).
-In most cases this is not really a problem, since the fluctuations in the
-virial can be two orders of magnitude larger than the average.
-Using cut-offs for the Coulomb interactions cause large errors
-in the energies, forces, and virial.
-Even when using a reaction-field or lattice sum method, the errors
-are larger than, or comparable to, the errors due to the partial use of
-single precision.
-Since MD is chaotic, trajectories with very similar starting conditions will
-diverge rapidly, the divergence is faster in mixed precision than in double
-precision.
-
-For most simulations, mixed precision is accurate enough.
-In some cases double precision is required to get reasonable results:
-\begin{itemize}
-\item normal mode analysis,
-for the conjugate gradient or l-bfgs minimization and the calculation and
-diagonalization of the Hessian
-\item long-term energy conservation, especially for large systems
-\end{itemize}
-
-\section{Environment Variables}
-{\gromacs} programs may be influenced by the use of
-\normindex{environment variables}.  First of all, the variables set in
-the {\tt \normindex{GMXRC}} file are essential for running and
-compiling {\gromacs}. Some other useful environment variables are
-listed in the following sections. Most environment variables function
-by being set in your shell to any non-NULL value. Specific
-requirements are described below if other values need to be set. You
-should consult the documentation for your shell for instructions on
-how to set environment variables in the current shell, or in config
-files for future shells. Note that requirements for exporting
-environment variables to jobs run under batch control systems vary and
-you should consult your local documentation for details.
-
-{\bf Output Control}
-
-\begin{enumerate}
-
-\item   {\tt GMX_CONSTRAINTVIR}: print constraint virial and force virial energy terms.
-\item   {\tt GMX_MAXBACKUP}: {\gromacs} automatically backs up old
-        copies of files when trying to write a new file of the same
-        name, and this variable controls the maximum number of
-        backups that will be made, default 99. If set to 0 it fails to
-        run if any output file already exists. And if set to -1 it
-        overwrites any output file without making a backup.
-\item   {\tt GMX_NO_QUOTES}: if this is explicitly set, no cool quotes
-        will be printed at the end of a program.
-\item   {\tt GMX_SUPPRESS_DUMP}: prevent dumping of step files during
-        (for example) blowing up during failure of constraint
-        algorithms.
-\item   {\tt GMX_TPI_DUMP}: dump all configurations to a {\tt .pdb}
-        file that have an interaction energy less than the value set
-        in this environment variable.
-\item   {\tt GMX_VIEW_XPM}: {\tt GMX_VIEW_XVG}, {\tt
-        GMX_VIEW_EPS} and {\tt GMX_VIEW_PDB}, commands used to
-        automatically view \@ {\tt .xvg}, {\tt .xpm}, {\tt .eps}
-        and {\tt .pdb} file types, respectively; they default to {\tt xv}, {\tt xmgrace},
-        {\tt ghostview} and {\tt rasmol}. Set to empty to disable
-        automatic viewing of a particular file type. The command will
-        be forked off and run in the background at the same priority
-        as the {\gromacs} tool (which might not be what you want).
-        Be careful not to use a command which blocks the terminal
-        ({\eg} {\tt vi}), since multiple instances might be run.
-\item   {\tt GMX_VIRIAL_TEMPERATURE}: print virial temperature energy term
-\item   {\tt GMX_LOG_BUFFER}: the size of the buffer for file I/O. When set
-        to 0, all file I/O will be unbuffered and therefore very slow.
-        This can be handy for debugging purposes, because it ensures
-        that all files are always totally up-to-date.
-\item   {\tt GMX_LOGO_COLOR}: set display color for logo in {\tt \normindex{ngmx}}.
-\item   {\tt GMX_PRINT_LONGFORMAT}: use long float format when printing
-        decimal values.
-\item   {\tt GMX_COMPELDUMP}: Applies for computational electrophysiology setups
-        only (see section \ref{sec:compel}). The initial structure gets dumped to 
-        {\tt .pdb} file, which allows to check whether multimeric channels have 
-        the correct PBC representation. 
-\end{enumerate}
-
-
-{\bf Debugging}
-
-\begin{enumerate}
-
-\item   {\tt GMX_PRINT_DEBUG_LINES}: when set, print debugging info on line numbers.
-\item   {\tt GMX_DD_NST_DUMP}: number of steps that elapse between dumping
-        the current DD to a PDB file (default 0). This only takes effect
-        during domain decomposition, so it should typically be
-        0 (never), 1 (every DD phase) or a multiple of {\tt nstlist}.
-\item   {\tt GMX_DD_NST_DUMP_GRID}: number of steps that elapse between dumping
-        the current DD grid to a PDB file (default 0). This only takes effect
-        during domain decomposition, so it should typically be
-        0 (never), 1 (every DD phase) or a multiple of {\tt nstlist}.
-\item   {\tt GMX_DD_DEBUG}: general debugging trigger for every domain
-        decomposition (default 0, meaning off). Currently only checks
-        global-local atom index mapping for consistency.
-\item   {\tt GMX_DD_NPULSE}: over-ride the number of DD pulses used
-        (default 0, meaning no over-ride). Normally 1 or 2.
-
-%\item   There are a number of extra environment variables like these
-%        that are used in debugging - check the code!
-
-\end{enumerate}
-
-{\bf Performance and Run Control}
-
-\begin{enumerate}
-
-\item   {\tt GMX_DO_GALACTIC_DYNAMICS}: planetary simulations are made possible (just for fun) by setting
-        this environment variable, which allows setting {\tt epsilon_r = -1} in the {\tt .mdp}
-        file. Normally, {\tt epsilon_r} must be greater than zero to prevent a fatal error.
-        See {\wwwpage} for example input files for a planetary simulation.
-\item   {\tt GMX_ALLOW_CPT_MISMATCH}: when set, runs will not exit if the
-        ensemble set in the {\tt .tpr} file does not match that of the
-        {\tt .cpt} file.
-\item   {\tt GMX_CUDA_NB_EWALD_TWINCUT}: force the use of twin-range cutoff kernel even if {\tt rvdw} =
-        {\tt rcoulomb} after PP-PME load balancing. The switch to twin-range kernels is automated,
-        so this variable should be used only for benchmarking.
-\item   {\tt GMX_CUDA_NB_ANA_EWALD}: force the use of analytical Ewald kernels. Should be used only for benchmarking.
-\item   {\tt GMX_CUDA_NB_TAB_EWALD}: force the use of tabulated Ewald kernels. Should be used only for benchmarking.
-\item   {\tt GMX_CUDA_STREAMSYNC}: force the use of cudaStreamSynchronize on ECC-enabled GPUs, which leads
-        to performance loss due to a known CUDA driver bug present in API v5.0 NVIDIA drivers (pre-30x.xx).
-        Cannot be set simultaneously with {\tt GMX_NO_CUDA_STREAMSYNC}.
-\item   {\tt GMX_CYCLE_ALL}: times all code during runs.  Incompatible with threads.
-\item   {\tt GMX_CYCLE_BARRIER}: calls MPI_Barrier before each cycle start/stop call.
-\item   {\tt GMX_DD_ORDER_ZYX}: build domain decomposition cells in the order
-        (z, y, x) rather than the default (x, y, z).
-\item   {\tt GMX_DD_USE_SENDRECV2}: during constraint and vsite communication, use a pair
-        of {\tt MPI_SendRecv} calls instead of two simultaneous non-blocking calls
-        (default 0, meaning off). Might be faster on some MPI implementations.
-\item   {\tt GMX_DLB_BASED_ON_FLOPS}: do domain-decomposition dynamic load balancing based on flop count rather than
-        measured time elapsed (default 0, meaning off).
-        This makes the load balancing reproducible, which can be useful for debugging purposes.
-        A value of 1 uses the flops; a value $>1$ adds $(\mbox{value} - 1)\times5\%$ of noise to the flops to increase the imbalance and the scaling.
-\item   {\tt GMX_DLB_MAX_BOX_SCALING}: maximum percentage box scaling permitted per domain-decomposition
-        load-balancing step (default 10)
-\item   {\tt GMX_DD_RECORD_LOAD}: record DD load statistics for reporting at end of the run (default 1, meaning on)
-\item   {\tt GMX_DD_NST_SORT_CHARGE_GROUPS}: number of steps that elapse between re-sorting of the charge
-        groups (default 1). This only takes effect during domain decomposition, so should typically
-        be 0 (never), 1 (to mean at every domain decomposition), or a multiple of {\tt nstlist}.
-\item   {\tt GMX_DETAILED_PERF_STATS}: when set, print slightly more detailed performance information
-        to the {\tt .log} file. The resulting output is the way performance summary is reported in versions
-        4.5.x and thus may be useful for anyone using scripts to parse {\tt .log} files or standard output.
-\item   {\tt GMX_DISABLE_SIMD_KERNELS}: disables architecture-specific SIMD-optimized (SSE2, SSE4.1, AVX, etc.)
-        non-bonded kernels thus forcing the use of plain C kernels.
-\item   {\tt GMX_DISABLE_CUDA_TIMING}: timing of asynchronously executed GPU operations can have a
-        non-negligible overhead with short step times. Disabling timing can improve performance in these cases.
-\item   {\tt GMX_DISABLE_GPU_DETECTION}: when set, disables GPU detection even if {\tt \normindex{mdrun}} was compiled
-        with GPU support.
-\item   {\tt GMX_DISABLE_PINHT}: disable pinning of consecutive threads to physical cores when using
-        Intel hyperthreading. Controlled with {\tt \normindex{mdrun} -nopinht} and thus this environment
-        variable will likely be removed.
-\item   {\tt GMX_DISRE_ENSEMBLE_SIZE}: the number of systems for distance restraint ensemble
-        averaging. Takes an integer value.
-\item   {\tt 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 {\tt GMX_NO_NONBONDED}
-        case in which the non-bonded calculations will not be called, but the CPU-GPU transfer will also be skipped.
-\item   {\tt GMX_ENX_NO_FATAL}: disable exiting upon encountering a corrupted frame in an {\tt .edr}
-        file, allowing the use of all frames up until the corruption.
-\item   {\tt GMX_FORCE_UPDATE}: update forces when invoking {\tt \normindex{mdrun} -rerun}.
-\item   {\tt GMX_GPU_ID}: set in the same way as the {\tt \normindex{mdrun}} option {\tt -gpu_id}, {\tt GMX_GPU_ID}
-        allows the user to specify different GPU id-s, which can be useful for selecting different
-        devices on different compute nodes in a cluster.  Cannot be used in conjunction with {\tt -gpu_id}.
-\item   {\tt GMX_IGNORE_FSYNC_FAILURE_ENV}: allow {\tt \normindex{mdrun}} to continue even if
-        a file is missing.
-\item   {\tt GMX_LJCOMB_TOL}: when set to a floating-point value, overrides the default tolerance of
-        1e-5 for force-field floating-point parameters.
-\item   {\tt GMX_MAX_MPI_THREADS}: sets the maximum number of MPI-threads that {\tt \normindex{mdrun}}
-        can use.
-\item   {\tt GMX_MAXCONSTRWARN}: if set to -1, {\tt \normindex{mdrun}} will
-        not exit if it produces too many LINCS warnings.
-\item   {\tt GMX_NB_GENERIC}: use the generic C kernel.  Should be set if using
-        the group-based cutoff scheme and also sets {\tt GMX_NO_SOLV_OPT} to be true,
-        thus disabling solvent optimizations as well.
-\item   {\tt GMX_NB_MIN_CI}: neighbor list balancing parameter used when running on GPU. Sets the
-        target minimum number pair-lists in order to improve multi-processor load-balance for better
-        performance with small simulation systems. Must be set to a positive integer, the default value
-        is optimized for NVIDIA Fermi and Kepler GPUs, therefore changing it is not necessary for
-        normal usage, but it can be useful on future architectures.
-\item   {\tt GMX_NBLISTCG}: use neighbor list and kernels based on charge groups.
-\item   {\tt GMX_NBNXN_CYCLE}: when set, print detailed neighbor search cycle counting.
-\item   {\tt GMX_NBNXN_EWALD_ANALYTICAL}: force the use of analytical Ewald non-bonded kernels,
-        mutually exclusive of {\tt GMX_NBNXN_EWALD_TABLE}.
-\item   {\tt GMX_NBNXN_EWALD_TABLE}: force the use of tabulated Ewald non-bonded kernels,
-        mutually exclusive of {\tt GMX_NBNXN_EWALD_ANALYTICAL}.
-\item   {\tt GMX_NBNXN_SIMD_2XNN}: force the use of 2x(N+N) SIMD CPU non-bonded kernels,
-        mutually exclusive of {\tt GMX_NBNXN_SIMD_4XN}.
-\item   {\tt GMX_NBNXN_SIMD_4XN}: force the use of 4xN SIMD CPU non-bonded kernels,
-        mutually exclusive of {\tt GMX_NBNXN_SIMD_2XNN}.
-\item   {\tt GMX_NO_ALLVSALL}: disables optimized all-vs-all kernels.
-\item   {\tt GMX_NO_CART_REORDER}: used in initializing domain decomposition communicators. Rank reordering
-        is default, but can be switched off with this environment variable.
-\item   {\tt GMX_NO_CUDA_STREAMSYNC}: the opposite of {\tt GMX_CUDA_STREAMSYNC}. Disables the use of the
-        standard cudaStreamSynchronize-based GPU waiting to improve performance when using CUDA driver API
-        ealier than v5.0 with ECC-enabled GPUs.
-\item   {\tt GMX_NO_INT}, {\tt GMX_NO_TERM}, {\tt GMX_NO_USR1}: disable signal handlers for SIGINT,
-        SIGTERM, and SIGUSR1, respectively.
-\item   {\tt GMX_NO_NODECOMM}: do not use separate inter- and intra-node communicators.
-\item   {\tt GMX_NO_NONBONDED}: 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.
-\item   {\tt GMX_NO_PULLVIR}: when set, do not add virial contribution to COM pull forces.
-\item   {\tt GMX_NOCHARGEGROUPS}: disables multi-atom charge groups, {\ie} each atom 
-        in all non-solvent molecules is assigned its own charge group.
-\item   {\tt GMX_NOPREDICT}: shell positions are not predicted.
-\item   {\tt GMX_NO_SOLV_OPT}: turns off solvent optimizations; automatic if {\tt GMX_NB_GENERIC}
-        is enabled.
-\item   {\tt GMX_NSCELL_NCG}: the ideal number of charge groups per neighbor searching grid cell is hard-coded
-        to a value of 10. Setting this environment variable to any other integer value overrides this hard-coded
-        value.
-\item   {\tt GMX_PME_NTHREADS}: set the number of OpenMP or PME threads (overrides the number guessed by 
-        {\tt \normindex{mdrun}}.
-\item   {\tt GMX_PME_P3M}: use P3M-optimized influence function instead of smooth PME B-spline interpolation.
-\item   {\tt GMX_PME_THREAD_DIVISION}: PME thread division in the format ``x y z'' for all three dimensions. The
-        sum of the threads in each dimension must equal the total number of PME threads (set in 
-        {\tt GMX_PME_NTHREADS}).
-\item   {\tt GMX_PMEONEDD}: if the number of domain decomposition cells is set to 1 for both x and y, 
-        decompose PME in one dimension.
-\item   {\tt GMX_REQUIRE_SHELL_INIT}: require that shell positions are initiated.
-\item   {\tt GMX_REQUIRE_TABLES}: require the use of tabulated Coulombic
-        and van der Waals interactions.
-\item   {\tt GMX_SCSIGMA_MIN}: the minimum value for soft-core $\sigma$. {\bf Note} that this value is set
-        using the {\tt sc-sigma} keyword in the {\tt .mdp} file, but this environment variable can be used
-        to reproduce pre-4.5 behavior with respect to this parameter.
-\item   {\tt GMX_TPIC_MASSES}: should contain multiple masses used for test particle insertion into a cavity.
-        The center of mass of the last atoms is used for insertion into the cavity.
-\item   {\tt GMX_USE_GRAPH}: use graph for bonded interactions.
-\item   {\tt GMX_VERLET_BUFFER_RES}: resolution of buffer size in Verlet cutoff scheme.  The default value is
-        0.001, but can be overridden with this environment variable.
-\item   {\tt GMX_VERLET_SCHEME}: convert from group-based to Verlet cutoff scheme, even if the {\tt cutoff_scheme} is
-        not set to use Verlet in the {\tt .mdp} file. It is unnecessary since the {\tt -testverlet} option of
-        {\tt \normindex{mdrun}} has the same functionality, but it is maintained for backwards compatibility.
-\item   {\tt MPIRUN}: the {\tt mpirun} command used by {\tt \normindex{g_tune_pme}}.
-\item   {\tt MDRUN}: the {\tt \normindex{mdrun}} command used by {\tt \normindex{g_tune_pme}}.
-\item   {\tt GMX_NSTLIST}: sets the default value for {\tt nstlist}, preventing it from being tuned during
-        {\tt \normindex{mdrun}} startup when using the Verlet cutoff scheme.
-\item   {\tt GMX_USE_TREEREDUCE}: use tree reduction for nbnxn force reduction. Potentially faster for large number of 
-        OpenMP threads (if memory locality is important).
-
-\end{enumerate}
-
-{\bf Analysis and Core Functions}
-
-\begin{enumerate}
-
-\item   {\tt GMX_QM_ACCURACY}: accuracy in Gaussian L510 (MC-SCF) component program.
-\item   {\tt GMX_QM_ORCA_BASENAME}: prefix of {\tt .tpr} files, used in Orca calculations
-        for input and output file names.
-\item   {\tt GMX_QM_CPMCSCF}: when set to a nonzero value, Gaussian QM calculations will
-        iteratively solve the CP-MCSCF equations.
-\item   {\tt GMX_QM_MODIFIED_LINKS_DIR}: location of modified links in Gaussian.
-\item   {\tt DSSP}: used by {\tt \normindex{do_dssp}} to point to the {\tt dssp}
-        executable (not just its path).
-\item   {\tt GMX_QM_GAUSS_DIR}: directory where Gaussian is installed.
-\item   {\tt GMX_QM_GAUSS_EXE}: name of the Gaussian executable.
-\item   {\tt GMX_DIPOLE_SPACING}: spacing used by {\tt \normindex{g_dipoles}}.
-\item   {\tt GMX_MAXRESRENUM}: sets the maximum number of residues to be renumbered by
-        {\tt \normindex{grompp}}. A value of -1 indicates all residues should be renumbered.
-\item   {\tt GMX_FFRTP_TER_RENAME}: Some force fields (like AMBER) use specific names for N- and C-
-        terminal residues (NXXX and CXXX) as {\tt .rtp} entries that are normally renamed. Setting
-        this environment variable disables this renaming.
-\item   {\tt GMX_PATH_GZIP}: {\tt gunzip} executable, used by {\tt \normindex{g_wham}}.
-\item   {\tt GMX_FONT}: name of X11 font used by {\tt \normindex{ngmx}}.
-\item   {\tt GMXTIMEUNIT}: the time unit used in output files, can be
-        anything in fs, ps, ns, us, ms, s, m or h.
-\item   {\tt GMX_QM_GAUSSIAN_MEMORY}: memory used for Gaussian QM calculation.
-\item   {\tt MULTIPROT}: name of the {\tt multiprot} executable, used by the
-        contributed program {\tt \normindex{do_multiprot}}.
-\item   {\tt NCPUS}: number of CPUs to be used for Gaussian QM calculation
-\item   {\tt GMX_ORCA_PATH}: directory where Orca is installed.
-\item   {\tt GMX_QM_SA_STEP}: simulated annealing step size for Gaussian QM calculation.
-\item   {\tt GMX_QM_GROUND_STATE}: defines state for Gaussian surface hopping calculation.
-\item   {\tt GMX_TOTAL}: name of the {\tt total} executable used by the contributed
-        {\tt \normindex{do_shift}} program.
-\item   {\tt GMX_ENER_VERBOSE}: make {\tt \normindex{g_energy}} and {\tt \normindex{eneconv}}
-        loud and noisy.
-\item   {\tt VMD_PLUGIN_PATH}: where to find VMD plug-ins. Needed to be
-        able to read file formats recognized only by a VMD plug-in.
-\item   {\tt VMDDIR}: base path of VMD installation.
-\item   {\tt GMX_USE_XMGR}: sets viewer to {\tt xmgr} (deprecated) instead of {\tt xmgrace}.
-
-\end{enumerate}
-
-\section{Running {\gromacs} in parallel}
-By default {\gromacs} will be compiled with the built-in thread-MPI library.
-This library handles communication between threads on a single
-node more efficiently than using an external MPI library.
-To run {\gromacs} in parallel over multiple nodes, e.g. on a cluster,
-you need to configure and compile {\gromacs} with an external
-MPI library. All supercomputers are shipped with MPI libraries optimized for 
-that particular platform, and there are several good free MPI
-implementations; OpenMPI is usually a good choice.
-Note that MPI and thread-MPI support are mutually incompatible.
-
-In addition to MPI parallelization, {\gromacs} supports also
-thread-parallelization through \normindex{OpenMP}. MPI and OpenMP parallelization
-can be combined, which results in, so called, hybrid parallelization. It can offer
-better performance and scaling in some cases.
-
-See {\wwwpage} for details on the use and performance of the different
-parallelization schemes.
-
-\section{Running {\gromacs} on \normindex{GPUs}}
-As of version 4.6, {\gromacs} has native GPU support through CUDA.
-Note that {\gromacs} only off-loads the most compute intensive parts
-to the GPU, currently the non-bonded interactions, and does all other
-parts of the MD calculation on the CPU. The requirements for the CUDA code
-are an Nvidia GPU with compute capability $\geq 2.0$, i.e. at
-least Fermi class.
-In many cases {\tt cmake} can auto-detect GPUs and the support will be
-configured automatically. To be sure GPU support is configured, pass
-the {\tt -DGMX_GPU=on} option to {\tt cmake}. The actual use of GPUs
-is decided at run time by {\tt mdrun}, depending on the availability
-of (suitable) GPUs and on the run input settings. A binary compiled
-with GPU support can also run CPU only simulations. Use {\tt mdrun -nb cpu}
-to force a simulation to run on CPUs only. Only simulations with the Verlet
-cut-off scheme will run on a GPU. To test performance of old tpr files
-with GPUs, you can use the {\tt -testverlet} option of {\tt mdrun},
-but as this doesn't do the full parameter consistency check of {\tt grommp},
-you should not use this option for production simulations.
-Getting good performance with {\gromacs} on GPUs is easy,
-but getting best performance can be difficult.
-Please check {\wwwpage} for up to date information on GPU usage.
-
-% LocalWords:  Opteron Itanium PowerPC Altivec Athlon Fortran virial bfgs Nasm
-% LocalWords:  diagonalization Cygwin MPI Multi GMXHOME extern gmx tx pid buf
-% LocalWords:  bufsize txs rx rxs init nprocs fp msg GMXRC DUMPNL BUFS GMXNPRI
-% LocalWords:  unbuffered SGI npri mdrun covar nmeig setenv XPM XVG EPS
-% LocalWords:  PDB xvg xpm eps pdb xmgrace ghostview rasmol GMXTIMEUNIT fs dssp
-% LocalWords:  mpi distclean ing mpirun goofus doofus fred topol np
-% LocalWords:  internet gromacs DGMX cmake SIMD intrinsics AVX PME XN
-% LocalWords:  Verlet pre config CONSTRAINTVIR MAXBACKUP TPI ngmx mdp
-% LocalWords:  LONGFORMAT DISTGCT CPT tpr cpt CUDA EWALD TWINCUT rvdw
-% LocalWords:  rcoulomb STREAMSYNC cudaStreamSynchronized ECC GPUs sc
-% LocalWords:  ZYX PERF GPU PINHT hyperthreading DISRE NONBONDED ENX
-% LocalWords:  edr ENER gpu FSYNC ENV LJCOMB TOL MAXCONSTRWARN LINCS
-% LocalWords:  SOLV NBLISTCG NBNXN XNN ALLVSALL cudaStreamSynchronize
-% LocalWords:  USR SIGINT SIGTERM SIGUSR NODECOMM intra PULLVIR multi
-% LocalWords:  NOCHARGEGROUPS NOPREDICT NSCELL NCG NTHREADS OpenMP CP
-% LocalWords:  PMEONEDD Coulombic der Waals SCSIGMA TPIC GMXNPRIALL
-% LocalWords:  GOMP KMP pme NSTLIST ENVVAR nstlist startup OMP NUM ps
-% LocalWords:  ACC SCF BASENAME Orca CPMCSCF MCSCF DEVEL EXE GKRWIDTH
-% LocalWords:  MAXRESRENUM grompp FFRTP TER NXXX CXXX rtp GZIP gunzip
-% LocalWords:  GMXFONT ns MEM MULTIPROT multiprot NCPUS CPUs OPENMM
-% LocalWords:  PLUGIN OpenMM plugins SASTEP TESTMC eneconv VMD VMDDIR
-% LocalWords:  GMX_USE_XMGR xmgr parallelization nt online Nvidia nb cpu
-% LocalWords:  testverlet grommp
index ed8442fbb3b586ac81a1d5005e2c4cddd750b920..ed4b53ce251289f9e3f8bbf059b64021464c12f7 100644 (file)
 \newcommand{\ttw}{4.33cm}  % 1/3 of the textwidth
 \newcommand{\htw}{7.5cm}  % 1/2 of the textwidth
 \newcommand{\ntw}{13cm} % 0.9 of the textwidth
-\newcommand{\gmxver}{@PROJECT_VERSION@}
+\newcommand{\gmxver}{@GMX_VERSION_STRING@}
 \newcommand{\gmxyear}{\the\year}
 \newcommand{\figref}[1]{Fig.~\ref{fig:#1}}
 \newcommand{\figsref}[2]{Figs.~\ref{fig:#1} and ~\ref{fig:#2}}
diff --git a/docs/manual/mkmdp b/docs/manual/mkmdp
deleted file mode 100755 (executable)
index c5cd752..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/bash
-
-if [[ ! -d $1 ]]; then
-  echo "Error: provide the GROMACS html directory as first argument."
-  exit
-fi
-
-GMXHTMLDIR=$1
-
-dir=${PWD}
-
-TEXDIR=.
-MANDIR=online
-HTML=$GMXHTMLDIR
-HTMLOL=$HTML/$MANDIR
-HTMLMDPOPT=$HTMLOL/mdp_opt.html
-TEXMDPOPT=$TEXDIR/mdp_opt.tex
-
-echo "Will convert $HTMLMDPOPT (html format)"
-echo "to $TEXMDPOPT (latex format)"
-
-echo -n "parsing."
-sed \
--e 's/<[aA] [^>]*>//g' \
--e 's/<\/[aA]>//g' \
--e 's/<[iI][mM][gG] [^>]*>//g' \
--e 's/<[pP]>//g' \
--e 's/<\/[pP]>//g' \
--e 's/&[nN][bB][sS][pP];/~/g' \
--e 's/<[hH][rR]>//g' \
-$HTMLMDPOPT > temp1
-
-echo -n "."
-awk '{
-  if (NF) {
-    if ( ($1 == "<P>") || ($1 == "<p>") || ($1 == "<BR>") || ($1 == "<br>") )
-      print ""
-    else
-      print $0
-    }
-  }' temp1 > temp2
-echo -n "."
-sed \
--e 's/&gt;=/$\\geq$/g;s/&ge;/$\\geq$/g' \
--e 's/&gt;/$\>$/g' \
--e 's/&lt;=/$\\leq$/g;s/&le;/$\\leq$/g' \
--e 's/&lt;/$\<$/g' \
--e 's/_/_/g' \
--e 's/%/\\%/g' \
--e 's/&/\\&/g' \
--e 's/<sup>\([^<]*\)<\/sup>/$^{\1}$/g' \
--e 's/<sub>\([^<]*\)<\/sub>/$_{\1}$/g' \
--e 's/<[tT][tT]>\([^<]*\)<\/[tT][tT]>/{\\tt \1}/g' \
--e 's/<[pP][rR][eE]>\([^<]*\)<\/[pP][rR][eE]>/\\\\{\\tt\1}\\\\/g' \
--e 's/<\!--Idx-->\([^>]*\)<\!--EIdx-->/\\normindex{\1}/g' \
--e 's/<\!--QuietIdx-->\([^>]*\)<\!--EQuietIdx-->/\\index{\1}/g' \
--e 's/<[hH]1>\([^<]*\)<\/[hH]1>/\\section{\1}/g' \
--e 's/<[hH]3>\([^<]*\)<\/[hH]3>/\\subsection{\1}/g' \
-temp2 > temp3
-
-echo -n "."
-sed \
--e 's/<[uU][lL]>/\\begin{itemize}/g' \
--e 's/<\/[uU][lL]>/\\end{itemize}/g' \
--e 's/<[lL][iI]>/\\item /g' \
--e 's/<[dD][lL] [cC][oO][^>]*>/\\vspace{-2ex}\\begin{description}[font=\\ttfamily]/g' \
--e 's/<[dD][lL][^>]*>/\\begin{description}[font=\\ttfamily]/g' \
--e 's/<\/[dD][lL]>/\\end{description}/g' \
--e 's/<[dD][tT]><[bB]>\(.*\)<\/[bB]>\(.*\)<\/[dD][tT]>/\\item[\1] \2\\hfill\\\\/g' \
--e 's/<[dD][tT]>\([^<]*\)<\/[dD][tT]>/\\item[\1]\\hfill\\\\/g' \
--e 's/<[bB]>\([^<]*\)<\/[bB]>/{\\tt \1}/g' \
--e 's/<[iI]>\([^<]*\)<\/[iI]>/{\\em \1}/g' \
--e 's/<[dD][dD]>//g' \
--e 's/<\/[dD][dD]>//g' \
--e 's/<\/[dD][tT]>//g' \
--e 's/ \(\[[^]]*\]\)\]/ {\1}\]/g' \
--e 's/\$lt\$/$<$/g' \
--e 's/\$gt\$/$>$/g' \
--e 's/e\.g\./{\\eg}/g' \
--e 's/i\.e\./{\\ie}/g' \
-temp3 > temp4
-
-echo -n "."
-awk 'BEGIN { printf("\\label{sec:mdpopt}\n"); }\
-{\
-  if ( index($0,"subsection") ) {\
-    if ( index($0,"General") ) {\
-      output=1;\
-    } else if ( index($0,"Index") )\
-      output=0;\
-  }\
-  if (output) print;\
-}' temp4 > $TEXMDPOPT
-
-echo "."
-
-rm temp1 temp2 temp3 temp4
-
-#last line
-exit
index 3c14898f4be4dc2ef87ab17ccc77ca0cc7b98dcc..0774ae539cbb954bcf42bb600075a03f676570b2 100644 (file)
@@ -7398,7 +7398,7 @@ rov and V. S. Ananthanarayanan},
 @Article{PSmith93c,
   author =      {P. E. Smith and W. F. van Gunsteren},
   title =       {{The Viscosity of SPC and SPC/E Water}},
-  journal =     BTcpc,
+  journal =     BTcpl,
   year =        1993,
   volume =      215,
   pages =       {315--318}
index d9f6cb3232801af863820f85c8e4b837bb434bba..ae998ef0db8e819e28dc2cbbdc74460372bd91ac 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,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.
@@ -71,6 +71,9 @@ present on UNIX since they are necessary for NFS support.
 \input{files}
 
 \section{Run Parameters\swapindexquiet{run}{parameter}}
-\input{mdp_opt}
+% TODO Check this is up to date when things stabilize
+The descriptions of {\tt .mdp} parameters can be found at
+\url{http://manual.gromacs.org/current/mdp-options.html}
+or in your installation at {\tt share/gromacs/html/mdp-options.html}
 
 % LocalWords:  online html GMXRC MANPATH grompp xdr NFS
index 7a86051ddb3fb4bf107fcde734e84c492b17d86a..ec8a53142efc4d39fafbd640a0c38965f92ec2a5 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,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.
@@ -1623,7 +1623,7 @@ If you want to have different functional forms between different
 groups of atoms, this can be set through energy groups.
 Different tables can be used for non-bonded interactions between
 different energy groups pairs through the {\tt .mdp} option {\tt energygrp-table}
-(see \secref{mdpopt}).
+(see details in the User Guide).
 Atoms that should interact with a different potential should
 be put into different energy groups.
 Between group pairs which are not listed in {\tt energygrp-table},
@@ -2128,7 +2128,7 @@ in contrast to energies displayed from NAMD simulations.
 % LocalWords:  vsitehydro planarity chirality pdb gmx virtualize virtualized xz
 % LocalWords:  vis massless tryptophan histidine phenyl parameterizing ij PPPM
 % LocalWords:  parameterization Berendsen rlist coulombtype rcoulomb vdwtype LJ
-% LocalWords:  rvdw energygrp mdrun pre GMXLIB mdpopt MOPAC GAMESS CPMD ONIOM
+% LocalWords:  rvdw energygrp mdrun pre GMXLIB MOPAC GAMESS CPMD ONIOM
 % LocalWords:  Morokuma iJ AQ AJ initio atomtype QMatom MMatom QMMM grps et al
 % LocalWords:  QMmethod QMbasis QMMMscheme RHF DFT LYP CASSCF MMVB CASelectrons
 % LocalWords:  CASorbitals planewavecutoff STO QMcharge QMmult diabatic edr
index 8a4f169a5f751bdf747e3d641a67ea17895f941a..16c31da177a36e87c7aaa9003bf52ee14a590157 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 DEFINED OUTPUT_DIR OR NOT DEFINED SOURCE_HTML_DIR)
+if (NOT DEFINED GMX_EXECUTABLE OR NOT DEFINED OUTPUT_DIR OR NOT DEFINED SOURCE_HTML_DIR)
     message(FATAL_ERROR "Required input parameter not set")
 endif()
 
-function(PRE_EXPORT_ACTIONS)
-    file(MAKE_DIRECTORY ${OUTPUT_DIR})
-    file(MAKE_DIRECTORY ${OUTPUT_DIR}/programs)
-    file(COPY ${SOURCE_HTML_DIR}/header.html.in DESTINATION .)
-    file(COPY ${SOURCE_HTML_DIR}/footer.html DESTINATION .)
-    file(COPY ${SOURCE_HTML_DIR}/links.dat   DESTINATION .)
-endfunction()
+file(MAKE_DIRECTORY ${OUTPUT_DIR})
+file(MAKE_DIRECTORY ${OUTPUT_DIR}/programs)
+file(COPY ${SOURCE_HTML_DIR}/header.html.in DESTINATION .)
+file(COPY ${SOURCE_HTML_DIR}/footer.html DESTINATION .)
+file(COPY ${SOURCE_HTML_DIR}/links.dat   DESTINATION .)
+
+# This is generated by gmx help -export html
+set(HEADER_FILE header.html)
 
-function(POST_EXPORT_ACTIONS)
-    # This is generated by gmx help -export html
-    set(HEADER_FILE header.html)
-    set(FOOTER_FILE ${SOURCE_HTML_DIR}/footer.html)
-    file(READ ${HEADER_FILE} HEADER_TEXT)
-    file(READ ${FOOTER_FILE} FOOTER_TEXT)
-    set(_title_re "[Tt][Ii][Tt][Ll][Ee]")
+execute_process(
+    COMMAND ${GMX_EXECUTABLE} -quiet help -export html
+    RESULT_VARIABLE exitcode)
+if (exitcode)
+    # Ensure that no partial output is left behind.
+    file(REMOVE_RECURSE ${OUTPUT_DIR})
+    file(REMOVE ${HEADER_FILE})
+    message(FATAL_ERROR
+        "Failed to generate HTML help. "
+        "Set GMX_BUILD_HELP=OFF or GMX_BUILD_HELP=AUTO if you want to skip them.\n"
+        "Error/exit code: ${exitcode}")
+endif()
 
-    function(CREATE_HTML_FILE SOURCE_FILE ROOTPATH)
-        file(RELATIVE_PATH _rel_path ${SOURCE_HTML_DIR} ${SOURCE_FILE})
-        file(READ ${SOURCE_FILE} _content)
-        string(REGEX REPLACE "^ *<${_title_re}>(.*)</${_title_re}>\n" "" _content "${_content}")
-        set(TITLE "${CMAKE_MATCH_1}")
-        string(CONFIGURE "${HEADER_TEXT}" _header @ONLY)
-        set(_content "${_header}${_content}${FOOTER_TEXT}")
-        file(WRITE ${OUTPUT_DIR}/${_rel_path} "${_content}")
-    endfunction()
+set(FOOTER_FILE ${SOURCE_HTML_DIR}/footer.html)
+file(READ ${HEADER_FILE} HEADER_TEXT)
+file(READ ${FOOTER_FILE} FOOTER_TEXT)
+set(_title_re "[Tt][Ii][Tt][Ll][Ee]")
 
-    create_html_file(${SOURCE_HTML_DIR}/online.html "")
-    file(COPY ${SOURCE_HTML_DIR}/images DESTINATION ${OUTPUT_DIR})
-    file(MAKE_DIRECTORY ${OUTPUT_DIR}/online)
-    file(COPY ${SOURCE_HTML_DIR}/online/style.css DESTINATION ${OUTPUT_DIR}/online)
-    file(GLOB _source_files ${SOURCE_HTML_DIR}/online/*.html)
-    foreach(_file ${_source_files})
-        create_html_file(${_file} "../")
-    endforeach()
+function(CREATE_HTML_FILE SOURCE_FILE ROOTPATH)
+    file(RELATIVE_PATH _rel_path ${SOURCE_HTML_DIR} ${SOURCE_FILE})
+    file(READ ${SOURCE_FILE} _content)
+    string(REGEX REPLACE "^ *<${_title_re}>(.*)</${_title_re}>\n" "" _content "${_content}")
+    set(TITLE "${CMAKE_MATCH_1}")
+    string(CONFIGURE "${HEADER_TEXT}" _header @ONLY)
+    set(_content "${_header}${_content}${FOOTER_TEXT}")
+    file(WRITE ${OUTPUT_DIR}/${_rel_path} "${_content}")
 endfunction()
 
-if (STEP STREQUAL "PRE")
-    pre_export_actions()
-elseif (STEP STREQUAL "POST")
-    post_export_actions()
-else()
-    message(FATAL_ERROR "Unknown parameter STEP=${STEP}")
-endif()
+create_html_file(${SOURCE_HTML_DIR}/online.html "")
+file(COPY ${SOURCE_HTML_DIR}/images DESTINATION ${OUTPUT_DIR})
+file(MAKE_DIRECTORY ${OUTPUT_DIR}/online)
+file(COPY ${SOURCE_HTML_DIR}/online/style.css DESTINATION ${OUTPUT_DIR}/online)
+file(GLOB _source_files ${SOURCE_HTML_DIR}/online/*.html)
+foreach(_file ${_source_files})
+    create_html_file(${_file} "../")
+endforeach()
index 861151879c922bfdb290c138c33c6dbe3f7cfbbf..2b119f9afcc9d5a733267d1717386b6d92032ac9 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.
 
+include(gmxCustomCommandUtilities)
+
 set(OUTPUT_DIR final)
-set(HTML_PAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${OUTPUT_DIR})
 
-if(SOURCE_IS_SOURCE_DISTRIBUTION)
-    # Make sure source package contains HTML pages.
-    if(NOT EXISTS "${HTML_PAGE_DIR}/online.html")
-        message(FATAL_ERROR "Online HTML pages are missing from source package.")
-    endif()
-endif()
+set(HTML_PAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${OUTPUT_DIR})
+if (GMX_BUILD_HELP)
+    # Unlike the man and completion targets, this target is not built
+    # automatically with GMX_BUILD_HELP=AUTO, since most people will not
+    # notice it missing.
+    file(GLOB_RECURSE deps
+         ${CMAKE_CURRENT_SOURCE_DIR}/images/*
+         ${CMAKE_CURRENT_SOURCE_DIR}/*.html
+         ${CMAKE_CURRENT_SOURCE_DIR}/*.css
+         )
+    list(APPEND deps
+         ${CMAKE_CURRENT_SOURCE_DIR}/BuildHtmlHelp.cmake
+         ${CMAKE_CURRENT_SOURCE_DIR}/header.html.in
+         ${CMAKE_CURRENT_SOURCE_DIR}/links.dat
+         )
 
-add_custom_target(html
-    ${CMAKE_COMMAND}
-    -D SOURCE_HTML_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-    -D OUTPUT_DIR=${OUTPUT_DIR}
-    -D STEP=PRE
-    -P ${CMAKE_CURRENT_SOURCE_DIR}/BuildHtmlHelp.cmake
-    COMMAND gmx -quiet help -export html
-    COMMAND ${CMAKE_COMMAND}
-    -D SOURCE_HTML_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-    -D OUTPUT_DIR=${OUTPUT_DIR}
-    -D STEP=POST
-    -P ${CMAKE_CURRENT_SOURCE_DIR}/BuildHtmlHelp.cmake
-    COMMENT "Generating HTML help"
-    VERBATIM)
+    gmx_add_custom_output_target(html OUTPUT STAMP
+        COMMAND ${CMAKE_COMMAND}
+            -D GMX_EXECUTABLE=$<TARGET_FILE:gmx>
+            -D SOURCE_HTML_DIR=${CMAKE_CURRENT_SOURCE_DIR}
+            -D OUTPUT_DIR=${OUTPUT_DIR}
+            -P ${CMAKE_CURRENT_SOURCE_DIR}/BuildHtmlHelp.cmake
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        DEPENDS gmx ${deps}
+        COMMENT "Generating HTML help")
 
-if (GMX_BUILD_HELP)
-    set_target_properties(html PROPERTIES EXCLUDE_FROM_ALL OFF)
+    if (GMX_BUILD_HELP_FORCE)
+        set_target_properties(html PROPERTIES EXCLUDE_FROM_ALL OFF)
+    endif()
     set_directory_properties(PROPERTIES
         ADDITIONAL_MAKE_CLEAN_FILES "${OUTPUT_DIR};header.html")
     set(HTML_PAGE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_DIR})
 endif()
 
-if (SOURCE_IS_SOURCE_DISTRIBUTION OR GMX_BUILD_HELP)
+if (SOURCE_IS_SOURCE_DISTRIBUTION OR GMX_BUILD_HELP_FORCE)
     install(DIRECTORY ${HTML_PAGE_DIR}/
         DESTINATION ${DATA_INSTALL_DIR}/html
         COMPONENT html)
 endif()
+gmx_cpack_add_generated_source_directory(${OUTPUT_DIR})
index 8ee9ba7b0ccbdabeaea6cb2eefc1c1aa14bd2eb8..01ee831cccefe0f468669db7165cbe30d930ec25 100644 (file)
@@ -19,10 +19,7 @@ rtp
 tex
 top
 tng
-tpa
-tpb
 tpr
-trj
 trr
 xpm
 xtc
index fb7d1cf555081a5f85770f5bf0b3c23b09c07dfd..9b1a1981fa1f6fc11430f75ca5a7ca204dc8a100 100644 (file)
@@ -1,26 +1,13 @@
+<!-- TODO migrate remaining content to new user guide (in future commits) -->
 <TITLE>GROMACS Online Reference</TITLE>
 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=10>
 <TR>
 <TD VALIGN=top WIDTH="25%">
 <h3>General</h3>
-<A HREF="online/getting_started.html">Getting Started</a>
-<br><br>
 <A HREF="online/flow.html">Flow Chart</a>
 <br><br>
 <A HREF="online/files.html">File Formats</a>
 <br><br>
-<A HREF="online/mdp_opt.html">mdp options</a>
-<br><br>
-<A HREF="http://www.gromacs.org/Documentation/FAQs">FAQ</a>
-<br>
-</TD>
-<TD VALIGN=top WIDTH=75%>
-<h3>Programs</h3>
-<A HREF="online/options.html">Options</a>
-<br><br>
-<a href="programs/byname.html">All Programs Alphabetically</a>
-<br><br>
-<a href="programs/bytopic.html">Programs by Topic</a>
 </TD>
 </TR>
 </TABLE>
index 2c138926ada6ccd386e93c05bf9444f85f6319eb..7cbdbe376c15580f6651cbc26c70b5265f2a160c 100644 (file)
@@ -2,7 +2,7 @@
 <h3>Description</h3>
 The dlg file format is used as input for the
 <a href="../programs/gmx-view.html">gmx view</a>
-trajectory viewer. These files are not meant to be altered bu the end user.
+trajectory viewer. These files are not meant to be altered by the end user.
 <h3>Sample</h3>
 <pre>  
 grid 39 18 {
index ee57c53221123e038d6e45c2f494062e6da11cd3..e4582178676924017fe69d9aae3b6222d323444f 100644 (file)
 <dt><b>Generic structure formats:</b>
 <a href="gro.html">gro</a>,
 <a href="g96.html">g96</a>,
-<a href="pdb.html">pdb</a>,
-<a href="tpr.html">tpr</a>,
-<a href="tpb.html">tpb</a> or
-<a href="tpa.html">tpa</a>
+<a href="pdb.html">pdb</a>, or
+<a href="tpr.html">tpr</a>
 <dt><b>Structure+mass(db):</b>
 <a href="tpr.html">tpr</a>,
-<a href="tpb.html">tpb</a>,
-<a href="tpa.html">tpa</a>,
 <a href="gro.html">gro</a>,
 <a href="g96.html">g96</a> or
 <a href="pdb.html">pdb</a>.
@@ -45,35 +41,26 @@ When gro or pdb is used approximate masses will be read from the mass database.
 <dd><dl compact>
 <dt><a href="tpr.html">tpr</a> <dd>system topology, parameters, coordinates 
 and velocities (binary, portable)
-<dt><a href="tpa.html">tpa</a> <dd>system topology, parameters, coordinates 
-and velocities (ascii)
-<dt><a href="tpb.html">tpb</a> <dd>system topology, parameters, coordinates 
-and velocities (binary)
 <dt><b>Generic run input file formats:</b>
-<a href="tpr.html">tpr</a>,
-<a href="tpb.html">tpb</a> or
-<a href="tpa.html">tpa</a>
+<a href="tpr.html">tpr</a>
 
 </dl>
 
 <br><dt><h3>Trajectory files</h3>
 <dd><dl compact>
 <dt><a href="tng.html">tng</a> <dd>Any kind of data (compressed, portable, any precision)
-<dt><a href="trj.html">trj</a> <dd>x, v and f (binary, full precision)
 <dt><a href="trr.html">trr</a> <dd>x, v and f (binary, full precision, portable)
 <dt><a href="xtc.html">xtc</a> <dd>x only (compressed, portable, any precision)
 <dt><a href="gro.html">gro</a> <dd>x and v (ascii, any precision)
 <dt><a href="g96.html">g96</a> <dd>x only (ascii, fixed high precision)
 <dt><a href="pdb.html">pdb</a> <dd>x only (ascii, reduced precision)
 <dt><b>Formats for full-precision data:</b>
-<a href="tng.html">tng</a>,
-<a href="trr.html">trr</a> or
-<a href="trj.html">trj</a>
+<a href="tng.html">tng</a> or
+<a href="trr.html">trr</a>
 <dt><b>Generic trajectory formats:</b>
 <a href="tng.html">tng</a>,
 <a href="xtc.html">xtc</a>,
 <a href="trr.html">trr</a>,
-<a href="trj.html">trj</a>,
 <a href="gro.html">gro</a>,
 <a href="g96.html">g96</a>,
 <a href="pdb.html">pdb</a> or
index 95ef4ae5d32dac34533842c3cfb532d32acb31a2..a57d9836d880cb4bc52c927aa5b2748d4c1e1475 100644 (file)
@@ -2,7 +2,7 @@
 <p>This is a flow chart of a typical GROMACS MD run of a protein
 in a box of water.
 A more detailed example is available in the
-<A HREF="getting_started.html">Getting Started</A>
+<A HREF="../user-guide.html#getting-started-with-gromacs">Getting Started</A>
 section. Several steps of energy minimization may be necessary,
 these consist of cycles: grompp -&gt; mdrun.
 <p>
diff --git a/docs/old-html/online/getting_started.html b/docs/old-html/online/getting_started.html
deleted file mode 100644 (file)
index d9de09f..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-<TITLE>Getting started</TITLE>
-<H3>Contents</H3>
-
-<ul>
-<li><a href="#start">Introduction</a>
-<ul>
-       <li><a href="#setup">Setting up your environment</a>
-</ul>
-<li><a href="#files">GROMACS files</a>
-<ul>
-       <li><a href="#top">Molecular topology file</a>
-       <li><a href="#gro">Molecular structure file</a>
-       <li><a href="#mdp">Molecular dynamics parameter file</a>
-       <li><a href="#ndx">Index file</a>
-       <li><a href="#tpr">Run input file</a>
-       <li><a href="#trx">Trajectory file</a>
-</ul>
-<li><a href="#ref">References</a>
-</ul>
-
-<P>
-More info can be found in the 
-<A HREF="flow.html">flowchart</A> 
-(for a quick overview) and the 
-<A HREF="http://www.gromacs.org/Documentation/FAQs">GROMACS FAQs</A>.
-</P>
-
-<br><hr><br>
-
-<a name="start"><H2>Introduction</A></H2>
-<p>
-In this chapter we assume the reader is familiar with Molecular
-Dynamics and familiar with Unix, including the use of a text editor
-such as <tt>jot</tt>, <tt>emacs</tt> or <tt>vi</tt>. We furthermore assume the
-GROMACS software is installed properly on your system. When you see a line
-like</p>
-
-<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
-<tr NOSAVE>
-<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
-<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
-
-<tt> ls -l
-</tt>
-<td></td>
-</tr>
-</table>
-<br>
-you are supposed to type the contents of that line on your computer.
-
-<H3><A NAME="setup">Setting up your environment</A></H3>
-<p>
-In order to check whether you have access to the GROMACS software, please
-start by entering the command:
-</p>
-<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
-<tr NOSAVE>
-<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
-<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
-
-<tt> mdrun -version
-</tt>
-<td></td>
-</tr>
-</table>
-<br>
-This command should print out information about the version of Gromacs
-installed.
-
-If this, in contrast, returns the phrase
-<pre>
-mdrun: command not found.
-</pre>
-
-then you have to verify where your version of GROMACS is installed.
-
-In the default case, the binaries are located in
-'/usr/local/gromacs/bin', however, you can ask your local system
-administrator for more information.  If we assume that GROMACS is
-installed in directory <tt>XXX</tt> you would find the executables (programs) in
-<tt>XXX/bin</tt>.  To be able to access the programs without
-problems, you will have to edit the login file for your shell. If you
-use the C shell, this file is called <TT>.cshrc</TT> or
-<TT>.tcshrc</TT>, and it is located in your home directory. Add a line
-like:
-
-<br><br>
-<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
-<tr NOSAVE>
-<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
-<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
-<tt> 
-source XXX/bin/GMXRC
-</tt>
-<td></td>
-</tr>
-</table>
-<br>
-
-Issue this command at the prompt too, or log off and on again to
-automatically get the environment.
-You should have an environment variable set now that is called
-GMXDATA that we will use further on. Let us check whether this was
-successful using:<br><br>
-
-<table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
-<tr NOSAVE>
-<td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
-<td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
-
-<tt> echo $GMXDATA
-</tt>
-<td></td>
-</tr>
-</table>
-<br>
-If it prints a directory name you are ready to rock, otherwise go back two steps.
-
-<br><hr><br>
-<H2><A NAME="files">GROMACS files</A></h2>
-Here is an overview of the most important GROMACS file types that you will
-encounter during the tutorial.
-<DL>
-<DT>
-<h3><A NAME="top">Molecular Topology file (<TT><a href="top.html">.top</a></TT>)</A></h3>
-<DD>
-The molecular topology file is generated by the program <TT>
-<a href="../programs/gmx-pdb2gmx.html">gmx pdb2gmx</a></TT>.
-<a href="../programs/gmx-pdb2gmx.html">gmx pdb2gmx</a> translates a
-<a href="pdb.html">pdb</a> structure file of any peptide or protein
-to a molecular topology file. This topology file contains a complete
-description of all the interactions in your peptide or protein.
-<P></P>
-
-<DT>
-<h3><A NAME="gro">Molecular Structure file (<TT><a href="gro.html">.gro</a></TT>, <TT><a href="pdb.html">.pdb</a></TT>)</A></h3>
-<DD>
-When the <a href="../programs/gmx-pdb2gmx.html">gmx pdb2gmx</a> program is executed
-to generate a molecular
-topology, it also translates the structure file (<TT><a href="pdb.html">.pdb</a></TT> file) 
-to a gromos
-structure file (<TT><a href="gro.html">.gro</a></TT> file). The main difference between a 
-<a href="pdb.html">pdb</a> file and a gromos file is their format and that
-a <TT><a href="gro.html">.gro</a></TT> file can also hold velocities. However, if you do not need the
-velocities, you can also use a <a href="pdb.html">pdb</a> file in all programs.
-To generate a box of solvent molecules
-around the peptide, the program 
-<a href="../programs/gmx-solvate.html">gmx solvate</a> is used. First the program
-<a href="../programs/gmx-editconf.html">gmx editconf</a> should be used to
-define a box of appropriate size around the molecule.
-<a href="../programs/gmx-solvate.html">gmx solvate</a>
-solvates a solute molecule (the peptide) into any solvent (in this
-case water). The output of <TT><a href="../programs/gmx-solvate.html">gmx solvate</a></TT>
-is a gromos structure file of the peptide solvated in water. The
-<a href="../programs/gmx-solvate.html">gmx solvate</a> program also changes the
-molecular topology file (generated by <a href="../programs/gmx-pdb2gmx.html">gmx pdb2gmx</a>)
-to add solvent to the topology.
-<P></P>
-
-<DT>
-<h3><A NAME="mdp">Molecular Dynamics parameter file (<TT><a href="mdp_opt.html">.mdp</a></TT>)</A></h3>
-<DD>
-The Molecular Dynamics Parameter (<TT><a href="mdp_opt.html">.mdp</a></TT>) file contains all
-information about the Molecular Dynamics simulation itself 
-e.g. time-step, number of steps, temperature, pressure etc. The
-easiest way of handling such a file is by adapting a sample <TT><a href="mdp_opt.html">.mdp</a></TT>
-file. A <TT><a href="mdp.html">sample mdp file</a></TT>
-can be found online.
-<P></P>
-
-<DT>
-<h3><A NAME="ndx">Index file (<TT><a href="ndx.html">.ndx</a></TT>)</A></h3>
-<DD>
-Sometimes you may need an index file to specify actions on groups of atoms
-(e.g. Temperature coupling, accelerations, freezing). Usually the default index
-groups will be sufficient, so for this demo we will
-not consider the use of index files.
-<P></P>
-
-<DT>
-<h3><A NAME="tpr">Run input file (<TT><a href="tpr.html">.tpr</a></TT>)</A></h3>
-<DD>
-The next step is to combine the molecular structure (<TT><a href="gro.html">.gro</a></TT> file),
-topology (<TT><a href="top.html">.top</a></TT> file) MD-parameters (<TT><a href="mdp_opt.html">.mdp</a></TT> file) and 
-(optionally) the
-index file (<TT><a href="ndx.html">ndx</a></TT>) to generate a run input file (<TT><a href="tpr.html">.tpr</a></tt> extension or
-<TT><a href="tpb.html">.tpb</a></tt> if you don't have XDR).
-This file contains all information needed to start a simulation with GROMACS.
-The
-<a href="../programs/gmx-grompp.html">gmx grompp</a> program processes all
-input files and generates the run input
-<tt><a href="tpr.html">.tpr</a></tt> file.
-<P></P>
-
-<DT>
-<h3><A NAME="trx">Trajectory file (<TT><a href="trr.html">.trr</a></TT></A>)</h3>
-<DD>
-Once the run input file is available, we can start the
-simulation. The program which starts the simulation is called 
-<a href="../programs/gmx-mdrun.html">gmx mdrun</a>. The only input file
-of <TT><a href="../programs/gmx-mdrun.html">gmx mdrun</a></TT> you usually need
-to start a run
-is the run input file (<TT><a href="tpr.html">.tpr</a></TT> file).
-The output files of 
-<TT><a href="../programs/gmx-mdrun.html">gmx mdrun</a></TT> are the
-trajectory file (<TT><a href="trr.html">.trr</a></TT> file
-or <TT><a href="trj.html">.trj</a></TT> if you don't have XDR) and a logfile (
-<TT><a href="log.html">.log</A></TT> file).
-<P></P>
-
-</DL>
-
-<br><hr><br>
-
-<P><H2><A NAME="ref">References</A></h2>
-
-<blockquote>
-<dl>
-
-<dt><A NAME="berendsen81">Berendsen, H.J.C., Postma, J.P.M., van
-Gunsteren, W.F., Hermans, J. (1981) <dd><it>Intermolecular
-Forces</it>, chapter Interaction models for water in relation to
-protein hydration, pp 331-342. Dordrecht: D. Reidel Publishing Company
-Dordrecht</dd><p>
-
-<dt><A NAME="kabsch83">Kabsch, W., Sander, C. (1983). <dd>Dictionary
-of protein secondary structure: Pattern recognition of hydrogen-bonded
-and geometrical features. <it>Biopolymers</it> <b>22</b>,
-2577--2637.</dd><p>
-
-<dt><A NAME="mierke91">Mierke, D.F., Kessler, H. (1991). <dd>Molecular
-dynamics with dimethyl sulfoxide as a solvent. Conformation of a
-cyclic hexapeptide. <it>J. Am. Chem. Soc.</it> <b>113</b>, 9446.</dd><p>
-
-<dt><A NAME="stryer88">Stryer, L. (1988). <dd><it>Biochemistry</it>
-vol. 1, p. 211. New York: Freeman, 3 edition.</dd><p>
-
-</dl>
-</blockquote>
index 29bb1a5cc9965e7027a15897cb792b038b055fbc..aca34a7d38f5489e9472526e8e829386dd2e9ea1 100644 (file)
@@ -1,5 +1,6 @@
 <title>mdp file format</title>
-<P> Follow <a href="mdp_opt.html">this link</a> for a detailed description of the options</a>.  </P>
+<P> See the <a href="../user-guide.html#molecular-dynamics-parameters-.mdp-options">user guide</a>
+for a detailed description of the options</a>.  </P>
 
 <P> Below is a sample mdp file.
 The ordering of the items is not important, but if you enter the same
diff --git a/docs/old-html/online/mdp_opt.html b/docs/old-html/online/mdp_opt.html
deleted file mode 100644 (file)
index f0fa212..0000000
+++ /dev/null
@@ -1,2194 +0,0 @@
-<TITLE>mdp options</TITLE>
-<!-- 
-
-PLEASE BE VERY CAREFUL WHEN EDITING THIS FILE: IT MUST BE
-AUTOMATICALLY PARSED BY A SIMPLE SCRIPT (mkmdp in the GROMACS manual repository) TO PRODUCE A
-CORRESPONDING LATEX FILE.
-
-IF YOU'RE NOT SURE ABOUT WHAT YOU'RE DOING, DON'T DO IT!
-
--->
-
-<H3>Table of Contents</H3>
-
-<ul>
-<li><A HREF="#general"><b>General remarks</b></A>
-<p> </p>
-<li><A HREF="#pp"><b>preprocessing</b></A> (include, define)
-<li><A HREF="#run"><b>run control</b></A> (integrator, tinit, dt, nsteps, init-step, comm-mode, nstcomm, comm-grps)
-<li><A HREF="#ld"><b>langevin dynamics</b></A> (bd-fric, ld-seed)
-<li><A HREF="#em"><b>energy minimization</b></A> (emtol, emstep, nstcgsteep)
-<li><a HREF="#shellmd"><b>shell molecular dynamics</b></a>(emtol,niter,fcstep)
-<li><a HREF="#tpi"><b>test particle insertion</b></a>(rtpi)
-<li><A HREF="#out"><b>output control</b></A> (nstxout, nstvout, nstfout, nstlog, nstcalcenergy, nstenergy, nstxout-compressed, compressed-x-precision, compressed-x-grps, energygrps)
-<li><A HREF="#nl"><b>neighbor searching</b></A> (cutoff-scheme, nstlist, nstcalclr, ns-type, pbc, periodic-molecules, verlet-buffer-tolerance, rlist, rlistlong)
-<li><A HREF="#el"><b>electrostatics</b></A> (coulombtype, coulomb-modifier, rcoulomb-switch, rcoulomb, epsilon-r, epsilon-rf)
-<li><A HREF="#vdw"><b>VdW</b></A> (vdwtype, vdw-modifier, rvdw-switch, rvdw, DispCorr)
-<li><A HREF="#table"><b>tables</b></A> (table-extension, energygrp-table)
-<li><A HREF="#ewald"><b>Ewald</b></A> (fourierspacing, fourier-nx, fourier-ny, fourier-nz, pme-order, ewald-rtol, ewald-geometry, epsilon-surface)
-<li><A HREF="#tc"><b>Temperature coupling</b></A> (tcoupl, nsttcouple, tc-grps, tau-t, ref-t)
-<li><A HREF="#pc"><b>Pressure coupling</b></A> (pcoupl, pcoupltype,
-  nstpcouple, tau-p, compressibility, ref-p, refcoord-scaling)
-<li><A HREF="#sa"><b>simulated annealing</b></A> (annealing, annealing-npoints, annealing-time, annealing-temp)
-<li><A HREF="#vel"><b>velocity generation</b></A> (gen-vel, gen-temp, gen-seed)
-<li><A HREF="#bond"><b>bonds</b></A> (constraints, constraint-algorithm, continuation, shake-tol, lincs-order, lincs-iter, lincs-warnangle, morse)
-<li><A HREF="#egexcl"><b>Energy group exclusions</b></A> (energygrp-excl)
-<li><A HREF="#walls"><b>Walls</b></A> (nwall, wall-type, wall-r-linpot, wall-atomtype,
-wall-density, wall-ewald-zfac)
-<li><A HREF="#pull"><b>COM pulling</b></A> (pull, ...)
-<li><A HREF="#nmr"><b>NMR refinement</b></A> (disre, disre-weighting, disre-mixed, disre-fc, disre-tau, nstdisreout, orire, orire-fc, orire-tau, orire-fitgrp, nstorireout)
-<li><A HREF="#free"><b>Free energy calculations</b></A> (free-energy, nstdhdl, dhdl-print-energy, init-lambda, delta-lambda, fep-lambdas, coul-lambdas, vdw-lambdas, bonded-lambdas, restraint-lambdas, mass-lambdas, temperature-lambdas, sc-alpha, sc-coul, sc-power, sc-r-power, sc-sigma, couple-moltype, couple-lambda0, couple-lambda1, couple-intramol)
-<li><A HREF="#expanded"><b>Expanded ensemble simulation</b></A> (lmc-stats, lmc-mc-move, lmc-seed, lmc-gibbsdelta, mc-temperature, nst-transition-matrix, init-lambda-weights, initial-wl-delta, wl-scale, wl-ratio, symmetrized-transition-matrix, lmc-forced-nstart, mininum-var-min, lmc-weights-equil, weight-equil-wl-delta, weight-equil-number-all-lambda, weight-equil-number-steps, weight-equil-number-samples, weight-equil-count-ratio, simulated-tempering, simulated-tempering-scaling, sim-temp-low, sim-temp-high)
-<li><A HREF="#neq"><b>Non-equilibrium MD</b></A> (acc-grps, accelerate, freezegrps, freezedim, cos-acceleration, deform)
-<li><A HREF="#ef"><b>Electric fields</b></A> (E-x, E-xt, E-y, E-yt, E-z, E-zt )
-<li><A HREF="#qmmm"><b>Mixed quantum/classical dynamics</b></A> (QMMM, QMMM-grps, QMMMscheme, QMmethod, QMbasis, QMcharge, Qmmult, CASorbitals, CASelectrons, SH)
-<li><A HREF="#gbsa"><b>Implicit solvent</b></A> (implicit-solvent, gb-algorithm, nstgbradii, rgbradii, gb-epsilon-solvent, gb-saltconc, gb-obc-alpha, gb-obc-beta, gb-obc-gamma, gb-dielectric-offset, sa-algorithm, sa-surface-tension)   
-<li><A HREF="#adress"><b>AdResS settings</b></A> (adress, adress_type, adress_const_wf, adress_ex_width, adress_hy_width, adress_ex_forcecap, adress_interface_correction, adress_site, adress_reference_coords, adress_tf_grp_names, adress_cg_grp_names)
-<li><A HREF="#user"><b>User defined thingies</b></A> (user1-grps, user2-grps, userint1, userint2, userint3, userint4, userreal1, userreal2, userreal3, userreal4)
-<li><A HREF="#idx"><b>Index</b></A>
-</ul>
-</P>
-
-<HR>
-
-<A NAME="general"><br>
-<h3>General</h3>
-
-<P>
-Default values are given in parentheses. The first option in
-the list is always the default option. Units are given in 
-square brackets The difference between a dash and an underscore 
-is ignored. </P>
-
-<P>
-A <a href="mdp.html">sample <TT>.mdp</TT> file</a> is
-available. This should be appropriate to start a normal
-simulation. Edit it to suit your specific needs and desires. </P>
-
-<A NAME="pp"><br>
-<hr>
-<h3>Preprocessing</h3>
-
-<dl>
-<dt><b>include:</b></dt>
-<dd>directories to include in your topology. Format: 
-<PRE>-I/home/john/mylib -I../otherlib</PRE></dd>
-<dt><b>define:</b></dt>
-<dd>defines to pass to the preprocessor, default is no defines. You can use
-any defines to control options in your customized topology files. Options
-that are already available by default are:
-<dd><dl compact>
-<dt>-DFLEXIBLE</dt>
-<dd>Will tell <tt>grompp</tt> to include flexible water in stead of rigid water into your
-topology, this can be useful for normal mode analysis.</dd>
-<dt>-DPOSRES</dt>
-<dd>Will tell <tt>grompp</tt> to include posre.itp into your topology, used for
-<!--Idx-->position restraint<!--EIdx-->s.</dd>
-</dl>
-</dl>
-
-<A NAME="run"><br>
-<hr>
-<h3>Run control</h3>
-
-<dl>
-<dt><b>integrator:</b> (Despite the name, this list includes algorithms that are not actually integrators. <tt>steep</tt> and all entries following it are in this category)</dt>
-<dd><dl compact>
-<dt><b>md</b></dt>
-<dd>A leap-frog algorithm<!--QuietIdx-->leap-frog integrator<!--EQuietIdx-->
-for integrating Newton's equations of motion.</dd>
-<dt><b>md-vv</b></dt>
-<dd>A velocity Verlet algorithm for integrating Newton's equations of motion.
-For constant NVE simulations started from corresponding points in the same trajectory, the trajectories 
-are analytically, but not binary, identical to the <b>md</b> leap-frog integrator.  The the kinetic
-energy, which is determined from the whole step velocities and is therefore
-slightly too high. The advantage of this integrator is more accurate,
-reversible Nose-Hoover and Parrinello-Rahman coupling integration
-based on Trotter expansion, as well as (slightly too small) full step velocity
-output. This all comes at the cost off extra computation, especially with
-constraints and extra communication in parallel. Note that for nearly all
-production simulations the <b>md</b> integrator is accurate enough.
-</dd>
-<dt><b>md-vv-avek</b></dt>
-<dd>A velocity Verlet algorithm identical to <b>md-vv</b>, except that
-the kinetic energy is determined as the average of
-the two half step kinetic energies as in the <b>md</b> integrator, and this thus more accurate.
-With Nose-Hoover and/or Parrinello-Rahman coupling this comes with
-a slight increase in computational cost.
-</dd>
-<dt><b>sd</b></dt>
-<dd> An accurate and efficient leap-frog stochastic dynamics integrator.
-With constraints, coordinates needs to be constrained twice per integration step.
-Depending on the computational cost of the force calculation,
-this can take a significant part of the simulation time.
-The temperature for one or more groups of atoms
-(<b><A HREF="#tc">tc-grps</A></b>)
-is set with <b><A HREF="#tc">ref-t</A></b> [K],
-the inverse friction constant for each group is set with
-<b><A HREF="#tc">tau-t</A></b> [ps].
-The parameter <b><A HREF="#tc">tcoupl</A></b> is ignored.
-The random generator is initialized with <b><A HREF="#ld">ld-seed</A></b>.
-When used as a thermostat, an appropriate value for <b>tau-t</b> is 2 ps,
-since this results in a friction that is lower than the internal friction
-of water, while it is high enough to remove excess heat
-NOTE: temperature deviations decay twice as fast as with
-a Berendsen thermostat with the same <b>tau-t</b>.</dd>
-<dt><b>sd2</b></dt>
-<dd> This used to be the default sd integrator, but is now deprecated.
-Four Gaussian random numbers are required per coordinate per step.
-With constraints, the temperature will be slightly too high.</dd>
-<dt><b>bd</b></dt>
-<dd>An Euler integrator for Brownian or position Langevin dynamics, the
-velocity is the force divided by a friction coefficient 
-(<b><A HREF="#ld">bd-fric</A></b> [amu ps<sup>-1</sup>])
-plus random thermal noise (<b><A HREF="#tc">ref-t</A></b>).
-When <b><A HREF="#ld">bd-fric</A></b><tt>=0</tt>, the friction coefficient for each
-particle is calculated as mass/<b><A HREF="#tc">tau-t</A></b>, as for the
-integrator <tt>sd</tt>.
-The random generator is initialized with <b><A HREF="#ld">ld-seed</A></b>.</dd>
-
-<dt><b>steep</b></dt>
-<dd>A <!--Idx-->steepest descent<!--EIdx--> algorithm for energy
-minimization. The maximum step size is <b><A HREF="#em">emstep</A></b>
-[nm], the tolerance is <b><A HREF="#em">emtol</A></b> [kJ
-mol<sup>-1</sup> nm<sup>-1</sup>].</dd>
-<dt><b>cg</b></dt>
-<dd>A <!--Idx-->conjugate gradient<!--EIdx--> algorithm for energy
-minimization, the tolerance is <b>emtol</b> [kJ mol<sup>-1</sup>
-nm<sup>-1</sup>]. CG is more efficient when a steepest descent step
-is done every once in a while, this is determined by 
-<b><A HREF="#em">nstcgsteep</A></b>.
-For a minimization prior to a normal mode analysis, which requires
-a very high accuracy, GROMACS should be compiled in double precision.</dd>
-<dt><b>l-bfgs</b></dt>
-<dd>A <!--Idx-->quasi-Newtonian<!--EIdx--> algorithm for energy minimization
-according to the low-memory Broyden-Fletcher-Goldfarb-Shanno approach.
-In practice this seems to converge faster than Conjugate Gradients, but due
-to the correction steps necessary it is not (yet) parallelized.
-</dd>
-<dt><b>nm</b></dt>
-<dd>Normal mode analysis<!--QuietIdx-->normal-mode analysis<!--EQuietIdx--> is performed
-on the structure in the <tt>tpr</tt> file. GROMACS should be
-compiled in double precision.</dd>
-<dt><b>tpi</b></dt>
-<dd> Test particle insertion. The last molecule in the topology
-is the test particle. A trajectory should be provided with
-the <tt>-rerun</tt> option of <tt>mdrun</tt>. This trajectory
-should not contain the molecule to be inserted. Insertions
-are performed <b>nsteps</b> times in each frame at random locations
-and with random orientiations of the molecule. When <b>nstlist</b>
-is larger than one, <b>nstlist</b> insertions are performed
-in a sphere with radius <b><A HREF="#tpi">rtpi</A></b>
-around a the same random location using the same neighborlist
-(and the same long-range energy when <b>rvdw</b> or <b>rcoulomb</b>&gt;<b>rlist</b>,
-which is only allowed for single-atom molecules).
-Since neighborlist construction is expensive, one can perform several
-extra insertions with the same list almost for free.
-The random seed is set with <b><A HREF="#ld">ld-seed</A></b>.
-The temperature for the Boltzmann weighting is set with
-<b><A HREF="#tc">ref-t</A></b>, this should match the temperature
-of the simulation of the original trajectory.
-Dispersion correction is implemented correctly for tpi.
-All relevant quantities are written to the file specified with
-the <tt>-tpi</tt> option of <tt>mdrun</tt>.
-The distribution of insertion energies is written to the file specified with
-the <tt>-tpid</tt> option of <tt>mdrun</tt>.
-No trajectory or energy file is written.
-Parallel tpi gives identical results to single node tpi.
-For charged molecules, using PME with a fine grid is most accurate
-and also efficient, since the potential in the system only needs
-to be calculated once per frame.
-</dd>
-<dt><b>tpic</b></dt>
-<dd> Test particle insertion into a predefined cavity location.
-The procedure is the same as for <b>tpi</b>, except that one coordinate
-extra is read from the trajectory, which is used as the insertion location.
-The molecule to be inserted should be centered at 0,0,0. Gromacs does
-not do this for you, since for different situations a different
-way of centering might be optimal.
-Also <b><A HREF="#tpi">rtpi</A></b> sets the radius for the sphere
-around this location. Neighbor searching is done only once per frame,
-<b>nstlist</b> is not used.
-Parallel tpic gives identical results to single node tpic.
-</dl>
-
-<dt><b>tinit: (0) [ps]</b></dt>
-<dd>starting time for your run (only makes sense for integrators <tt>md</tt>,
-<tt>sd</tt> and <tt>bd</tt>)</dd>
-<dt><b>dt: (0.001) [ps]</b></dt></dd>
-<dd>time step for integration (only makes sense for integrators <tt>md</tt>,
-<tt>sd</tt> and <tt>bd</tt>)</dd>
-<dt><b>nsteps: (0)</b></dt>
-<dd>maximum number of steps to integrate or minimize, -1 is no maximum</dd>
-<dt><b>init-step: (0)</b></dt>
-<dd>The starting step.
-The time at an step i in a run is calculated as: t = <tt>tinit</tt> + <tt>dt</tt>*(<tt>init-step</tt> + i).
-The free-energy lambda is calculated as: lambda = <tt>init-lambda</tt> + <tt>delta-lambda</tt>*(<tt>init-step</tt> + i).
-Also non-equilibrium MD parameters can depend on the step number.
-Thus for exact restarts or redoing part of a run it might be necessary to
-set <tt>init-step</tt> to the step number of the restart frame.
-<tt>gmx convert-tpr</tt> does this automatically.
-</dd>
-<dt><b>comm-mode:</b></dt>
-<dd><dl compact>
-<dt><b>Linear</b></dt>
-<dd>Remove center of mass translation</dd>
-<dt><b>Angular</b></dt>
-<dd>Remove center of mass translation and rotation around the center of mass
-</dd>
-<dt><b>None</b></dt>
-<dd>No restriction on the center of mass motion
-</dl></dd>
-<dt><b>nstcomm: (100) [steps]</b></dt>
-<dd>frequency for center of mass motion removal</dd>
-<dt><b>comm-grps:</b></dt>
-<dd>group(s) for center of mass motion removal, default is the whole system</dd>
-</dl>
-
-<A NAME="ld"><br>
-<hr>
-<h3><!--Idx-->Langevin dynamics<!--EIdx--></h3>
-
-<dl>
-<dt><b>bd-fric: (0) [amu ps<sup>-1</sup>]</b></dt>
-<dd>Brownian dynamics friction coefficient.
-When <b>bd-fric</b><tt>=0</tt>, the friction coefficient for each
-particle is calculated as mass/<b><A HREF="#tc">tau-t</A></b>.</dd>
-<dt><b>ld-seed: (-1) [integer]</b></dt>
-<dd>used to initialize random generator for thermal noise
-for stochastic and Brownian dynamics.
-When <b>ld-seed</b> is set to -1, a pseudo random seed is used.
-When running BD or SD on multiple processors, each processor uses a seed equal
-to <b>ld-seed</b> plus the processor number.</dd>
-</dl>
-
-<A NAME="em"><br>
-<hr>
-<h3>Energy minimization<!--QuietIdx-->energy minimization<!--EQuietIdx--></h3>
-<dl>
-<dt><b>emtol: (10.0) [kJ mol<sup>-1</sup> nm<sup>-1</sup>]</b></dt>
-<dd>the minimization is converged when the maximum force is smaller than 
-this value</dd>
-<dt><b>emstep: (0.01) [nm]</b></dt>
-<dd>initial step-size</dd>
-<dt><b>nstcgsteep: (1000) [steps]</b></dt>
-<dd>frequency of performing 1 steepest descent step while doing
-conjugate gradient energy minimization.</dd>
-<dt><b>nbfgscorr: (10)</b></dt>
-<dd>Number of correction steps to use for L-BFGS minimization. A higher
-number is (at least theoretically) more accurate, but slower.</dd>
-</dl>
-
-<A NAME="shellmd"><br>
-<hr>
-<h3>Shell Molecular Dynamics<!--QuietIdx-->shell molecular dynamics<!--EQuietIdx--></h3>
-When shells or
-flexible constraints are present in the system the positions of the shells
-and the lengths of the flexible constraints are optimized at
-every time step until either the RMS force on the shells and constraints
-is less than emtol, or a maximum number of iterations (niter) has been reached
-<dl>
-<dt><b>emtol: (10.0) [kJ mol<sup>-1</sup> nm<sup>-1</sup>]</b></dt>
-<dd>the minimization is converged when the maximum force is smaller than 
-this value. For shell MD this value should be 1.0 at most, but since the
-variable is used for energy minimization as well the default is 10.0.</dd>
-<dt><b>niter: (20)</b></dt>
-<dd>maximum number of iterations for optimizing the shell positions
-and the flexible constraints.</dd>
-<dt><b>fcstep: (0) [ps<sup>2</sup>]</b></dt>
-<dd>the step size for optimizing the flexible constraints.
-Should be chosen as mu/(d<sup>2</sup>V/dq<sup>2</sup>)
-where mu is the reduced mass of two particles in a flexible constraint
-and d<sup>2</sup>V/dq<sup>2</sup> is the second derivative of the potential
-in the constraint direction. Hopefully this number does not differ too
-much between the flexible constraints, as the number of iterations
-and thus the runtime is very sensitive to <tt>fcstep</tt>.
-Try several values!</dd>
-</dl>
-
-<A NAME="tpi"><br>
-<hr>
-<h3>Test particle insertion</h3>
-<dl>
-<dt><b>rtpi: (0.05) [nm]</b></dt>
-<dd>the test particle insertion radius see integrators
-<b><a href="#run">tpi</a></b> and <b><a href="#run">tpic</a></b></dd>
-</dl>
-
-<A NAME="out"><br>
-<hr>
-<h3>Output control</h3>
-<dl>
-<dt><b>nstxout: (0) [steps]</b></dt>
-<dd>number of steps that elapse between writing coordinates to output
-<!--Idx-->trajectory file<!--EIdx-->, the last coordinates are always written</dd>
-<dt><b>nstvout: (0) [steps]</b></dt>
-<dd>number of steps that elapse between writing velocities to output trajectory,
-the last velocities are always written</dd>
-<dt><b>nstfout: (0) [steps]</b></dt>
-<dd>number of steps that elapse between writing forces to output trajectory.</dd>
-<dt><b>nstlog: (1000) [steps]</b></dt>
-<dd>number of steps that elapse between writing energies to the <!--Idx-->log file<!--EIdx-->,
-the last energies are always written</dd>
-<dt><b>nstcalcenergy: (100)</b></dt>
-<dd>number of steps that elapse between calculating the energies, 0 is never.
-This option is only relevant with dynamics.
-With a twin-range cut-off setup <b>nstcalcenergy</b> should be equal to
-or a multiple of <b>nstlist</b>.
-This option affects the performance in parallel simulations,
-because calculating energies requires global communication between all
-processes which can become a bottleneck at high parallelization.
-</dd>
-<dt><b>nstenergy: (1000) [steps]</b></dt>
-<dd>number of steps that else between writing energies to energy file,
-the last energies are always written,
-should be a multiple of <b>nstcalcenergy</b>.
-Note that the exact sums and fluctuations over all MD steps
-modulo <b>nstcalcenergy</b> are stored in the energy file,
-so <tt>g_energy</tt> can report exact
-energy averages and fluctuations also when <b>nstenergy</b><tt>&gt;1</tt></dd>
-<dt><b>nstxout-compressed: (0) [steps]</b></dt>
-<dd>number of steps that elapse between writing position coordinates using lossy compression</dd>
-<dt><b>compressed-x-precision: (1000) [real]</b></dt>
-<dd>precision with which to write to the compressed trajectory file</dd>
-<dt><b>compressed-x-grps:</b></dt>
-<dd>group(s) to write to the compressed trajectory file, by default the whole system is written
-(if <b>nstxout-compressed</b> &gt; 0)</dd>
-<dt><b>energygrps:</b></dt>
-<dd>group(s) to write to energy file</dd>
-</dl>
-
-<A NAME="nl"><br>
-<hr>
-<h3>Neighbor searching<!--QuietIdx-->neighbor searching<!--EQuietIdx--></h3>
-<dl>
-<dt><b>cutoff-scheme:</b></dt>
-<dd><dl compact>
-<dt><b>Verlet</b></dt>
-<dd>Generate a pair list with buffering. The buffer size is automatically set 
-based on <b>verlet-buffer-tolerance</b>, unless this is set to -1, in which case
-<b>rlist</b> will be used. This option has an explicit, exact cut-off at 
-<b>rvdw</b>=<b>rcoulomb</b>. Currently only cut-off, reaction-field, 
-PME electrostatics and plain LJ are supported. Some <tt>mdrun</tt> functionality 
-is not yet supported with the <b>Verlet</b> scheme, but <tt>grompp</tt> checks for this. 
-Native GPU acceleration is only supported with <b>Verlet</b>.
-With GPU-accelerated PME or with separate PME ranks,
-<tt>mdrun</tt> will automatically tune the CPU/GPU load balance by 
-scaling <b>rcoulomb</b> and the grid spacing. This can be turned off with 
-<tt>-notunepme</tt>.
-
-<b>Verlet</b> is faster than <b>group</b> when there is no water, or if <b>group</b> would use a pair-list buffer to conserve energy.
-</dd>
-<dt><b>group</b></dt>
-<dd>Generate a pair list for groups of atoms. These groups correspond to the 
-charge groups in the topology. This was the only cut-off treatment scheme 
-before version 4.6. 
-There is no explicit buffering of the pair list. This enables efficient force 
-calculations for water, but energy is only conserved when a buffer is explicitly added.</dd>
-
-</dl></dd>
-
-<dt><b>nstlist: (10) [steps]</b></dt>
-<dd><dl compact>
-<dt><b>&gt;0</b></dt>
-<dd>Frequency to update the <!--Idx-->neighbor list<!--EIdx--> (and
-the long-range forces, when using twin-range cut-offs). When this is 0,
-the neighbor list is made only once.
-With energy minimization the neighborlist will be updated for every
-energy evaluation when <b>nstlist</b><tt>&gt;0</tt>.
-With <b>cutoff-scheme=Verlet</b> and <b>verlet-buffer-tolerance</b> set,
-<b>nstlist</b> is actually a minimum value and <tt>mdrun</tt> might increase it, unless it is set to 1.
-With parallel simulations and/or non-bonded force calculation on the GPU,
-a value of 20 or 40 often gives the best performance.
-With <b>cutoff-scheme=Group</b> and non-exact cut-off's, <b>nstlist</b> will
-affect the accuracy of your simulation and it can not be chosen freely.
-</dd>
-<dt><b>0</b></dt>
-<dd>The neighbor list is only constructed once and never updated.
-This is mainly useful for vacuum simulations in which all particles
-see each other.</dd>
-<dt><b>-1</b></dt>
-<dd>Automated update frequency, only supported with <b>cutoff-scheme</b>=<b>group</b>.
-This can only be used with switched, shifted or user potentials where
-the cut-off can be smaller than <b>rlist</b>. One then has a buffer
-of size <b>rlist</b> minus the longest cut-off.
-The neighbor list is only updated when one or more particles have moved further
-than half the buffer size from the center of geometry of their charge group
-as determined at the previous neighbor search.
-Coordinate scaling due to pressure coupling or the <b>deform</b> option
-is taken into account.
-This option guarantees that their are no cut-off artifacts,
-but for larger systems this can come at a high computational cost,
-since the neighbor list update frequency will be determined
-by just one or two particles moving slightly beyond the half buffer length
-(which does not necessarily imply that the neighbor list is invalid),
-while 99.99% of the particles are fine.
-</dd>
-</dl></dd>
-
-<dt><b>nstcalclr: (-1) [steps]</b></dt>
-<dd>
-Controls the period between calculations of long-range forces when
-using the group cut-off scheme.
-<dl compact>
-<dt><b>1</b></dt>
-<dd>Calculate the long-range forces every single step. This is useful
-to have separate neighbor lists with buffers for electrostatics and Van
-der Waals interactions, and in particular it makes it possible to have
-the Van der Waals cutoff longer than electrostatics (useful e.g. with
-PME). However, there is no point in having identical long-range
-cutoffs for both interaction forms and update them every step - then
-it will be slightly faster to put everything in the short-range
-list.</dd>
-<dt><b>&gt;1</b></dt>
-<dd>Calculate the long-range forces every <b>nstcalclr</b> steps and
-use a multiple-time-step integrator to combine forces. This can now be
-done more frequently than <b>nstlist</b> since the lists are stored,
-and it might be a good idea e.g. for Van der Waals interactions that
-vary slower than electrostatics.</dd>
-<dt><b>-1</b></dt>
-<dd>Calculate long-range forces on steps where neighbor searching is
-performed. While this is the default value, you might want to consider
-updating the long-range forces more frequently.</dd>
-</dl>
-Note that twin-range force evaluation might be enabled automatically
-by PP-PME load balancing. This is done in order to maintain the chosen
-Van der Waals interaction radius even if the load balancing is
-changing the electrostatics cutoff. If the <tt>.mdp</tt> file already
-specifies twin-range interactions (e.g. to evaluate Lennard-Jones
-interactions with a longer cutoff than the PME electrostatics every
-2-3 steps), the load balancing will have also a small effect on
-Lennard-Jones, since the short-range cutoff (inside which forces are
-evaluated every step) is changed.
-</dd>
-
-
-
-<dt><b>ns-type:</b></dt>
-<dd><dl compact>
-<dt><b>grid</b></dt>
-<dd>Make a grid in the box and only check atoms in neighboring grid
-cells when constructing a new neighbor list every <b>nstlist</b> steps.
-In large systems grid search is much faster than simple search.</dd>
-<dt><b>simple</b></dt>
-<dd>Check every atom in the box when constructing a new neighbor list
-every <b>nstlist</b> steps (only with <b>cutoff-scheme=group</b>).</dd>
-</dl></dd>
-
-<dt><b>pbc:</b></dt>
-<dd><dl compact>
-<dt><b>xyz</b></dt>
-<dd>Use periodic boundary conditions in all directions.</dd>
-<dt><b>no</b></dt>
-<dd>Use no periodic boundary conditions, ignore the box.
-To simulate without cut-offs, set all cut-offs to 0 and <b>nstlist</b><tt>=0</tt>.
-For best performance without cut-offs on a single MPI rank,
-use <b>nstlist</b><tt>=0</tt>, <b>ns-type</b><tt>=simple</tt></dd>
-<dt><b>xy</b></dt>
-<dd>Use periodic boundary conditions in x and y directions only.
-This works only with <b>ns-type</b><tt>=grid</tt> and can be used
-in combination with <b><a href="#walls">walls</a></b>.
-Without walls or with only one wall the system size is infinite
-in the z direction. Therefore pressure coupling or Ewald summation
-methods can not be used.
-These disadvantages do not apply when two walls are used.</dd>
-</dl></dd>
-
-<dt><b>periodic-molecules:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>molecules are finite, fast molecular PBC can be used</dd>
-<dt><b>yes</b></dt>
-<dd>for systems with molecules that couple to themselves through
-the periodic boundary conditions, this requires a slower PBC algorithm
-and molecules are not made whole in the output</dd>
-</dl></dd>
-
-<dt><b>verlet-buffer-tolerance: (0.005) [kJ/mol/ps]</b></dt>
-<dd>Useful only with <b>cutoff-scheme</b>=<b>Verlet</b>. This sets the maximum
-allowed error for pair interactions per particle caused by the Verlet buffer,
-which indirectly sets <b>rlist</b>. 
-As both <b>nstlist</b> and the Verlet buffer size are fixed 
-(for performance reasons), particle pairs not in the pair list can occasionally 
-get within the cut-off distance during <b>nstlist</b>-1 nsteps. This 
-causes very small jumps in the energy. In a constant-temperature ensemble,
-these very small energy jumps can be 
-estimated for a given cut-off and <b>rlist</b>. The estimate assumes a 
-homogeneous particle distribution, hence the errors might be slightly 
-underestimated for multi-phase systems. For longer pair-list life-time
-(<b>nstlist</b>-1)*dt the buffer is overestimated, because the interactions
-between particles are ignored. Combined with cancellation of errors,
-the actual drift of the total energy is usually one to two orders of magnitude
-smaller.
-Note that the generated buffer size takes into account that
-the GROMACS pair-list setup leads to a reduction in the drift by
-a factor 10, compared to a simple particle-pair based list.
-Without dynamics (energy minimization etc.), the buffer is 5% of the cut-off.
-For NVE simulations the initial temperature is used, unless this is zero,
-in which case a buffer of 10% is used. For NVE simulations the tolerance
-usually needs to be lowered to achieve proper energy conservation on
-the nanosecond time scale. To override the automated buffer setting,
-use <b>verlet-buffer-tolerance</b>=-1 and set <b>rlist</b> manually.</dd>
-
-<dt><b>rlist: (1) [nm]</b></dt>
-<dd>Cut-off distance for the short-range neighbor list.
-With <b>cutoff-scheme</b>=<b>Verlet</b>, this is by default set by the
-<b>verlet-buffer-tolerance</b> option and the value of <b>rlist</b> is ignored.</dd>
-
-<dt><b>rlistlong: (-1) [nm]</b></dt>
-<dd>Cut-off distance for the long-range neighbor list.
-This parameter is only relevant for a twin-range cut-off setup
-with switched potentials. In that case a buffer region is required to account
-for the size of charge groups. In all other cases this parameter
-is automatically set to the longest cut-off distance.</dd>
-</dl>
-
-
-<A NAME="el"><br>
-<hr>
-<h3>Electrostatics<!--QuietIdx-->electrostatics<!--EQuietIdx--></h3>
-<dl>
-<dt><b>coulombtype:</b></dt>
-<dd><dl compact>
-
-<dt><b>Cut-off</b></dt>
-<dd>Twin range cut-offs with neighborlist cut-off <b>rlist</b> and
-Coulomb cut-off <b>rcoulomb</b>,
-where <b>rcoulomb</b>&ge;<b>rlist</b>.
-
-<dt><b>Ewald</b></dt>
-<dd>Classical <!--Idx-->Ewald sum<!--EIdx--> electrostatics.
-The real-space cut-off <b>rcoulomb</b> should be equal to <b>rlist</b>.
-Use e.g. <b>rlist</b><tt>=0.9</tt>, <b>rcoulomb</b><tt>=0.9</tt>. The highest magnitude of
-wave vectors used in reciprocal space is controlled by <b>fourierspacing</b>.
-The relative accuracy of direct/reciprocal space
-is controlled by <b>ewald-rtol</b>.
-<br>
-NOTE: Ewald scales as O(N<sup>3/2</sup>)
-and is thus extremely slow for large systems. It is included mainly for
-reference - in most cases PME will perform much better.</dd>
-
-<dt><b><!--Idx-->PME<!--EIdx--></b></dt>
-<dd>Fast smooth Particle-Mesh Ewald (SPME) electrostatics. Direct space is similar
-to the Ewald sum, while the reciprocal part is performed with
-FFTs. Grid dimensions are controlled with <b>fourierspacing</b> and the
-interpolation order with <b>pme-order</b>. With a grid spacing of 0.1
-nm and cubic interpolation the electrostatic forces have an accuracy
-of 2-3*10<sup>-4</sup>. Since the error from the vdw-cutoff is larger than this you
-might try 0.15 nm. When running in parallel the interpolation
-parallelizes better than the FFT, so try decreasing grid dimensions
-while increasing interpolation.</dd>
-
-<dt><b><!--Idx-->P3M-AD<!--EIdx--></b></dt>
-<dd>Particle-Particle Particle-Mesh algorithm with analytical derivative
-for for long range electrostatic interactions. The method and code
-is identical to SPME, except that the influence function is optimized
-for the grid. This gives a slight increase in accuracy.</dd>
-
-<dt><b>Reaction-Field electrostatics<!--QuietIdx-->reaction-field electrostatics<!--EQuietIdx--></b></dt>
-<dd>Reaction field with Coulomb cut-off <b>rcoulomb</b>,
-where <b>rcoulomb</b> &ge; <b>rlist</b>.
-The dielectric constant beyond the cut-off is <b>epsilon-rf</b>.
-The dielectric constant can be set to infinity by setting <b>epsilon-rf</b><tt>=0</tt>.</dd>
-
-<dt><b>Generalized-Reaction-Field</b></dt>
-<dd>Generalized reaction field with Coulomb cut-off <b>rcoulomb</b>,
-where <b>rcoulomb</b> &ge; <b>rlist</b>.
-The dielectric constant beyond the cut-off is <b>epsilon-rf</b>.
-The ionic strength is computed from the number of charged 
-(i.e. with non zero charge) <!--Idx-->charge group<!--EIdx-->s.
-The temperature for the GRF potential is set with 
-<b><A HREF="#tc">ref-t</A></b> [K].</dd>
-
-<dt><b>Reaction-Field-zero</b></dt>
-<dd>In GROMACS, normal reaction-field electrostatics with
-<b>cutoff-scheme</b><b>=group</b> leads to bad
-energy conservation. <b>Reaction-Field-zero</b> solves this
-by making the potential zero beyond the cut-off. It can only
-be used with an infinite dielectric constant (<b>epsilon-rf=0</b>),
-because only for that value the force vanishes at the cut-off.
-<b>rlist</b> should be 0.1 to 0.3 nm larger than <b>rcoulomb</b>
-to accommodate for the size of charge groups and diffusion
-between neighbor list updates. This, and the fact that table lookups
-are used instead of analytical functions make <b>Reaction-Field-zero</b>
-computationally more expensive than normal reaction-field.</dd>
-
-<dt><b>Reaction-Field-nec</b></dt>
-<dd>The same as <b>Reaction-Field</b>, but implemented as in
-GROMACS versions before 3.3. No reaction-field correction is applied
-to excluded atom pairs and self pairs.
-The 1-4 interactions are calculated using a reaction-field.
-The missing correction due to the excluded pairs that do not have a 1-4
-interaction is up to a few percent of the total electrostatic
-energy and causes a minor difference in the forces and the pressure.</dd>
-
-<dt><b>Shift</b></dt>
-<dd>Analogous to <b>Shift</b> for <b>vdwtype</b>.
-You might want to use <b>Reaction-Field-zero</b> instead,
-which has a similar potential shape, but has a physical interpretation
-and has better energies due to the exclusion correction terms.
-</dd>
-
-<dt><b>Encad-Shift</b></dt>
-<dd>The Coulomb
-potential is decreased over the whole range, using the definition
-from the Encad simulation package.</dd>
-
-<dt><b>Switch</b></dt>
-<dd>Analogous to <b>Switch</b> for <b>vdwtype</b>.
-Switching the Coulomb potential can lead to serious artifacts,
-advice: use <b>Reaction-Field-zero</b> instead.</dd>
-
-<dt><b>User</b></dt> 
-<dd><a name="usertab"></a><tt>mdrun</tt> will now expect to find a file
-<tt>table.xvg</tt> with user-defined potential functions for
-repulsion, dispersion and Coulomb. When pair interactions are present,
-<tt>mdrun</tt> also expects to find a file <tt>tablep.xvg</tt> for
-the pair interactions. When the same interactions should be used
-for non-bonded and pair interactions the user can specify the same
-file name for both table files.
-These files should contain 7
-columns: the <tt>x</tt> value,
-<tt>f(x)</tt>, <tt>-f'(x)</tt>,
-<tt>g(x)</tt>, <tt>-g'(x)</tt>,
-<tt>h(x)</tt>, <tt>-h'(x)</tt>,
-where <tt>f(x)</tt> is the Coulomb function, <tt>g(x)</tt> the dispersion function
-and <tt>h(x)</tt> the repulsion function.
-When <b>vdwtype</b> is not set to <b>User</b> the values
-for <tt>g</tt>, <tt>-g'</tt>, <tt>h</tt> and <tt>-h'</tt> are ignored.
-For the non-bonded interactions <tt>x</tt> values should run
-from 0 to the largest cut-off distance + <b>table-extension</b>
-and should be uniformly spaced. For the pair interactions the table
-length in the file will be used.
-The optimal spacing, which is used for non-user tables,
-is <tt>0.002</tt> [nm] when you run in mixed precision
-or <tt>0.0005</tt> [nm] when you run in double precision.
-The function value at <tt>x=0</tt> is not important. More information is
-in the printed manual.</dd>
-
-<dt><b>PME-Switch</b></dt>
-<dd>A combination of PME and a switch function for the direct-space part
-(see above). <b>rcoulomb</b> is allowed to be smaller than <b>rlist</b>.
-This is mainly useful constant energy simulations (note that using
-<b>PME</b> with <b>cutoff-scheme</b>=<b>Verlet</b> will be more efficient).
-</dd>
-
-<dt><b>PME-User</b></dt>
-<dd>A combination of PME and user tables (see above).
-<b>rcoulomb</b> is allowed to be smaller than <b>rlist</b>.
-The PME mesh contribution is subtracted from the user table by <tt>mdrun</tt>.
-Because of this subtraction the user tables should contain
-about 10 decimal places.</dd>
-
-<dt><b>PME-User-Switch</b></dt>
-<dd>A combination of PME-User and a switching function (see above).
-The switching function is applied to final particle-particle interaction,
-i.e. both to the user supplied function and the PME Mesh correction part.</dd>
-
-</dl></dd>
-
-<dt><b>coulomb-modifier:</b></dt>
-<dd><dl compact>
-<dt><b>Potential-shift-Verlet</b></dt>
-<dd>Selects <b>Potential-shift</b> with the Verlet cutoff-scheme,
-as it is (nearly) free; selects <b>None</b> with the group cutoff-scheme.</dd>
-<dt><b>Potential-shift</b></dt>
-<dd>Shift the Coulomb potential by a constant such that it is zero at the cut-off.
-This makes the potential the integral of the force. Note that this does not
-affect the forces or the sampling.</dd>
-<dt><b>None</b></dt>
-<dd>Use an unmodified Coulomb potential. With the group scheme this means no exact cut-off is used, energies and forces are calculated for all pairs in the neighborlist.</dd>
-</dl></dd>
-
-
-<A NAME="el2">
-<dt><b>rcoulomb-switch: (0) [nm]</b></dt>
-<dd>where to start switching the Coulomb potential, only relevant when force or potential switching is used</dd>
-
-<dt><b>rcoulomb: (1) [nm]</b></dt>
-<dd>distance for the Coulomb <!--Idx-->cut-off<!--EIdx--></dd>
-
-<dt><b>epsilon-r: (1)</b></dt>
-<dd>The relative <!--Idx-->dielectric constant<!--EIdx-->.
-A value of 0 means infinity.</dd>
-
-<dt><b>epsilon-rf: (0)</b></dt>
-<dd>The relative dielectric constant of the reaction field.
-This is only used with reaction-field electrostatics.
-A value of 0 means infinity.</dd>
-</dl>
-
-<A NAME="vdw">
-<hr>
-<h3>VdW</h3>
-<dl>
-<dt><b>vdwtype:</b></dt>
-<dd><dl compact>
-<dt><b>Cut-off</b></dt>
-<dd>Twin range cut-offs with neighbor list cut-off <b>rlist</b> and
-VdW cut-off <b>rvdw</b>,
-where <b>rvdw</b> <tt>&ge;</tt> <b>rlist</b>.</dd>
-
-<dt><b>PME</b></dt>
-<dd>Fast smooth Particle-mesh Ewald (SPME) for VdW interactions. The
-grid dimensions are controlled with <b>fourierspacing</b> in the same
-way as for electrostatics, and the interpolation order is controlled
-with <b>pme-order</b>. The relative accuracy of direct/reciprocal
-space is controlled by <b>ewald-rtol-lj</b>, and the specific
-combination rules that are to be used by the reciprocal routine are
-set using <b>lj-pme-comb-rule</b>.</dd>
-
-<dt><b>Shift</b></dt>
-<dd>This functionality is deprecated and replaced by <b>vdw-modifier = Force-switch</b>.
-The LJ (not Buckingham) potential is decreased over the whole
-range and the forces decay smoothly to zero between <b>rvdw-switch</b>
-and <b>rvdw</b>.  The neighbor search cut-off <b>rlist</b> should be
-0.1 to 0.3 nm larger than <b>rvdw</b> to accommodate for the size of
-charge groups and diffusion between neighbor list
-updates.</dd>
-
-<dt><b>Switch</b></dt>
-<dd>This functionality is deprecated and replaced by <b>vdw-modifier = Potential-switch</b>.
-The LJ (not Buckingham)
-potential is normal out to <b>rvdw-switch</b>, after which it is switched
-off to reach zero at <b>rvdw</b>. Both the potential and force functions
-are continuously smooth, but be aware that all switch functions will give rise
-to a bulge (increase) in the force (since we are switching the potential).
-The neighbor search cut-off <b>rlist</b> should be 0.1 to 0.3 nm larger than
-<b>rvdw</b> to accommodate for the size of charge groups and diffusion
-between neighbor list updates.</dd>
-
-<dt><b>Encad-Shift</b></dt>
-<dd>The LJ (not Buckingham)
-potential is decreased over the whole range, using the definition
-from the Encad simulation package.</dd>
-
-<dt><b>User</b></dt>
-<dd>See <b><a href="#usertab">user</a></b> for <b>coulombtype</b>.
-The function value at <tt>x=0</tt> is not important. When you want to
-use LJ correction, make sure that <b>rvdw</b> corresponds to the
-cut-off in the user-defined function.
-When <b>coulombtype</b> is not set to <b>User</b> the values
-for <tt>f</tt> and <tt>-f'</tt> are ignored.</dd>
-</dl></dd>
-
-<dt><b>vdw-modifier:</b></dt>
-<dd><dl compact>
-<dt><b>Potential-shift-Verlet</b></dt>
-<dd>Selects <b>Potential-shift</b> with the Verlet cutoff-scheme,
-as it is (nearly) free; selects <b>None</b> with the group cutoff-scheme.</dd>
-<dt><b>Potential-shift</b></dt>
-<dd>Shift the Van der Waals potential by a constant such that it is zero at the cut-off.
-This makes the potential the integral of the force. Note that this does not
-affect the forces or the sampling.</dd>
-<dt><b>None</b></dt>
-<dd>Use an unmodified Van der Waals potential. With the group scheme this means no exact cut-off is used, energies and forces are calculated for all pairs in the neighborlist.</dd>
-<dt><b>Force-switch</b></dt>
-<dd>Smoothly switches the forces to zero between <b>rvdw-switch</b> and <b>rvdw</b>. This shifts the potential shift over the whole range and switches it to zero at the cut-off. Note that this is more expensive to calculate than a plain cut-off and it is not required for energy conservation, since <b>Potential-shift</b> conserves energy just as well.</dd>
-<dt><b>Potential-switch</b></dt>
-<dd>Smoothly switches the potential to zero between <b>rvdw-switch</b> and <b>rvdw</b>. Note that this introduces articifically large forces in the switching region and is much more expensive to calculate. This option should only be used if the force field you are using requires this.</dd>
-</dl></dd>
-
-<dt><b>rvdw-switch: (0) [nm]</b></dt>
-<dd>where to start switching the LJ force and possibly the potential, only relevant when force or potential switching is used</dd>
-
-<dt><b>rvdw: (1) [nm]</b></dt>
-<dd>distance for the LJ or Buckingham <!--Idx-->cut-off<!--EIdx--></dd>
-
-<dt><b>DispCorr:</b></dt>
-<dd><dl compact></dd>
-<dt><b>no</b></dt>
-<dd>don't apply any correction</dd>
-<dt><b>EnerPres</b></dt>
-<dd>apply long range <!--Idx-->dispersion correction<!--EIdx-->s for Energy
-and Pressure</dd>
-<dt><b>Ener</b></dt>
-<dd>apply long range dispersion corrections for Energy
-only</dd>
-</dl>
-</dl>
-
-<A NAME="table">
-<hr>
-<h3>Tables</h3>
-<dl>
-<dt><b>table-extension: (1) [nm]</b></dt>
-<dd>Extension of the non-bonded potential lookup tables beyond the largest cut-off distance.
-The value should be large enough to account for charge group sizes
-and the diffusion between neighbor-list updates.
-Without user defined potential the same table length is used
-for the lookup tables for the 1-4 interactions,
-which are always tabulated irrespective of the use of
-tables for the non-bonded interactions. The value of <b>table-extension</b> in no way
-affects the values of <b>rlist</b>, <b>rcoulomb</b>, or <b>rvdw</b>. </dd>
-
-<dt><b>energygrp-table:</b></dt>
-<dd>When user tables are used for electrostatics and/or VdW,
-here one can give pairs of energy groups for which seperate
-user tables should be used.
-The two energy groups will be appended to the table file name,
-in order of their definition in <b>energygrps</b>, seperated by underscores.
-For example, if <tt>energygrps = Na Cl Sol</tt>
-and <tt>energygrp-table = Na Na Na Cl</tt>, <tt>mdrun</tt> will read
-<tt>table_Na_Na.xvg</tt> and <tt>table_Na_Cl.xvg</tt> in addition
-to the normal <tt>table.xvg</tt> which will be used for all other
-energy group pairs.
-</dd>
-</dl>
-
-<A NAME="ewald">
-<hr>
-<h3>Ewald</h3>
-<dl>
-<dt><b>fourierspacing: (0.12) [nm]</b></dt>
-<dd>For ordinary Ewald, the ratio of the box dimensions and the spacing
-determines a lower bound for the number of wave vectors to use in each
-(signed) direction. For PME and P3M, that ratio determines a lower bound
-for the number of Fourier-space grid points that will be used along that
-axis. In all cases, the number for each direction can be overridden by
-entering a non-zero value for <b>fourier_n[xyz]</b>.
-For optimizing the relative load of the particle-particle interactions
-and the mesh part of PME, it is useful to know that
-the accuracy of the electrostatics remains nearly constant
-when the Coulomb cut-off and the PME grid spacing are scaled
-by the same factor.</dd>
-
-<dt><b>fourier-nx (0) ; fourier-ny (0) ; fourier-nz: (0)</b></dt>
-<dd>Highest magnitude of wave vectors in reciprocal space when using Ewald.</dd>
-<dd>Grid size when using PME or P3M. These values override
-<b>fourierspacing</b> per direction. The best choice is powers of
-2, 3, 5 and 7. Avoid large primes.</dd>
-
-<dt><b>pme-order (4)</b></dt>
-<dd>Interpolation order for PME. 4 equals cubic interpolation. You might try
-6/8/10 when running in parallel and simultaneously decrease grid dimension.</dd>
-
-<dt><b>ewald-rtol (1e-5)</b></dt>
-<dd>The relative strength of the Ewald-shifted direct potential at
-<b>rcoulomb</b> is given by <b>ewald-rtol</b>.
-Decreasing this will give a more accurate direct sum,
-but then you need more wave vectors for the reciprocal sum.</dd>
-
-<dt><b>ewald-rtol-lj (1e-3)</b></dt>
-<dd>When doing PME for VdW-interactions, <b>ewald-rtol-lj</b> is used
-to control the relative strength of the dispersion potential at <b>rvdw</b> in
-the same way as <b>ewald-rtol</b> controls the electrostatic potential.</dd>
-
-<dt><b>lj-pme-comb-rule (Geometric)</b></dt>
-<dd>The combination rules used to combine VdW-parameters in the reciprocal part of LJ-PME. 
-Geometric rules are much faster than Lorentz-Berthelot and usually the recommended choice, even
-when the rest of the force field uses the Lorentz-Berthelot rules.</dd>
-<dd><dl compact>
-<dt><b>Geometric</b></dt>
-<dd>Apply geometric combination rules</dd>
-<dt><b>Lorentz-Berthelot</b></dt>
-<dd>Apply Lorentz-Berthelot combination rules</dd>
-</dl></dd>
-
-<dt><b>ewald-geometry: (3d)</b></dt>
-<dd><dl compact>
-<dt><b>3d</b></dt>
-<dd>The Ewald sum is performed in all three dimensions.</dd>
-<dt><b>3dc</b></dt>
-<dd>The reciprocal sum is still performed in 3D,
-but a force and potential correction applied in the <tt>z</tt>
-dimension to produce a pseudo-2D summation.
-If your system has a slab geometry in the <tt>x-y</tt> plane you can
-try to increase the <tt>z</tt>-dimension of the box (a box height of 3 times
-the slab height is usually ok)
-and use this option.</dd>
-</dl></dd>
-
-<dt><b>epsilon-surface: (0)</b></dt>
-<dd>This controls the dipole correction to the Ewald summation in 3D. The
-default value of zero means it is turned off. Turn it on by setting it to the value 
-of the relative permittivity of the imaginary surface around your infinite system. Be
-careful - you shouldn't use this if you have free mobile charges in your system. 
-This value does not affect the slab 3DC variant of the long range corrections.</dd>
-
-</dl>
-
-<A NAME="tc"><br>
-<hr>
-<h3>Temperature coupling<!--QuietIdx-->temperature coupling<!--EQuietIdx--></h3>
-
-<dl>
-<dt><b>tcoupl:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>No temperature coupling.</dd>
-<dt><b>berendsen</b></dt>
-<dd>Temperature coupling with a Berendsen-thermostat to a bath with
-temperature <b>ref-t</b> [K], with time constant <b>tau-t</b> [ps].
-Several groups can be coupled separately, these are specified in the
-<b>tc-grps</b> field separated by spaces.</dd>
-<dt><b>nose-hoover</b></dt>
-<dd>Temperature coupling using a Nose-Hoover extended
-ensemble. The reference temperature and coupling groups are selected
-as above, but in this case <b>tau-t</b> [ps] controls the period
-of the temperature fluctuations at equilibrium, which is slightly
-different from a relaxation time.
-For NVT simulations the conserved energy quantity is written
-to energy and log file.</dd>
-<dt><b>andersen</b></dt>
-<dd>Temperature coupling by randomizing a fraction of the particles
-at each timestep. Reference temperature and coupling groups are selected
-as above. <b>tau-t</b> is the average time between randomization of each molecule.
-Inhibits particle dynamics somewhat, but little or no ergodicity issues. Currently
-only implemented with velocity Verlet, and not implemented with constraints.</dd>
-<dt><b>andersen-massive</b></dt>
-<dd>Temperature coupling by randomizing all particles at infrequent timesteps.
-Reference temperature and coupling groups are selected
-as above. <b>tau-t</b> is the time between randomization of all molecules.
-Inhibits particle dynamics somewhat, but little or no ergodicity issues. Currently
-only implemented with velocity Verlet.</dd>
-<dt><b>v-rescale</b></dt>
-<dd>Temperature coupling using velocity rescaling with a stochastic term
-(JCP 126, 014101).
-This thermostat is similar to Berendsen coupling, with the same scaling
-using <b>tau-t</b>, but the stochastic term ensures that a proper
-canonical ensemble is generated. The random seed is set with
-<b><A HREF="#ld">ld-seed</A></b>.
-This thermostat works correctly even for <b>tau-t</b><tt>=0</tt>.
-For NVT simulations the conserved energy quantity is written
-to the energy and log file.</dd>
-</dl>
-<dt><b>nsttcouple: (-1)</b></dt>
-<dd>The frequency for coupling the temperature.
-The default value of -1 sets <b>nsttcouple</b> equal to <b>nstlist</b>,
-unless <b>nstlist</b>&le;0, then a value of 10 is used.
-For velocity Verlet integrators <b>nsttcouple</b> is set to 1.</dd>
-</dd>
-<dt><b>nh-chain-length (10)</b></dt>
-<dd>the number of chained Nose-Hoover thermostats for velocity Verlet integrators, the leap-frog <b>md</b> integrator only supports 1.  Data for the NH chain variables is not printed to the .edr, but can be using the <tt>GMX_NOSEHOOVER_CHAINS</tt> environment variable</dd>
-<dt><b>tc-grps:</b></dt>
-<dd>groups to couple separately to temperature bath</dd>
-<dt><b>tau-t: [ps]</b></dt>
-<dd>time constant for coupling (one for each group in <b>tc-grps</b>),
--1 means no temperature coupling</dd>
-<dt><b>ref-t: [K]</b></dt>
-<dd>reference temperature for coupling (one for each group in <b>tc-grps</b>)</dd>
-</dl>
-
-<A NAME="pc"><br>
-<hr>
-<h3>Pressure coupling<!--QuietIdx-->pressure coupling<!--EQuietIdx--></h3>
-
-<dl>
-<dt><b>pcoupl:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>No pressure coupling. This means a fixed box size.</dd>
-<dt><b>berendsen</b></dt>
-<dd>Exponential relaxation pressure coupling with time constant
-<b>tau-p</b> [ps]. The box is scaled every timestep. It has been
-argued that this does not yield a correct thermodynamic ensemble,
-but it is the most efficient way to scale a box at the beginning
-of a run.</dd>
-<dt><b>Parrinello-Rahman</b></dt>
-<dd>Extended-ensemble pressure coupling where the box vectors are
-subject to an equation of motion. The equation of motion for the atoms
-is coupled to this. No instantaneous scaling takes place.  As for
-Nose-Hoover temperature coupling the time constant <b>tau-p</b> [ps]
-is the period of pressure fluctuations at equilibrium. This is
-probably a better method when you want to apply pressure scaling
-during data collection, but beware that you can get very large
-oscillations if you are starting from a different pressure. For
-simulations where the exact fluctation of the NPT ensemble are
-important, or if the pressure coupling time is very short it may not
-be appropriate, as the previous time step pressure is used in some
-steps of the GROMACS implementation for the current time step pressure.</dd>
-</dl></dd>
-<dt><b>MTTK</b></dt>
-<dd>Martyna-Tuckerman-Tobias-Klein implementation, only useable with <b>md-vv</b>
-or <b>md-vv-avek</b>, very similar to Parrinello-Rahman.  
-As for Nose-Hoover temperature coupling the time constant <b>tau-p</b>
-[ps] is the period of pressure fluctuations at equilibrium. This is
-probably a better method when you want to apply pressure scaling
-during data collection, but beware that you can get very large
-oscillations if you are starting from a different pressure. Currently only supports isotropic scaling.</dd>
-</dl></dd>
-
-<dl>
-<dt><b>pcoupltype:</b></dt>
-<dd><dl compact>
-<dt><b>isotropic</b></dt>
-<dd>Isotropic pressure coupling with time constant <b>tau-p</b> [ps].
-The compressibility and reference pressure are set with
-<b>compressibility</b> [bar<sup>-1</sup>] and <b>ref-p</b> [bar], one
-value is needed.</dd>
-<dt><b>semiisotropic</b></dt>
-<dd>Pressure coupling which is isotropic in the <tt>x</tt> and <tt>y</tt> direction,
-but different in the <tt>z</tt> direction.
-This can be useful for membrane simulations.
-2 values are needed for <tt>x/y</tt> and <tt>z</tt> directions respectively.</dd>
-<dt><b>anisotropic</b></dt>
-<dd>Idem, but 6 values are needed for <tt>xx</tt>, <tt>yy</tt>, <tt>zz</tt>, <tt>xy/yx</tt>, <tt>xz/zx</tt> and <tt>yz/zy</tt>
-components, respectively.
-When the off-diagonal compressibilities are set to zero,
-a rectangular box will stay rectangular.
-Beware that anisotropic scaling can lead to extreme deformation
-of the simulation box.</dd>
-<dt><b>surface-tension</b></dt>
-<dd>Surface tension coupling for surfaces parallel to the xy-plane.
-Uses normal pressure coupling for the <tt>z</tt>-direction, while the surface tension
-is coupled to the <tt>x/y</tt> dimensions of the box.
-The first <b>ref-p</b> value is the reference surface tension times
-the number of surfaces [bar nm], 
-the second value is the reference <tt>z</tt>-pressure [bar].
-The two <b>compressibility</b> [bar<sup>-1</sup>] values are the compressibility
-in the <tt>x/y</tt> and <tt>z</tt> direction respectively.
-The value for the <tt>z</tt>-compressibility should be reasonably accurate since it
-influences the convergence of the surface-tension, it can also be set to zero
-to have a box with constant height.</dd>
-</dl></dd>
-
-<dt><b>nstpcouple: (-1)</b></dt>
-<dd>The frequency for coupling the pressure.
-The default value of -1 sets <b>nstpcouple</b> equal to <b>nstlist</b>,
-unless <b>nstlist</b> &le;0, then a value of 10 is used.
-For velocity Verlet integrators <b>nstpcouple</b> is set to 1.</dd>
-</dd>
-
-<dt><b>tau-p: (1) [ps]</b></dt>
-<dd>time constant for coupling</dd>
-<dt><b>compressibility: [bar<sup>-1</sup>]</b></dt>
-<dd>compressibility (NOTE: this is now really in bar<sup>-1</sup>)
-For water at 1 atm and 300 K the compressibility is 4.5e-5 [bar<sup>-1</sup>].</dd>
-<dt><b>ref-p: [bar]</b></dt>
-<dd>reference pressure for coupling</dd>
-<dt><b>refcoord-scaling:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>The reference coordinates for position restraints are not modified.
-Note that with this option the virial and pressure will depend on the absolute
-positions of the reference coordinates.</dd>
-<dt><b>all</b></dt>
-<dd>The reference coordinates are scaled with the scaling matrix of the pressure coupling.</dd>
-<dt><b>com</b></dt>
-<dd>Scale the center of mass of the reference coordinates with the scaling matrix of the pressure coupling. The vectors of each reference coordinate to the center of mass are not scaled. Only one COM is used, even when there are multiple molecules with position restraints. For calculating the COM of the reference coordinates in the starting configuration, periodic boundary conditions are not taken into account.
-</dl></dd>
-</dd>
-</dl>
-
-<A NAME="sa"><br>
-<hr>
-<h3>Simulated annealing<!--QuietIdx-->simulated annealing<!--EQuietIdx--></h3>
-
-Simulated annealing is controlled separately for each temperature group in GROMACS. The reference temperature is a piecewise linear function, but you can use an arbitrary number of points for each group, and choose either a single sequence or a periodic behaviour for each group. The actual annealing is performed by dynamically changing the reference temperature used in the thermostat algorithm selected, so remember that the system will usually not instantaneously reach the reference temperature!
-<dl>
-<dt><b>annealing:</b></dt>
-<dd>Type of annealing for each temperature group</dd>
-<dd><dl compact></dd>
-<dt><b>no</b></dt>
-<dd>No simulated annealing - just couple to reference temperature value.</dd>
-<dt><b>single</b></dt>
-<dd>A single sequence of annealing points. If your simulation is longer than the time of the last point, the temperature will be coupled to this constant value after the annealing sequence has reached the last time point.</dd>
-<dt><b>periodic</b></dt>
-<dd>The annealing will start over at the first reference point once the last reference time is reached. This is repeated until the simulation ends. 
-</dd>
-</dl>
-
-<dt><b>annealing-npoints:</b></dt>
-<dd>A list with the number of annealing reference/control points used for 
-each temperature group. Use 0 for groups that are not annealed. The number of entries should equal the number of temperature groups.</dd>
-
-<dt><b>annealing-time:</b></dt>
-<dd>List of times at the annealing reference/control points for each group. If you are using periodic annealing, the times will be used modulo the last value, i.e. if the values are 0, 5, 10, and 15, the coupling will restart at the 0ps value after 15ps, 30ps, 45ps, etc. The number of entries should equal the sum of the numbers given in <tt>annealing-npoints</tt>.</dd>
-
-<dt><b>annealing-temp:</b></dt>
-<dd>List of temperatures at the annealing reference/control points for each group. The number of entries should equal the sum of the numbers given in <tt>annealing-npoints</tt>.</dd>
-<br>
-Confused? OK, let's use an example. Assume you have two temperature groups, set the group selections to <tt>annealing = single periodic</tt>, the number of points of each group to <tt>annealing-npoints = 3 4</tt>, the times to <tt>annealing-time = 0 3 6 0 2 4 6</tt> and finally temperatures to <tt>annealing-temp = 298 280 270 298 320 320 298</tt>.
-The first group will be coupled to 298K at 0ps, but the reference temperature will drop linearly to reach 280K at 3ps, and then linearly between 280K and 270K from 3ps to 6ps. After this is stays constant, at 270K. The second group is coupled to 298K at 0ps, it increases linearly to 320K at 2ps, where it stays constant until 4ps. Between 4ps and 6ps it decreases to 298K, and then it starts over with the same pattern again, i.e. rising linearly from 298K to 320K between 6ps and 8ps. Check the summary printed by <tt>grompp</tt> if you are unsure!
-</dl>
-
-<A NAME="vel"><br>
-<hr>
-<h3>Velocity generation</h3>
-
-<dl>
-<dt><b>gen-vel:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd> Do not generate velocities. The velocities are set to zero
-when there are no velocities in the input structure file.</dd>
-<dt><b>yes</b></dt>
-<dd>Generate velocities in <tt>grompp</tt> according to a Maxwell distribution at
-temperature <b>gen-temp</b> [K], with random seed <b>gen-seed</b>. 
-This is only meaningful with integrator <b><A HREF="#run">md</A></b>.</dd>
-</dl></dd>
-<dt><b>gen-temp: (300) [K]</b></dt>
-<dd>temperature for Maxwell distribution</dd>
-<dt><b>gen-seed: (-1) [integer]</b></dt>
-<dd>used to initialize random generator for random velocities,
-when <b>gen-seed</b> is set to -1, a pseudo random seed is used.
-</dl>
-
-<A NAME="bond"><br>
-<hr>
-<h3>Bonds</h3>
-
-<dl>
-<dt><b>constraints<!--QuietIdx-->constraint algorithms<!--EQuietIdx-->:</b></dt>
-<dd><dl compact>
-<dt><b>none</b></dt>
-<dd>No constraints except for those defined explicitly in the topology,
-i.e. bonds are represented by a harmonic (or other) potential
-or a Morse potential (depending on the setting of <b>morse</b>)
-and angles by a harmonic (or other) potential.
-<dt><b>h-bonds</b></dt>
-<dd>Convert the bonds with H-atoms to constraints.</dd>
-<dt><b>all-bonds</b></dt>
-<dd>Convert all bonds to constraints.</dd>
-<dt><b>h-angles</b></dt>
-<dd>Convert all bonds and additionally the angles that involve H-atoms
-to bond-constraints.</dd>
-<dt><b>all-angles</b></dt>
-<dd>Convert all bonds and angles to bond-constraints.</dd>
-</dl>
-
-<dt><b>constraint-algorithm:</b></dt>
-<dd><dl compact>
-<dt><b><!--Idx-->LINCS<!--EIdx--></b></dt>
-<dd>LINear Constraint Solver.
-With domain decomposition the parallel version P-LINCS is used.
-The accuracy in set with
-<b>lincs-order</b>, which sets the number of matrices in the expansion
-for the matrix inversion.
-After the matrix inversion correction the algorithm does
-an iterative correction to compensate for lengthening due to rotation.
-The number of such iterations can be controlled with
-<b>lincs-iter</b>. The root mean square relative constraint deviation
-is printed to the log file every <b>nstlog</b> steps.
-If a bond rotates more than <b>lincs-warnangle</b> [degrees] in one step, 
-a warning will be printed both to the log file and to <TT>stderr</TT>. 
-LINCS should not be used with coupled angle constraints.
-</dd>
-<dt><b><!--Idx-->SHAKE<!--EIdx--></b></dt>
-<dd>SHAKE is slightly slower and less stable than LINCS, but does work with 
-angle constraints.
-The relative tolerance is set with <b>shake-tol</b>, 0.0001 is a good value
-for ``normal'' MD. SHAKE does not support constraints between atoms
-on different nodes, thus it can not be used with domain decompositon
-when inter charge-group constraints are present.
-SHAKE can not be used with energy minimization.
-</dd>
-</dl></dd>
-<dt><b>continuation:</b></dt>
-<dd>This option was formerly known as <tt>unconstrained-start</tt>.</dd>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>apply constraints to the start configuration and reset shells</dd>
-<dt><b>yes</b></dt>
-<dd>do not apply constraints to the start configuration
-and do not reset shells, useful for exact coninuation and reruns</dd>
-</dl></dd>
-
-<A NAME="bond2">
-<dt><b>shake-tol: (0.0001)</b></dt>
-<dd>relative tolerance for SHAKE</dd>
-<dt><b>lincs-order: (4)</b></dt>
-<dd>Highest order in the expansion of the constraint coupling matrix.
-When constraints form triangles, an additional expansion of the same
-order is applied on top of the normal expansion only for the couplings
-within such triangles.
-For ``normal'' MD simulations an order of 4 usually suffices, 6 is
-needed for large time-steps with virtual sites or BD.
-For accurate energy minimization an order of 8 or more might be required.
-With domain decomposition, the cell size is limited by the distance
-spanned by <b>lincs-order</b>+1 constraints. When one wants to scale
-further than this limit, one can decrease <b>lincs-order</b> and increase
-<b>lincs-iter</b>, since the accuracy does not deteriorate
-when (1+<b>lincs-iter</b>)*<b>lincs-order</b> remains constant.</dd>
-<dt><b>lincs-iter: (1)</b></dt>
-<dd>Number of iterations to correct for rotational lengthening in LINCS.
-For normal runs a single step is sufficient, but for NVE
-runs where you want to conserve energy accurately or for accurate
-energy minimization you might want to increase it to 2.
-<dt><b>lincs-warnangle: </b>(30) [degrees]</dt>
-<dd>maximum angle that a bond can rotate before LINCS will complain</dd>
-
-<dt><b>morse:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>bonds are represented by a harmonic potential</dd>
-<dt><b>yes</b></dt>
-<dd>bonds are represented by a Morse potential</dd>
-</dl></dd>
-</dl>
-
-<A NAME="egexcl"><br>
-<hr>
-<h3>Energy group <!--Idx-->exclusions<!--EIdx--></h3>
-<dl>
-<dt><b>energygrp-excl: </b></dt>
-<dd>Pairs of energy groups for which all non-bonded interactions are
-excluded. An example: if you have two energy groups <tt>Protein</tt>
-and <tt>SOL</tt>, specifying
-<br>
-<tt>energygrp-excl&nbsp;=&nbsp;Protein&nbsp;Protein&nbsp;&nbsp;SOL&nbsp;SOL</tt>
-<br>
-would give only the non-bonded interactions between the protein and the
-solvent. This is especially useful for speeding up energy calculations with
-<tt>mdrun -rerun</tt> and for excluding interactions within frozen groups.</dd>
-</dl>
-
-<A NAME="walls"><br>
-<hr>
-<h3>Walls<!--QuietIdx-->walls<!--EQuietIdx--></h3>
-<dl>
-<dt><b>nwall: 0</b></dt>
-<dd>When set to <b>1</b> there is a wall at <tt>z=0</tt>, when set to <b>2</b>
-there is also a wall at <tt>z=z-box</tt>. Walls can only be used with <b>pbc=xy</b>.
-When set to <b>2</b> pressure coupling and Ewald summation can be used
-(it is usually best to use semiisotropic pressure coupling with
-the <tt>x/y</tt> compressibility set to 0, as otherwise the surface area will change).
-Walls interact wit the rest of the system through an optional <tt>wall-atomtype</tt>.
-Energy groups <tt>wall0</tt> and <tt>wall1</tt> (for <b>nwall=2</b>) are
-added automatically to monitor the interaction of energy groups
-with each wall.
-The <A HREF="#run">center of mass motion removal</A> will be turned
-off in the <tt>z</tt>-direction.</dd>
-<dt><b>wall-atomtype:</b></dt>
-<dd>the atom type name in the force field for each wall. 
-By (for example) defining a special wall atom type in the topology with its 
-own combination rules, this allows for independent tuning of the interaction 
-of each atomtype with the walls.</dd>
-<dt><b>wall-type:</b></dt>
-<dd><dl compact>
-<dt><b>9-3</b></dt>
-<dd>LJ integrated over the volume behind the wall: 9-3 potential</dd>
-<dt><b>10-4</b></dt>
-<dd>LJ integrated over the wall surface: 10-4 potential</dd>
-<dt><b>12-6</b></dt>
-<dd>direct LJ potential with the z distance from the wall</dd>
-<dt><b>table</b></dt><dd>user defined potentials indexed with the z distance from the wall, the tables are read analogously to
-the <b><A HREF="#table">energygrp-table</A></b> option,
-where the first name is for a ``normal'' energy group and the second name
-is <tt>wall0</tt> or <tt>wall1</tt>,
-only the dispersion and repulsion columns are used</dd>
-</dl></dd>
-<dt><b>wall-r-linpot: -1 (nm)</b></dt>
-<dd>Below this distance from the wall the potential is continued
-linearly and thus the force is constant. Setting this option to
-a postive value is especially useful for equilibration when some atoms
-are beyond a wall.
-When the value is &le;0 (&lt;0 for <b>wall-type=table</b>),
-a fatal error is generated when atoms are beyond a wall.
-</dd>
-<dt><b>wall-density: [nm<sup>-3</sup>/nm<sup>-2</sup>]</b></dt>
-<dd>the number density of the atoms for each wall for wall types
-<b>9-3</b> and <b>10-4</b>
-<dt><b>wall-ewald-zfac: 3</b></dt>
-<dd>The scaling factor for the third box vector for Ewald summation only,
-the minimum is 2.
-Ewald summation can only be used with <b>nwall=2</b>, where one
-should use <b><A HREF="#ewald">ewald-geometry</A><tt>=3dc</tt></b>.
-The empty layer in the box serves to decrease the unphysical Coulomb
-interaction between periodic images.</dd>
-</dl>
-
-<A NAME="pull"><br>
-<hr>
-<h3>COM <!--Idx-->pulling<!--EIdx--></h3>
-<dl>
-<dt><b>pull:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>No center of mass pulling.
-All the following pull options will be ignored
-(and if present in the <tt>.mdp</tt> file, they unfortunately generate warnings)</dd>
-<dt><b>umbrella</b></dt>
-<dd>Center of mass pulling using an umbrella potential
-between the reference group and one or more groups.</dd>
-<dt><b>constraint</b></dt>
-<dd>Center of mass pulling using a constraint
-between the reference group and one or more groups.
-The setup is identical to the option <b>umbrella</b>, except for the fact
-that a rigid constraint is applied instead of a harmonic potential.</dd>
-<dt><b>constant-force</b></dt>
-<dd>Center of mass pulling using a linear potential and therefore
-a constant force. For this option there is no reference position
-and therefore the parameters <b>pull-init</b> and <b>pull-rate</b>
-are not used.</dd>
-</dl></dd>
-<dt><b>pull-geometry:</b></dt>
-<dd><dl compact>
-<dt><b>distance</b></dt>
-<dd>Pull along the vector connecting the two groups.
-Components can be selected with <b>pull-dim</b>.</dd>
-<dt><b>direction</b></dt>
-<dd>Pull in the direction of <b>pull-vec</b>.</dd>
-<dt><b>direction-periodic</b></dt>
-<dd>As <b>direction</b>, but allows the distance to be larger than
-half the box size. With this geometry the box should not be dynamic
-(e.g. no pressure scaling) in the pull dimensions and the pull force
-is not added to virial.</dd>
-<dt><b>cylinder</b></dt>
-<dd>Designed for pulling with respect to a layer where the reference COM
-is given by a local cylindrical part of the reference group.
-The pulling is in the direction of <b>pull-vec</b>.
-From the reference group a cylinder is selected around the axis going
-through the pull group with direction <b>pull-vec</b> using two radii.
-The radius <b>pull-r1</b> gives the radius within which all
-the relative weights are one, between <b>pull-r1</b> and
-<b>pull-r0</b> the weights are switched to zero. Mass weighting is also used.
-Note that the radii should be smaller than half the box size.
-For tilted cylinders they should be even smaller than half the box size
-since the distance of an atom in the reference group
-from the COM of the pull group has both a radial and an axial component.</dd>
-</dl></dd>
-<dt><b>pull-dim: (Y Y Y)</b></dt>
-<dd>the distance components to be used with geometry <b>distance</b>,
-and also sets which components are printed
-to the output files</dd>
-<dt><b>pull-r1: (1) [nm]</b></dt>
-<dd>the inner radius of the cylinder for geometry <b>cylinder</b></dd>
-<dt><b>pull-r0: (1) [nm]</b></dt>
-<dd>the outer radius of the cylinder for geometry <b>cylinder</b></dd>
-<dt><b>pull-constr-tol: (1e-6)</b></dt>
-<dd>the relative constraint tolerance for constraint pulling</dd>
-<dt><b>pull-start:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>do not modify <b>pull-init</b>
-<dt><b>yes</b></dt>
-<dd>add the COM distance of the starting conformation to <b>pull-init</b></dd>
-</dl>
-<dt><b>pull-print-reference: (10)</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>do not print the COM of the first group in each pull coordinate</dd>
-<dt><b>yes</b></dt>
-<dd>print the COM of the first group in each pull coordinate</dd>
-</dl>
-<dt><b>pull-nstxout: (10)</b></dt>
-<dd>frequency for writing out the COMs of all the pull group</dd>
-<dt><b>pull-nstfout: (1)</b></dt>
-<dd>frequency for writing out the force of all the pulled group</dd>
-<dt><b>pull-ngroups: (1)</b></dt>
-<dd>The number of pull groups, not including the absolute reference group,
-when used. Pull groups can be reused in multiple pull coordinates.
-Below only the pull options for group 1 are given, further groups simply
-increase the group index number.</dd>
-<dt><b>pull-ncoords: (1)</b></dt>
-<dd>The number of pull coordinates. Below only the pull options for
-coordinate 1 are given, further coordinates simply increase the coordinate
-index number.</dd>
-
-<dt><b>pull-group1-name: </b></dt>
-<dd>The name of the pull group, is looked up in the index file
-or in the default groups to obtain the atoms involved.</dd>
-<dt><b>pull-group1-weights: </b></dt>
-<dd>Optional relative weights which are multiplied with the masses of the atoms
-to give the total weight for the COM. The number should be 0, meaning all 1,
-or the number of atoms in the pull group.</dd>
-<dt><b>pull-group1-pbcatom: (0)</b></dt>
-<dd>The reference atom for the treatment of periodic boundary conditions
-inside the group
-(this has no effect on the treatment of the pbc between groups).
-This option is only important when the diameter of the pull group
-is larger than half the shortest box vector.
-For determining the COM, all atoms in the group are put at their periodic image
-which is closest to <b>pull-group1-pbcatom</b>.
-A value of 0 means that the middle atom (number wise) is used.
-This parameter is not used with geometry <b>cylinder</b>.
-A value of -1 turns on cosine weighting, which is useful for a group
-of molecules in a periodic system, e.g. a water slab (see Engin et al.
-J. Chem. Phys. B 2010).</dd>
-
-<dt><b>pull-coord1-groups: </b></dt>
-<dd>The two groups indices should be given on which this pull coordinate
-will operate. The first index can be 0, in which case an absolute reference
-of <b>pull-coord1-origin</b> is used. With an absolute reference the system
-is no longer translation invariant and one should think about what to do with
-the <A HREF="#run">center of mass motion</A>.</dd>
-<dt><b>pull-coord1-origin: (0.0 0.0 0.0)</b></dt>
-<dd>The pull reference position for use with an absolute reference.</dd>
-<dt><b>pull-coord1-vec: (0.0 0.0 0.0)</b></dt>
-<dd>The pull direction. <tt>grompp</tt> normalizes the vector.</dd>
-<dt><b>pull-coord1-init: (0.0) [nm]</b></dt>
-<dd>The reference distance at t=0.</dd>
-<dt><b>pull-coord1-rate: (0) [nm/ps]</b></dt>
-<dd>The rate of change of the reference position.</dd>
-<dt><b>pull-coord1-k: (0) [kJ mol<sup>-1</sup> nm<sup>-2</sup>] / [kJ mol<sup>-1</sup> nm<sup>-1</sup>]</b></dt>
-<dd>The force constant. For umbrella pulling this is the harmonic force
-constant in [kJ mol<sup>-1</sup> nm<sup>-2</sup>]. For constant force pulling
-this is the force constant of the linear potential, and thus minus (!)
-the constant force in [kJ mol<sup>-1</sup> nm<sup>-1</sup>].</dd>
-<dt><b>pull-coord1-kB: (pull-k1) [kJ mol<sup>-1</sup> nm<sup>-2</sup>] / [kJ mol<sup>-1</sup> nm<sup>-1</sup>]</b></dt>
-<dd>As <b>pull-coord1-k</b>, but for state B. This is only used when
-<A HREF="#free"><b>free-energy</b></A> is turned on.
-The force constant is then (1 - lambda)*<b>pull-coord1-k</b> + lambda*<b>pull-coord1-kB</b></dt>.
-
-</dl>
-
-<A NAME="nmr"><br>
-<hr>
-<h3><!--Idx-->NMR refinement<!--EIdx--></h3>
-<dl>
-<dt><b>disre:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>ignore <!--Idx-->distance restraint<!--EIdx--> information in topology file</dd>
-<dt><b>simple</b></dt>
-<dd>simple (per-molecule) distance restraints.
-<dt><b>ensemble</b></dt>
-<dd>distance restraints over an ensemble of molecules in one
-simulation box. Normally, one would perform ensemble averaging over
-multiple subsystems, each in a separate box, using <tt>mdrun -multi</tt>;s
-upply <tt>topol0.tpr</tt>, <tt>topol1.tpr</tt>, ... with different
-coordinates and/or velocities.
-The environment variable <tt>GMX_DISRE_ENSEMBLE_SIZE</tt> sets the number
-of systems within each ensemble (usually equal to the <tt>mdrun -multi</tt> value).</dd>
-</dd>
-</dl></dd>
-<dt><b>disre-weighting:</b></dt>
-<dd><dl compact>
-<dt><b>equal</b> (default)</dt>
-<dd>divide the restraint force equally over all atom pairs in the restraint</dd>
-<dt><b>conservative</b></dt>
-<dd>the forces are the derivative of the restraint potential,
-this results in an r<sup>-7</sup> weighting of the atom pairs.
-The forces are conservative when <tt>disre-tau</tt> is zero.</dd>
-</dl></dd>
-<dt><b>disre-mixed:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>the violation used in the calculation of the restraint force is the
-time-averaged violation </dd>
-<dt><b>yes</b></dt>
-<dd>the violation used in the calculation of the restraint force is the
-square root of the product of the time-averaged violation and the instantaneous violation</dd>
-</dl></dd>
-
-<dt><b>disre-fc: (1000) [kJ mol<sup>-1</sup> nm<sup>-2</sup>]</b></dt>
-<dd>force constant for distance restraints, which is multiplied by a
-(possibly) different factor for each restraint given in the <tt>fac</tt>
-column of the interaction in the topology file.</dd>
-
-<dt><b>disre-tau: (0) [ps]</b></dt>
-<dd>time constant for distance restraints running average. A value of zero turns off time averaging.</dd>
-
-<dt><b>nstdisreout: (100) [steps]</b></dt>
-<dd>period between steps when the running time-averaged and instantaneous distances
-of all atom pairs involved in restraints are written to the energy file
-(can make the energy file very large)</dd>
-
-<A NAME="nmr2">
-<dt><b>orire:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>ignore <!--Idx-->orientation restraint<!--EIdx--> information in topology file</dd>
-<dt><b>yes</b></dt>
-<dd>use orientation restraints, ensemble averaging can be performed
-with <tt>mdrun -multi</tt></dd>
-</dl>
-<dt><b>orire-fc: (0) [kJ mol]</b></dt>
-<dd>force constant for orientation restraints, which is multiplied by a
-(possibly) different weight factor for each restraint, can be set to zero to
-obtain the orientations from a free simulation</dd>
-<dt><b>orire-tau: (0) [ps]</b></dt>
-<dd>time constant for orientation restraints running average. A value of zero turns off time averaging.</dd>
-<dt><b>orire-fitgrp: </b></dt>
-<dd>fit group for orientation restraining. This group of atoms is used
-to determine the rotation <b>R</b> of the system with respect to the
-reference orientation. The reference orientation is the starting
-conformation of the first subsystem. For a protein, backbone is a reasonable
-choice</dd>
-<dt><b>nstorireout: (100) [steps]</b></dt>
-<dd>period between steps when the running time-averaged and instantaneous orientations
-for all restraints, and the molecular order tensor are written to the energy file
-(can make the energy file very large)</dd>
-</dl>
-
-<A NAME="free"><br>
-<hr>
-<h3>Free energy calculations<!--QuietIdx-->free energy calculations<!--EQuietIdx--></h3>
-
-<dl>
-<dt><b>free-energy:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>Only use topology A.</dd>
-<dt><b>yes</b></dt>
-<dd>Interpolate between topology A (lambda=0) to topology B (lambda=1)
-and write the derivative of the Hamiltonian with respect to lambda (as specified with <b>dhdl-derivatives</b>), or the Hamiltonian differences with respect to other lambda values (as specified with <b>foreign-lambda</b>) to
-the energy file and/or to <tt>dhdl.xvg</tt>, where they can be processed by, for example <tt>g_bar</tt>.
-The potentials, bond-lengths and angles are interpolated linearly as
-described in the manual. When <b>sc-alpha</b> is larger than zero, soft-core
-potentials are used for the LJ and Coulomb interactions.</dd>
-<dt><b>expanded</b></dt>
-<dd> Turns on expanded ensemble simulation, where the alchemical state becomes a dynamic variable, allowing jumping between different Hamiltonians. See the <A HREF="#expanded">expanded ensemble options</A> for controlling how expanded ensemble simulations are performed. The different Hamiltonians used in expanded ensemble simulations are defined by the other free energy options.</dd>
-</dl></dd>
-<dt><b>init-lambda: (-1)</b></dt>
-<dd>starting value for lambda (float).  Generally, this should only be used with slow growth (i.e. nonzero <b>delta-lambda</b>).  In other cases, <b>init-lambda-state</b> should be specified instead. Must be greater than or equal to 0.</dd>
-<dt><b>delta-lambda: (0)</b></dt>
-<dd>increment per time step for lambda</dd>
-<dt><b>init-lambda-state: (-1)</b></dt>
-<dd>starting value for the lambda state (integer).  Specifies which columm of the lambda vector (<b>coul-lambdas</b>, <b>vdw-lambdas</b>, <b>bonded-lambdas</b>, <b>restraint-lambdas</b>, <b>mass-lambdas</b>, <b>temperature-lambdas</b>, <b>fep-lambdas</b>) should be used. This is a zero-based index: <b>init-lambda-state</b> 0 means the first column, and so on.</dd>
-<dt><b>fep-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. 
-Values must be between 0 and 1.
-Free energy differences between different lambda values can then
-be determined with <tt>g_bar</tt>. <b>fep-lambdas</b> is different from the other -lambdas keywords because
-all components of the lambda vector that are not specified will use <b>fep-lambdas</b> (including restraint-lambdas and therefore the pull code restraints).</dd>
-<dt><b>coul-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. Values must be between 0 and 1.
-Only the electrostatic interactions are controlled with this component of the lambda vector (and only if the lambda=0 and lambda=1 states have differing electrostatic interactions).</dd>
-<dt><b>vdw-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. Values must be between 0 and 1.
-Only the van der Waals interactions are controlled with this component of the lambda vector.</dd>
-<dt><b>bonded-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. Values must be between 0 and 1.
-Only the bonded interactions are controlled with this component of the lambda vector.</dd>
-<dt><b>restraint-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. Values must be between 0 and 1.
-Only the restraint interactions: dihedral restraints, and the pull code restraints are controlled with this component of the lambda vector. </dd>
-<dt><b>mass-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. Values must be between 0 and 1.
-Only the particle masses are controlled with this component of the lambda vector.</dd>
-<dt><b>temperature-lambdas: ()</b></dt>
-<dd>Zero, one or more lambda values for which Delta H values will
-be determined and written to dhdl.xvg every <b>nstdhdl</b> steps. Values must be between 0 and 1.
-Only the temperatures controlled with this component of the lambda vector.
-Note that these lambdas should not be used for replica exchange, only for simulated tempering.</dd>
-<dt><b>calc-lambda-neighbors (1)</b></dt>
-<dd>Controls the number of lambda values for which Delta H values will be
-calculated and written out, if <b>init-lambda-state</b> has been set. A
-positive value will limit the number of lambda points calculated to only the
-nth neighbors of <b>init-lambda-state</b>: for example, if
-<b>init-lambda-state</b> is 5 and this parameter has a value of 2, energies for
-lambda points 3-7 will be calculated and writen out. A value of -1 means all
-lambda points will be written out. For normal BAR such as with g_bar, a value
-of 1 is sufficient, while for MBAR -1 should be used.</dd>
-<dt><b>sc-alpha: (0)</b></dt>
-<dd>the soft-core alpha parameter, a value of 0 results in linear interpolation of the LJ and Coulomb interactions</dd>
-<dt><b>sc-r-power: (6)</b></dt>
-<dd>the power of the radial term in the soft-core equation.  Possible values are 6 and 48. 6 is more standard, and is the default.  When 48 is used, then sc-alpha should generally be much lower (between 0.001 and 0.003).</dd>
-<dt><b>sc-coul: (no)</b></dt>
-<dd>Whether to apply the soft core free energy interaction transformation to the Columbic interaction of a molecule. Default is no, as it is generally
-more efficient to turn off the Coulomic interactions linearly before turning off the van der Waals interactions.</dd>
-<dt><b>sc-power: (0)</b></dt>
-<dd>the power for lambda in the soft-core function, only the values 1 and 2 are supported</dd>
-<dt><b>sc-sigma: (0.3) [nm]</b></dt>
-<dd>the soft-core sigma for particles which have a C6 or C12 parameter equal
-to zero or a sigma smaller than <b>sc-sigma</b></dd>
-<dt><b>couple-moltype:</b></dt>
-<dd>Here one can supply a molecule type (as defined in the topology)
-for calculating solvation or coupling free energies.
-There is a special option <b>system</b> that couples all molecule types
-in the system. This can be useful for equilibrating a system
-starting from (nearly) random coordinates.
-<b>free-energy</b> has to be turned on.
-The Van der Waals interactions and/or charges in this molecule type can be
-turned on or off between lambda=0 and lambda=1, depending on the settings
-of <b>couple-lambda0</b> and <b>couple-lambda1</b>. If you want to decouple
-one of several copies of a molecule, you need to copy and rename
-the molecule definition in the topology.</dd>
-<dt><b>couple-lambda0:</b></dt>
-<dd><dl compact>
-<dt><b>vdw-q</b></dt>
-<dd>all interactions are on at lambda=0
-<dt><b>vdw</b></dt>
-<dd>the charges are zero (no Coulomb interactions) at lambda=0
-<dt><b>q</b></dt>
-<dd>the Van der Waals interactions are turned at lambda=0; soft-core interactions will be required to avoid singularities
-<dt><b>none</b></dt>
-<dd>the Van der Waals interactions are turned off and the charges are zero at lambda=0; soft-core interactions will be required to avoid singularities.
-</dl>
-<dt><b>couple-lambda1:</b></dt>
-<dd> analogous to <b>couple-lambda1</b>, but for lambda=1
-<dt><b>couple-intramol:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>All intra-molecular non-bonded interactions for moleculetype <b>couple-moltype</b> are replaced by exclusions and explicit pair interactions. In this manner the decoupled state of the molecule corresponds to the proper vacuum state without periodicity effects.
-<dt><b>yes</b></dt>
-<dd>The intra-molecular Van der Waals and Coulomb interactions are also turned on/off. This can be useful for partitioning free-energies of relatively large molecules, where the intra-molecular non-bonded interactions might lead to kinetically trapped vacuum conformations. The 1-4 pair interactions are not turned off.
-</dl>
-<dt><b>nstdhdl: (100)</b></dt>
-<dd>the frequency for writing dH/dlambda and possibly Delta H to dhdl.xvg,
-0 means no ouput, should be a multiple of <b>nstcalcenergy</b></dd>.</dd>
-<dt><b>dhdl-derivatives: (yes)</b></dt>
-<dd>If yes (the default), the derivatives of the Hamiltonian with respect to lambda at each <b>nstdhdl</b> step are written out. These values are needed for interpolation of linear energy differences with <tt>g_bar</tt> (although the same can also be achieved with the right <b>foreign lambda</b> setting, that may not be as flexible), or with thermodynamic integration</dd>
-<dt><b>dhdl-print-energy: (no)</b></dt>
-<dd> Include either the total or the potential energy in the dhdl file.  Options are 'no', 'potential', or 'total'. This information is needed for later free energy analysis if the states of interest are at different temperatures.  If all states are at the same temperature, this information is not needed. 'potential' is useful in case one is using <tt>mdrun -rerun</tt> to generate the <tt>dhdl.xvg</tt> file.  When rerunning from an existing trajectory, the kinetic energy will often not be correct, and thus one must compute the residual free energy from the potential alone, with the kinetic energy component computed analytically.
-</dd>
-<dt><b>separate-dhdl-file: (yes)</b></dt>
-<dd><dl compact>
-<dt><b>yes</b></dt>
-<dd>the free energy values that are calculated (as specified with the <b>foreign-lambda</b> and <b>dhdl-derivatives</b> settings) are written out to a separate file, with the default name <tt>dhdl.xvg</tt>. This file can be used directly with <tt>g_bar</tt>.</dd>
-<dt><b>no</b></dt>
-<dd>The free energy values are written out to the energy output file (<tt>ener.edr</tt>, in accumulated blocks at every <b>nstenergy</b> steps), where they can be extracted with <tt>g_energy</tt> or used directly with <tt>g_bar</tt>.</dd>
-</dl>
-<dt><b>dh-hist-size: (0)</b></dt>
-<dd>If nonzero, specifies the size of the histogram into which the Delta H values (specified with <b>foreign-lambda</b>) and the derivative dH/dl values are binned, and written to ener.edr. This can be used to save disk space while calculating free energy differences. One histogram gets written for each <b>foreign lambda</b> and two for the dH/dl, at every <b>nstenergy</b> step. Be aware that incorrect histogram settings (too small size or too wide bins) can introduce errors. Do not use histograms unless you're certain you need it.</dd>
-<dt><b>dh-hist-spacing (0.1)</b></dt>
-<dd>Specifies the bin width of the histograms, in energy units. Used in conjunction with <b>dh-hist-size</b>. This size limits the accuracy with which free energies can be calculated.  Do not use histograms unless you're certain you need it.</dd>
-</dl>
-<A NAME="expanded"><br>
-<hr>
-<h3><!--Idx-->Expanded Ensemble calculations<!--EIdx--></h3>
-
-<dl>
-<dt><b>nstexpanded</b></dt> <dd>The number of integration steps beween attempted moves changing the system Hamiltonian in expanded ensemble simulations.  Must be a multiple of <b>nstcalcenergy</b>, but can be greater or less than <b>nstdhdl</b>.</dd>
-<dt><b>lmc-stats:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>No Monte Carlo in state space is performed.</dd>
-<dt><b>metropolis-transition</b></dt>
-<dd> Uses the Metropolis weights to update the expanded ensemble weight of each state.
-Min{1,exp(-(beta_new u_new - beta_old u_old)}</dd>
-<dt><b>barker-transition</b></dt>
-<dd> Uses the Barker transition critera to update the expanded ensemble weight of each state i, defined by
-exp(-beta_new u_new)/[exp(-beta_new u_new)+exp(-beta_old u_old)</dd>
-<dt><b>wang-landau</b></dt>
-<dd>Uses the Wang-Landau algorithm (in state space, not energy space) to update the expanded ensemble weights.</dd>
-<dt><b>min-variance</b></dt>
-<dd>Uses the minimum variance updating method of Escobedo et al. to update the expanded ensemble weights. Weights
-will not be the free energies, but will rather emphasize states that need more sampling to give even uncertainty.</dd>
-</dl>
-<dt><b>lmc-mc-move:</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>No Monte Carlo in state space is performed.</dd>
-<dt><b>metropolis-transition</b></dt>
-<dd> Randomly chooses a new state up or down, then uses the Metropolis critera to decide whether to accept or reject:
-Min{1,exp(-(beta_new u_new - beta_old u_old)}</dd>
-<dt><b>barker-transition</b></dt>
-<dd> Randomly chooses a new state up or down, then uses the Barker transition critera to decide whether to accept or reject: exp(-beta_new u_new)/[exp(-beta_new u_new)+exp(-beta_old u_old)]</dd>
-<dt><b>gibbs</b></dt>
-<dd> Uses the conditional weights of the state given the coordinate (exp(-beta_i u_i) / sum_k exp(beta_i u_i) to
-decide which state to move to.</dd>
-<dt><b>metropolized-gibbs</b></dt>
-<dd>
-<dd> Uses the conditional weights of the state given the coordinate (exp(-beta_i u_i) / sum_k exp(beta_i u_i) to
-decide which state to move to, EXCLUDING the current state, then uses a rejection step to ensure detailed
-balance. Always more efficient that Gibbs, though only marginally so in many situations, such as when only the nearest neighbors have decent phase space overlap.</dd>
-</dl>
-<dt><b>lmc-seed: (-1)</b></dt>
-<dd> random seed to use for Monte Carlo moves in state space. When <b>lmc-seed</b> is set to -1, a pseudo random seed is us</dd>
-<dt><b>mc-temperature:</b></dt>
-<dd> Temperature used for acceptance/rejection for Monte Carlo moves. If not specified, the temperature of the
-simulation specified in the first group of <b>ref_t</b> is used.</dd>
-<dt><b>wl-ratio: (0.8)</b></dt>
-<dd>The cutoff for the histogram of state occupancies to be reset, and the free energy incrementor to be reset as delta -> delta*wl-scale. If we define the Nratio = (number of samples at each histogram) / (average number of samples at each histogram).  <b>wl-ratio</b> of 0.8 means that means that the histogram is only considered flat if all Nratio &gt; 0.8 AND simultaneously all 1/Nratio &gt; 0.8.</dd>
-<dt><b>wl-scale: (0.8)</b></dt>
-<dd> Each time the histogram is considered flat, then the current value of the Wang-Landau incrementor for the free energies is multiplied by <b>wl-scale</b>.  Value must be between 0 and 1.</dd>
-<dt><b>init-wl-delta: (1.0)</b></dt>
-<dd>The initial value of the Wang-Landau incrementor in kT. Some value near 1 kT is usually most efficient, though sometimes a value of 2-3 in units of kT works better if the free energy differences are large.</dd>
-<dt><b>wl-oneovert: (no)</b></dt>
-<dd>Set Wang-Landau incrementor to scale with 1/(simulation time) in the large sample limit. There is significant evidence that the standard Wang-Landau algorithms in state space presented here result in free energies getting 'burned in' to incorrect values that depend on the initial state. when <b>wl-oneovert</b> is true, then when the incrementor becomes less than 1/N, where N is the mumber of samples collected (and thus proportional to the data collection time, hence '1 over t'), then the Wang-Lambda incrementor is set to 1/N, decreasing every step.  Once this occurs, <b>wl-ratio</b> is ignored, but the weights will still stop updating when the equilibration criteria set in <b>lmc-weights-equil</b> is achieved.</dd>
-<dt><b>lmc-repeats: (1)</b></dt>
-<dd>Controls the number of times that each Monte Carlo swap type is performed each iteration. In the limit of large numbers of Monte Carlo repeats, then all methods converge to Gibbs sampling.  The value will generally not need to be different from 1.</dd>
-<dt><b>lmc-gibbsdelta: (-1)</b></dt>
-<dd> Limit Gibbs sampling to selected numbers of neighboring states. For Gibbs sampling, it is sometimes inefficient to perform Gibbs sampling over all of the states that are defined.  A positive value of <b>lmc-gibbsdelta</b> means that only states plus or minus <b>lmc-gibbsdelta</b> are considered in exchanges up and down. A value of -1 means that all states are considered.  For less than 100 states, it is probably not that expensive to include all states.</dd> 
-<dt><b>lmc-forced-nstart: (0)</b></dt>
-<dd> Force initial state space sampling to generate weights. In order to come up with reasonable initial weights, this setting allows the simulation to drive from the initial to the final lambda state, with <b>lmc-forced-nstart</b> steps at each state before moving on to the next lambda state. If <b>lmc-forced-nstart</b> is sufficiently long (thousands of steps, perhaps), then the weights will be close to correct.  However, in most cases, it is probably better to simply run the standard weight equilibration algorithms.
-<dt><b>nst-transition-matrix: (-1)</b></dt>
-<dd>Frequency of outputting the expanded ensemble transition matrix.  A negative number means it will only be printed at the end of the simulation.<dd>
-<dt><b>symmetrized-transition-matrix: (no) </b></dt>
-<dd>Whether to symmetrize the empirical transition matrix. In the infinite limit the matrix will be symmetric, but will diverge with statistical noise for short timescales.  Forced symmetrization, by using the matrix T_sym = 1/2 (T + transpose(T)), removes problems like the existence of (small magnitude) negative eigenvalues.</dd>
-<dt><b>mininum-var-min: (100)</b></dt>
-<dd> The <b>min-variance</b> strategy (option of <b>lmc-stats</b> is only valid for larger number of samples, and can get stuck if too few samples are used at each state.  <b>mininum-var-min</b> is the minimum number of samples that each state that are allowed before the <b>min-variance</b> strategy is activated if selected.</dd>
-<dt><b>init-lambda-weights: </b></dt>
-<dd>The initial weights (free energies) used for the expanded ensemble states.  Default is a vector of zero weights. format is similar to the lambda vector settings in <b>fep-lambdas</b>, except the weights can be any floating point number.  Units are kT. Its length must match the lambda vector lengths.</dd>
-<dt><b>lmc-weights-equil: (no)</b></dt>
-<dd><dl compact>
-<dt><b>no</b></dt>
-<dd>Expanded ensemble weights continue to be updated throughout the simulation.</dd>
-<dt><b>yes</b></dt>
-<dd>The input expanded ensemble weights are treated as equilibrated, and are not updated throughout the simulation.</dd>
-<dt><b>wl-delta</b></dt>
-<dd>Expanded ensemble weight updating is stopped when the Wang-Landau incrementor falls below the value specified by <b>weight-equil-wl-delta</b>.</dd>
-<dt><b>number-all-lambda</b></dt>
-<dd>Expanded ensemble weight updating is stopped when the number of samples at all of the lambda states is greater than the value specified by <b>weight-equil-number-all-lambda</b>.</dd>
-<dt><b>number-steps</b></dt>
-<dd>Expanded ensemble weight updating is stopped when the number of steps is greater than the level specified by <b>weight-equil-number-steps</b>.</dd>
-<dt><b>number-samples</b></dt>
-<dd>Expanded ensemble weight updating is stopped when the number of total samples across all lambda states is greater than the level specified by <b>weight-equil-number-samples</b>.</dd>
-<dt><b>count-ratio</b></dt>
-<dd>Expanded ensemble weight updating is stopped when the ratio of samples at the least sampled lambda state and most sampled lambda state greater than the value specified by <b>weight-equil-count-ratio</b>.</dd> 
-</dl>
-<dt><b>simulated-tempering: (no)</b></dt>
-<dd>Turn simulated tempering on or off. Simulated tempering is implemented as expanded ensemble sampling with different temperatures instead of different Hamiltonians.</dd>
-<dt><b>sim-temp-low: (300)</b></dt>
-<dd>Low temperature for simulated tempering.</dd>
-<dt><b>sim-temp-high: (300)</b></dt>
-<dd>High temperature for simulated tempering.</dd>
-<dt><b>simulated-tempering-scaling: (linear)</b></dt>
-<dd>Controls the way that the temperatures at intermediate lambdas are calculated from the <b>temperature-lambda</b> part of the lambda vector.</dd>
-<dd><dl compact>
-<dt><b>linear</b></dt>
-<dd>Linearly interpolates the temperatures using the values of <b>temperature-lambda</b>,i.e. if <b>sim-temp-low</b>=300, <b>sim-temp-high</b>=400, then lambda=0.5 correspond to a temperature of 350. A nonlinear set of temperatures can always be implemented with uneven spacing in lambda.</dd>
-<dt><b>geometric</b></dt>
-<dd> Interpolates temperatures geometrically between <b>sim-temp-low</b> and <b>sim-temp-high</b>. The i:th state has temperature <b>sim-temp-low</b> * (<b>sim-temp-high</b>/<b>sim-temp-low</b>) raised to the power of (i/(ntemps-1)).  This should give roughly equal exchange for constant heat capacity, though of course things simulations that involve protein folding have very high heat capacity peaks.</dd>
-<dt><b>exponential</b></dt>
-<dd> Interpolates temperatures exponentially between <b>sim-temp-low</b> and <b>sim-temp-high</b>. The ith state has temperature
-<b>sim-temp-low</b> + (<b>sim-temp-high</b>-<b>sim-temp-low</b>)*((exp(<b>temperature-lambdas</b>[i])-1)/(exp(1.0)-1)).</dd>
-</dl>
-</dl>
-
-<A NAME="neq"><br>
-<hr>
-<h3>Non-equilibrium MD<!--QuietIdx-->non-equilibrium MD<!--EQuietIdx--></h3>
-
-<dl>
-<dt><b>acc-grps: </b></dt>
-<dd>groups for constant acceleration (e.g.: <tt>Protein Sol</tt>)
-all atoms in groups Protein and Sol will experience constant acceleration
-as specified in the <b>accelerate</b> line</dd>
-<dt><b>accelerate: (0) [nm ps<sup>-2</sup>]</b></dt>
-<dd>acceleration for <b>acc-grps</b>; x, y and z for each group
-(e.g. <tt>0.1 0.0 0.0 -0.1 0.0 0.0</tt> means that first group has constant 
-acceleration of 0.1 nm ps<sup>-2</sup> in X direction, second group the 
-opposite).</dd>
-<dt><b>freezegrps: </b></dt>
-<dd>Groups that are to be frozen (i.e. their X, Y, and/or Z position will
-not be updated; e.g. <tt>Lipid SOL</tt>). <b>freezedim</b> specifies for
-which dimension the freezing applies.
-To avoid spurious contibrutions to the virial and pressure due to large
-forces between completely frozen atoms you need to use
-<A HREF="#egexcl">energy group exclusions</A>, this also saves computing time.
-Note that coordinates of frozen atoms are not scaled by pressure-coupling
-algorithms.</dd>
-<dt><b>freezedim: </b></dt>
-<dd>dimensions for which groups in <b>freezegrps</b> should be frozen, 
-specify <tt>Y</tt> or <tt>N</tt> for X, Y and Z and for each group
-(e.g. <tt>Y Y N N N N</tt> means that particles in the first group 
-can move only in Z direction. The particles in the second group can 
-move in any direction).</dd>
-<dt><b>cos-acceleration: (0) [nm ps<sup>-2</sup>]</b></dt>
-<dd>the amplitude of the acceleration profile for calculating the
-<!--Idx-->viscosity<!--EIdx-->.
-The acceleration is in the X-direction and the magnitude is 
-<b>cos-acceleration</b> cos(2 pi z/boxheight).
-Two terms are added to the energy file:
-the amplitude of the velocity profile and 1/viscosity.</dd>
-<dt><b><!--Idx-->deform<!--EIdx-->: (0 0 0 0 0 0) [nm ps<sup>-1</sup>]</b></dt>
-<dd>The velocities of deformation for the box elements:
-a(x) b(y) c(z) b(x) c(x) c(y). Each step the box elements
-for which <b>deform</b> is non-zero are calculated as:
-box(ts)+(t-ts)*deform, off-diagonal elements are corrected
-for periodicity. The coordinates are transformed accordingly.
-Frozen degrees of freedom are (purposely) also transformed.
-The time ts is set to t at the first step and at steps at which
-x and v are written to trajectory to ensure exact restarts.
-Deformation can be used together with semiisotropic or anisotropic
-pressure coupling when the appropriate compressibilities are set to zero.
-The diagonal elements can be used to <!--Idx-->strain<!--EIdx--> a solid.
-The off-diagonal elements can be used to <!--Idx-->shear<!--EIdx--> a solid
-or a liquid.</dd>
-</dl>
-
-<A NAME="ef"><br>
-<hr>
-<h3>Electric fields<!--QuietIdx-->electric field<!--EQuietIdx--></h3>
-
-<dl>
-<dt><b>E-x ; E-y ; E-z:</b></dt>
-<dd>If you want to use an electric field in a direction, enter 3 numbers
-after the appropriate <b>E-*</b>, the first number: the number of cosines,
-only 1 is implemented (with frequency 0) so enter 1,
-the second number: the strength of the electric field in
-<b>V nm<sup>-1</sup></b>,
-the third number: the phase of the cosine, you can enter any number here
-since a cosine of frequency zero has no phase.</dd>
-<dt><b>E-xt;  E-yt;  E-zt: </b></dt>
-<dd>not implemented yet</dd>
-</dl>
-<br>
-
-<hr>
-<A NAME="qmmm"><br>
-<h3>Mixed quantum/classical molecular dynamics<!--QuietIdx>QM/MM<!--EQuietIdx--></h3>
-
-<dl>
-<dt><b>QMMM:</b></dt>
-<dd><dl compact="compact">
-<dt><b>no</b></dt>
-<dd>No QM/MM.</dd>
-<dt><b>yes</b></dt>
-<dd>Do a QM/MM simulation. Several groups can be described at
-different QM levels separately. These are specified in
-the <b>QMMM-grps</b> field separated by spaces. The level of <i>ab
-initio</i> theory at which the groups are described is specified
-by <b>QMmethod</b> and <b>QMbasis</b> Fields. Describing the
-groups at different levels of theory is only possible with the ONIOM
-QM/MM scheme, specified by <b>QMMMscheme</b>.</dd>
-</dl></dd>
-
-<dt><b>QMMM-grps:</b></dt>
-<dd>groups to be descibed at the QM level</dd>
-
-<dt><b>QMMMscheme:</b></dt>
-<dd><dl compact="compact">
-<dt><b>normal</b></dt>
-<dd>normal QM/MM. There can only be one <b>QMMM-grps</b> that is modelled
-at the <b>QMmethod</b> and <b>QMbasis</b> level of <i>ab initio</i>
-theory. The rest of the system is described at the MM level. The QM
-and MM subsystems interact as follows: MM point charges are included
-in the QM one-electron hamiltonian and all Lennard-Jones interactions
-are described at the MM level.</dd>
-<dt><b>ONIOM</b></dt>
-<dd>The interaction between the subsystem is described using the ONIOM
-method by Morokuma and co-workers. There can be more than one <b>QMMM-grps</b> each modeled at a different level of QM theory
-(<b>QMmethod</b> and <b>QMbasis</b>).
-</dd></dl></dd>
-
-<dt><b>QMmethod: (RHF)</b></dt>
-<dd>Method used to compute the energy and gradients on the QM
-atoms. Available methods are AM1, PM3, RHF, UHF, DFT, B3LYP, MP2,
-CASSCF, and MMVB. For CASSCF, the number of electrons and orbitals
-included in the active space is specified by <b>CASelectrons</b>
-and <b>CASorbitals</b>. </dd>
-
-<dt><b>QMbasis: (STO-3G)</b></dt>
-<dd>Basis set used to expand the electronic wavefuntion. Only Gaussian
-basis sets are currently available, <i>i.e.</i> STO-3G, 3-21G, 3-21G*,
-3-21+G*, 6-21G, 6-31G, 6-31G*, 6-31+G*, and 6-311G.</dd>
-
-<dt><b>QMcharge: (0) [integer]</b></dt>
-<dd>The total charge in <tt>e</tt> of the <b>QMMM-grps</b>. In case
-there are more than one <b>QMMM-grps</b>, the total charge of each
-ONIOM layer needs to be specified separately.</dd>
-
-<dt><b>QMmult: (1) [integer]</b></dt>
-<dd>The multiplicity of the <b>QMMM-grps</b>. In case there are more
-than one <b>QMMM-grps</b>, the multiplicity of each ONIOM layer needs
-to be specified separately.</dd>
-
-<dt><b>CASorbitals: (0) [integer]</b></dt>
-<dd>The number of orbitals to be included in the active space when
-doing a CASSCF computation.</dd>
-
-<dt><b>CASelectrons: (0) [integer]</b></dt>
-<dd>The number of electrons to be included in the active space when
-doing a CASSCF computation.</dd>
-
-<dt><b>SH:</b></dt>
-<dd><dl compact="compact">
-<dt><b>no</b></dt>
-<dd>No surface hopping. The system is always in the electronic
-ground-state.</dd>
-<dt><b>yes</b></dt>
-<dd>Do a QM/MM MD simulation on the excited state-potential energy
-surface and enforce a <i>diabatic</i> hop to the ground-state when the
-system hits the conical intersection hyperline in the course the
-simulation. This option only works in combination with the CASSCF
-method.</dd>
-</dl>
-</dl>
-
-<A NAME="gbsa"><br>
-<hr>
-<h3>Implicit solvent</h3>
-
-<dl>
-<dt><b>implicit-solvent:</b></dt>
-<dd><dl compact="compact">
-<dt><b>no</b></dt>
-<dd>No implicit solvent</dd>
-<dt><b>GBSA</b></dt>
-<dd>Do a simulation with implicit solvent using the Generalized Born formalism. 
-Three different methods for calculating the Born radii are available, Still, HCT and
-OBC. These are specified with the <b>gb-algorithm</b> field. The non-polar solvation
-is specified with the <b>sa-algorithm</b> field.</dd>
-</dl>
-
-<dt><b>gb-algorithm:</b></dt>
-<dd><dl compact="compact">
-<dt><b>Still</b></dt>
-<dd>Use the Still method to calculate the Born radii</dd>
-<dt><b>HCT</b></dt>
-<dd>Use the Hawkins-Cramer-Truhlar method to calculate the Born radii</dd>
-<dt><b>OBC</b></dt>
-<dd>Use the Onufriev-Bashford-Case method to calculate the Born radii</dd>
-</dl>
-
-<dt><b>nstgbradii: (1) [steps]</b></dt>
-<dd>Frequency to (re)-calculate the Born radii. For most practial purposes,
-setting a value larger than 1 violates energy conservation and leads to
-unstable trajectories.</dd>
-
-<dt><b>rgbradii: (1.0) [nm]</b></dt>
-<dd>Cut-off for the calculation of the Born radii. Currently must be equal to rlist</dd>
-
-<dt><b>gb-epsilon-solvent: (80)</b></dt>
-<dd>Dielectric constant for the implicit solvent</dd>
-
-<dt><b>gb-saltconc: (0) [M]</b></dt>
-<dd>Salt concentration for implicit solvent models, currently not used</dd>
-
-<dt><b>gb-obc-alpha (1); gb-obc-beta (0.8); gb-obc-gamma (4.85);</b></dt>
-<dd>Scale factors for the OBC model. Default values are OBC(II).
-Values for OBC(I) are 0.8, 0 and 2.91 respectively</dd>
-
-<dt><b>gb-dielectric-offset: (0.009) [nm]</b></dt>
-<dd>Distance for the di-electric offset when calculating the Born radii. This is
-the offset between the center of each atom the center of the polarization energy 
-for the corresponding atom</dd>
-
-<dt><b>sa-algorithm</b></dt>
-<dd><dl compact="compact">
-<dt><b>Ace-approximation</b></dt>
-<dd>Use an Ace-type approximation (default)</dd>
-<dt><b>None</b></dt>
-<dd>No non-polar solvation calculation done. For GBSA only the polar part gets 
-calculated</dd>
-</dl>
-
-<dt><b>sa-surface-tension: [kJ mol<sup>-1</sup> nm<sup>-2</sup>]</b></dt>
-<dd>Default value for surface tension with SA algorithms. The default value is -1; 
-Note that if this default value is not changed
-it will be overridden by <tt>grompp</tt> using values that are specific for the choice
-of radii algorithm (0.0049 kcal/mol/Angstrom<sup>2</sup> for Still, 0.0054 kcal/mol/Angstrom<sup>2</sup> 
-for HCT/OBC)
-
-Setting it to 0 will while using an sa-algorithm other than None means 
-no non-polar calculations are done.
-</dd>
-</dl>   
-
-<A NAME="adress"><br>
-<hr>
-<h3>Adaptive Resolution Simulation</h3>
-
-<dl>
-<dt><b>adress: (no)</b></dt>
-<dd>Decide whether the AdResS feature is turned on.</dd>
-<dt><b>adress-type: (Off)</b></dt>
-<dd><dl compact>
-<dt><b>Off</b></dt>
-<dd>Do an AdResS simulation with weight equal 1, which is equivalent to an explicit (normal) MD simulation. The difference to disabled AdResS is that the AdResS variables are still read-in and hence are defined.</dd>
-<dt><b>Constant</b></dt>
-<dd>Do an AdResS simulation with a constant weight, <b>adress-const-wf</b> defines the value of the weight</dd>
-<dt><b>XSplit</b></dt>
-<dd>Do an AdResS simulation with simulation box split in x-direction, so basically the weight is only a function of the x coordinate and all distances are measured using the x coordinate only.</dd>
-<dt><b>Sphere</b></dt>
-<dd>Do an AdResS simulation with spherical explicit zone.</dd>
-</dl></dd>
-<dt><b>adress-const-wf: (1)</b></dt>
-<dd>Provides the weight for a constant weight simulation (<b>adress-type</b>=Constant)</dd>
-<dt><b>adress-ex-width: (0)</b></dt>
-<dd>Width of the explicit zone,  measured from <b>adress-reference-coords</b>.</dd>
-<dt><b>adress-hy-width: (0)</b></dt>
-<dd>Width of the hybrid zone.</dd>
-<dt><b>adress-reference-coords: (0,0,0)</b></dt>
-<dd>Position of the center of the explicit zone. Periodic boundary conditions apply for measuring the distance from it.</dd>
-<dt><b>adress-cg-grp-names</b></dt>
-<dd>The names of the coarse-grained energy groups. All other energy groups are considered explicit and their interactions will be automatically excluded with the coarse-grained groups.</dd>
-<dt><b>adress-site: (COM)</b>The mapping point from which the weight is calculated.</dt>
-<dd><dl compact>
-<dt><b>COM</b></dt>
-<dd>The weight is calculated from the center of mass of each charge group.</dd>
-<dt><b>COG</b></dt>
-<dd>The weight is calculated from the center of geometry of each charge group.</dd>
-<dt><b>Atom</b></dt>
-<dd>The weight is calculated from the position of 1st atom of each charge group.</dd>
-<dt><b>AtomPerAtom</b></dt>
-<dd>The weight is calculated from the position of each individual atom.</dd>
-</dl></dd>
-<dt><b>adress-interface-correction: (Off)</b></dt>
-<dd><dl compact>
-<dt><b>Off</b></dt>
-<dd>Do not a apply any interface correction.</dd>
-<dt><b>thermoforce</b></dt>
-<dd>Apply thermodynamic force interface correction. The table can be specified using the <tt>-tabletf</tt> option of <tt>mdrun</tt>. The table should contain the potential and force (acting on molecules) as function of the distance from <b>adress-reference-coords</b>.</dd>
-</dl></dd>
-<dt><b>adress-tf-grp-names</b></dt>
-<dd>The names of the energy groups to which the <b>thermoforce</b> is applied if enabled in <b>adress-interface-correction</b>. If no group is given the default table is applied.</dd>
-<dt><b>adress-ex-forcecap: (0)</b></dt>
-<dd>Cap the force in the hybrid region, useful for big molecules. 0 disables force capping.</dd>
-</dl>
-
-<A NAME="user"><br>
-<hr>
-<h3>User defined thingies</h3>
-
-<dl>
-<dt><b>user1-grps; user2-grps: </b></dt>
-<dt><b>userint1 (0); userint2 (0); userint3 (0); userint4 (0)</b></dt>
-<dt><b>userreal1 (0); userreal2 (0); userreal3 (0); userreal4 (0)</b></dt>
-<dd>These you can use if you modify code. You can pass integers and
-reals to your subroutine. Check the inputrec definition in
-<tt>src/include/types/inputrec.h</tt></dd>
-
-</dl>
-
-<A NAME="idx"><br>
-<hr>
-<h3>Index</h3>
-
-<P>
-
-<multicol cols=4> 
-<A HREF="#neq">acc-grps</A><br>
-<A HREF="#neq">accelerate</A><br>
-<A HREF="#sa">annealing</A><br>
-<A HREF="#sa">annealing-npoints</A><br>
-<A HREF="#sa">annealing-time</A><br>
-<A HREF="#sa">annealing-temp</A><br>
-<A HREF="#ld">bd-fric</A><br>
-<A HREF="#vdw">bDispCorr</A><br>
-<A HREF="#run">comm-mode</A><br>
-<A HREF="#run">comm-grps</A><br>
-<A HREF="#pc">compressibility</A><br>
-<A HREF="#bond">constraint-algorithm</A><br>
-<A HREF="#bond">constraints</A><br>
-<A HREF="#neq">cos-acceleration</A><br>
-<A HREF="#el">coulombtype</A><br>
-<A HREF="#el">coulomb-modifier</A><br>
-<A HREF="#free">couple-intramol</A><br>
-<A HREF="#free">couple-lambda0</A><br>
-<A HREF="#free">couple-lambda1</A><br>
-<A HREF="#free">couple-moltype</A><br>
-<A HREF="#nl">cutoff-scheme</A><br>
-<A HREF="#pp">define</A><br>
-<A HREF="#neq">deform</A><br>
-<A HREF="#free">delta-lambda</A><br>
-<A HREF="#nmr">disre</A><br>
-<A HREF="#nmr">disre-weighting</A><br>
-<A HREF="#nmr">disre-mixed</A><br>
-<A HREF="#nmr">disre-fc</A><br>
-<A HREF="#nmr">disre-tau</A><br>
-<A HREF="#run">dt</A><br>
-<A HREF="#em">emstep</A><br>
-<A HREF="#em">emtol</A><br>
-<A HREF="#egexcl">energygrp-excl</A><br>
-<A HREF="#table">energygrp-table</A><br>
-<A HREF="#out">energygrps</A><br>
-<A HREF="#el2">epsilon-r</A><br>
-<A HREF="#el2">epsilon-rf</A><br>
-<A HREF="#ewald">ewald-rtol</A><br>
-<A HREF="#ewald">ewald-geometry</A><br>
-<A HREF="#ewald">epsilon-surface</A><br>
-<A HREF="#ef">E-x</A><br>
-<A HREF="#ef">E-xt</A><br>
-<A HREF="#ef">E-y</A><br>
-<A HREF="#ef">E-yt</A><br>
-<A HREF="#ef">E-z</A><br>
-<A HREF="#ef">E-zt </A><br>
-<A HREF="#shellmd">fcstep</A><br>
-<A HREF="#ewald">fourier-nx</A><br>
-<A HREF="#ewald">fourier-ny</A><br>
-<A HREF="#ewald">fourier-nz</A><br>
-<A HREF="#ewald">fourierspacing</A><br>
-<A HREF="#free">free-energy</A><br>
-<A HREF="#neq">freezedim </A><br>
-<A HREF="#neq">freezegrps</A><br>
-<A HREF="#vel">gen-seed</A><br>
-<A HREF="#vel">gen-temp</A><br>
-<A HREF="#vel">gen-vel</A><br>
-<A HREF="#pp">include</A><br>
-<A HREF="#free">init-lambda</A><br>
-<A HREF="#expanded">init-lambda-weights</A><br>
-<A HREF="#run">init-step</A><br>
-<A HREF="#expanded">initial-wl-delta</A><br>
-<A HREF="#run">integrator</A><br>
-<A HREF="#ld">ld-seed</A><br>
-<A HREF="#bond2">lincs-iter</A><br>
-<A HREF="#bond2">lincs-order</A><br>
-<A HREF="#bond2">lincs-warnangle</A><br>
-<A HREF="#expanded">lmc-forced-nstart</A><br>
-<A HREF="#expanded">lmc-gibbsdelta</A><br>
-<A HREF="#expanded">lmc-mc-move</A><br>
-<A HREF="#expanded">lmc-seed</A><br>
-<A HREF="#expanded">lmc-stats</A><br>
-<A HREF="#expanded">lmc-weights-equil</A><br>
-<A HREF="#expanded">mc-temperature</A><br>
-<A HREF="#expanded">mininum-var-min</A><br>
-<A HREF="#bond2">morse</A><br>
-<A HREF="#em">nbfgscorr</A><br>
-<A HREF="#shellmd">niter</A><br>
-<A HREF="#tc">nh-chain-length</A><br>
-<A HREF="#em">nstcgsteep</A><br>
-<A HREF="#out">nstcalcenergy</A><br>
-<A HREF="#run">nstcomm</A><br>
-<A HREF="#nmr">nstdisreout</A><br>
-<A HREF="#out">nstenergy</A><br>
-<A HREF="#run">nsteps</A><br>
-<A HREF="#out">nstfout</A><br>
-<A HREF="#nl">nstlist</A><br>
-<A HREF="#out">nstlog</A><br>
-<A HREF="#pc">nstpcouple</A><br>
-<A HREF="#tc">nsttcouple</A><br>
-<A HREF="#out">nstvout</A><br>
-<A HREF="#out">nstxout</A><br>
-<A HREF="#out">nstxout-compressed</A><br>
-<A HREF="#expanded">nst-transition-matrix</A><br>
-<A HREF="#nl">ns-type</A><br>
-<A HREF="#wall">nwall</A><br>
-<A HREF="#nmr2">orire</A><br>
-<A HREF="#nmr2">orire-fc</A><br>
-<A HREF="#nmr2">orire-tau</A><br>
-<A HREF="#nmr2">orire-fitgrp</A><br>
-<A HREF="#nmr2">nstorireout</A><br>
-<A HREF="#nl">pbc</A><br>
-<A HREF="#pc">pcoupl</A><br>
-<A HREF="#pc">pcoupltype</A><br>
-<A HREF="#nl">periodic-molecules</A><br>
-<A HREF="#ewald">pme-order</A><br>
-<A HREF="#pull">pull</A><br>
-<A HREF="#pc">refcoord-scaling</A><br>
-<A HREF="#pc">ref-p</A><br>
-<A HREF="#tc">ref-t</A><br>
-<A HREF="#el2">rcoulomb-switch</A><br>
-<A HREF="#el2">rcoulomb</A><br>
-<A HREF="#nl">rlist</A><br>
-<A HREF="#nl">rlistlong</A><br>
-<A HREF="#tpi">rtpi</A><br>
-<A HREF="#vdw">rvdw-switch</A><br>
-<A HREF="#vdw">rvdw</A><br>
-<A HREF="#free">sc-alpha</A><br>
-<A HREF="#free">sc-power</A><br>
-<A HREF="#free">sc-sigma</A><br>
-<A HREF="#bond2">shake-tol</A><br>
-<A HREF="#expanded">sim-temp-low</A><br>
-<A HREF="#expanded">sim-temp-high</A><br>
-<A HREF="#expanded">simulated-tempering</A><br>
-<A HREF="#expanded">simulated-tempering-scaling</A><br>
-<A HREF="#expanded">symmetrized-transition-matrix</A><br>
-<A HREF="#table">table-extension</A><br>
-<A HREF="#pc">tau-p</A><br>
-<A HREF="#tc">tau-t</A><br>
-<A HREF="#tc">tc-grps</A><br>
-<A HREF="#tc">tcoupl</A><br>
-<A HREF="#run">tinit</A><br>
-<A HREF="#bond">continuation</A><br>
-<A HREF="#user">user1-grps</A><br>
-<A HREF="#user">user2-grps</A><br>
-<A HREF="#user">userint1</A><br>
-<A HREF="#user">userint2</A><br>
-<A HREF="#user">userint3</A><br>
-<A HREF="#user">userint4</A><br>
-<A HREF="#user">userreal1</A><br>
-<A HREF="#user">userreal2</A><br>
-<A HREF="#user">userreal3</A><br>
-<A HREF="#user">userreal4</A><br>
-<A HREF="#vdw">vdwtype</A><br>
-<A HREF="#vdw">vdw-modifier</A><br>
-<A HREF="#nl">verlet-buffer-tolerance</A><br>
-<A HREF="#out">compressed-x-grps</A><br>
-<A HREF="#out">compressed-x-precision</A><br>
-<A HREF="#sa">zero-temp-time</A><br>
-<A HREF="#walls">wall-atomtype</A><br>
-<A HREF="#walls">wall-density</A><br>
-<A HREF="#walls">wall-ewald-zfac</A><br>
-<A HREF="#walls">wall-r-linpot</A><br>
-<A HREF="#walls">wall-type</A><br>
-<A HREF="#expanded">weight-equil-count-ratio</A><br>
-<A HREF="#expanded">weight-equil-number-all-lambda</A><br>
-<A HREF="#expanded">weight-equil-number-samples</A><br>
-<A HREF="#expanded">weight-equil-number-steps</A><br>
-<A HREF="#expanded">weight-equil-wl-delta</A><br>
-<A HREF="#expanded">wl-ratio</A><br>
-<A HREF="#expanded">wl-scale</A><br>
-</multicol>
index c02310223886fc4e701d610ebcbb6b07cd3c998c..6492e5db38fbd0a5d50ae0885773fef87ca0c761 100644 (file)
@@ -1,7 +1,7 @@
 <title>mtx file format</title>
 <H3>Description</H3>
 Files with the mtx file extension contain a matrix.
-The file format is identical to the <a href="trj.html">trj</a> format.
+The file format is identical to the <a href="trr.html">trr</a> format.
 Currently this file format is only used for hessian matrices,
 which are produced with <a href="../programs/gmx-mdrun.html">gmx mdrun</a> and read by
 <a href="../programs/gmx-nmeig.html">gmx nmeig</a>.
diff --git a/docs/old-html/online/options.html b/docs/old-html/online/options.html
deleted file mode 100644 (file)
index af9fc65..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<TITLE>Options</TITLE>
-<UL>
-<LI>
-Optional files are not used unless the option is set, in contrast to
-non optional files, where the default file name is used when the
-option is not set.
-<P>
-All GROMACS programs will accept file options without a file extension
-or filename being specified. In such cases the default filenames will
-be used. With multiple input file types, such as generic structure
-format, the directory will be searched for files of each type with the
-supplied or default name. When no such file is found, or with output
-files the first file type will be used.
-<P>
-All GROMACS programs with the exception of <tt>mdrun</tt>,
-<tt>trjcat</tt> and <tt>eneconv</tt> check if the command line options
-are valid.  If this is not the case, the program will be halted.
-<P>
-<LI>
-All GROMACS programs have 4 hidden options:
-<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
-<TR><TH>option</TH><TH>type</TH><TH>default</TH><TH>description</TH></TR>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]hidden</tt></b> </TD><TD ALIGN=RIGHT> bool </TD><TD ALIGN=RIGHT> <tt>   yes</tt> </TD><TD> [hidden] Print hidden options </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]quiet</tt></b> </TD><TD ALIGN=RIGHT> bool </TD><TD ALIGN=RIGHT> <tt>    no</tt> </TD><TD> [hidden] Do not print help info </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-man</tt></b> </TD><TD ALIGN=RIGHT> enum </TD><TD ALIGN=RIGHT> <tt>html</tt> </TD><TD> [hidden] Write manual and quit: no, html, tex, nroff, java, ascii or completion </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]debug</tt></b> </TD><TD ALIGN=RIGHT> bool </TD><TD ALIGN=RIGHT> <tt>    no</tt> </TD><TD> [hidden] Write file with debug information </TD></TD>
-</TABLE>
-<P>
-<LI>
-Enumerated options (enum) should be used with one of the arguments
-listed in the option description, the argument may be abbreviated.
-The first match to the shortest argument in the list will be selected.
-<P>
-<LI>
-Vector options can be used with 1 or 3 parameters. When only one
-parameter is supplied the two others are also set to this value.
-<P>
-<LI>
-All GROMACS programs can read compressed or g-zipped files. There
-might be a problem with reading compressed <tt>.xtc</tt>,
-<tt>.trr</tt> and <tt>.trj</tt> files, but these will not compress
-very well anyway.
-<P>
-<LI>
-Most GROMACS programs can process a trajectory with less atoms than
-the run input or structure file, but only if the trajectory consists
-of the first n atoms of the run input or structure file.
-</UL>
index 8bba16691f72e8f99ba1d539c79c88f08e16fb97..67f6c174ff7c618657415bbb04fa50a7748950c3 100644 (file)
@@ -2,7 +2,7 @@
 <H3>Description</H3>
 The top file extension stands for topology. It is an ascii file which is 
 read by <a href="../programs/gmx-grompp.html">gmx grompp</a> which processes it
-and creates a binary topology (<a href="tpb.html">.tpb file</a>).<br>
+and creates a binary topology (<a href="tpr.html">.tpr file</a>).<br>
 A sample file is included below:
 <pre>
 ;
diff --git a/docs/old-html/online/tpa.html b/docs/old-html/online/tpa.html
deleted file mode 100644 (file)
index 9002525..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<title>tpa file format</title>
-<H3>Description</H3>
-The tpa file extension stands for binary run input file. This file contains 
-the starting structure of your simulation, The molecular topology and 
-all the simulation data. Because this file is in binary format it 
-cannot be read with a normal editor. To read a binary run input file type:
-<PRE>
-% <a href="../programs/gmx-dump.html">gmx dump</a> -s topol.tpa
-</PRE>
-or if you're not such a fast reader:
-<PRE>
-% gmxdump -s topol.tpa | more
-</PRE>
-
-<p>
-You can also compare two tpa files using:
-<pre>
-% <a href="../programs/gmx-check.html">gmx check</a> -s1 top1 -s2 top2 | more
-</pre>
diff --git a/docs/old-html/online/tpb.html b/docs/old-html/online/tpb.html
deleted file mode 100644 (file)
index 4206296..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<title>tpb file format</title>
-<h3>Description</h3>
-The tpb file extension stands for binary run input file. This file contains 
-the starting structure of your simulation, The molecular topology and 
-all the simulation data. Because this file is in binary format it 
-cannot be read with a normal editor. To read a binary run input file type:
-<PRE>
-% <a href="../programs/gmx-dump.html">gmx dump</a> -s topol.tpb
-</PRE>
-or if you're not such a fast reader:
-<PRE>
-% gmxdump -s topol.tpb | more
-</PRE>
-
-<p>
-You can also compare two tpb files using:
-<pre>
-% <a href="../programs/gmx-check.html">gmx check</a> -s1 top1 -s2 top2 | more
-</pre>
diff --git a/docs/old-html/online/trj.html b/docs/old-html/online/trj.html
deleted file mode 100644 (file)
index 0077a8e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<title>trj file format</title>
-<h3>Description</h3>
-Files with the trj file extension contain the trajectory of a simulation. 
-In this file all the coordinates, velocities, forces and energies are 
-printed as you told GROMACS in your mdp file. This file is in binary 
-format an can be read with <a href="../programs/gmx-dump.html">gmx dump</a>.
-<PRE>
-% <a href="../programs/gmx-dump.html">gmx dump</a> -f traj.trj
-</PRE>
-or if you're not such a fast reader:
-<PRE>
-% gmxdump -f traj.trj | more
-</PRE>
-
-<p>
-You can also get a quick look in the contents of the file (number of 
-frames etc.) using:
-<PRE>
-% <a href="../programs/gmx-check.html">gmx check</a> -f traj.trj
-</PRE>
index 28477eb16862e23d3ddeb296c11ba8e5735dd529..c48caeebfdc1748cca6117a59492bf0ecb9f4b10 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,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.
 if(MARKDOWN_CONFIGURE_IS_POSSIBLE AND PANDOC_EXECUTABLE)
     set(name "user-guide")
     configure_markdown(main.md)
-    make_markdown_html(${name} ${CMAKE_CURRENT_BINARY_DIR}/main.md)
-    make_markdown_pdf(${name} ${CMAKE_CURRENT_BINARY_DIR}/main.md)
+    configure_markdown(references.md)
+
+    # TODO The concatenation of the markdown into a single document on
+    # the pandoc command line generated by CMake is not pretty, but
+    # there's no standard native include-file mechanism in
+    # Markdown. We should resolve this when we agree on a final
+    # generation platform.
+    list(APPEND list_of_markdown_files
+        ${CMAKE_CURRENT_SOURCE_DIR}/getting-started.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/tools.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/mdp-options.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/cutoff-schemes.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/mdrun-features.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/mdrun-performance.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/file-formats.md
+        ${CMAKE_CURRENT_SOURCE_DIR}/environment-variables.md
+        )
+
+    make_markdown_html(${name} ${CMAKE_CURRENT_BINARY_DIR}/main.md ${list_of_markdown_files} ${CMAKE_CURRENT_BINARY_DIR}/references.md)
+    make_markdown_pdf(${name} ${CMAKE_CURRENT_BINARY_DIR}/main.md ${list_of_markdown_files} ${CMAKE_CURRENT_BINARY_DIR}/references.md)
 
     # Add a top-level target for the webpage build to hook onto
     add_custom_target(${name}
diff --git a/docs/user-guide/cutoff-schemes.md b/docs/user-guide/cutoff-schemes.md
new file mode 100644 (file)
index 0000000..02dbc2f
--- /dev/null
@@ -0,0 +1,3 @@
+# Non-bonded cut-off schemes
+
+TODO in future patch
diff --git a/docs/user-guide/environment-variables.md b/docs/user-guide/environment-variables.md
new file mode 100644 (file)
index 0000000..cd56ddd
--- /dev/null
@@ -0,0 +1,336 @@
+
+# Environment Variables
+
+GROMACS programs may be influenced by the use of
+environment variables.  First of all, the variables set in
+the `GMXRC` file are essential for running and
+compiling GROMACS. Some other useful environment variables are
+listed in the following sections. Most environment variables function
+by being set in your shell to any non-NULL value. Specific
+requirements are described below if other values need to be set. You
+should consult the documentation for your shell for instructions on
+how to set environment variables in the current shell, or in config
+files for future shells. Note that requirements for exporting
+environment variables to jobs run under batch control systems vary and
+you should consult your local documentation for details.
+
+## Output Control
+
+* `GMX_CONSTRAINTVIR`: print constraint virial and force virial energy terms.
+
+* `GMX_MAXBACKUP`: GROMACS automatically backs up old
+        copies of files when trying to write a new file of the same
+        name, and this variable controls the maximum number of
+        backups that will be made, default 99. If set to 0 it fails to
+        run if any output file already exists. And if set to -1 it
+        overwrites any output file without making a backup.
+
+* `GMX_NO_QUOTES`: if this is explicitly set, no cool quotes
+        will be printed at the end of a program.
+
+* `GMX_SUPPRESS_DUMP`: prevent dumping of step files during
+        (for example) blowing up during failure of constraint
+        algorithms.
+
+* `GMX_TPI_DUMP`: dump all configurations to a [.pdb]
+        file that have an interaction energy less than the value set
+        in this environment variable.
+
+* `GMX_VIEW_XPM`: `GMX_VIEW_XVG`, `GMX_VIEW_EPS` and `GMX_VIEW_PDB`, commands used to
+        automatically view [.xvg], [.xpm], [.eps]
+        and [.pdb] file types, respectively; they default to `xv`, `xmgrace`,
+        `ghostview` and `rasmol`. Set to empty to disable
+        automatic viewing of a particular file type. The command will
+        be forked off and run in the background at the same priority
+        as the GROMACS tool (which might not be what you want).
+        Be careful not to use a command which blocks the terminal
+        (e.g. `vi`), since multiple instances might be run.
+
+* `GMX_VIRIAL_TEMPERATURE`: print virial temperature energy term
+
+* `GMX_LOG_BUFFER`: the size of the buffer for file I/O. When set
+        to 0, all file I/O will be unbuffered and therefore very slow.
+        This can be handy for debugging purposes, because it ensures
+        that all files are always totally up-to-date.
+
+* `GMX_LOGO_COLOR`: set display color for logo in [gmx view].
+
+* `GMX_PRINT_LONGFORMAT`: use long float format when printing
+        decimal values.
+
+* `GMX_COMPELDUMP`: Applies for computational electrophysiology setups
+        only (see reference manual). The initial structure gets dumped to 
+        [.pdb] file, which allows to check whether multimeric channels have 
+        the correct PBC representation. 
+
+## Debugging
+
+* `GMX_PRINT_DEBUG_LINES`: when set, print debugging info on line numbers.
+
+* `GMX_DD_NST_DUMP`: number of steps that elapse between dumping
+        the current DD to a PDB file (default 0). This only takes effect
+        during domain decomposition, so it should typically be
+        0 (never), 1 (every DD phase) or a multiple of `nstlist`.
+
+* `GMX_DD_NST_DUMP_GRID`: number of steps that elapse between dumping
+        the current DD grid to a PDB file (default 0). This only takes effect
+        during domain decomposition, so it should typically be
+        0 (never), 1 (every DD phase) or a multiple of `nstlist`.
+
+* `GMX_DD_DEBUG`: general debugging trigger for every domain
+        decomposition (default 0, meaning off). Currently only checks
+        global-local atom index mapping for consistency.
+
+* `GMX_DD_NPULSE`: over-ride the number of DD pulses used
+        (default 0, meaning no over-ride). Normally 1 or 2.
+
+* There are a number of extra environment variables like these
+  that are used in debugging - check the code!
+
+## Performance and Run Control
+
+* `GMX_DO_GALACTIC_DYNAMICS`: planetary simulations are made possible (just for fun) by setting
+        this environment variable, which allows setting `epsilon_r = -1` in the [.mdp]
+        file. Normally, `epsilon_r` must be greater than zero to prevent a fatal error.
+        See [wwwpage] for example input files for a planetary simulation.
+
+* `GMX_ALLOW_CPT_MISMATCH`: when set, runs will not exit if the
+        ensemble set in the [.tpr] file does not match that of the
+        [.cpt] file.
+
+* `GMX_CUDA_NB_EWALD_TWINCUT`: force the use of twin-range cutoff kernel even if `rvdw` =
+        `rcoulomb` after PP-PME load balancing. The switch to twin-range kernels is automated,
+        so this variable should be used only for benchmarking.
+
+* `GMX_CUDA_NB_ANA_EWALD`: force the use of analytical Ewald kernels. Should be used only for benchmarking.
+
+* `GMX_CUDA_NB_TAB_EWALD`: force the use of tabulated Ewald kernels. Should be used only for benchmarking.
+
+* `GMX_CUDA_STREAMSYNC`: force the use of cudaStreamSynchronize on ECC-enabled GPUs, which leads
+        to performance loss due to a known CUDA driver bug present in API v5.0 NVIDIA drivers (pre-30x.xx).
+        Cannot be set simultaneously with `GMX_NO_CUDA_STREAMSYNC`.
+
+* `GMX_CYCLE_ALL`: times all code during runs.  Incompatible with threads.
+
+* `GMX_CYCLE_BARRIER`: calls MPI_Barrier before each cycle start/stop call.
+
+* `GMX_DD_ORDER_ZYX`: build domain decomposition cells in the order
+        (z, y, x) rather than the default (x, y, z).
+
+* `GMX_DD_USE_SENDRECV2`: during constraint and vsite communication, use a pair
+        of `MPI_SendRecv` calls instead of two simultaneous non-blocking calls
+        (default 0, meaning off). Might be faster on some MPI implementations.
+
+* `GMX_DLB_BASED_ON_FLOPS`: do domain-decomposition dynamic load balancing based on flop count rather than
+        measured time elapsed (default 0, meaning off).
+        This makes the load balancing reproducible, which can be useful for debugging purposes.
+        A value of 1 uses the flops; a value > 1 adds (value - 1)*5% of noise to the flops to increase the imbalance and the scaling.
+
+* `GMX_DLB_MAX_BOX_SCALING`: maximum percentage box scaling permitted per domain-decomposition
+        load-balancing step (default 10)
+
+* `GMX_DD_RECORD_LOAD`: record DD load statistics for reporting at end of the run (default 1, meaning on)
+
+* `GMX_DD_NST_SORT_CHARGE_GROUPS`: number of steps that elapse between re-sorting of the charge
+        groups (default 1). This only takes effect during domain decomposition, so should typically
+        be 0 (never), 1 (to mean at every domain decomposition), or a multiple of `nstlist`.
+
+* `GMX_DETAILED_PERF_STATS`: when set, print slightly more detailed performance information
+        to the [.log] file. The resulting output is the way performance summary is reported in versions
+        4.5.x and thus may be useful for anyone using scripts to parse [.log] files or standard output.
+
+* `GMX_DISABLE_SIMD_KERNELS`: disables architecture-specific SIMD-optimized (SSE2, SSE4.1, AVX, etc.)
+        non-bonded kernels thus forcing the use of plain C kernels.
+
+* `GMX_DISABLE_CUDA_TIMING`: timing of asynchronously executed GPU operations can have a
+        non-negligible overhead with short step times. Disabling timing can improve performance in these cases.
+
+* `GMX_DISABLE_GPU_DETECTION`: when set, disables GPU detection even if [mdrun] was compiled
+        with GPU support.
+
+* `GMX_DISRE_ENSEMBLE_SIZE`: the number of systems for distance restraint ensemble
+        averaging. Takes an integer value.
+
+* `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 [.edr]
+        file, allowing the use of all frames up until the corruption.
+
+* `GMX_FORCE_UPDATE`: update forces when invoking `mdrun -rerun`.
+
+* `GMX_GPU_ID`: set in the same way as `mdrun -gpu_id`, `GMX_GPU_ID`
+        allows the user to specify different GPU id-s, which can be useful for selecting different
+        devices on different compute nodes in a cluster.  Cannot be used in conjunction with `mdrun -gpu_id`.
+
+* `GMX_IGNORE_FSYNC_FAILURE_ENV`: allow [mdrun] to continue even if
+        a file is missing.
+
+* `GMX_LJCOMB_TOL`: when set to a floating-point value, overrides the default tolerance of
+        1e-5 for force-field floating-point parameters.
+
+* `GMX_MAX_MPI_THREADS`: sets the maximum number of MPI-threads that [mdrun]
+        can use.
+
+* `GMX_MAXCONSTRWARN`: if set to -1, [mdrun] will
+        not exit if it produces too many LINCS warnings.
+
+* `GMX_NB_GENERIC`: use the generic C kernel.  Should be set if using
+        the group-based cutoff scheme and also sets `GMX_NO_SOLV_OPT` to be true,
+        thus disabling solvent optimizations as well.
+
+* `GMX_NB_MIN_CI`: neighbor list balancing parameter used when running on GPU. Sets the
+        target minimum number pair-lists in order to improve multi-processor load-balance for better
+        performance with small simulation systems. Must be set to a positive integer, the default value
+        is optimized for NVIDIA Fermi and Kepler GPUs, therefore changing it is not necessary for
+        normal usage, but it can be useful on future architectures.
+
+* `GMX_NBLISTCG`: use neighbor list and kernels based on charge groups.
+
+* `GMX_NBNXN_CYCLE`: when set, print detailed neighbor search cycle counting.
+
+* `GMX_NBNXN_EWALD_ANALYTICAL`: force the use of analytical Ewald non-bonded kernels,
+        mutually exclusive of `GMX_NBNXN_EWALD_TABLE`.
+
+* `GMX_NBNXN_EWALD_TABLE`: force the use of tabulated Ewald non-bonded kernels,
+        mutually exclusive of `GMX_NBNXN_EWALD_ANALYTICAL`.
+
+* `GMX_NBNXN_SIMD_2XNN`: force the use of 2x(N+N) SIMD CPU non-bonded kernels,
+        mutually exclusive of `GMX_NBNXN_SIMD_4XN`.
+
+* `GMX_NBNXN_SIMD_4XN`: force the use of 4xN SIMD CPU non-bonded kernels,
+        mutually exclusive of `GMX_NBNXN_SIMD_2XNN`.
+
+* `GMX_NO_ALLVSALL`: disables optimized all-vs-all kernels.
+
+* `GMX_NO_CART_REORDER`: used in initializing domain decomposition communicators. Rank reordering
+        is default, but can be switched off with this environment variable.
+
+* `GMX_NO_CUDA_STREAMSYNC`: the opposite of `GMX_CUDA_STREAMSYNC`. Disables the use of the
+        standard cudaStreamSynchronize-based GPU waiting to improve performance when using CUDA driver API
+        ealier than v5.0 with ECC-enabled GPUs.
+
+* `GMX_NO_INT`, `GMX_NO_TERM`, `GMX_NO_USR1`: disable signal handlers for SIGINT,
+        SIGTERM, and SIGUSR1, respectively.
+
+* `GMX_NO_NODECOMM`: do not use separate inter- and intra-node communicators.
+
+* `GMX_NO_NONBONDED`: 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.
+
+* `GMX_NO_PULLVIR`: when set, do not add virial contribution to COM pull forces.
+
+* `GMX_NOCHARGEGROUPS`: disables multi-atom charge groups, i.e. each atom 
+        in all non-solvent molecules is assigned its own charge group.
+
+* `GMX_NOPREDICT`: shell positions are not predicted.
+
+* `GMX_NO_SOLV_OPT`: turns off solvent optimizations; automatic if `GMX_NB_GENERIC`
+        is enabled.
+
+* `GMX_NSCELL_NCG`: the ideal number of charge groups per neighbor searching grid cell is hard-coded
+        to a value of 10. Setting this environment variable to any other integer value overrides this hard-coded
+        value.
+
+* `GMX_PME_NTHREADS`: set the number of OpenMP or PME threads (overrides the number guessed by 
+        [mdrun].
+
+* `GMX_PME_P3M`: use P3M-optimized influence function instead of smooth PME B-spline interpolation.
+
+* `GMX_PME_THREAD_DIVISION`: PME thread division in the format "x y z" for all three dimensions. The
+        sum of the threads in each dimension must equal the total number of PME threads (set in 
+        `GMX_PME_NTHREADS`).
+
+* `GMX_PMEONEDD`: if the number of domain decomposition cells is set to 1 for both x and y, 
+        decompose PME in one dimension.
+
+* `GMX_REQUIRE_SHELL_INIT`: require that shell positions are initiated.
+
+* `GMX_REQUIRE_TABLES`: require the use of tabulated Coulombic
+        and van der Waals interactions.
+
+* `GMX_SCSIGMA_MIN`: the minimum value for soft-core sigma. **Note** that this value is set
+        using the `sc-sigma` keyword in the [.mdp] file, but this environment variable can be used
+        to reproduce pre-4.5 behavior with respect to this parameter.
+
+* `GMX_TPIC_MASSES`: should contain multiple masses used for test particle insertion into a cavity.
+        The center of mass of the last atoms is used for insertion into the cavity.
+
+* `GMX_USE_GRAPH`: use graph for bonded interactions.
+
+* `GMX_VERLET_BUFFER_RES`: resolution of buffer size in Verlet cutoff scheme.  The default value is
+        0.001, but can be overridden with this environment variable.
+
+* `MPIRUN`: the `mpirun` command used by [gmx tune_pme].
+
+* `MDRUN`: the [mdrun] command used by [gmx tune_pme].
+
+* `GMX_NSTLIST`: sets the default value for `nstlist`, preventing it from being tuned during
+        [mdrun] startup when using the Verlet cutoff scheme.
+
+* `GMX_USE_TREEREDUCE`: use tree reduction for nbnxn force reduction. Potentially faster for large number of 
+        OpenMP threads (if memory locality is important).
+
+## Analysis and Core Functions
+
+* `GMX_QM_ACCURACY`: accuracy in Gaussian L510 (MC-SCF) component program.
+
+* `GMX_QM_ORCA_BASENAME`: prefix of [.tpr] files, used in Orca calculations
+        for input and output file names.
+
+* `GMX_QM_CPMCSCF`: when set to a nonzero value, Gaussian QM calculations will
+        iteratively solve the CP-MCSCF equations.
+
+* `GMX_QM_MODIFIED_LINKS_DIR`: location of modified links in Gaussian.
+
+* `DSSP`: used by [gmx do_dssp] to point to the `dssp`
+        executable (not just its path).
+
+* `GMX_QM_GAUSS_DIR`: directory where Gaussian is installed.
+
+* `GMX_QM_GAUSS_EXE`: name of the Gaussian executable.
+
+* `GMX_DIPOLE_SPACING`: spacing used by [gmx dipoles].
+
+* `GMX_MAXRESRENUM`: sets the maximum number of residues to be renumbered by
+        [gmx grompp]. A value of -1 indicates all residues should be renumbered.
+
+* `GMX_FFRTP_TER_RENAME`: Some force fields (like AMBER) use specific names for N- and C-
+        terminal residues (NXXX and CXXX) as [.rtp] entries that are normally renamed. Setting
+        this environment variable disables this renaming.
+
+* `GMX_PATH_GZIP`: `gunzip` executable, used by [gmx wham].
+
+* `GMX_FONT`: name of X11 font used by [gmx view].
+
+* `GMXTIMEUNIT`: the time unit used in output files, can be
+        anything in fs, ps, ns, us, ms, s, m or h.
+
+* `GMX_QM_GAUSSIAN_MEMORY`: memory used for Gaussian QM calculation.
+
+* `MULTIPROT`: name of the `multiprot` executable, used by the
+        contributed program `do_multiprot`.
+
+* `NCPUS`: number of CPUs to be used for Gaussian QM calculation
+
+* `GMX_ORCA_PATH`: directory where Orca is installed.
+
+* `GMX_QM_SA_STEP`: simulated annealing step size for Gaussian QM calculation.
+
+* `GMX_QM_GROUND_STATE`: defines state for Gaussian surface hopping calculation.
+
+* `GMX_TOTAL`: name of the `total` executable used by the contributed
+        `do_shift` program.
+
+* `GMX_ENER_VERBOSE`: make [gmx energy] and [gmx eneconv]
+        loud and noisy.
+
+* `VMD_PLUGIN_PATH`: where to find VMD plug-ins. Needed to be
+        able to read file formats recognized only by a VMD plug-in.
+
+* `VMDDIR`: base path of VMD installation.
+
+* `GMX_USE_XMGR`: sets viewer to `xmgr` (deprecated) instead of `xmgrace`.
diff --git a/docs/user-guide/file-formats.md b/docs/user-guide/file-formats.md
new file mode 100644 (file)
index 0000000..e846523
--- /dev/null
@@ -0,0 +1,5 @@
+# GROMACS file formats
+
+TODO in future patch: gather information from
+docs/old-html/online/*html, convert to Markdown, update for accuracy,
+organize here.
diff --git a/docs/user-guide/getting-started.md b/docs/user-guide/getting-started.md
new file mode 100644 (file)
index 0000000..026265b
--- /dev/null
@@ -0,0 +1,92 @@
+# Getting started with GROMACS
+
+In this chapter we assume the reader is familiar with Molecular Dynamics and
+familiar with Unix, including the use of a text editor such as `jot`, `emacs`
+or `vi`. We furthermore assume the GROMACS software is installed properly on
+your system. When you see a line like
+
+    ls -l
+
+you are supposed to type the contents of that line on your computer terminal.
+
+## Setting up your environment
+
+In order to check whether you have access to GROMACS, please
+start by entering the command:
+
+    gmx -version
+
+This command should print out information about the version of Gromacs
+installed. If this, in contrast, returns the phrase
+
+    gmx: command not found.
+
+then you have to find where your version of GROMACS is installed. In
+the default case, the binaries are located in
+`/usr/local/gromacs/bin`, however, you can ask your local system
+administrator for more information, and then follow the advice in the
+[install guide](install-guide.html#getting-access-to-gromacs-after-installation).
+
+## Flowchart of typical GROMACS simulation
+
+A typical simulation workflow with GROMACS is [illustrated here](online/flow.html).
+
+## Important GROMACS files
+
+Here is an overview of the most important GROMACS file types that you will
+encounter.
+
+### Molecular Topology file (`.top`)
+
+The molecular topology file is generated by the program [gmx pdb2gmx]. [gmx pdb2gmx] translates a [PDB] structure file of any peptide or protein to a molecular topology file. This topology file contains a complete description of all the interactions in your peptide or protein. 
+
+### Molecular Structure file (`.gro`, `.pdb`)
+
+When [gmx pdb2gmx] is executed to generate a molecular topology, it also translates the structure file ([.pdb] file) to a GROMOS structure file ([.gro] file). The main difference between a [pdb] file and a gromos file is their format and that a [.gro] file can also hold velocities. However, if you do not need the velocities, you can also use a [PDB] file in all programs. To generate a box of solvent molecules around the peptide, the program [gmx solvate] is used. First the program [gmx editconf] should be used to define a box of appropriate size around the molecule. [gmx solvate] solvates a solute molecule (the peptide) into any solvent (in this case, water). The output of [gmx solvate] is a gromos structure file of the peptide solvated in water. [gmx solvate] also changes the molecular topology file (generated by [gmx pdb2gmx]) to add solvent to the topology. 
+
+### Molecular Dynamics parameter file (`.mdp`)
+
+The Molecular Dynamics Parameter ([.mdp]) file contains all information about the Molecular Dynamics simulation itself e.g. time-step, number of steps, temperature, pressure etc. The easiest way of handling such a file is by adapting a sample [.mdp] file. A [sample mdp file](online/mdp.html) is available.
+
+### Index file (`.ndx`)
+
+Sometimes you may need an index file to specify actions on groups of atoms (e.g. temperature coupling, accelerations, freezing). Usually the default index groups will be sufficient, so for this demo we will not consider the use of index files. 
+
+### Run input file (`.tpr`)
+
+The next step is to combine the molecular structure ([.gro] file), topology ([.top] file) MD-parameters ([.mdp] file) and (optionally) the index file ([.ndx]) to generate a run input file ([.tpr] extension). This file contains all information needed to start a simulation with GROMACS. The [gmx grompp] program processes all input files and generates the run input [.tpr] file.
+
+### Trajectory file (`.trr`)
+
+Once the run input file is available, we can start the simulation. The program which starts the simulation is called [gmx mdrun] (or sometimes just mdrun, or mdrun_mpi). The only input file of [gmx mdrun] that you usually need in order to start a run is the run input file ([.tpr] file). The typical output files of [gmx mdrun] are the trajectory file ([.trr] file), a logfile ( [.log] file),
+and perhaps a checkpoint file ([.cpt] file). 
+
+## Tutorial material
+
+There are [many tutorials
+available](http://www.gromacs.org/Documentation/Tutorials) that cover
+aspects of using GROMACS.
+
+## Background reading
+
+> Berendsen, H.J.C., Postma, J.P.M., van Gunsteren, W.F., Hermans, J. (1981)
+Intermolecular Forces, chapter Interaction models for water in relation to
+protein hydration, pp 331-342. Dordrecht: D. Reidel Publishing Company
+Dordrecht
+
+>
+
+> Kabsch, W., Sander, C. (1983).     Dictionary of protein secondary
+structure: Pattern recognition of hydrogen-bonded and geometrical features.
+Biopolymers **22**, 2577--2637.
+
+>
+
+> Mierke, D.F., Kessler, H. (1991).     Molecular dynamics with dimethyl
+sulfoxide as a solvent. Conformation of a cyclic hexapeptide. J. Am. Chem.
+Soc. **113**, 9446.
+
+>
+
+> Stryer, L. (1988).     Biochemistry vol. 1, p. 211. New York: Freeman, 3
+edition.
index ab05a9f7d1ca8fa61f3cfe74d82e8a67fda64b53..1af0a6aadbc10648dd59056b7178de0280c930ee 100644 (file)
@@ -2,4 +2,11 @@
 
 # Introduction #
 
-Coming soon!
+This guide provides
+
+* material introducing GROMACS
+* practical advice for making effective use of GROMACS.
+
+For getting, building and installing GROMACS, see the [install
+guide]. For background on algorithms and implementations, see the
+[reference manual].
diff --git a/docs/user-guide/mdp-options.md b/docs/user-guide/mdp-options.md
new file mode 100644 (file)
index 0000000..0d870f6
--- /dev/null
@@ -0,0 +1,1194 @@
+# Molecular dynamics parameters (.mdp options)
+
+## General information
+
+Default values are given in parentheses. The first option in the list is always the default option. Units are given in square brackets The difference between a dash and an underscore is ignored.
+
+A [sample `.mdp` file](online/mdp.html) is available. This should be appropriate to start a normal simulation. Edit it to suit your specific needs and desires.
+
+
+### Preprocessing
+
+include:
+:    directories to include in your topology. Format: `-I/home/john/mylib -I../otherlib`
+
+define:
+:    defines to pass to the preprocessor, default is no defines. You can use any defines to control options in your customized topology files. Options that are already available by default are:  
+     `-DFLEXIBLE` will use flexible water instead of rigid water into your topology, this can be useful for normal mode analysis.  
+     `-DPOSRES` will trigger the inclusion of `posre.itp` into your topology, used for position restraints.
+
+
+### Run control
+
+integrator:
+:   (Despite the name, this list includes algorithms that are not actually integrators. **steep** and all entries following it are in this category)
+
+    md
+    :   A leap-frog algorithm for integrating Newton's equations of motion.
+
+    md-vv
+    :   A velocity Verlet algorithm for integrating Newton's equations of motion. For constant NVE simulations started from corresponding points in the same trajectory, the trajectories are analytically, but not binary, identical to the **md** leap-frog integrator. The the kinetic energy, which is determined from the whole step velocities and is therefore slightly too high. The advantage of this integrator is more accurate, reversible Nose-Hoover and Parrinello-Rahman coupling integration based on Trotter expansion, as well as (slightly too small) full step velocity output. This all comes at the cost off extra computation, especially with constraints and extra communication in parallel. Note that for nearly all production simulations the **md** integrator is accurate enough. 
+
+    md-vv-avek
+    :   A velocity Verlet algorithm identical to **md-vv**, except that the kinetic energy is determined as the average of the two half step kinetic energies as in the **md** integrator, and this thus more accurate. With Nose-Hoover and/or Parrinello-Rahman coupling this comes with a slight increase in computational cost.
+
+    sd
+    :   An accurate and efficient leap-frog stochastic dynamics integrator. With constraints, coordinates needs to be constrained twice per integration step. Depending on the computational cost of the force calculation, this can take a significant part of the simulation time. The temperature for one or more groups of atoms (**tc-grps**) is set with **ref-t**, the inverse friction constant for each group is set with **tau-t**. The parameter **tcoupl** is ignored. The random generator is initialized with **ld-seed**. When used as a thermostat, an appropriate value for **tau-t** is 2 ps, since this results in a friction that is lower than the internal friction of water, while it is high enough to remove excess heat NOTE: temperature deviations decay twice as fast as with a Berendsen thermostat with the same **tau-t**.
+
+    sd2
+    :   This used to be the default sd integrator, but is now deprecated. Four Gaussian random numbers are required per coordinate per step. With constraints, the temperature will be slightly too high.
+
+    bd
+    :   An Euler integrator for Brownian or position Langevin dynamics, the velocity is the force divided by a friction coefficient (**bd-fric**) plus random thermal noise (**ref-t**). When **bd-fric**`=0`, the friction coefficient for each particle is calculated as mass/**tau-t**, as for the integrator **sd**. The random generator is initialized with **ld-seed**.
+
+    steep
+    :   A steepest descent algorithm for energy minimization. The maximum step size is **emstep**, the tolerance is **emtol**.
+
+    cg
+    :   A conjugate gradient algorithm for energy minimization, the tolerance is **emtol**. CG is more efficient when a steepest descent step is done every once in a while, this is determined by **nstcgsteep**. For a minimization prior to a normal mode analysis, which requires a very high accuracy, GROMACS should be compiled in double precision.
+
+    l-bfgs
+    :   A quasi-Newtonian algorithm for energy minimization according to the low-memory Broyden-Fletcher-Goldfarb-Shanno approach. In practice this seems to converge faster than Conjugate Gradients, but due to the correction steps necessary it is not (yet) parallelized. 
+
+    nm
+    :   Normal mode analysis is performed on the structure in the [.tpr] file. GROMACS should be compiled in double precision.
+
+    tpi
+    :   Test particle insertion. The last molecule in the topology is the test particle. A trajectory must be provided to `mdrun -rerun`. This trajectory should not contain the molecule to be inserted. Insertions are performed **nsteps** times in each frame at random locations and with random orientiations of the molecule. When **nstlist** is larger than one, **nstlist** insertions are performed in a sphere with radius **rtpi** around a the same random location using the same neighborlist (and the same long-range energy when **rvdw** or **rcoulomb**>**rlist**, which is only allowed for single-atom molecules). Since neighborlist construction is expensive, one can perform several extra insertions with the same list almost for free. The random seed is set with **ld-seed**. The temperature for the Boltzmann weighting is set with **ref-t**, this should match the temperature of the simulation of the original trajectory. Dispersion correction is implemented correctly for TPI. All relevant quantities are written to the file specified with `mdrun -tpi`. The distribution of insertion energies is written to the file specified with `mdrun -tpid`. No trajectory or energy file is written. Parallel TPI gives identical results to single-node TPI. For charged molecules, using PME with a fine grid is most accurate and also efficient, since the potential in the system only needs to be calculated once per frame. 
+
+    tpic
+    :   Test particle insertion into a predefined cavity location. The procedure is the same as for **tpi**, except that one coordinate extra is read from the trajectory, which is used as the insertion location. The molecule to be inserted should be centered at 0,0,0. Gromacs does not do this for you, since for different situations a different way of centering might be optimal. Also **rtpi** sets the radius for the sphere around this location. Neighbor searching is done only once per frame, **nstlist** is not used. Parallel **tpic** gives identical results to single-rank **tpic**.
+
+tinit: (0) [ps]
+:    starting time for your run (only makes sense for integrators **md**, **sd** and **bd**)
+
+dt: (0.001) [ps]
+:    time step for integration (only makes sense for integrators **md**, **sd** and **bd**)
+
+nsteps: (0)
+:    maximum number of steps to integrate or minimize, -1 is no maximum
+
+init-step: (0)
+:    The starting step. The time at an step i in a run is calculated as: t = **tinit** + **dt** * (**init-step** + i). The free-energy lambda is calculated as: lambda = **init-lambda** + **delta-lambda** * (**init-step** + i). Also non-equilibrium MD parameters can depend on the step number. Thus for exact restarts or redoing part of a run it might be necessary to set **init-step** to the step number of the restart frame. [gmx convert-tpr] does this automatically.
+
+comm-mode:
+:    + **Linear**  
+     Remove center of mass translation
+
+     + **Angular**  
+     Remove center of mass translation and rotation around the center of mass 
+
+     + **None**  
+     No restriction on the center of mass motion 
+
+nstcomm: (100) [steps]
+:    frequency for center of mass motion removal
+
+comm-grps:
+:    group(s) for center of mass motion removal, default is the whole system
+
+
+### Langevin dynamics
+
+bd-fric: (0) [amu ps-1]
+:    Brownian dynamics friction coefficient. When **bd-fric** =0, the friction coefficient for each particle is calculated as mass/**tau-t**.
+
+ld-seed: (-1) [integer]
+:    used to initialize random generator for thermal noise for stochastic and Brownian dynamics. When **ld-seed** is set to -1, a pseudo random seed is used. When running BD or SD on multiple processors, each processor uses a seed equal to **ld-seed** plus the processor number.
+
+
+### Energy minimization
+
+emtol: (10.0) [kJ mol-1 nm-1]
+:    the minimization is converged when the maximum force is smaller than this value
+
+emstep: (0.01) [nm]
+:    initial step-size
+
+nstcgsteep: (1000) [steps]
+:    frequency of performing 1 steepest descent step while doing conjugate gradient energy minimization.
+
+nbfgscorr: (10)
+:    Number of correction steps to use for L-BFGS minimization. A higher number is (at least theoretically) more accurate, but slower.
+
+
+### Shell Molecular Dynamics
+
+When shells or flexible constraints are present in the system the positions of the shells and the lengths of the flexible constraints are optimized at every
+time step until either the RMS force on the shells and constraints is less than emtol, or a maximum number of iterations **niter** has been reached
+
+emtol: (10.0) [kJ mol-1 nm-1]
+:    the minimization is converged when the maximum force is smaller than this value. For shell MD this value should be 1.0 at most, but since the variable is used for energy minimization as well the default is 10.0.
+
+niter: (20)
+:    maximum number of iterations for optimizing the shell positions and the flexible constraints.
+
+fcstep: (0) [ps2]
+:    the step size for optimizing the flexible constraints. Should be chosen as mu/(d2V/dq2) where mu is the reduced mass of two particles in a flexible constraint and d2V/dq2 is the second derivative of the potential in the constraint direction. Hopefully this number does not differ too much between the flexible constraints, as the number of iterations and thus the runtime is very sensitive to **fcstep**. Try several values!
+  
+
+### Test particle insertion
+
+rtpi: (0.05) [nm]
+:   the test particle insertion radius, see integrators **tpi** and **tpic**
+
+
+### Output control
+
+nstxout: (0) [steps]
+:    number of steps that elapse between writing coordinates to output trajectory file, the last coordinates are always written
+
+nstvout: (0) [steps]
+:    number of steps that elapse between writing velocities to output trajectory, the last velocities are always written
+
+nstfout: (0) [steps]
+:    number of steps that elapse between writing forces to output trajectory.
+
+nstlog: (1000) [steps]
+:    number of steps that elapse between writing energies to the log file, the last energies are always written
+
+nstcalcenergy: (100)
+:    number of steps that elapse between calculating the energies, 0 is never. This option is only relevant with dynamics. With a twin-range cut-off setup **nstcalcenergy** should be equal to or a multiple of **nstlist**. This option affects the performance in parallel simulations, because calculating energies requires global communication between all processes which can become a bottleneck at high parallelization. 
+
+nstenergy: (1000) [steps]
+:    number of steps that else between writing energies to energy file, the last energies are always written, should be a multiple of **nstcalcenergy**. Note that the exact sums and fluctuations over all MD steps modulo **nstcalcenergy** are stored in the energy file, so [gmx energy] can report exact energy averages and fluctuations also when **nstenergy** >1
+
+nstxout-compressed: (0) [steps]
+:    number of steps that elapse between writing position coordinates using lossy compression
+
+compressed-x-precision: (1000) [real]
+:    precision with which to write to the compressed trajectory file
+
+compressed-x-grps:
+:    group(s) to write to the compressed trajectory file, by default the whole system is written (if **nstxout-compressed** > 0)
+
+energygrps:
+:    group(s) to write to energy file
+  
+
+### Neighbor searching
+
+cutoff-scheme:
+:   + **Verlet**  
+    Generate a pair list with buffering. The buffer size is automatically set based on **verlet-buffer-tolerance**, unless this is set to -1, in which case **rlist** will be used. This option has an explicit, exact cut-off at **rvdw**=**rcoulomb**. Currently only cut-off, reaction-field, PME electrostatics and plain LJ are supported. Some [mdrun] functionality is not yet supported with the **Verlet** scheme, but [gmx grompp] checks for this. Native GPU acceleration is only supported with **Verlet**. With GPU-accelerated PME or with separate PME ranks, [mdrun] will automatically tune the CPU/GPU load balance by scaling **rcoulomb** and the grid spacing. This can be turned off with `mdrun -notunepme`. **Verlet** is faster than **group** when there is no water, or if **group** would use a pair-list buffer to conserve energy.
+
+    + **group**
+    Generate a pair list for groups of atoms. These groups correspond to the charge groups in the topology. This was the only cut-off treatment scheme before version 4.6, and is **deprecated in 5.0**. There is no explicit buffering of the pair list. This enables efficient force calculations for water, but energy is only conserved when a buffer is explicitly added.
+
+nstlist: (10) [steps]
+:   + **>0**  
+    Frequency to update the neighbor list (and the long-range forces, when using twin-range cut-offs). When this is 0, the neighbor list is made only once. With energy minimization the neighborlist will be updated for every energy evaluation when **nstlist** >0. With **cutoff-scheme=Verlet** and **verlet-buffer-tolerance** set, **nstlist** is actually a minimum value and [mdrun] might increase it, unless it is set to 1. With parallel simulations and/or non-bonded force calculation on the GPU, a value of 20 or 40 often gives the best performance. With **cutoff-scheme=Group** and non-exact cut-off's, **nstlist** will affect the accuracy of your simulation and it can not be chosen freely. 
+
+    + **0**  
+    The neighbor list is only constructed once and never updated. This is mainly useful for vacuum simulations in which all particles see each other.
+
+    + **<0**  
+    Unused.
+
+nstcalclr: (-1) [steps]
+:   Controls the period between calculations of long-range forces when using the group cut-off scheme. 
+
+    + **1**  
+    Calculate the long-range forces every single step. This is useful to have separate neighbor lists with buffers for electrostatics and Van der Waals interactions, and in particular it makes it possible to have the Van der Waals cutoff longer than electrostatics (useful _e.g._ with PME). However, there is no point in having identical long-range cutoffs for both interaction forms and update them every step - then it will be slightly faster to put everything in the short-range list.
+
+    + **>1**  
+    Calculate the long-range forces every **nstcalclr** steps and use a multiple-time-step integrator to combine forces. This can now be done more frequently than **nstlist** since the lists are stored, and it might be a good idea _e.g._ for Van der Waals interactions that vary slower than electrostatics.
+
+    + **-1**  
+    Calculate long-range forces on steps where neighbor searching is performed. While this is the default value, you might want to consider updating the long-range forces more frequently.
+
+    Note that twin-range force evaluation might be enabled automatically by PP-PME load balancing. This is done in order to maintain the chosen Van der Waals interaction radius even if the load balancing is changing the electrostatics cutoff. If the [.mdp] file already specifies twin-range interactions (_e.g._ to evaluate Lennard-Jones interactions with a longer cutoff than the PME electrostatics every 2-3 steps), the load balancing will have also a small effect on Lennard-Jones, since the short-range cutoff (inside which forces are evaluated every step) is changed.
+
+ns-type:
+:   + **grid**  
+    Make a grid in the box and only check atoms in neighboring grid cells when constructing a new neighbor list every **nstlist** steps. In large systems grid search is much faster than simple search.
+
+    + **simple**  
+    Check every atom in the box when constructing a new neighbor list every **nstlist** steps (only with **cutoff-scheme=group**).
+
+pbc:
+:   + **xyz**  
+    Use periodic boundary conditions in all directions.
+
+    + **no**  
+    Use no periodic boundary conditions, ignore the box. To simulate without cut-offs, set all cut-offs and **nstlist** to 0. For best performance without cut-offs on a single MPI rank, set **nstlist** to zero and `ns-type=simple`.
+
+    + **xy**  
+    Use periodic boundary conditions in x and y directions only. This works only with `ns-type=grid` and can be used in combination with **walls**. Without walls or with only one wall the system size is infinite in the z direction. Therefore pressure coupling or Ewald summation methods can not be used. These disadvantages do not apply when two walls are used.
+
+periodic-molecules:
+:   + **no**  
+    molecules are finite, fast molecular PBC can be used
+
+    + **yes**  
+    for systems with molecules that couple to themselves through the periodic boundary conditions, this requires a slower PBC algorithm and molecules are not made whole in the output
+
+verlet-buffer-tolerance: (0.005) [kJ/mol/ps]
+:    Useful only with **cutoff-scheme**=**Verlet**. This sets the maximum allowed error for pair interactions per particle caused by the Verlet buffer, which indirectly sets **rlist**. As both **nstlist** and the Verlet buffer size are fixed (for performance reasons), particle pairs not in the pair list can occasionally get within the cut-off distance during **nstlist**-1 nsteps. This causes very small jumps in the energy. In a constant-temperature ensemble, these very small energy jumps can be estimated for a given cut-off and **rlist**. The estimate assumes a homogeneous particle distribution, hence the errors might be slightly underestimated for multi-phase systems. For longer pair-list life-time (**nstlist**-1)*dt the buffer is overestimated, because the interactions between particles are ignored. Combined with cancellation of errors, the actual drift of the total energy is usually one to two orders of magnitude smaller. Note that the generated buffer size takes into account that the GROMACS pair-list setup leads to a reduction in the drift by a factor 10, compared to a simple particle-pair based list. Without dynamics (energy minimization etc.), the buffer is 5% of the cut-off. For NVE simulations the initial temperature is used, unless this is zero, in which case a buffer of 10% is used. For NVE simulations the tolerance usually needs to be lowered to achieve proper energy conservation on the nanosecond time scale. To override the automated buffer setting, use **verlet-buffer-tolerance**=-1 and set **rlist** manually.
+
+rlist: (1) [nm]
+:    Cut-off distance for the short-range neighbor list. With **cutoff-scheme**=**Verlet**, this is by default set by the **verlet-buffer-tolerance** option and the value of **rlist** is ignored.
+
+rlistlong: (-1) [nm]
+:    Cut-off distance for the long-range neighbor list. This parameter is only relevant for a twin-range cut-off setup with switched potentials. In that case a buffer region is required to account for the size of charge groups. In all other cases this parameter is automatically set to the longest cut-off distance.
+
+
+### Electrostatics
+
+coulombtype:
+:   + **Cut-off**  
+    Twin range cut-offs with neighborlist cut-off **rlist** and Coulomb cut-off **rcoulomb**, where **rcoulomb**>=**rlist**.
+
+    + **Ewald**  
+    Classical Ewald sum electrostatics. The real-space cut-off **rcoulomb** should be equal to **rlist**. Use _e.g._ **rlist** =0.9, **rcoulomb** =0.9. The highest magnitude of wave vectors used in reciprocal space is controlled by **fourierspacing**. The relative accuracy of direct/reciprocal space is controlled by **ewald-rtol**.  
+    NOTE: Ewald scales as O(N3/2) and is thus extremely slow for large systems. It is included mainly for reference - in most cases PME will perform much better.
+
+    + **PME**  
+    Fast smooth Particle-Mesh Ewald (SPME) electrostatics. Direct space is similar to the Ewald sum, while the reciprocal part is performed with FFTs. Grid dimensions are controlled with **fourierspacing** and the interpolation order with **pme-order**. With a grid spacing of 0.1 nm and cubic interpolation the electrostatic forces have an accuracy of 2-3*10-4. Since the error from the vdw-cutoff is larger than this you might try 0.15 nm. When running in parallel the interpolation parallelizes better than the FFT, so try decreasing grid dimensions while increasing interpolation.
+
+    + **P3M-AD**  
+    Particle-Particle Particle-Mesh algorithm with analytical derivative for for long range electrostatic interactions. The method and code is identical to SPME, except that the influence function is optimized for the grid. This gives a slight increase in accuracy.
+
+    + **Reaction-Field electrostatics**  
+    Reaction field with Coulomb cut-off **rcoulomb**, where **rcoulomb** >= **rlist**. The dielectric constant beyond the cut-off is **epsilon-rf**. The dielectric constant can be set to infinity by setting **epsilon-rf**=0.
+
+    + **Generalized-Reaction-Field**  
+    Generalized reaction field with Coulomb cut-off **rcoulomb**, where **rcoulomb** >= **rlist**. The dielectric constant beyond the cut-off is **epsilon-rf**. The ionic strength is computed from the number of charged (_i.e._ with non zero charge) charge groups. The temperature for the GRF potential is set with **ref-t**.
+
+    + **Reaction-Field-zero**  
+    In GROMACS, normal reaction-field electrostatics with **cutoff-scheme****=group** leads to bad energy conservation. **Reaction-Field-zero** solves this by making the potential zero beyond the cut-off. It can only be used with an infinite dielectric constant (**epsilon-rf=0**), because only for that value the force vanishes at the cut-off. **rlist** should be 0.1 to 0.3 nm larger than **rcoulomb** to accommodate for the size of charge groups and diffusion between neighbor list updates. This, and the fact that table lookups are used instead of analytical functions make **Reaction-Field-zero** computationally more expensive than normal reaction-field.
+
+    + **Reaction-Field-nec**  
+    The same as **Reaction-Field**, but implemented as in GROMACS versions before 3.3. No reaction-field correction is applied to excluded atom pairs and self pairs. The 1-4 interactions are calculated using a reaction-field. The missing correction due to the excluded pairs that do not have a 1-4 interaction is up to a few percent of the total electrostatic energy and causes a minor difference in the forces and the pressure.
+
+    + **Shift**  
+    Analogous to **Shift** for **vdwtype**. You might want to use **Reaction-Field-zero** instead, which has a similar potential shape, but has a physical interpretation and has better energies due to the exclusion correction terms. 
+
+    + **Encad-Shift**  
+    The Coulomb potential is decreased over the whole range, using the definition from the Encad simulation package.
+
+    + **Switch**  
+    Analogous to **Switch** for **vdwtype**. Switching the Coulomb potential can lead to serious artifacts, advice: use **Reaction-Field-zero** instead.
+
+    + **User**  
+    [mdrun] will now expect to find a file `table.xvg` with user-defined potential functions for repulsion, dispersion and Coulomb. When pair interactions are present, [mdrun] also expects to find a file `tablep.xvg` for the pair interactions. When the same interactions should be used for non-bonded and pair interactions the user can specify the same file name for both table files. These files should contain 7 columns: the `x` value, `f(x)`, `-f'(x)`, `g(x)`, `-g'(x)`, `h(x)`, `-h'(x)`, where `f(x)` is the Coulomb function, `g(x)` the dispersion function and `h(x)` the repulsion function. When **vdwtype** is not set to **User** the values for `g`, `-g'`, `h` and `-h'` are ignored. For the non-bonded interactions `x` values should run from 0 to the largest cut-off distance + **table-extension** and should be uniformly spaced. For the pair interactions the table length in the file will be used. The optimal spacing, which is used for non-user tables, is `0.002 nm` when you run in mixed precision or `0.0005 nm` when you run in double precision. The function value at `x=0` is not important. More information is in the printed manual.
+
+    + **PME-Switch**  
+    A combination of PME and a switch function for the direct-space part (see above). **rcoulomb** is allowed to be smaller than **rlist**. This is mainly useful constant energy simulations (note that using **PME** with **cutoff-scheme**=**Verlet** will be more efficient). 
+
+    + **PME-User**  
+    A combination of PME and user tables (see above). **rcoulomb** is allowed to be smaller than **rlist**. The PME mesh contribution is subtracted from the user table by [mdrun]. Because of this subtraction the user tables should contain about 10 decimal places.
+
+    + **PME-User-Switch**  
+    A combination of PME-User and a switching function (see above). The switching function is applied to final particle-particle interaction, _i.e._ both to the user supplied function and the PME Mesh correction part.
+
+coulomb-modifier:
+:   + **Potential-shift-Verlet**  
+    Selects **Potential-shift** with the Verlet cutoff-scheme, as it is (nearly) free; selects **None** with the group cutoff-scheme.
+
+    + **Potential-shift**  
+    Shift the Coulomb potential by a constant such that it is zero at the cut-off. This makes the potential the integral of the force. Note that this does not affect the forces or the sampling.
+
+    + **None**  
+    Use an unmodified Coulomb potential. With the group scheme this means no exact cut-off is used, energies and forces are calculated for all pairs in the neighborlist.
+
+rcoulomb-switch: (0) [nm]
+:   where to start switching the Coulomb potential, only relevant when force or potential switching is used
+
+rcoulomb: (1) [nm]
+:   distance for the Coulomb cut-off
+
+epsilon-r: (1)
+:   The relative dielectric constant. A value of 0 means infinity.
+
+epsilon-rf: (0)
+:   The relative dielectric constant of the reaction field. This is only used with reaction-field electrostatics. A value of 0 means infinity.
+
+
+### VdW
+
+vdwtype:
+:   + **Cut-off**    
+    Twin range cut-offs with neighbor list cut-off **rlist** and VdW cut-off **rvdw**, where **rvdw** >= **rlist**.
+
+    + **PME**    
+    Fast smooth Particle-mesh Ewald (SPME) for VdW interactions. The grid dimensions are controlled with **fourierspacing** in the same way as for electrostatics, and the interpolation order is controlled with **pme-order**. The relative accuracy of direct/reciprocal space is controlled by **ewald-rtol-lj**, and the specific combination rules that are to be used by the reciprocal routine are set using **lj-pme-comb-rule**.
+
+    + **Shift**    
+    This functionality is deprecated and replaced by **vdw-modifier = Force-switch**. The LJ (not Buckingham) potential is decreased over the whole range and the forces decay smoothly to zero between **rvdw-switch** and **rvdw**. The neighbor search cut-off **rlist** should be 0.1 to 0.3 nm larger than **rvdw** to accommodate for the size of charge groups and diffusion between neighbor list updates.
+
+    + **Switch**    
+    This functionality is deprecated and replaced by **vdw-modifier = Potential-switch**. The LJ (not Buckingham) potential is normal out to **rvdw-switch**, after which it is switched off to reach zero at **rvdw**. Both the potential and force functions are continuously smooth, but be aware that all switch functions will give rise to a bulge (increase) in the force (since we are switching the potential). The neighbor search cut-off **rlist** should be 0.1 to 0.3 nm larger than **rvdw** to accommodate for the size of charge groups and diffusion between neighbor list updates.
+
+    + **Encad-Shift**    
+    The LJ (not Buckingham) potential is decreased over the whole range, using the definition from the Encad simulation package.
+
+    + **User**    
+    See **user** for **coulombtype**. The function value at zero is not important. When you want to use LJ correction, make sure that **rvdw** corresponds to the cut-off in the user-defined function. When **coulombtype** is not set to **User** the values for `f` and `-f'` are ignored.
+
+vdw-modifier:
+:   + **Potential-shift-Verlet**    
+    Selects **Potential-shift** with the Verlet cutoff-scheme, as it is (nearly) free; selects **None** with the group cutoff-scheme.
+
+    + **Potential-shift**    
+    Shift the Van der Waals potential by a constant such that it is zero at the cut-off. This makes the potential the integral of the force. Note that this does not affect the forces or the sampling.
+
+    + **None**    
+    Use an unmodified Van der Waals potential. With the group scheme this means no exact cut-off is used, energies and forces are calculated for all pairs in the neighborlist.
+
+    + **Force-switch**    
+    Smoothly switches the forces to zero between **rvdw-switch** and **rvdw**. This shifts the potential shift over the whole range and switches it to zero at the cut-off. Note that this is more expensive to calculate than a plain cut-off and it is not required for energy conservation, since **Potential-shift** conserves energy just as well.
+
+    + **Potential-switch**    
+    Smoothly switches the potential to zero between **rvdw-switch** and **rvdw**. Note that this introduces articifically large forces in the switching region and is much more expensive to calculate. This option should only be used if the force field you are using requires this.
+
+rvdw-switch: (0) [nm]
+:    where to start switching the LJ force and possibly the potential, only relevant when force or potential switching is used
+
+rvdw: (1) [nm]
+:    distance for the LJ or Buckingham cut-off
+
+DispCorr:
+:   + **no**    
+    don't apply any correction
+
+    + **EnerPres**    
+    apply long range dispersion corrections for Energy and Pressure
+
+    + **Ener**    
+    apply long range dispersion corrections for Energy only
+
+
+### Tables
+
+table-extension: (1) [nm]
+:    Extension of the non-bonded potential lookup tables beyond the largest cut-off distance. The value should be large enough to account for charge group sizes and the diffusion between neighbor-list updates. Without user defined potential the same table length is used for the lookup tables for the 1-4 interactions, which are always tabulated irrespective of the use of tables for the non-bonded interactions. The value of **table-extension** in no way affects the values of **rlist**, **rcoulomb**, or **rvdw**. 
+
+energygrp-table:
+:    When user tables are used for electrostatics and/or VdW, here one can give pairs of energy groups for which seperate user tables should be used. The two energy groups will be appended to the table file name, in order of their definition in **energygrps**, seperated by underscores. For example, if `energygrps = Na Cl Sol` and `energygrp-table = Na Na Na Cl`, [mdrun] will read `table_Na_Na.xvg` and `table_Na_Cl.xvg` in addition to the normal `table.xvg` which will be used for all other energy group pairs. 
+
+
+### Ewald
+
+fourierspacing: (0.12) [nm]
+:    For ordinary Ewald, the ratio of the box dimensions and the spacing determines a lower bound for the number of wave vectors to use in each (signed) direction. For PME and P3M, that ratio determines a lower bound for the number of Fourier-space grid points that will be used along that axis. In all cases, the number for each direction can be overridden by entering a non-zero value for **fourier_n[xyz]**. For optimizing the relative load of the particle-particle interactions and the mesh part of PME, it is useful to know that the accuracy of the electrostatics remains nearly constant when the Coulomb cut-off and the PME grid spacing are scaled by the same factor.
+
+fourier-nx (0) ; fourier-ny (0) ; fourier-nz: (0)
+:    Highest magnitude of wave vectors in reciprocal space when using Ewald.
+    Grid size when using PME or P3M. These values override **fourierspacing** per direction. The best choice is powers of 2, 3, 5 and 7. Avoid large primes.
+
+pme-order (4)
+:    Interpolation order for PME. 4 equals cubic interpolation. You might try 6/8/10 when running in parallel and simultaneously decrease grid dimension.
+
+ewald-rtol (1e-5)
+:    The relative strength of the Ewald-shifted direct potential at **rcoulomb** is given by **ewald-rtol**. Decreasing this will give a more accurate direct sum, but then you need more wave vectors for the reciprocal sum.
+
+ewald-rtol-lj (1e-3)
+:    When doing PME for VdW-interactions, **ewald-rtol-lj** is used to control the relative strength of the dispersion potential at **rvdw** in the same way as **ewald-rtol** controls the electrostatic potential.
+
+lj-pme-comb-rule (Geometric)
+:    The combination rules used to combine VdW-parameters in the reciprocal part of LJ-PME. Geometric rules are much faster than Lorentz-Berthelot and usually the recommended choice, even when the rest of the force field uses the Lorentz-Berthelot rules.
+
+    + **Geometric**    
+    Apply geometric combination rules
+
+    + **Lorentz-Berthelot**    
+    Apply Lorentz-Berthelot combination rules
+
+ewald-geometry: (3d)
+:   + **3d**    
+    The Ewald sum is performed in all three dimensions.
+
+    + **3dc**    
+    The reciprocal sum is still performed in 3D, but a force and potential correction applied in the `z` dimension to produce a pseudo-2D summation. If your system has a slab geometry in the `x-y` plane you can try to increase the `z`-dimension of the box (a box height of 3 times the slab height is usually ok) and use this option.
+
+epsilon-surface: (0)
+:    This controls the dipole correction to the Ewald summation in 3D. The default value of zero means it is turned off. Turn it on by setting it to the value of the relative permittivity of the imaginary surface around your infinite system. Be careful - you shouldn't use this if you have free mobile charges in your system. This value does not affect the slab 3DC variant of the long range corrections.
+
+
+### Temperature coupling
+
+tcoupl:
+:   + **no**    
+    No temperature coupling.
+
+    + **berendsen**    
+    Temperature coupling with a Berendsen-thermostat to a bath with temperature **ref-t**, with time constant **tau-t**. Several groups can be coupled separately, these are specified in the **tc-grps** field separated by spaces.
+
+    + **nose-hoover**    
+    Temperature coupling using a Nose-Hoover extended ensemble. The reference temperature and coupling groups are selected as above, but in this case **tau-t** controls the period of the temperature fluctuations at equilibrium, which is slightly different from a relaxation time. For NVT simulations the conserved energy quantity is written to energy and log file.
+
+    + **andersen**    
+    Temperature coupling by randomizing a fraction of the particles at each timestep. Reference temperature and coupling groups are selected as above. **tau-t** is the average time between randomization of each molecule. Inhibits particle dynamics somewhat, but little or no ergodicity issues. Currently only implemented with velocity Verlet, and not implemented with constraints.
+
+    + **andersen-massive**    
+    Temperature coupling by randomizing all particles at infrequent timesteps. Reference temperature and coupling groups are selected as above. **tau-t** is the time between randomization of all molecules. Inhibits particle dynamics somewhat, but little or no ergodicity issues. Currently only implemented with velocity Verlet.
+
+    + **v-rescale**    
+    Temperature coupling using velocity rescaling with a stochastic term (JCP 126, 014101). This thermostat is similar to Berendsen coupling, with the same scaling using **tau-t**, but the stochastic term ensures that a proper canonical ensemble is generated. The random seed is set with **ld-seed**. This thermostat works correctly even for **tau-t**=0. For NVT simulations the conserved energy quantity is written to the energy and log file.
+
+nsttcouple: (-1)
+:    The frequency for coupling the temperature. The default value of -1 sets **nsttcouple** equal to **nstlist**, unless **nstlist**<=0, then a value of 10 is used. For velocity Verlet integrators **nsttcouple** is set to 1.
+
+nh-chain-length (10)
+:    the number of chained Nose-Hoover thermostats for velocity Verlet integrators, the leap-frog **md** integrator only supports 1. Data for the NH chain variables is not printed to the .edr, but can be using the `GMX_NOSEHOOVER_CHAINS` environment variable
+
+tc-grps:
+:    groups to couple to separate temperature baths
+
+tau-t: [ps]
+:    time constant for coupling (one for each group in **tc-grps**), -1 means no temperature coupling
+
+ref-t: [K]
+:    reference temperature for coupling (one for each group in **tc-grps**)
+  
+
+### Pressure coupling
+
+pcoupl:
+:   + **no**    
+    No pressure coupling. This means a fixed box size.
+
+    + **berendsen**    
+    Exponential relaxation pressure coupling with time constant **tau-p**. The box is scaled every timestep. It has been argued that this does not yield a correct thermodynamic ensemble, but it is the most efficient way to scale a box at the beginning of a run.
+
+    + **Parrinello-Rahman**    
+    Extended-ensemble pressure coupling where the box vectors are subject to an equation of motion. The equation of motion for the atoms is coupled to this. No instantaneous scaling takes place. As for Nose-Hoover temperature coupling the time constant **tau-p** is the period of pressure fluctuations at equilibrium. This is probably a better method when you want to apply pressure scaling during data collection, but beware that you can get very large oscillations if you are starting from a different pressure. For simulations where the exact fluctation of the NPT ensemble are important, or if the pressure coupling time is very short it may not be appropriate, as the previous time step pressure is used in some steps of the GROMACS implementation for the current time step pressure.
+
+    + **MTTK**    
+    Martyna-Tuckerman-Tobias-Klein implementation, only useable with **md-vv** or **md-vv-avek**, very similar to Parrinello-Rahman. As for Nose-Hoover temperature coupling the time constant **tau-p** is the period of pressure fluctuations at equilibrium. This is probably a better method when you want to apply pressure scaling during data collection, but beware that you can get very large oscillations if you are starting from a different pressure. Currently (as of version 5.1), it only supports isotropic scaling, and only works without constraints.
+
+pcoupltype:
+:   + **isotropic**    
+    Isotropic pressure coupling with time constant **tau-p**. The compressibility and reference pressure are set with **compressibility** and **ref-p**, one value is needed.
+
+    + **semiisotropic**    
+    Pressure coupling which is isotropic in the `x` and `y` direction, but different in the `z` direction. This can be useful for membrane simulations. 2 values are needed for `x/y` and `z` directions respectively.
+
+    + **anisotropic**    
+    Idem, but 6 values are needed for `xx`, `yy`, `zz`, `xy/yx`, `xz/zx` and `yz/zy` components, respectively. When the off-diagonal compressibilities are set to zero, a rectangular box will stay rectangular. Beware that anisotropic scaling can lead to extreme deformation of the simulation box.
+
+    + **surface-tension**    
+    Surface tension coupling for surfaces parallel to the xy-plane. Uses normal pressure coupling for the `z`-direction, while the surface tension is coupled to the `x/y` dimensions of the box. The first **ref-p** value is the reference surface tension times the number of surfaces [bar nm], the second value is the reference `z`-pressure [bar]. The two **compressibility** values are the compressibility in the `x/y` and `z` direction respectively. The value for the `z`-compressibility should be reasonably accurate since it influences the convergence of the surface-tension, it can also be set to zero to have a box with constant height.
+
+nstpcouple: (-1)
+:    The frequency for coupling the pressure. The default value of -1 sets **nstpcouple** equal to **nstlist**, unless **nstlist** <=0, then a value of 10 is used. For velocity Verlet integrators **nstpcouple** is set to 1.
+
+tau-p: (1) [ps]
+:    time constant for coupling
+
+compressibility: [bar-1]
+:    compressibility (NOTE: this is now really in bar-1) For water at 1 atm and 300 K the compressibility is 4.5e-5 [bar-1].
+
+ref-p: [bar]
+:    reference pressure for coupling
+
+refcoord-scaling:
+:   + **no**    
+    The reference coordinates for position restraints are not modified. Note that with this option the virial and pressure will depend on the absolute positions of the reference coordinates.
+
+    + **all**    
+    The reference coordinates are scaled with the scaling matrix of the pressure coupling.
+
+    + **com**    
+    Scale the center of mass of the reference coordinates with the scaling matrix of the pressure coupling. The vectors of each reference coordinate to the center of mass are not scaled. Only one COM is used, even when there are multiple molecules with position restraints. For calculating the COM of the reference coordinates in the starting configuration, periodic boundary conditions are not taken into account. 
+
+
+### Simulated annealing
+
+Simulated annealing is controlled separately for each temperature group in GROMACS. The reference temperature is a piecewise linear function, but you can use an arbitrary number of points for each group, and choose either a single sequence or a periodic behaviour for each group. The actual annealing is performed by dynamically changing the reference temperature used in the thermostat algorithm selected, so remember that the system will usually not instantaneously reach the reference temperature!
+
+annealing:
+:    Type of annealing for each temperature group
+    
+    + **no**    
+    No simulated annealing - just couple to reference temperature value.
+
+    + **single**    
+    A single sequence of annealing points. If your simulation is longer than the time of the last point, the temperature will be coupled to this constant value after the annealing sequence has reached the last time point.
+
+    + **periodic**    
+    The annealing will start over at the first reference point once the last reference time is reached. This is repeated until the simulation ends. 
+
+annealing-npoints:
+:    A list with the number of annealing reference/control points used for each temperature group. Use 0 for groups that are not annealed. The number of entries should equal the number of temperature groups.
+
+annealing-time:
+:    List of times at the annealing reference/control points for each group. If you are using periodic annealing, the times will be used modulo the last value, _i.e._ if the values are 0, 5, 10, and 15, the coupling will restart at the 0ps value after 15ps, 30ps, 45ps, etc. The number of entries should equal the sum of the numbers given in **annealing-npoints**.
+
+annealing-temp:
+:    List of temperatures at the annealing reference/control points for each group. The number of entries should equal the sum of the numbers given in **annealing-npoints**.
+
+     Confused? OK, let's use an example. Assume you have two temperature groups, set the group selections to `annealing = single periodic`, the number of points of each group to `annealing-npoints = 3 4`, the times to `annealing-time = 0 3 6 0 2 4 6` and finally temperatures to `annealing-temp = 298 280 270 298 320 320 298`. The first group will be coupled to 298K at 0ps, but the reference temperature will drop linearly to reach 280K at 3ps, and then linearly between 280K and 270K from 3ps to 6ps. After this is stays constant, at 270K. The second group is coupled to 298K at 0ps, it increases linearly to 320K at 2ps, where it stays constant until 4ps. Between 4ps and 6ps it decreases to 298K, and then it starts over with the same pattern again, _i.e._ rising linearly from 298K to 320K between 6ps and 8ps. Check the summary printed by [gmx grompp] if you are unsure!  
+
+
+### Velocity generation
+
+gen-vel:
+:   + **no**    
+     Do not generate velocities. The velocities are set to zero when there are no velocities in the input structure file.
+
+    + **yes**    
+    Generate velocities in [gmx grompp] according to a Maxwell distribution at temperature **gen-temp**, with random seed **gen-seed**. This is only meaningful with integrator **md**.
+
+gen-temp: (300) [K]
+:    temperature for Maxwell distribution
+
+gen-seed: (-1) [integer]
+:    used to initialize random generator for random velocities, when **gen-seed** is set to -1, a pseudo random seed is used.    
+
+
+### Bonds
+
+constraints:
+:   + **none**    
+    No constraints except for those defined explicitly in the topology, _i.e._ bonds are represented by a harmonic (or other) potential or a Morse potential (depending on the setting of **morse**) and angles by a harmonic (or other) potential. **h-bonds**
+    Convert the bonds with H-atoms to constraints.
+
+    + **all-bonds**    
+    Convert all bonds to constraints.
+
+    + **h-angles**    
+    Convert all bonds and additionally the angles that involve H-atoms to bond-constraints.
+
+    + **all-angles**    
+    Convert all bonds and angles to bond-constraints.
+
+constraint-algorithm:
+:   + **LINCS**    
+    LINear Constraint Solver. With domain decomposition the parallel version P-LINCS is used. The accuracy in set with **lincs-order**, which sets the number of matrices in the expansion for the matrix inversion. After the matrix inversion correction the algorithm does an iterative correction to compensate for lengthening due to rotation. The number of such iterations can be controlled with **lincs-iter**. The root mean square relative constraint deviation is printed to the log file every **nstlog** steps. If a bond rotates more than **lincs-warnangle** in one step, a warning will be printed both to the log file and to `stderr`. LINCS should not be used with coupled angle constraints.
+
+    + **SHAKE**    
+    SHAKE is slightly slower and less stable than LINCS, but does work with angle constraints. The relative tolerance is set with **shake-tol**, 0.0001 is a good value for "normal" MD. SHAKE does not support constraints between atoms on different nodes, thus it can not be used with domain decompositon when inter charge-group constraints are present. SHAKE can not be used with energy minimization.
+
+continuation:
+:    This option was formerly known as **unconstrained-start**.
+
+    + **no**    
+    apply constraints to the start configuration and reset shells
+
+    + **yes**    
+    do not apply constraints to the start configuration and do not reset shells, useful for exact coninuation and reruns
+
+shake-tol: (0.0001)
+:    relative tolerance for SHAKE
+
+lincs-order: (4)
+:    Highest order in the expansion of the constraint coupling matrix. When constraints form triangles, an additional expansion of the same order is applied on top of the normal expansion only for the couplings within such triangles. For "normal" MD simulations an order of 4 usually suffices, 6 is needed for large time-steps with virtual sites or BD. For accurate energy minimization an order of 8 or more might be required. With domain decomposition, the cell size is limited by the distance spanned by **lincs-order**+1 constraints. When one wants to scale further than this limit, one can decrease **lincs-order** and increase **lincs-iter**, since the accuracy does not deteriorate when (1+**lincs-iter**)***lincs-order** remains constant.
+
+lincs-iter: (1)
+:    Number of iterations to correct for rotational lengthening in LINCS. For normal runs a single step is sufficient, but for NVE runs where you want to conserve energy accurately or for accurate energy minimization you might want to increase it to 2.
+
+lincs-warnangle: (30) [degrees]
+:    maximum angle that a bond can rotate before LINCS will complain
+
+morse:
+:   + **no**    
+    bonds are represented by a harmonic potential
+
+    + **yes**    
+    bonds are represented by a Morse potential
+
+
+### Energy group exclusions
+
+energygrp-excl: 
+:    Pairs of energy groups for which all non-bonded interactions are excluded. An example: if you have two energy groups `Protein` and `SOL`, specifying `energygrp-excl = Protein Protein  SOL SOL` would give only the non-bonded interactions between the protein and the solvent. This is especially useful for speeding up energy calculations with `mdrun -rerun` and for excluding interactions within frozen groups.
+
+
+### Walls
+
+nwall: 0
+:    When set to **1** there is a wall at `z=0`, when set to **2** there is also a wall at `z=z-box`. Walls can only be used with **pbc=xy**. When set to **2** pressure coupling and Ewald summation can be used (it is usually best to use semiisotropic pressure coupling with the `x/y` compressibility set to 0, as otherwise the surface area will change). Walls interact wit the rest of the system through an optional **wall-atomtype**. Energy groups `wall0` and `wall1` (for **nwall=2**) are added automatically to monitor the interaction of energy groups with each wall. The center of mass motion removal will be turned off in the `z`-direction.
+
+wall-atomtype:
+:    the atom type name in the force field for each wall. By (for example) defining a special wall atom type in the topology with its own combination rules, this allows for independent tuning of the interaction of each atomtype with the walls.
+
+wall-type:
+:   + **9-3**    
+    LJ integrated over the volume behind the wall: 9-3 potential
+
+    + **10-4**    
+    LJ integrated over the wall surface: 10-4 potential
+
+    + **12-6**    
+    direct LJ potential with the `z` distance from the wall
+
+    + **table**    
+    user defined potentials indexed with the `z` distance from the wall, the tables are read analogously to the **energygrp-table** option, where the first name is for a "normal" energy group and the second name is `wall0` or `wall1`, only the dispersion and repulsion columns are used
+
+wall-r-linpot: -1 (nm)
+:    Below this distance from the wall the potential is continued linearly and thus the force is constant. Setting this option to a postive value is especially useful for equilibration when some atoms are beyond a wall. When the value is <=0 (<0 for **wall-type=table**), a fatal error is generated when atoms are beyond a wall. 
+
+wall-density: [nm-3/nm-2]
+:    the number density of the atoms for each wall for wall types **9-3** and **10-4** 
+
+wall-ewald-zfac: 3
+:    The scaling factor for the third box vector for Ewald summation only, the minimum is 2. Ewald summation can only be used with **nwall=2**, where one should use **ewald-geometry`=3dc`**. The empty layer in the box serves to decrease the unphysical Coulomb interaction between periodic images.
+  
+
+### COM pulling
+
+pull:
+:   + **no**    
+    No center of mass pulling. All the following pull options will be ignored (and if present in the [.mdp] file, they unfortunately generate warnings)
+
+    + **umbrella**    
+    Center of mass pulling using an umbrella potential between the reference group and one or more groups.
+
+    + **constraint**    
+    Center of mass pulling using a constraint between the reference group and one or more groups. The setup is identical to the option **umbrella**, except for the fact that a rigid constraint is applied instead of a harmonic potential.
+
+    + **constant-force**    
+    Center of mass pulling using a linear potential and therefore a constant force. For this option there is no reference position and therefore the parameters **pull-init** and **pull-rate** are not used.
+
+pull-geometry:
+:   + **distance**    
+    Pull along the vector connecting the two groups. Components can be selected with **pull-dim**.
+
+    + **direction**    
+    Pull in the direction of **pull-vec**.
+
+    + **direction-periodic**    
+    As **direction**, but allows the distance to be larger than half the box size. With this geometry the box should not be dynamic (_e.g._ no pressure scaling) in the pull dimensions and the pull force is not added to virial.
+
+    + **cylinder**    
+    Designed for pulling with respect to a layer where the reference COM is given by a local cylindrical part of the reference group. The pulling is in the direction of **pull-vec**. From the reference group a cylinder is selected around the axis going through the pull group with direction **pull-vec** using two radii. The radius **pull-r1** gives the radius within which all the relative weights are one, between **pull-r1** and **pull-r0** the weights are switched to zero. Mass weighting is also used. Note that the radii should be smaller than half the box size. For tilted cylinders they should be even smaller than half the box size since the distance of an atom in the reference group from the COM of the pull group has both a radial and an axial component.
+
+pull-dim: (Y Y Y)
+:    the distance components to be used with geometry **distance**, and also sets which components are printed to the output files
+
+pull-r1: (1) [nm]
+:    the inner radius of the cylinder for geometry **cylinder**
+
+pull-r0: (1) [nm]
+:    the outer radius of the cylinder for geometry **cylinder**
+
+pull-constr-tol: (1e-6)
+:    the relative constraint tolerance for constraint pulling
+
+pull-start:
+:   + **no**    
+    do not modify **pull-init**
+
+    + **yes**
+    add the COM distance of the starting conformation to **pull-init**
+
+pull-print-reference: (10)
+:   + **no**    
+    do not print the COM of the first group in each pull coordinate
+
+    + **yes**    
+    print the COM of the first group in each pull coordinate
+
+pull-nstxout: (10)
+:    frequency for writing out the COMs of all the pull group
+
+pull-nstfout: (1)
+:    frequency for writing out the force of all the pulled group
+
+pull-ngroups: (1)
+:    The number of pull groups, not including the absolute reference group, when used. Pull groups can be reused in multiple pull coordinates. Below only the pull options for group 1 are given, further groups simply increase the group index number.
+
+pull-ncoords: (1)
+:    The number of pull coordinates. Below only the pull options for coordinate 1 are given, further coordinates simply increase the coordinate index number.
+
+pull-group1-name: 
+:    The name of the pull group, is looked up in the index file or in the default groups to obtain the atoms involved.
+
+pull-group1-weights: 
+:    Optional relative weights which are multiplied with the masses of the atoms to give the total weight for the COM. The number should be 0, meaning all 1, or the number of atoms in the pull group.
+
+pull-group1-pbcatom: (0)
+:    The reference atom for the treatment of periodic boundary conditions inside the group (this has no effect on the treatment of the pbc between groups). This option is only important when the diameter of the pull group is larger than half the shortest box vector. For determining the COM, all atoms in the group are put at their periodic image which is closest to **pull-group1-pbcatom**. A value of 0 means that the middle atom (number wise) is used. This parameter is not used with geometry **cylinder**. A value of -1 turns on cosine weighting, which is useful for a group of molecules in a periodic system, _e.g._ a water slab (see Engin et al. J. Chem. Phys. B 2010).
+
+pull-coord1-groups: 
+:    The two groups indices should be given on which this pull coordinate will operate. The first index can be 0, in which case an absolute reference of **pull-coord1-origin** is used. With an absolute reference the system is no longer translation invariant and one should think about what to do with the center of mass motion.
+
+pull-coord1-origin: (0.0 0.0 0.0)
+:    The pull reference position for use with an absolute reference.
+
+pull-coord1-vec: (0.0 0.0 0.0)
+:    The pull direction. [gmx grompp] normalizes the vector.
+
+pull-coord1-init: (0.0) [nm]
+:    The reference distance at t=0.
+
+pull-coord1-rate: (0) [nm/ps]
+:    The rate of change of the reference position.
+
+pull-coord1-k: (0) [kJ mol-1 nm-2] / [kJ mol-1 nm-1]
+:    The force constant. For umbrella pulling this is the harmonic force constant in [kJ mol-1 nm-2]. For constant force pulling this is the force constant of the linear potential, and thus the negative (!) of the constant force in [kJ mol-1 nm-1].
+
+pull-coord1-kB: (pull-k1) [kJ mol-1 nm-2] / [kJ mol-1 nm-1]
+:    As **pull-coord1-k**, but for state B. This is only used when **free-energy** is turned on. The force constant is then (1 - lambda) * **pull-coord1-k** + lambda * **pull-coord1-kB**.
+
+
+### NMR refinement
+
+disre:
+:   + **no**    
+    ignore distance restraint information in topology file
+
+    + **simple**    
+    simple (per-molecule) distance restraints.
+
+    + **ensemble**
+    distance restraints over an ensemble of molecules in one simulation box. Normally, one would perform ensemble averaging over multiple subsystems, each in a separate box, using `mdrun -multi`. Supply `topol0.tpr`, `topol1.tpr`, ... with different coordinates and/or velocities. The environment variable `GMX_DISRE_ENSEMBLE_SIZE` sets the number of systems within each ensemble (usually equal to the `mdrun -multi` value).
+
+disre-weighting:
+:   + **equal**     (default)
+    divide the restraint force equally over all atom pairs in the restraint
+
+    + **conservative**    
+    the forces are the derivative of the restraint potential, this results in an weighting of the atom pairs to the reciprocal seventh power of the displacement. The forces are conservative when **disre-tau** is zero.
+
+disre-mixed:
+:   + **no**    
+    the violation used in the calculation of the restraint force is the time-averaged violation 
+
+    + **yes**    
+    the violation used in the calculation of the restraint force is the square root of the product of the time-averaged violation and the instantaneous violation
+
+disre-fc: (1000) [kJ mol-1 nm-2]
+:    force constant for distance restraints, which is multiplied by a (possibly) different factor for each restraint given in the `fac` column of the interaction in the topology file.
+
+disre-tau: (0) [ps]
+:    time constant for distance restraints running average. A value of zero turns off time averaging.
+
+nstdisreout: (100) [steps]
+:    period between steps when the running time-averaged and instantaneous distances of all atom pairs involved in restraints are written to the energy file (can make the energy file very large)
+
+orire:
+:   + **no**    
+    ignore orientation restraint information in topology file
+
+    + **yes**    
+    use orientation restraints, ensemble averaging can be performed with `mdrun -multi`
+
+orire-fc: (0) [kJ mol]
+:    force constant for orientation restraints, which is multiplied by a (possibly) different weight factor for each restraint, can be set to zero to obtain the orientations from a free simulation
+
+orire-tau: (0) [ps]
+:    time constant for orientation restraints running average. A value of zero turns off time averaging.
+
+orire-fitgrp: 
+:    fit group for orientation restraining. This group of atoms is used to determine the rotation **R** of the system with respect to the reference orientation. The reference orientation is the starting conformation of the first subsystem. For a protein, backbone is a reasonable choice
+
+nstorireout: (100) [steps]
+:    period between steps when the running time-averaged and instantaneous orientations for all restraints, and the molecular order tensor are written to the energy file (can make the energy file very large)
+  
+
+### Free energy calculations
+
+free-energy:
+:   + **no**    
+    Only use topology A.
+
+    + **yes**    
+    Interpolate between topology A (lambda=0) to topology B (lambda=1) and write the derivative of the Hamiltonian with respect to lambda (as specified with **dhdl-derivatives**), or the Hamiltonian differences with respect to other lambda values (as specified with **foreign-lambda**) to the energy file and/or to `dhdl.xvg`, where they can be processed by, for example [gmx bar]. The potentials, bond-lengths and angles are interpolated linearly as described in the manual. When **sc-alpha** is larger than zero, soft-core potentials are used for the LJ and Coulomb interactions.
+
+    + **expanded**    
+     Turns on expanded ensemble simulation, where the alchemical state becomes a dynamic variable, allowing jumping between different Hamiltonians. See the expanded ensemble options for controlling how expanded ensemble simulations are performed. The different Hamiltonians used in expanded ensemble simulations are defined by the other free energy options.
+
+init-lambda: (-1)
+:    starting value for lambda (float). Generally, this should only be used with slow growth (_i.e._ nonzero **delta-lambda**). In other cases, **init-lambda-state** should be specified instead. Must be greater than or equal to 0.
+
+delta-lambda: (0)
+:    increment per time step for lambda
+
+init-lambda-state: (-1)
+:    starting value for the lambda state (integer). Specifies which columm of the lambda vector (**coul-lambdas**, **vdw-lambdas**, **bonded-lambdas**, **restraint-lambdas**, **mass-lambdas**, **temperature-lambdas**, **fep-lambdas**) should be used. This is a zero-based index: **init-lambda-state** 0 means the first column, and so on.
+
+fep-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Free energy differences between different lambda values can then be determined with [gmx bar]. **fep-lambdas** is different from the other `-lambdas` keywords because all components of the lambda vector that are not specified will use **fep-lambdas** (including restraint-lambdas and therefore the pull code restraints).
+
+coul-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Only the electrostatic interactions are controlled with this component of the lambda vector (and only if the lambda=0 and lambda=1 states have differing electrostatic interactions).
+
+vdw-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Only the van der Waals interactions are controlled with this component of the lambda vector.
+
+bonded-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Only the bonded interactions are controlled with this component of the lambda vector.
+
+restraint-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Only the restraint interactions: dihedral restraints, and the pull code restraints are controlled with this component of the lambda vector. 
+
+mass-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Only the particle masses are controlled with this component of the lambda vector.
+
+temperature-lambdas: ()
+:    Zero, one or more lambda values for which Delta H values will be determined and written to dhdl.xvg every **nstdhdl** steps. Values must be between 0 and 1. Only the temperatures controlled with this component of the lambda vector. Note that these lambdas should not be used for replica exchange, only for simulated tempering.
+
+calc-lambda-neighbors (1)
+:    Controls the number of lambda values for which Delta H values will be calculated and written out, if **init-lambda-state** has been set. A positive value will limit the number of lambda points calculated to only the nth neighbors of **init-lambda-state**: for example, if **init-lambda-state** is 5 and this parameter has a value of 2, energies for lambda points 3-7 will be calculated and writen out. A value of -1 means all lambda points will be written out. For normal BAR such as with [gmx bar], a value of 1 is sufficient, while for MBAR -1 should be used.
+
+sc-alpha: (0)
+:    the soft-core alpha parameter, a value of 0 results in linear interpolation of the LJ and Coulomb interactions
+
+sc-r-power: (6)
+:    the power of the radial term in the soft-core equation. Possible values are 6 and 48. 6 is more standard, and is the default. When 48 is used, then sc-alpha should generally be much lower (between 0.001 and 0.003).
+
+sc-coul: (no)
+:    Whether to apply the soft core free energy interaction transformation to the Columbic interaction of a molecule. Default is no, as it is generally more efficient to turn off the Coulomic interactions linearly before turning off the van der Waals interactions.
+
+sc-power: (0)
+:    the power for lambda in the soft-core function, only the values 1 and 2 are supported
+
+sc-sigma: (0.3) [nm]
+:    the soft-core sigma for particles which have a C6 or C12 parameter equal to zero or a sigma smaller than **sc-sigma**
+
+couple-moltype:
+:    Here one can supply a molecule type (as defined in the topology) for calculating solvation or coupling free energies. There is a special option **system** that couples all molecule types in the system. This can be useful for equilibrating a system starting from (nearly) random coordinates. **free-energy** has to be turned on. The Van der Waals interactions and/or charges in this molecule type can be turned on or off between lambda=0 and lambda=1, depending on the settings of **couple-lambda0** and **couple-lambda1**. If you want to decouple one of several copies of a molecule, you need to copy and rename the molecule definition in the topology.
+
+couple-lambda0:
+:   + **vdw-q**    
+    all interactions are on at lambda=0
+
+    + **vdw**  
+    the charges are zero (no Coulomb interactions) at lambda=0
+
+    + **q**  
+    the Van der Waals interactions are turned at lambda=0; soft-core interactions will be required to avoid singularities
+
+    + **none**  
+    the Van der Waals interactions are turned off and the charges are zero at lambda=0; soft-core interactions will be required to avoid singularities.
+
+couple-lambda1:
+:     analogous to **couple-lambda1**, but for lambda=1
+
+couple-intramol:
+:   + **no**   
+    All intra-molecular non-bonded interactions for moleculetype **couple-moltype** are replaced by exclusions and explicit pair interactions. In this manner the decoupled state of the molecule corresponds to the proper vacuum state without periodicity effects.
+
+    + **yes**  
+    The intra-molecular Van der Waals and Coulomb interactions are also turned on/off. This can be useful for partitioning free-energies of relatively large molecules, where the intra-molecular non-bonded interactions might lead to kinetically trapped vacuum conformations. The 1-4 pair interactions are not turned off.
+
+* **nstdhdl: (100)**
+    the frequency for writing dH/dlambda and possibly Delta H to dhdl.xvg, 0 means no ouput, should be a multiple of **nstcalcenergy**.
+
+dhdl-derivatives: (yes)
+:    If yes (the default), the derivatives of the Hamiltonian with respect to lambda at each **nstdhdl** step are written out. These values are needed for interpolation of linear energy differences with [gmx bar] (although the same can also be achieved with the right **foreign lambda** setting, that may not be as flexible), or with thermodynamic integration
+
+dhdl-print-energy: (no)
+:     Include either the total or the potential energy in the dhdl file. Options are 'no', 'potential', or 'total'. This information is needed for later free energy analysis if the states of interest are at different temperatures. If all states are at the same temperature, this information is not needed. 'potential' is useful in case one is using `mdrun -rerun` to generate the `dhdl.xvg` file. When rerunning from an existing trajectory, the kinetic energy will often not be correct, and thus one must compute the residual free energy from the potential alone, with the kinetic energy component computed analytically. 
+
+separate-dhdl-file: (yes)
+:   + **yes**    
+    the free energy values that are calculated (as specified with the **foreign-lambda** and **dhdl-derivatives** settings) are written out to a separate file, with the default name `dhdl.xvg`. This file can be used directly with [gmx bar].
+
+    + **no**    
+    The free energy values are written out to the energy output file (`ener.edr`, in accumulated blocks at every **nstenergy** steps), where they can be extracted with [gmx energy] or used directly with [gmx bar].
+
+dh-hist-size: (0)
+:    If nonzero, specifies the size of the histogram into which the Delta H values (specified with **foreign-lambda**) and the derivative dH/dl values are binned, and written to ener.edr. This can be used to save disk space while calculating free energy differences. One histogram gets written for each **foreign lambda** and two for the dH/dl, at every **nstenergy** step. Be aware that incorrect histogram settings (too small size or too wide bins) can introduce errors. Do not use histograms unless you're certain you need it.
+
+dh-hist-spacing (0.1)
+:    Specifies the bin width of the histograms, in energy units. Used in conjunction with **dh-hist-size**. This size limits the accuracy with which free energies can be calculated. Do not use histograms unless you're certain you need it.
+
+
+### Expanded Ensemble calculations
+
+nstexpanded
+:    The number of integration steps beween attempted moves changing the system Hamiltonian in expanded ensemble simulations. Must be a multiple of **nstcalcenergy**, but can be greater or less than **nstdhdl**.
+lmc-stats:
+:   + **no**    
+    No Monte Carlo in state space is performed.
+
+    + **metropolis-transition**    
+     Uses the Metropolis weights to update the expanded ensemble weight of each state. Min{1,exp(-(beta_new u_new - beta_old u_old)}
+
+    + **barker-transition**    
+     Uses the Barker transition critera to update the expanded ensemble weight of each state i, defined by exp(-beta_new u_new)/[exp(-beta_new u_new)+exp(-beta_old u_old)
+
+    + **wang-landau**    
+    Uses the Wang-Landau algorithm (in state space, not energy space) to update the expanded ensemble weights.
+
+    + **min-variance**    
+    Uses the minimum variance updating method of Escobedo et al. to update the expanded ensemble weights. Weights will not be the free energies, but will rather emphasize states that need more sampling to give even uncertainty.
+
+lmc-mc-move:
+:   + **no**    
+    No Monte Carlo in state space is performed.
+
+    + **metropolis-transition**    
+     Randomly chooses a new state up or down, then uses the Metropolis critera to decide whether to accept or reject: Min{1,exp(-(beta_new u_new - beta_old u_old)}
+
+    + **barker-transition**    
+     Randomly chooses a new state up or down, then uses the Barker transition critera to decide whether to accept or reject: exp(-beta_new u_new)/[exp(-beta_new u_new)+exp(-beta_old u_old)]
+
+    + **gibbs**    
+     Uses the conditional weights of the state given the coordinate (exp(-beta_i u_i) / sum_k exp(beta_i u_i) to decide which state to move to.
+
+    + **metropolized-gibbs**    
+          Uses the conditional weights of the state given the coordinate (exp(-beta_i u_i) / sum_k exp(beta_i u_i) to decide which state to move to, EXCLUDING the current state, then uses a rejection step to ensure detailed balance. Always more efficient that Gibbs, though only marginally so in many situations, such as when only the nearest neighbors have decent phase space overlap.
+
+lmc-seed: (-1)
+:     random seed to use for Monte Carlo moves in state space. When **lmc-seed** is set to -1, a pseudo random seed is us
+
+mc-temperature:
+:     Temperature used for acceptance/rejection for Monte Carlo moves. If not specified, the temperature of the simulation specified in the first group of **ref_t** is used.
+
+wl-ratio: (0.8)
+:    The cutoff for the histogram of state occupancies to be reset, and the free energy incrementor to be changed from delta to delta * **wl-scale**. If we define the Nratio = (number of samples at each histogram) / (average number of samples at each histogram). **wl-ratio** of 0.8 means that means that the histogram is only considered flat if all Nratio > 0.8 AND simultaneously all 1/Nratio > 0.8.
+
+wl-scale: (0.8)
+:     Each time the histogram is considered flat, then the current value of the Wang-Landau incrementor for the free energies is multiplied by **wl-scale**. Value must be between 0 and 1.
+
+init-wl-delta: (1.0)
+:    The initial value of the Wang-Landau incrementor in kT. Some value near 1 kT is usually most efficient, though sometimes a value of 2-3 in units of kT works better if the free energy differences are large.
+
+wl-oneovert: (no)
+:    Set Wang-Landau incrementor to scale with 1/(simulation time) in the large sample limit. There is significant evidence that the standard Wang-Landau algorithms in state space presented here result in free energies getting 'burned in' to incorrect values that depend on the initial state. when **wl-oneovert** is true, then when the incrementor becomes less than 1/N, where N is the mumber of samples collected (and thus proportional to the data collection time, hence '1 over t'), then the Wang-Lambda incrementor is set to 1/N, decreasing every step. Once this occurs, **wl-ratio** is ignored, but the weights will still stop updating when the equilibration criteria set in **lmc-weights-equil** is achieved.
+
+lmc-repeats: (1)
+:    Controls the number of times that each Monte Carlo swap type is performed each iteration. In the limit of large numbers of Monte Carlo repeats, then all methods converge to Gibbs sampling. The value will generally not need to be different from 1.
+
+lmc-gibbsdelta: (-1)
+:     Limit Gibbs sampling to selected numbers of neighboring states. For Gibbs sampling, it is sometimes inefficient to perform Gibbs sampling over all of the states that are defined. A positive value of **lmc-gibbsdelta** means that only states plus or minus **lmc-gibbsdelta** are considered in exchanges up and down. A value of -1 means that all states are considered. For less than 100 states, it is probably not that expensive to include all states.
+
+lmc-forced-nstart: (0)
+:     Force initial state space sampling to generate weights. In order to come up with reasonable initial weights, this setting allows the simulation to drive from the initial to the final lambda state, with **lmc-forced-nstart** steps at each state before moving on to the next lambda state. If **lmc-forced-nstart** is sufficiently long (thousands of steps, perhaps), then the weights will be close to correct. However, in most cases, it is probably better to simply run the standard weight equilibration algorithms. **nst-transition-matrix: (-1)**
+    Frequency of outputting the expanded ensemble transition matrix. A negative number means it will only be printed at the end of the simulation.
+
+symmetrized-transition-matrix: (no) 
+:    Whether to symmetrize the empirical transition matrix. In the infinite limit the matrix will be symmetric, but will diverge with statistical noise for short timescales. Forced symmetrization, by using the matrix T_sym = 1/2 (T + transpose(T)), removes problems like the existence of (small magnitude) negative eigenvalues.
+
+mininum-var-min: (100)
+:     The **min-variance** strategy (option of **lmc-stats** is only valid for larger number of samples, and can get stuck if too few samples are used at each state. **mininum-var-min** is the minimum number of samples that each state that are allowed before the **min-variance** strategy is activated if selected.
+
+init-lambda-weights: 
+:    The initial weights (free energies) used for the expanded ensemble states. Default is a vector of zero weights. format is similar to the lambda vector settings in **fep-lambdas**, except the weights can be any floating point number. Units are kT. Its length must match the lambda vector lengths.
+
+lmc-weights-equil: (no)
+:   + **no**    
+    Expanded ensemble weights continue to be updated throughout the simulation.
+
+    + **yes**    
+    The input expanded ensemble weights are treated as equilibrated, and are not updated throughout the simulation.
+
+    + **wl-delta**    
+    Expanded ensemble weight updating is stopped when the Wang-Landau incrementor falls below the value specified by **weight-equil-wl-delta**.
+
+    + **number-all-lambda**    
+    Expanded ensemble weight updating is stopped when the number of samples at all of the lambda states is greater than the value specified by **weight-equil-number-all-lambda**.
+
+    + **number-steps**    
+    Expanded ensemble weight updating is stopped when the number of steps is greater than the level specified by **weight-equil-number-steps**.
+
+    + **number-samples**    
+    Expanded ensemble weight updating is stopped when the number of total samples across all lambda states is greater than the level specified by **weight-equil-number-samples**.
+
+    + **count-ratio**    
+    Expanded ensemble weight updating is stopped when the ratio of samples at the least sampled lambda state and most sampled lambda state greater than the value specified by **weight-equil-count-ratio**.
+
+simulated-tempering: (no)
+:    Turn simulated tempering on or off. Simulated tempering is implemented as expanded ensemble sampling with different temperatures instead of different Hamiltonians.
+
+sim-temp-low: (300) [K]
+:    Low temperature for simulated tempering.
+
+sim-temp-high: (300) [K]
+:    High temperature for simulated tempering.
+
+simulated-tempering-scaling: (linear)
+:    Controls the way that the temperatures at intermediate lambdas are calculated from the **temperature-lambda** part of the lambda vector.
+
+    + **linear**    
+    Linearly interpolates the temperatures using the values of **temperature-lambda**, _i.e._ if **sim-temp-low**=300, **sim-temp-high**=400, then lambda=0.5 correspond to a temperature of 350. A nonlinear set of temperatures can always be implemented with uneven spacing in lambda.
+
+    + **geometric**    
+     Interpolates temperatures geometrically between **sim-temp-low** and **sim-temp-high**. The i:th state has temperature **sim-temp-low** * (**sim-temp-high**/**sim-temp-low**) raised to the power of (i/(ntemps-1)). This should give roughly equal exchange for constant heat capacity, though of course things simulations that involve protein folding have very high heat capacity peaks.
+
+    + **exponential**    
+     Interpolates temperatures exponentially between **sim-temp-low** and **sim-temp-high**. The ith state has temperature **sim-temp-low** + (**sim-temp-high**-**sim-temp-low**)*((exp(**temperature-lambdas**[i])-1)/(exp(1.0)-1)).
+
+
+### Non-equilibrium MD
+
+acc-grps: 
+:    groups for constant acceleration (_e.g._ `Protein Sol`) all atoms in groups Protein and Sol will experience constant acceleration as specified in the **accelerate** line
+
+accelerate: (0) [nm ps-2]
+:    acceleration for **acc-grps**; x, y and z for each group (_e.g._ `0.1 0.0 0.0 -0.1 0.0 0.0` means that first group has constant acceleration of 0.1 nm ps-2 in X direction, second group the opposite).
+
+freezegrps: 
+:    Groups that are to be frozen (_i.e._ their X, Y, and/or Z position will not be updated; _e.g._ `Lipid SOL`). **freezedim** specifies for which dimension the freezing applies. To avoid spurious contibrutions to the virial and pressure due to large forces between completely frozen atoms you need to use energy group exclusions, this also saves computing time. Note that coordinates of frozen atoms are not scaled by pressure-coupling algorithms.
+
+freezedim: 
+:    dimensions for which groups in **freezegrps** should be frozen, specify `Y` or `N` for X, Y and Z and for each group (_e.g._ `Y Y N N N N` means that particles in the first group can move only in Z direction. The particles in the second group can move in any direction).
+
+cos-acceleration: (0) [nm ps-2]
+:    the amplitude of the acceleration profile for calculating the viscosity. The acceleration is in the X-direction and the magnitude is **cos-acceleration** cos(2 pi z/boxheight). Two terms are added to the energy file: the amplitude of the velocity profile and 1/viscosity.
+
+deform: (0 0 0 0 0 0) [nm ps-1]
+:    The velocities of deformation for the box elements: a(x) b(y) c(z) b(x) c(x) c(y). Each step the box elements for which **deform** is non-zero are calculated as: box(ts)+(t-ts)*deform, off-diagonal elements are corrected for periodicity. The coordinates are transformed accordingly. Frozen degrees of freedom are (purposely) also transformed. The time ts is set to t at the first step and at steps at which x and v are written to trajectory to ensure exact restarts. Deformation can be used together with semiisotropic or anisotropic pressure coupling when the appropriate compressibilities are set to zero. The diagonal elements can be used to strain a solid. The off-diagonal elements can be used to shear a solid or a liquid.
+  
+
+### Electric fields
+
+E-x ; E-y ; E-z:
+:    If you want to use an electric field in a direction, enter 3 numbers after the appropriate **E-***, the first number: the number of cosines, only 1 is implemented (with frequency 0) so enter 1, the second number: the strength of the electric field in **V nm-1**, the third number: the phase of the cosine, you can enter any number here since a cosine of frequency zero has no phase.
+
+E-xt; E-yt; E-zt: 
+:    not implemented yet
+
+
+### Mixed quantum/classical molecular dynamics
+
+QMMM:
+:   + **no**    
+    No QM/MM.
+
+    + **yes**    
+    Do a QM/MM simulation. Several groups can be described at different QM levels separately. These are specified in the **QMMM-grps** field separated by spaces. The level of _ab initio_ theory at which the groups are described is specified by **QMmethod** and **QMbasis** Fields. Describing the groups at different levels of theory is only possible with the ONIOM QM/MM scheme, specified by **QMMMscheme**.
+
+QMMM-grps:
+:    groups to be descibed at the QM level
+
+QMMMscheme:
+:   + **normal**    
+    normal QM/MM. There can only be one **QMMM-grps** that is modelled at the **QMmethod** and **QMbasis** level of _ab initio_ theory. The rest of the system is described at the MM level. The QM and MM subsystems interact as follows: MM point charges are included in the QM one-electron hamiltonian and all Lennard-Jones interactions are described at the MM level.
+
+    + **ONIOM**    
+    The interaction between the subsystem is described using the ONIOM method by Morokuma and co-workers. There can be more than one **QMMM-grps** each modeled at a different level of QM theory (**QMmethod** and **QMbasis**). 
+
+QMmethod: (RHF)
+:    Method used to compute the energy and gradients on the QM atoms. Available methods are AM1, PM3, RHF, UHF, DFT, B3LYP, MP2, CASSCF, and MMVB. For CASSCF, the number of electrons and orbitals included in the active space is specified by **CASelectrons** and **CASorbitals**. 
+
+QMbasis: (STO-3G)
+:    Basis set used to expand the electronic wavefuntion. Only Gaussian basis sets are currently available, _i.e._ `STO-3G, 3-21G, 3-21G*, 3-21+G*, 6-21G, 6-31G, 6-31G*, 6-31+G*,` and `6-311G`.
+
+QMcharge: (0) [integer]
+:    The total charge in `e` of the **QMMM-grps**. In case there are more than one **QMMM-grps**, the total charge of each ONIOM layer needs to be specified separately.
+
+QMmult: (1) [integer]
+:    The multiplicity of the **QMMM-grps**. In case there are more than one **QMMM-grps**, the multiplicity of each ONIOM layer needs to be specified separately.
+
+CASorbitals: (0) [integer]
+:    The number of orbitals to be included in the active space when doing a CASSCF computation.
+
+CASelectrons: (0) [integer]
+:    The number of electrons to be included in the active space when doing a CASSCF computation.
+
+SH:
+:   + **no**    
+    No surface hopping. The system is always in the electronic ground-state.
+
+    + **yes**    
+    Do a QM/MM MD simulation on the excited state-potential energy surface and enforce a _diabatic_ hop to the ground-state when the system hits the conical intersection hyperline in the course the simulation. This option only works in combination with the CASSCF method.
+  
+
+### Implicit solvent
+
+implicit-solvent:
+:   + **no**    
+    No implicit solvent
+
+    + **GBSA**    
+    Do a simulation with implicit solvent using the Generalized Born formalism. Three different methods for calculating the Born radii are available, Still, HCT and OBC. These are specified with the **gb-algorithm** field. The non-polar solvation is specified with the **sa-algorithm** field.
+
+gb-algorithm:
+:   + **Still**    
+    Use the Still method to calculate the Born radii
+
+    + **HCT**    
+    Use the Hawkins-Cramer-Truhlar method to calculate the Born radii
+
+    + **OBC**    
+    Use the Onufriev-Bashford-Case method to calculate the Born radii
+
+nstgbradii: (1) [steps]
+:    Frequency to (re)-calculate the Born radii. For most practial purposes, setting a value larger than 1 violates energy conservation and leads to unstable trajectories.
+
+rgbradii: (1.0) [nm]
+:    Cut-off for the calculation of the Born radii. Currently must be equal to rlist
+
+gb-epsilon-solvent: (80)
+:    Dielectric constant for the implicit solvent
+
+gb-saltconc: (0) [M]
+:    Salt concentration for implicit solvent models, currently not used
+
+gb-obc-alpha (1); gb-obc-beta (0.8); gb-obc-gamma (4.85);
+:    Scale factors for the OBC model. Default values are OBC(II). Values for OBC(I) are 0.8, 0 and 2.91 respectively
+
+gb-dielectric-offset: (0.009) [nm]
+:    Distance for the di-electric offset when calculating the Born radii. This is the offset between the center of each atom the center of the polarization energy for the corresponding atom
+
+sa-algorithm
+:   + **Ace-approximation**    
+    Use an Ace-type approximation (default)
+
+    + **None**    
+    No non-polar solvation calculation done. For GBSA only the polar part gets calculated
+
+sa-surface-tension: [kJ mol-1 nm-2]
+:    Default value for surface tension with SA algorithms. The default value is -1; Note that if this default value is not changed it will be overridden by [gmx grompp] using values that are specific for the choice of radii algorithm (0.0049 kcal/mol/Angstrom2 for Still, 0.0054 kcal/mol/Angstrom2 for HCT/OBC) Setting it to 0 will while using an sa-algorithm other than None means no non-polar calculations are done. 
+  
+
+### Adaptive Resolution Simulation
+
+adress: (no)
+:    Decide whether the AdResS feature is turned on.
+
+adress-type: (Off)
+:   + **Off**    
+    Do an AdResS simulation with weight equal 1, which is equivalent to an explicit (normal) MD simulation. The difference to disabled AdResS is that the AdResS variables are still read-in and hence are defined.
+
+    + **Constant**    
+    Do an AdResS simulation with a constant weight, **adress-const-wf** defines the value of the weight
+
+    + **XSplit**    
+    Do an AdResS simulation with simulation box split in x-direction, so basically the weight is only a function of the x coordinate and all distances are measured using the x coordinate only.
+
+    + **Sphere**    
+    Do an AdResS simulation with spherical explicit zone.
+
+adress-const-wf: (1)
+:    Provides the weight for a constant weight simulation (**adress-type**=Constant)
+
+adress-ex-width: (0)
+:    Width of the explicit zone, measured from **adress-reference-coords**.
+
+adress-hy-width: (0)
+:    Width of the hybrid zone.
+
+adress-reference-coords: (0,0,0)
+:    Position of the center of the explicit zone. Periodic boundary conditions apply for measuring the distance from it.
+
+adress-cg-grp-names
+:    The names of the coarse-grained energy groups. All other energy groups are considered explicit and their interactions will be automatically excluded with the coarse-grained groups.
+* **adress-site: (COM)**  The mapping point from which the weight is calculated.
+
+    + **COM**    
+    The weight is calculated from the center of mass of each charge group.
+
+    + **COG**    
+    The weight is calculated from the center of geometry of each charge group.
+
+    + **Atom**    
+    The weight is calculated from the position of 1st atom of each charge group.
+
+    + **AtomPerAtom**    
+    The weight is calculated from the position of each individual atom.
+
+adress-interface-correction: (Off)
+:   + **Off**    
+    Do not a apply any interface correction.
+
+    + **thermoforce**    
+    Apply thermodynamic force interface correction. The table can be specified using the `-tabletf` option of [mdrun]. The table should contain the potential and force (acting on molecules) as function of the distance from **adress-reference-coords**.
+
+adress-tf-grp-names
+:    The names of the energy groups to which the **thermoforce** is applied if enabled in **adress-interface-correction**. If no group is given the default table is applied.
+
+adress-ex-forcecap: (0)
+:    Cap the force in the hybrid region, useful for big molecules. 0 disables force capping.
+  
+
+### User defined thingies
+
+user1-grps; user2-grps; userint1 (0); userint2 (0); userint3 (0); userint4 (0); userreal1 (0); userreal2 (0); userreal3 (0); userreal4 (0)
+:    These you can use if you modify code. You can pass integers and reals to your subroutine. Check the inputrec definition in `src/include/types/inputrec.h`
diff --git a/docs/user-guide/mdrun-features.md b/docs/user-guide/mdrun-features.md
new file mode 100644 (file)
index 0000000..3989e1b
--- /dev/null
@@ -0,0 +1,109 @@
+# Useful `mdrun` features #
+
+This section discusses features in `mdrun` that don't fit well
+elsewhere.
+
+## Re-running a simulation
+
+The rerun feature allows you to take a trajectory file in any
+supported format and compute quantities based upon the coordinates in
+that file using the model physics supplied in the `topol.tpr` file. It
+can be used with command lines like `mdrun -s topol -rerun
+traj.trr`. That [.tpr] could be different from the one that generated
+the trajectory. This can be used to compute the energy or forces for
+exactly the coordinates supplied as input, or to extract quantities
+based on subsets of the molecular system (see [gmx convert-tpr] and
+[gmx trjconv]).
+
+Neighbour searching is normally performed for every frame in the
+trajectory, since [mdrun] can no longer assume anything about how the
+structures were generated. If `nstlist` is zero, then only one
+neighbour list will be constructed. Naturally, no update or constraint
+algorithms are ever used.
+
+## Running a simulation in reproducible mode
+
+It is generally difficult to run an efficient parallel MD simulation
+that is based primarily on floating-point arithmetic and is fully
+reproducible. By default, [mdrun] will observe how things are going
+and vary how the simulation is conducted in order to optimize
+throughput. However, there is a "reproducible mode" available with
+`mdrun -reprod` that will systematically eliminate all sources of
+variation within that run; repeated invocations on the same input and
+hardware will be binary identical. However, running in this mode on
+different hardware, or with a different compiler, etc. will not be
+reproducible. This should normally only be used when investigating
+possible problems.
+
+## Running multi-simulations
+
+There are numerous situations where running a related set of
+simulations within the same invocation of mdrun are necessary or
+useful. Running a replica-exchange simulation requires it, as do
+simulations using ensemble-based distance or orientation restraints.
+Running a related series of lambda points for a free-energy
+computation is also convenient to do this way.
+
+This feature requires [configuring GROMACS with an external MPI
+library](install-guide.html#mpi-support) so that the set of
+simulations can communicate. The `n` simulations within the set can
+use internal MPI parallelism also, so that `mpirun -np x mdrun_mpi`
+for `x` a multiple of `n` will use `x/n` ranks per simulation.
+
+There are two ways of organizing files when running such
+simulations. Most of the normal mechanisms work in either case,
+including `-deffnm`.
+
+`-multidir`
+  You must create a set of `n` directories for the `n` simulations,
+  place all the relevant input files in those directories (e.g. named
+  `topol.tpr`), and run with `mpirun -np x mdrun_mpi -s topol
+  -multidir <names-of-directories>`. If the order of the simulations
+  within the multi-simulation is significant, then you are responsible
+  for ordering their names when you provide them to `-multidir`. Be
+  careful with shells that do filename globbing dictionary-style, e.g.
+  `dir1 dir10 dir11 ... dir2 ...`. This option is generally the
+  most convenient to use. `mdrun -table` for the group cutoff-scheme
+  works only in this mode.
+
+`-multi`
+  You must organize that the filenames for each simulation in a set of
+  `n` simulations have an integer `0` through `n-1` appended to
+  the filename (e.g. `topol2.tpr`), and run with `mpirun -np x mdrun
+  -multi n -s input`. The order of simulations within the set is
+  determined by the integer appended.
+
+### Examples running multi-simulations
+
+    mpirun -np 32 mdrun_mpi -multi
+
+Starts a multi-simulation on 32 ranks with as many simulations `n` as
+there are files named `topol*.tpr` for integers `0` to `n-1`. Other
+input and output files are suffixed similarly.
+
+    mpirun -np 32 mdrun_mpi -multidir a b c d
+
+Starts a multi-simulation on 32 ranks with 4 simulations. The input
+and output files are found in directories `a`, `b`, `c`, and `d`.
+
+    mpirun -np 32 mdrun_mpi -multidir a b c d -gpu_id 0000000011111111
+
+Starts the same multi-simulation as before. On a machine with two
+physical nodes and two GPUs per node, there will be 16 MPI ranks per
+node, and 8 MPI ranks per simulation. The 16 MPI ranks doing PP work
+on a node are mapped to the GPUs with IDs 0 and 1, even though they
+come from more than one simulation. They are mapped in the order
+indicated, so that the PP ranks from each simulation use a single
+GPU. However, the order `0101010101010101` could run faster.
+
+### Running replica-exchange simulations
+
+When running a multi-simulation, using `mdrun -replex n` means that a
+replica exchange is attempted every given number of steps. The number
+of replicas is set with the `-multi` or `-multidir` option, described
+above.  All run input files should use a different value for the
+coupling parameter (e.g. temperature), which ascends over the set of
+input files. The random seed for replica exchange is set with
+`-reseed`. After every exchange, The velocities are scaled and
+neighbor searching is performed. See the Reference Manual for more
+details on how replica exchange functions in GROMACS.
diff --git a/docs/user-guide/mdrun-performance.md b/docs/user-guide/mdrun-performance.md
new file mode 100644 (file)
index 0000000..012295c
--- /dev/null
@@ -0,0 +1,435 @@
+# Getting good performance from `mdrun` #
+
+The GROMACS build system and the `mdrun` tool has a lot of built-in
+and configurable intelligence to detect your hardware and make pretty
+effective use of that hardware. For a lot of casual and serious use of
+`mdrun`, the automatic machinery works well enough. But to get the
+most from your hardware to maximise your scientific quality, read on!
+
+## Hardware background information ##
+
+Modern computer hardware is complex and heterogeneous, so we need to
+discuss a little bit of background information and set up some
+definitions. Experienced HPC users can skip this section.
+
+core
+:   A hardware compute unit that actually executes instructions. There
+    is normally more than one core in a processor, often many more.
+
+cache
+:   A special kind of memory local to core(s) that is much faster to
+    access than main memory, kind of like the top of a human's desk,
+    compared to their filing cabinet. There are often several layers
+    of caches associated with a core.
+
+socket
+:   A group of cores that share some kind of locality, such as a shared
+    cache. This makes it more efficient to spread computational work
+    over cores within a socket than over cores in different
+    sockets. Modern processors often have more than one socket.
+
+node
+:   A group of sockets that share coarser-level locality, such as shared
+    access to the same memory without requiring any network
+    hardware. A normal laptop or desktop computer is a node. A node
+    is often the smallest amount of a large compute cluster that a
+    user can request to use.
+
+thread
+:   A stream of instructions for a core to execute. There are
+    many different programming abstractions that create and manage
+    spreading computation over multiple threads, such as OpenMP,
+    pthreads, winthreads, CUDA, OpenCL, and OpenACC. Some kinds of
+    hardware can map more than one software thread to a core; on Intel
+    x86 processors this is called "hyper-threading." Normally,
+    `mdrun` will not benefit from such mapping.
+
+affinity
+:   On some kinds of hardware, software threads can migrate
+    between cores to help automatically balance workload. Normally,
+    the performance of `mdrun` will degrade dramatically if this is
+    permitted, so `mdrun` will by default set the affinity of its
+    threads to their cores, unless the user or software environment
+    has already done so. Setting thread affinity is sometimes called
+    "pinning" threads to cores.
+
+MPI
+:   The dominant multi-node parallelization-scheme, which
+    provides a standardized language in which programs can be
+    written that work across more than one node.
+
+rank
+:   In MPI, a rank is the smallest grouping of hardware
+    used in the multi-node parallelization scheme. That grouping can
+    be controlled by the user, and might correspond to a core, a
+    socket, a node, or a group of nodes. The best choice varies with
+    the hardware, software and compute task. Sometimes an MPI rank is
+    called an MPI process.
+
+GPU
+:   A graphics processing unit, which is often faster
+    and more efficient than conventional processors for particular
+    kinds of compute workloads. A GPU is always associated with a
+    particular node, and often a particular socket within that node.
+
+OpenMP
+:   A standardized technique supported by many compilers
+    to share a compute workload over multiple cores. Often
+    combined with MPI to achieve hybrid MPI/OpenMP parallelism.
+
+CUDA
+:   A programming-language extension developed by Nvidia
+    for use in writing code for their GPUs.
+
+SIMD
+:   Modern CPU cores have instructions that can execute
+    large numbers of floating-point instructions in a single
+    cycle.
+
+
+## GROMACS background information ##
+
+The algorithms in `mdrun` and their implementations are most relevant
+when choosing how to make good use of the hardware. For details,
+see the Reference Manual. The most important of these are
+
+Domain Decomposition (DD)
+:   This algorithm decomposes the (short-ranged) component of the
+    non-bonded interactions into domains that share spatial locality,
+    which permits efficient code to be written. Each domain handles
+    all of the particle-particle (PP) interactions for its members,
+    and is mapped to a single rank. Within a PP rank, OpenMP threads
+    can share the workload, or the work can be off-loaded to a
+    GPU. The PP rank also handles any bonded interactions for the
+    members of its domain. A GPU may perform work for more than one PP
+    rank, but it is normally most efficient to use a single PP rank
+    per GPU and for that rank to have thousands of atoms. When the
+    work of a PP rank is done on the CPU, mdrun will make extensive
+    use of the SIMD capabilities of the core. There are various
+    [command-line options](#controlling-the-domain-decomposition-algorithm)
+    to control the behaviour of the DD algorithm.
+
+Particle-mesh Ewald (PME)
+:   This algorithm treats the long-ranged components of the non-bonded
+    interactions (Coulomb and/or Lennard-Jones).  Either all, or just
+    a subset of ranks may participate in the work for computing
+    long-ranged component (often inaccurately called simple the "PME"
+    component). Because the algorithm uses a 3D FFT that requires
+    global communication, its performance gets worse as more ranks
+    participate, which can mean it is fastest to use just a subset of
+    ranks (e.g.  one-quarter to one-half of the ranks). If there are
+    separate PME ranks, then the remaining ranks handle the PP
+    work. Otherwise, all ranks do both PP and PME work.
+
+## Running mdrun within a single node ##
+
+`mdrun` can be configured and compiled in several different ways that
+are efficient to use within a single node. The default configuration
+using a suitable compiler will deploy a multi-level hybrid parallelism
+that uses CUDA, OpenMP and the threading platform native to the
+hardware. For programming convenience, in GROMACS, those native
+threads are used to implement on a single node the same MPI scheme as
+would be used between nodes, but much more efficient; this is called
+thread-MPI. From a user's perspective, real MPI and thread-MPI look
+almost the same, and GROMACS refers to MPI ranks to mean either kind,
+except where noted. A real external MPI can be used for `mdrun` within
+a single node, but runs more slowly than the thread-MPI version.
+
+By default, `mdrun` will inspect the hardware available at run time
+and do its best to make fairly efficient use of the whole node. The
+log file, stdout and stderr are used to print diagnostics that
+inform the user about the choices made and possible consequences.
+
+A number of command-line parameters are available to vary the default
+behaviour.
+
+`-nt`
+:   The total number of threads to use. The default, 0, will start as
+    many threads as available cores. Whether the threads are
+    thread-MPI ranks, or OpenMP threads within such ranks depends on
+    other settings.
+
+`-ntmpi`
+:   The total number of thread-MPI ranks to use. The default, 0,
+    will start one rank per GPU (if present), and otherwise one rank
+    per core.
+
+`-ntomp`
+:   The total number of OpenMP threads per rank to start. The
+    default, 0, will start one thread on each available core.
+    Alternatively, mdrun will honour the appropriate system
+    environment variable (e.g. `OMP_NUM_THREADS`) if set.
+
+`-npme`
+:   The total number of ranks to dedicate to the long-ranged
+    component of PME, if used. The default, -1, will dedicate ranks
+    only if the total number of threads is at least 12, and will use
+    around one-third of the ranks for the long-ranged component.
+
+`-ntomp_pme`
+:   When using PME with separate PME ranks,
+    the total number of OpenMP threads per separate PME ranks.
+    The default, 0, copies the value from `-ntomp`.
+
+`-gpu_id`
+:   A string that specifies the ID numbers of the GPUs to be
+    used by corresponding PP ranks on this node. For example,
+    "0011" specifies that the lowest two PP ranks use GPU 0,
+    and the other two use GPU 1.
+
+`-pin`
+:   Can be set to "auto," "on" or "off" to control whether
+    mdrun will attempt to set the affinity of threads to cores.
+    Defaults to "auto," which means that if mdrun detects that all the
+    cores on the node are being used for mdrun, then it should behave
+    like "on," and attempt to set the affinities (unless they are
+    already set by something else).
+
+`-pinoffset`
+:   If `-pin on`, specifies the logical core number to
+    which mdrun should pin the first thread. When running more than
+    one instance of mdrun on a node, use this option to to avoid
+    pinning threads from different mdrun instances to the same core.
+
+`-pinstride`
+:   If `-pin on`, specifies the stride in logical core
+    numbers for the cores to which mdrun should pin its threads. When
+    running more than one instance of mdrun on a node, use this option
+    to to avoid pinning threads from different mdrun instances to the
+    same core.  Use the default, 0, to minimize the number of threads
+    per physical core - this lets mdrun manage the hardware-, OS- and
+    configuration-specific details of how to map logical cores to
+    physical cores.
+
+`-ddorder`
+:   Can be set to "interleave," "pp_pme" or "cartesian."
+    Defaults to "interleave," which means that any separate PME ranks
+    will be mapped to MPI ranks in an order like PP, PP, PME, PP, PP,
+    PME, ... etc. This generally makes the best use of the available
+    hardware. "pp_pme" maps all PP ranks first, then all PME
+    ranks. "cartesian" is a special-purpose mapping generally useful
+    only on special torus networks with accelerated global
+    communication for Cartesian communicators. Has no effect if there
+    are no separate PME ranks.
+
+`-nb`
+:   Can be set to "auto", "cpu", "gpu", "cpu_gpu."
+    Defaults to "auto," which uses a compatible GPU if available.
+    Setting "cpu" requires that no GPU is used. Setting "gpu" requires
+    that a compatible GPU be available and will be used. Setting
+    "cpu_gpu" permits the CPU to execute a GPU-like code path, which
+    will run slowly on the CPU and should only be used for debugging.
+
+### Examples for mdrun on one node
+
+    mdrun
+Starts mdrun using all the available resources. mdrun
+will automatically choose a fairly efficient division
+into thread-MPI ranks, OpenMP threads and assign work
+to compatible GPUs. Details will vary with hardware
+and the kind of simulation being run.
+
+    mdrun -nt 8
+Starts mdrun using 8 threads, which might be thread-MPI
+or OpenMP threads depending on hardware and the kind
+of simulation being run.
+
+    mdrun -ntmpi 2 -ntomp 4
+Starts mdrun using eight total threads, with four thread-MPI
+ranks and two OpenMP threads per core. You should only use
+these options when seeking optimal performance, and
+must take care that the ranks you create can have
+all of their OpenMP threads run on the same socket.
+The number of ranks must be a multiple of the number of
+sockets, and the number of cores per node must be
+a multiple of the number of threads per rank.
+
+    mdrun -gpu_id 12
+Starts mdrun using GPUs with IDs 1 and 2 (e.g. because
+GPU 0 is dedicated to running a display). This requires
+two thread-MPI ranks, and will split the available
+CPU cores between them using OpenMP threads.
+
+    mdrun -ntmpi 4 -gpu_id "1122"
+Starts mdrun using four thread-MPI ranks, and maps them
+to GPUs with IDs 1 and 2. The CPU cores available will
+be split evenly between the ranks using OpenMP threads.
+
+    mdrun -nt 6 -pin on -pinoffset 0
+    mdrun -nt 6 -pin on -pinoffset 3
+Starts two mdrun processes, each with six total threads.
+Threads will have their affinities set to particular
+logical cores, beginning from the logical core
+with rank 0 or 3, respectively. The above would work
+well on an Intel CPU with six physical cores and
+hyper-threading enabled. Use this kind of setup only
+if restricting mdrun to a subset of cores to share a
+node with other processes.
+
+    mpirun_mpi -np 2
+When using an `mdrun_mpi` compiled with external MPI,
+this will start two ranks and as many OpenMP threads
+as the hardware and MPI setup will permit. If the
+MPI setup is restricted to one node, then the resulting
+`mdrun_mpi` will be local to that node.
+
+## Running mdrun on more than one node ##
+
+This requires configuring GROMACS to build with an external MPI
+library. By default, this mdrun executable will be named
+`mdrun_mpi`. All of the considerations for running single-node
+mdrun still apply, except that `-ntmpi` and `-nt` cause a fatal
+error, and instead the number of ranks is controlled by the
+MPI environment.
+Settings such as `-npme` are much more important when
+using multiple nodes. Configuring the MPI environment to
+produce one rank per core is generally good until one
+approaches the strong-scaling limit. At that point, using
+OpenMP to spread the work of an MPI rank over more than one
+core is needed to continue to improve absolute performance.
+The location of the scaling limit depends on the processor,
+presence of GPUs, network, and simulation algorithm, but
+it is worth measuring at around ~200 atoms/core if you
+need maximum throughput.
+
+There are further command-line parameters that are relevant in these
+cases.
+
+`-tunepme`
+:   If "on," will optimize various aspects of the PME
+    and DD algorithms, shifting load between ranks and/or
+    GPUs to maximize throughput
+
+`-gcom`
+:   Can be used to limit global communication every n steps. This can
+    improve performance for highly parallel simulations where this global
+    communication step becomes the bottleneck. For a global thermostat
+    and/or barostat, the temperature and/or pressure will also only be
+    updated every `-gcom` steps. By default, it is set to the
+    minimum of `nstcalcenergy` and `nstlist`.
+
+The [gmx tune_pme] utility is available to search a wider
+range of parameter space, including making safe
+modifications to the [.tpr] file, and varying `-npme`.
+It is only aware of the number of ranks created by
+the MPI environment, and does not explicitly manage
+any aspect of OpenMP during the optimization.
+
+### Examples for mdrun on more than one node ##
+
+The examples and explanations for for single-node mdrun are
+still relevant, but `-nt` is no longer the way
+to choose the number of MPI ranks.
+
+    mpirun -np 16 mdrun_mpi
+Starts `mdrun_mpi` with 16 ranks, which are mapped to
+the hardware by the MPI library, e.g. as specified
+in an MPI hostfile. The available cores will be
+automatically split among ranks using OpenMP threads,
+depending on the hardware and any environment settings
+such as `OMP_NUM_THREADS`.
+
+    mpirun -np 16 mdrun_mpi -npme 5
+Starts `mdrun_mpi` with 16 ranks, as above, and
+require that 5 of them are dedicated to the PME
+component.
+
+    mpirun -np 11 mdrun_mpi -ntomp 2 -npme 6 -ntomp_pme 1
+Starts `mdrun_mpi` with 11 ranks, as above, and
+require that six of them are dedicated to the PME
+component with one OpenMP thread each. The remaining
+five do the PP component, with two OpenMP threads
+each.
+
+    mpirun -np 4 mdrun -ntomp 6 -gpu_id 00
+Starts `mdrun_mpi` on a machine with two nodes, using
+four total ranks, each rank with six OpenMP threads,
+and both ranks on a node sharing GPU with ID 0.
+
+    mpirun -np 8 mdrun -ntomp 3 -gpu_id 0000
+Starts `mdrun_mpi` on a machine with two nodes, using
+eight total ranks, each rank with three OpenMP threads,
+and all four ranks on a node sharing GPU with ID 0.
+This may or may not be faster than the previous setup
+on the same hardware.
+
+    mpirun -np 20 mdrun_mpi -ntomp 4 -gpu_id 0
+Starts `mdrun_mpi` with 20 ranks, and assigns the CPU cores evenly
+across ranks each to one OpenMP thread. This setup is likely to be
+suitable when there are ten nodes, each with one GPU, and each node
+has two sockets.
+
+    mpirun -np 20 mdrun_mpi -gpu_id 00
+Starts `mdrun_mpi` with 20 ranks, and assigns the CPU cores evenly
+across ranks each to one OpenMP thread. This setup is likely to be
+suitable when there are ten nodes, each with one GPU, and each node
+has two sockets.
+
+    mpirun -np 20 mdrun_mpi -gpu_id 01
+Starts `mdrun_mpi` with 20 ranks. This setup is likely
+to be suitable when there are ten nodes, each with two
+GPUs.
+
+    mpirun -np 40 mdrun_mpi -gpu_id 0011
+Starts `mdrun_mpi` with 40 ranks. This setup is likely
+to be suitable when there are ten nodes, each with two
+GPUs, and OpenMP performs poorly on the hardware.
+
+## Controlling the domain decomposition algorithm
+
+This section lists all the options that affect how the domain
+decomposition algorithm decomposes the workload to the available
+parallel hardware.
+
+`-rdd`
+:   Can be used to set the required maximum distance for inter
+    charge-group bonded interactions. Communication for two-body
+    bonded interactions below the non-bonded cut-off distance always
+    comes for free with the non-bonded communication. Atoms beyond
+    the non-bonded cut-off are only communicated when they have
+    missing bonded interactions; this means that the extra cost is
+    minor and nearly indepedent of the value of `-rdd`. With dynamic
+    load balancing, option `-rdd` also sets the lower limit for the
+    domain decomposition cell sizes. By default `-rdd` is determined
+    by [mdrun] based on the initial coordinates. The chosen value will
+    be a balance between interaction range and communication cost.
+
+`-ddcheck`
+:   On by default. When inter charge-group bonded interactions are
+    beyond the bonded cut-off distance, [mdrun] terminates with an
+    error message. For pair interactions and tabulated bonds that do
+    not generate exclusions, this check can be turned off with the
+    option `-noddcheck`.
+
+`-rcon`
+:   When constraints are present, option `-rcon` influences
+    the cell size limit as well.  
+    Atoms connected by NC constraints, where NC is the LINCS order
+    plus 1, should not be beyond the smallest cell size. A error
+    message is generated when this happens, and the user should change
+    the decomposition or decrease the LINCS order and increase the
+    number of LINCS iterations.  By default [mdrun] estimates the
+    minimum cell size required for P-LINCS in a conservative
+    fashion. For high parallelization, it can be useful to set the
+    distance required for P-LINCS with `-rcon`.
+
+`-dds`
+:   Sets the minimum allowed x, y and/or z scaling of the cells with
+    dynamic load balancing. [mdrun] will ensure that the cells can
+    scale down by at least this factor. This option is used for the
+    automated spatial decomposition (when not using `-dd`) as well as
+    for determining the number of grid pulses, which in turn sets the
+    minimum allowed cell size. Under certain circumstances the value
+    of `-dds` might need to be adjusted to account for high or low
+    spatial inhomogeneity of the system.
+
+## Finding out how to run mdrun better
+
+TODO In future patch: red flags in log files, how to interpret wallcycle output
+
+TODO In future patch: import wiki page stuff on performance checklist; maybe here,
+maybe elsewhere
+
+## Running mdrun with GPUs
+
+TODO In future patch: any tips not covered above
diff --git a/docs/user-guide/references.md b/docs/user-guide/references.md
new file mode 100644 (file)
index 0000000..c5833a6
--- /dev/null
@@ -0,0 +1,36 @@
+[/a/]: # (TODO when we decide on file formats and generation engine, resolve whether generating these should be automated, or whatever)
+
+[gmx bar]: programs/gmx-bar.html
+[gmx energy]: programs/gmx-energy.html
+[gmx convert-tpr]: programs/gmx-convert-tpr.html
+[gmx trjconv]: programs/gmx-trjconv.html
+[gmx dipoles]: programs/gmx-dipoles.html
+[gmx tune_pme]: programs/gmx-tune_pme.html
+[gmx do_dssp]: programs/gmx-do_dssp.html
+[gmx view]: programs/gmx-view.html
+[gmx eneconv]: programs/gmx-eneconv.html
+[gmx wham]: programs/gmx-wham.html
+[gmx grompp]: programs/gmx-grompp.html
+[gmx solvate]: programs/gmx-solvate.html
+[gmx editconf]: programs/gmx-editconf.html
+[gmx pdb2gmx]: programs/gmx-pdb2gmx.html
+[gmx mdrun]: programs/gmx-mdrun.html
+[mdrun]: programs/gmx-mdrun.html
+[trjcat]: programs/gmx-trjcat.html
+[eneconv]: programs/gmx-eneconv.html
+
+[pdb]: online/pdb.html
+[.pdb]: online/pdb.html
+[.gro]: online/gro.html
+[.top]: online/top.html
+[.cpt]: online/cpt.html
+[.trr]: online/trr.html
+[.xtc]: online/xtc.html
+[.tng]: online/tng.html
+[.tpr]: online/tpr.html
+[.ndx]: online/ndx.html
+[.mdp]: online/mdp.html
+
+[wwwpage]: http://www.gromacs.org
+[install guide]: install-guide.html
+[reference manual]: manual-@PROJECT_VERSION@.pdf
diff --git a/docs/user-guide/tools.md b/docs/user-guide/tools.md
new file mode 100644 (file)
index 0000000..c76222a
--- /dev/null
@@ -0,0 +1,56 @@
+# Command-line tools in GROMACS  
+
+GROMACS includes many tools for preparing, running and analysing
+molecular dynamics simulations. These are all structured as part of
+the `gmx` binary, and invoked with commands like `gmx grompp`.
+[mdrun] is the only other binary that [can be
+built](install-guide.html#building-only-mdrun), but even it can be run
+with `gmx mdrun`. Documentation for these can be found at the links
+below.
+
+* Tools documentation [by name](programs/byname.html)  
+* Tools documentation [by topic](programs/bytopic.html)  
+
+## Common options and behaviour of GROMACS tools
+
+Optional files are not used unless the option is set, in contrast to
+non optional files, where the default file name is used when the
+option is not set.
+
+All GROMACS tools will accept file options without a file extension
+or filename being specified. In such cases the default filenames will
+be used. With multiple input file types, such as generic structure
+format, the directory will be searched for files of each type with the
+supplied or default name. When no such file is found, or with output
+files the first file type will be used.
+
+All GROMACS tools with the exception of [mdrun], [trjcat] and
+[eneconv] check if the command line options are valid.  If this is not
+the case, the program will be halted.
+
+All GROMACS tools have 4 hidden options:
+
+       option  type  default  description
+-------------  ----  -------  ------------------
+`-[no]hidden`  bool  [`yes`]  [hidden] Print description for hidden options
+`-[no]quiet`   bool  [` no`]  [hidden] Do not print help info
+`-[no]debug`   bool  [` no`]  [hidden] Write file with debug information
+
+Many tools accept enumerated options (enum), which should be used with
+one of the arguments listed in the option description. The argument
+may be abbreviated, and the first match to the shortest argument in
+the list will be selected.
+
+Many tools also use options that may accept a vector of values. Either
+1 or 3 parameters can be supplied; when only one parameter is supplied
+the two other values are also set to this value.
+
+All GROMACS tools can read compressed (`*.Z`) or g-zipped (`*.gz`)
+files. There might be a problem with reading compressed [.tng] or
+[.xtc] files, but these will not compress very well anyway.
+
+Most GROMACS tools can process a trajectory with fewer atoms than the
+run input or structure file, but only if the trajectory consists of
+the first n atoms of the run input or structure file.
+
+
index a7a1a0c22b7ccd4575535055d435bc079d16b333..eed26cafe75135267189a786f84660e611175624 100644 (file)
@@ -55,6 +55,7 @@ GMXBIN=${GMXPREFIX}/@BIN_INSTALL_DIR@
 GMXLDLIB=${GMXPREFIX}/@LIB_INSTALL_DIR@
 GMXMAN=${GMXPREFIX}/@MAN_INSTALL_DIR@
 GMXDATA=${GMXPREFIX}/@DATA_INSTALL_DIR@
+GROMACS_DIR=${GMXPREFIX}
 
 LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
 PKG_CONFIG_PATH=${GMXLDLIB}/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}
@@ -63,7 +64,8 @@ PATH=${GMXBIN}${PATH:+:}${PATH}
 MANPATH=${GMXMAN}:${MANPATH}
 
 # export should be separate, so /bin/sh understands it
-export GMXBIN GMXLDLIB GMXMAN GMXDATA LD_LIBRARY_PATH PATH MANPATH PKG_CONFIG_PATH
+export GMXBIN GMXLDLIB GMXMAN GMXDATA LD_LIBRARY_PATH PATH MANPATH
+export PKG_CONFIG_PATH GROMACS_DIR
 
 IFS="$old_IFS"
 unset old_IFS
index f22607920b96cb3c2a2e5de659c1c41e8eadae8d..16a85df5c36adc2263985934f88d57e305ac8bfb 100644 (file)
@@ -75,6 +75,7 @@ setenv GMXBIN ${GMXPREFIX}/@BIN_INSTALL_DIR@
 setenv GMXLDLIB ${GMXPREFIX}/@LIB_INSTALL_DIR@
 setenv GMXMAN ${GMXPREFIX}/@MAN_INSTALL_DIR@
 setenv GMXDATA ${GMXPREFIX}/@DATA_INSTALL_DIR@
+setenv GROMACS_DIR ${GMXPREFIX}
 
 #make them begin with :
 if ($?LD_LIBRARY_PATH) setenv LD_LIBRARY_PATH ":${LD_LIBRARY_PATH}"
index dbc671e398c47209ddc21c164ff71409f30f2efb..29ef88ad49f8670a5ff6bf8f6c333cb91fbf71f4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2011,2012, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -43,10 +43,6 @@ install(FILES README template.cpp Makefile.pkg
         DESTINATION ${DATA_INSTALL_DIR}/template
         COMPONENT development)
 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindGROMACS.cmakein
-        ${CMAKE_CURRENT_BINARY_DIR}/cmake/FindGROMACS.cmake @ONLY)
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/FindGROMACS.cmake
+install(FILES cmake/FindGROMACS.cmake
         DESTINATION ${DATA_INSTALL_DIR}/template/cmake
         COMPONENT development)
-
index 0cc6dcdfba7edb81f4510f52b4b4fde679896275..5d738b8d637554aa696d99ceb2da686d71427f05 100644 (file)
@@ -1,44 +1,42 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.8)
 
-project(template)
+project(template CXX)
 
-# Cmake modules/macros are in a subdirectory to keep this file cleaner
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-
-if(NOT CMAKE_BUILD_TYPE)
+if (NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
-endif(NOT CMAKE_BUILD_TYPE)
+endif()
 
-option(GMX_DOUBLE "Use double precision" OFF)
+# CMake modules are in a subdirectory to keep this file cleaner
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
-########################################################################
-# Fix stupid flags on MSVC
-########################################################################
-IF(CMAKE_GENERATOR MATCHES "Visual Studio")
-    STRING(REPLACE /MD /MT CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
-    SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
-    STRING(REPLACE /MD /MT CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
-    SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "" FORCE)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
-
-########################################################################
-# Basic system tests (standard libraries, headers, functions, types)   #
-########################################################################
-
-if (GMX_DOUBLE)
-  set(LIBGROMACS "libgromacs_d")
-else(GMX_DOUBLE)
-  set(LIBGROMACS "libgromacs")
-endif(GMX_DOUBLE)
-
-FIND_PACKAGE(GROMACS COMPONENTS ${LIBGROMACS} REQUIRED)
-message("GROMACS version ${GROMACS_VERSION_STRING} found")
-if ("${GROMACS_VERSION_STRING}" VERSION_LESS "5.0")
-  message(FATAL_ERROR "This template works with GROMACS 5.0 (and possibly later versions)")
+# In principle, this could be deduced from GROMACS_IS_DOUBLE returned by
+# find_package(GROMACS) based on the suffix alone, but it is clearer that the
+# user explicitly sets what they want to get, and then need to provide a suffix
+# to match.
+option(GMX_DOUBLE "Use double precision" OFF)
+set(GMX_SUFFIX "" CACHE STRING "Suffix for the GROMACS installation to use (empty for default)")
+
+# This does not allow for a non-suffixed double-precision libgromacs, but
+# that should be rare enough for demonstration purposes.
+if (GMX_DOUBLE AND NOT GMX_SUFFIX)
+    set(GROMACS_SUFFIX "_d")
+else()
+    set(GROMACS_SUFFIX ${GMX_SUFFIX})
 endif()
 
-add_definitions( ${GROMACS_DEFINITIONS} )
-include_directories( ${GROMACS_INCLUDE_DIRS} )
+find_package(GROMACS 5.1 REQUIRED)
+gromacs_check_double(GMX_DOUBLE)
+gromacs_check_compiler(CXX)
+include_directories(${GROMACS_INCLUDE_DIRS})
+add_definitions(${GROMACS_DEFINITIONS})
+
+# Use static linking on MSVC
+if (CMAKE_GENERATOR MATCHES "Visual Studio")
+    string(REPLACE /MD /MT CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
+    set(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} CACHE STRING "" FORCE)
+    string(REPLACE /MD /MT CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+    set(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} CACHE STRING "" FORCE)
+endif()
 
 add_executable(template template.cpp)
 target_link_libraries(template ${GROMACS_LIBRARIES})
index dc25c57bfa4a3e06a5f6bb8aea734625a53fb58d..bc1e4b6c323b5ab5d399ebf85b0ccc567837d389 100644 (file)
@@ -1,6 +1,10 @@
 Once installed, this directory contains CMakelist.txt,
 Makefile.pkg and a small program that you could use as
 a template when writing your own analysis software.
+Further explanation for the template code can be found
+in the Doxygen documentation (link to the latest development
+version):
+  <http://jenkins.gromacs.org/job/Documentation_Gerrit_Nightly/javadoc/doxygen/html-user/page_analysistemplate.xhtml>
 
 The CMakelist.txt can be used together with cmake to
 build the template program:
@@ -10,30 +14,19 @@ Alternatively, setting CMAKE_PREFIX_PATH will direct cmake
 to find a particular GROMACS installation.
 
 The Makefile.pkg can be used if cmake is unavailable. It
-makes use of pkg-config only to build the template program:
+makes use of pkg-config to build the template program:
 $ source /path/to/GMXRC
 $ make -f Makefile.pkg
 
 You will need to make sure that you use a sufficiently similar C++
 compiler and C++ Standard Library as the one that was used for
-compiling GROMACS, preferably the same one. If you used any system
-libraries (e.g. Boost, FFTW, BLAS, LAPACK) when installing GROMACS,
-then you will need make them available to the template build system
-also. The easiest way to do this is to have pkg-config installed on
-your system, and to source GMXRC from the GROMACS installation before
-you attempt to configure the template. A subset of Boost is supposed
-to be installed with GROMACS, but currently the automatic machinery
-does not detect that installation, so you may need to install Boost
-(headers only) in order to use the GROMACS template program.
-
-If the compiler used for GROMACS was capable of some C++11 features
-then, by default, those will be required for compiling the
-template. To make that work, you can either configure GROMACS with
-$ cmake -DGMX_CXX11=off
-or configure the template with the appropriate
-$ cmake -DCMAKE_CXX_FLAGS="-flag-for-your-compiler"
-You can find out the necessary flags from your compiler's documentation,
-or by inspecting the src/buildinfo.h file in the GROMACS build tree.
+compiling GROMACS, preferably the same one.  Boost headers used to
+compile GROMACS are also required, and are automatically added to
+the include path by both of the above build systems.
+See the Doxygen documentation for using GROMACS as a library for
+more details about the build system used to build the template, as
+well as its limitations (link to the latest development version):
+  <http://jenkins.gromacs.org/job/Documentation_Gerrit_Nightly/javadoc/doxygen/html-user/page_usinglibrary.xhtml>
 
 ----------------------------------------------------------
 
diff --git a/share/template/cmake/FindGROMACS.cmake b/share/template/cmake/FindGROMACS.cmake
new file mode 100644 (file)
index 0000000..67a8a65
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+# This file should remain version-agnostic, with all things specific to a
+# particular GROMACS version remaining in the package configuration files.
+# This find module only provides some convenience functionality to manage the
+# suffixes etc.
+# That should allow using the same FindGROMACS.cmake file with multiple
+# different GROMACS installations on the same machine.
+
+# Propagate all flags passed to parent find_package() to the config call below.
+set(_gmx_find_args "")
+if (GROMACS_FIND_VERSION)
+    if (GROMACS_FIND_VERSION VERSION_LESS "5.1")
+        message(FATAL_ERROR
+            "This version of FindGROMACS.cmake requires GROMACS-provided "
+            "package configuration files, and only works to find "
+            "GROMACS 5.1 or later.")
+    endif()
+    list(APPEND _gmx_find_args ${GROMACS_FIND_VERSION})
+    if (GROMACS_FIND_VERSION_EXACT)
+        list(APPEND _gmx_find_args EXACT)
+    endif()
+endif()
+if (GROMACS_FIND_REQUIRED)
+    list(APPEND _gmx_find_args REQUIRED)
+endif()
+if (GROMACS_FIND_QUIETLY)
+    list(APPEND _gmx_find_args QUIET)
+endif()
+
+# Determine the actual name of the package configuration files.
+set(_gmx_pkg_name gromacs)
+if (DEFINED GROMACS_SUFFIX)
+    set(_gmx_pkg_name gromacs${GROMACS_SUFFIX})
+endif()
+# Delegate all the actual work to the package configuration files.
+# The CONFIGS option is not really necessary, but provides a bit better error
+# messages, since we actually know what the config file should be called.
+find_package(GROMACS ${_gmx_find_args} CONFIG
+             NAMES ${_gmx_pkg_name}
+             CONFIGS ${_gmx_pkg_name}-config.cmake)
+unset(_gmx_find_args)
+unset(_gmx_pkg_name)
diff --git a/share/template/cmake/FindGROMACS.cmakein b/share/template/cmake/FindGROMACS.cmakein
deleted file mode 100644 (file)
index f50d356..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2009-2011, by the VOTCA Development Team (http://www.votca.org).
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# - Finds parts of GROMACS
-# Find the native GROMACS components headers and libraries.
-#
-#  GROMACS_INCLUDE_DIRS   - where to find GROMACS headers.
-#  GROMACS_LIBRARIES      - List of libraries when used by GROMACS.
-#  GROMACS_FOUND          - True if all GROMACS components were found.
-#  GROMACS_DEFINITIONS    - Extra definies needed by GROMACS
-#  GROMACS_PKG            - The name of the pkg-config package needed
-#  GROMACS_VERSION        - GROMACS lib interface version
-#  GROMACS_MAJOR_VERSION  - GROMACS lib interface major version
-#  GROMACS_MINOR_VERSION  - GROMACS lib interface minor version
-#  GROMACS_PATCH_LEVEL    - GROMACS lib interface patch level
-#  GROMACS_VERSION_STRING - GROMACS lib interface version string (e.g. "4.5.3")
-#
-
-find_package(PkgConfig)
-list(LENGTH GROMACS_FIND_COMPONENTS GROMACS_NUM_COMPONENTS_WANTED)
-if(${GROMACS_NUM_COMPONENTS_WANTED} LESS 1)
-  message(FATAL_ERROR "find_package(GROMACS) needs to be supplied with the name of a GROMACS component for which it can search")
-elseif(${GROMACS_NUM_COMPONENTS_WANTED} GREATER 1)
-  message(FATAL_ERROR "We only support finding one GROMACS component at this point, go and implement it ;-)")
-elseif(${GROMACS_FIND_COMPONENTS} MATCHES "^lib(gmx|gromacs)(_d)?$")
-  set(GROMACS_PKG "${GROMACS_FIND_COMPONENTS}")
-  string(REGEX REPLACE "^lib(.*)" "\\1" GROMACS_LIBRARY_NAME "${GROMACS_PKG}")
-else()
-  message(FATAL_ERROR "We do not support finding ${GROMACS_FIND_COMPONENTS}, go and implement it ;-)")
-endif()
-
-if(GMX_DOUBLE AND NOT "${GROMACS_PKG}" MATCHES "_d$")
-  message(FATAL_ERROR "GMX_DOUBLE was true, but I was asked to find ${GROMACS_PKG} (without _d at the end) - illogical!")
-endif(GMX_DOUBLE AND NOT "${GROMACS_PKG}" MATCHES "_d$")
-if(NOT GMX_DOUBLE AND "${GROMACS_PKG}" MATCHES "_d$")
-  message(FATAL_ERROR "GMX_DOUBLE was false, but I was asked to find ${GROMACS_PKG} (with _d at the end) - illogical!")
-endif(NOT GMX_DOUBLE AND "${GROMACS_PKG}" MATCHES "_d$")
-
-pkg_check_modules(PC_GROMACS ${GROMACS_PKG})
-if (GMX_DOUBLE)
-  list(APPEND GMX_DEFS "-DGMX_DOUBLE")
-endif(GMX_DOUBLE)
-if (PC_GROMACS_CFLAGS_OTHER)
-  foreach(DEF ${PC_GROMACS_CFLAGS_OTHER})
-    if (${DEF} MATCHES "^-D")
-      list(APPEND GMX_DEFS ${DEF})
-    endif (${DEF} MATCHES "^-D")
-  endforeach(DEF)
-  list(REMOVE_DUPLICATES GMX_DEFS)
-endif (PC_GROMACS_CFLAGS_OTHER)
-set(GROMACS_DEFINITIONS "${GMX_DEFS}" CACHE STRING "extra GROMACS definitions")
-
-find_library(GROMACS_LIBRARY NAMES ${GROMACS_LIBRARY_NAME}
-             HINTS ${PC_GROMACS_LIBRARY_DIRS} @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@)
-if (GROMACS_LIBRARY)
-  if("${GROMACS_LIBRARY}" MATCHES "lib(gmx|gromacs)[^;]*\\.a")
-    if(PC_GROMACS_LIBRARIES)
-      list(REMOVE_ITEM PC_GROMACS_LIBRARIES ${GROMACS_LIBRARY_NAME})
-      foreach (LIB ${PC_GROMACS_LIBRARIES})
-        find_library(GROMACS_${LIB} NAMES ${LIB}
-                     HINTS ${PC_GROMACS_LIBRARY_DIRS} @CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@)
-        list(APPEND GMX_DEP_LIBRARIES ${GROMACS_${LIB}})
-        unset(GROMACS_${LIB} CACHE)
-      endforeach(LIB)
-    endif(PC_GROMACS_LIBRARIES)
-    if(PC_GROMACS_CFLAGS_OTHER)
-      foreach(LIB ${PC_GROMACS_CFLAGS_OTHER})
-        if (${LIB} MATCHES "thread")
-          find_package(Threads REQUIRED)
-          list(APPEND GMX_DEP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-        endif (${LIB} MATCHES "thread")
-      endforeach(LIB)
-    endif(PC_GROMACS_CFLAGS_OTHER)
-    set(GROMACS_DEP_LIBRARIES "${GMX_DEP_LIBRARIES}" CACHE FILEPATH "GROMACS depency libs (only needed for static (.a) ${GROMACS_LIBRARY}")
-  endif("${GROMACS_LIBRARY}" MATCHES "lib(gmx|gromacs)[^;]*\\.a")
-  include(CheckLibraryExists)
-  check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" GromacsVersion "" FOUND_GROMACS_VERSION)
-  if(NOT FOUND_GROMACS_VERSION)
-    message(FATAL_ERROR "Could not find GromacsVersion in ${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GROMACS_LIBRARY and GROMACS_DEP_LIBRARY by hand which sets the GROMACS lib and its depencies (e.g. -DGROMACS_LIBRARY='/path/to/libgmx.so' -DGROMACS_DEP_LIBRARIES='/path/to/libblas.so;/path/to/libm.so') !")
-  endif(NOT FOUND_GROMACS_VERSION)
-  check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" init_mtop "" FOUND_GROMACS_INIT_MTOP)
-  if(NOT FOUND_GROMACS_INIT_MTOP)
-    message(FATAL_ERROR "Could not find init_mtop in the GROMACS library, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. This most likely means that your GROMACS version is too old, we need at least GROMACS 4.0.7.")
-  endif(NOT FOUND_GROMACS_INIT_MTOP)
-  set(GROMACS_VERSION 40000)
-  check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" output_env_done "" FOUND_GROMACS_OUTPUT_ENV_DONE)
-  if(FOUND_GROMACS_OUTPUT_ENV_DONE)
-    set(GROMACS_VERSION 40500)
-  endif(FOUND_GROMACS_OUTPUT_ENV_DONE)
-  check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" gmx_nonbonded_setup "" FOUND_GROMACS_GMX_NONBONDED_SETUP)
-  if(FOUND_GROMACS_GMX_NONBONDED_SETUP)
-    set(GROMACS_VERSION 40600)
-  endif(FOUND_GROMACS_GMX_NONBONDED_SETUP)
-  check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" init_domdec_vsites "" FOUND_GROMACS_INIT_DOMDEC_VSITES)
-  if(FOUND_GROMACS_INIT_DOMDEC_VSITES)
-    set(GROMACS_VERSION 50000)
-  endif(FOUND_GROMACS_INIT_DOMDEC_VSITES)
-  set(GROMACS_VERSION ${GROMACS_VERSION} CACHE STRING "GROMACS lib interface version")
-else(GROMACS_LIBRARY)
-  set(GROMACS_VERSION 40500)
-endif (GROMACS_LIBRARY)
-
-math(EXPR GROMACS_MAJOR_VERSION "${GROMACS_VERSION} / 10000")
-math(EXPR GROMACS_MINOR_VERSION "${GROMACS_VERSION} / 100 % 100")
-math(EXPR GROMACS_PATCH_LEVEL "${GROMACS_VERSION} % 100")
-set(GROMACS_VERSION_STRING "${GROMACS_MAJOR_VERSION}.${GROMACS_MINOR_VERSION}.${GROMACS_PATCH_LEVEL}")
-
-if ("${GROMACS_PKG}" MATCHES "libgmx")
-  if (${GROMACS_VERSION} EQUAL 40000)
-    find_path(GROMACS_INCLUDE_DIR tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
-  else(${GROMACS_VERSION} EQUAL 40000)
-   find_path(GROMACS_INCLUDE_DIR gromacs/tpxio.h HINTS ${PC_GROMACS_INCLUDE_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
-  endif(${GROMACS_VERSION} EQUAL 40000)
-elseif("${GROMACS_PKG}" MATCHES "libgromacs")
-  find_path(GROMACS_INCLUDE_DIR gromacs/version.h HINTS ${PC_GROMACS_INCLUDE_DIRS} @CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@)
-endif("${GROMACS_PKG}" MATCHES "libgmx")
-
-set(GROMACS_LIBRARIES "${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" )
-set(GROMACS_INCLUDE_DIRS ${GROMACS_INCLUDE_DIR} )
-if (PC_GROMACS_INCLUDE_DIRS)
-  list(APPEND GROMACS_INCLUDE_DIRS ${PC_GROMACS_INCLUDE_DIRS})
-endif(PC_GROMACS_INCLUDE_DIRS)
-
-if(NOT ${GROMACS_MAJOR_VERSION} LESS 5)
-    include(CheckIncludeFile)
-    # Let find_package find the subset of Boost installed with
-    # GROMACS, by appending the relevant subdirectory, unless
-    # pkg-config already took care of it.
-    if(PC_GROMACS_INCLUDE_DIRS)
-      set(BOOST_INCLUDEDIR ${GROMACS_INCLUDE_DIRS})
-    else()
-      set(BOOST_INCLUDEDIR ${GROMACS_INCLUDE_DIRS}/gromacs/external/boost)
-    endif()
-    find_package(Boost 1.44.0 REQUIRED)
-    if(Boost_FOUND)
-        list(APPEND GROMACS_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
-    else()
-        message(FATAL_ERROR "Boost not found, compiling the GROMACS template will not work")
-    endif()
-endif()
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set GROMACS_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(GROMACS DEFAULT_MSG GROMACS_LIBRARY GROMACS_INCLUDE_DIR)
-
-mark_as_advanced(GROMACS_INCLUDE_DIR GROMACS_LIBRARY GROMACS_DEFINITIONS GROMACS_PKG GROMACS_VERSION GROMACS_DEP_LIBRARIES)
index 474b5d99de8b9eba32924a003ecdb17e08ba4803..6df804758152109408e849930030f48b9afc21e4 100644 (file)
@@ -1,4 +1,4 @@
-413
+525
 If You Want Something Done You Have to Do It Yourself_(Highlander II)
 I Live the Life They Wish They Did_(Tricky)
 Jesus Built My Hotrod_(Ministry)
@@ -397,6 +397,7 @@ Restraint! What possible restraint?_(Joseph Conrad)
 It was something to at least have a choice of nightmares_(Joseph Conrad)
 You fight, work, sweat, nearly kill yourself, sometimes you do kill yourself, trying to accomplish something - and you can't._(Joseph Conrad)
 And after some more talk we agreed that the wisdom of rats had been grossly overrated, being in fact no greater than that of men_(Joseph Conrad)
+It's an easy game, just don't let the ball past!_(Szilard Pall)
 The soul? There's nothing but chemistry here_(Breaking Bad)
 You got one part of that wrong. This is not meth._(Breaking Bad)
 It's easy to remember: a half a kT is equal to five fourths of a kJ/mol._(Anders Gabrielsson)
@@ -412,4 +413,114 @@ In the processing of models we must be especially cautious of the human weakness
 ... and that dream of dreams, a computational model that predicts everything accurately._(Roald Hoffmann)
 You see it through a charmed medium: you can not discern that the gilding is slime and the silk draperies cobwebs; that the marble is sordid slate, and the polished woods mere refuse chips and scale bark._(Mr. Rochester in Jane Eyre by Charlotte Bronte)
 I know poetry is not dead, nor genius lost; nor has Mammon gained power over either, to bind or slay; they will both assert their existence, their presence, their liberty and strength again one day._(Jane Eyre in Jane Eyre by Charlotte Bronte)
-
+Parallel programming is not about elegance!_(Bill Gropp)
+In a talk you have a choice: You can make one point or no points._(Paul Sigler)
+Where all think alike, no one thinks very much._(Walter Lippmann)
+The scientist is not the person who always gives the right answers, he is the one who asks the right questions._(Claude Levi-Strauss)
+A curious aspect of the theory of evolution is that everybody thinks he understands it._(Jacques Monod)
+When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong._(Arthur C. Clarke)
+Energy is a very subtle concept. It is very, very difficult to get right._(Richard Feynman)
+The determined Real Programmer can write FORTRAN programs in any language._(Ed Post)
+FORTRAN was the language of choice for the same reason that three-legged races are popular._(Ken Thompson)
+A computer without COBOL and FORTRAN is like a piece of chocolate cake without ketchup or mustard._(Unix fortune program)
+Consistently separating words by spaces became a general custom about the tenth century A.D., and lasted until about 1957, when FORTRAN abandoned the practice._(Sun FORTRAN Reference Manual)
+Ludwig Boltzmann, who spent much of his life studying statistical mechanics, died in 1906, by his own hand. Paul Ehrenfest, carrying on the same work, died similarly in 1933. Now it is our turn to study statistical mechanics. Perhaps it will be wise to approach the subject cautiously._(David Goodstein)
+It all works because Avogadro's number is closer to infinity than to 10._(Ralph Baierlein)
+In this house, we OBEY the laws of thermodynamics!_(Homer Simpson)
+We mathematicians are all a bit crazy._(Lev Landau)
+There is no such thing as free energy. Anyone who advocates it does not know what he is talking about._(Alireza Haghighat)
+In science it often happens that scientists say, 'You know that's a really good argument; my position is mistaken,' and then they would actually change their minds and you never hear that old view from them again. They really do it. It doesn't happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion._(Carl Sagan)
+There is nothing new to be discovered in physics now. All that remains is more and more precise measurement._(Lord Kelvin, 1900)
+I love fools' experiments. I am always making them._(Charles Darwin)
+If you want to save your child from polio, you can pray or you can inoculate... choose science._(Carl Sagan)
+Molecular biology is essentially the practice of biochemistry without a license._(Edwin Chargaff)
+If at one time or another I have brushed a few colleagues the wrong way, I must apologize: I had not realized that they were covered with fur._(Edwin Chargaff)
+It has not escaped our notice that the specific pairing we have postulated immediately suggests a possible copying mechanism for the genetic material._(Watson & Crick)
+The researcher's art is first of all to find himself a good boss._(Andre Lwoff)
+What about my nose?_(Aneesur Rahman, responding to an Argonne manager arguing the long hair of Charles Bennett in his group was disreputing the lab; Retold by Michael Klein)
+Science, my lad, is made up of mistakes, but they are mistakes which it is useful to make, because they lead little by little to the truth._(Jules Verne)
+Don't be afraid of hard work. Nothing worthwhile comes easily. Don't let others discourage you or tell you that you can't do it. In my day I was told women didn't go into chemistry. I saw no reason why we couldn't._(Gertrude Elion)
+The Nobel Prize is fine, but the drugs I've developed are rewards in themselves._(Gertrude Elion)
+...sometimes a scream is better than a thesis._(Ralph Waldo Emerson)
+The great tragedy of science - the slaying of a beautiful hypothesis by an ugly fact._(Thomas Henry Huxley)
+Dr Pauling, how do you have so many good ideas? Well David, I have a lot of ideas and throw away the bad ones._(Linus Pauling)
+I try to identify myself with the atoms... I ask what I would do If I were a carbon atom or a sodium atom._(Linus Pauling)
+I admired Bohr very much. We had long talks together, long talks in which Bohr did practically all the talking._(Paul Dirac)
+Predictions can be very difficult - especially about the future._(Niels Bohr)
+For those who want some proof that physicists are human, the proof is in the idiocy of all the different units which they use for measuring energy._(Richard Feynman)
+Dreams seldom materialize on their own._(Dian Fossey)
+Above all, don't fear difficult moments. The best comes from them._(Rita Levi-Montalcini)
+Our struggle today is not to have a female Einstein get appointed as an assistant professor. It is for a woman schlemiel to get as quickly promoted as a male schlemiel._(Bella Abzug)
+I never thought of stopping, and I just hated sleeping. I can't imagine having a better life._(Barbara McClintock)
+The farther the experiment is from theory, the closer it is to the Nobel Prize._(Irene Joliot-Curie)
+I never see what has been done; I only see what remains to be done._(Marie Curie)
+There is no reason for any individual to have a computer in his home._(Ken Olsen, head of Digital Equipment Corp.)
+People disagree with me. I just ignore them._(Linus Torvalds on the use of C++ in the kernel)
+Beware of bugs in the above code; I have only proved it correct, not tried it._(Donald Knuth)
+My greatest contribution to the field of science is that I never entered it._(Colin Powell)
+We are perhaps not far removed from the time when we shall be able to submit the bulk of chemical phenomena to calculation._(Joseph Gay-Lussac, 1808)
+If mathematical analysis should ever hold a prominent place in chemistry - an aberration which is happily almost impossible - it would occasion a rapid and widespread degeneration of that science._(Aguste Comte, 1830)
+Almost without exception, the talented women I have known have believed they had less ability than they actually had. And almost without exception, the talented men I have known believed they had more._(Gregory Petsko)
+The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time._(Tom Cargill)
+The Internet?  We are not interested in it._(Bill Gates, 1993)
+Perl: The only language that looks the same before and after RSA encryption._(Keith Bostic)
+There are only two things wrong with C++:  The initial concept and the implementation._(Bertrand Meyer)
+XML is not a language in the sense of a programming language any more than sketches on a napkin are a language._(Charles Simonyi)
+It has been discovered that C++ provides a remarkable facility for concealing the trivial details of a program - such as where its bugs are._(David Keppel)
+UNIX is basically a simple operating system. It just takes a genius to understand its simplicity._(Dennis Ritchie)
+There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence._(Jeremy Anderson)
+There are only two kinds of programming languages: those people always bitch about and those nobody uses._(Bjarne Stroustrup)
+If Java had true garbage collection, most programs would delete themselves upon execution._(Robert Sewell)
+Documentation is like sex: When it's good it's great, and when it's bad it's better than nothing._(Linus Torvalds)
+C has the power of assembly language and the convenience of... assembly language._(Dennis Ritchie)
+The last good thing written in C was Franz Schubert's Symphony Number 9._(Erwin Dieterich)
+User-friendly, adj.: Programmer-hostile._(New Hacker's Dictionary)
+First off, I'd suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it's a great symbolic gesture._(Linus Torvalds)
+I invented the term 'Object-Oriented', and I can tell you I did not have C++ in mind._(Alay Kay, author of Smalltalk)
+FORTRAN, the infantile disorder, by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use._(Edsger Dijkstra, 1970)
+Do you know what cations don't like? Dog-ions. Do you know what they like? Pie._(Tom Cheatham)
+The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka" but "That's funny..."._(Isaac Asimov)
+Those people who think they know everything are a great annoyance to those of us who do._(Isaac Asimov)
+No great discovery was ever made without a bold guess._(Marie Curie)
+Chance favors the prepared mind._(Louis Pasteur)
+I love deadlines. I like the whooshing sound they make as they fly by._(Douglas Adams)
+Good judgement is the result of experience; experience is the result of bad judgement._(Mark Twain)
+No matter how important you are, you are not as important as lunch._(Randy Pausch)
+There is just one thing I can promise you about the outer-space program: your tax dollar will go farther._(Wernher von Braun)
+Harvard makes mistakes too, you know. Kissinger taught there._(Woody Allen)
+Nothing in biology makes sense except in the light of evolution._(Theodosius Dobzhansky)
+I have a hunch that the unknown sequences of DNA will decode into copyright notices and patent protections._(Donald Knuth)
+It always takes longer than you think even when you take Hofstadter's Law into account._(Hofstadter's Law)
+A ship in port is safe, but that is not what ships are for. Sail out to sea and do new things._(Grace Hopper, developer of COBOL)
+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)
+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)
+X-rays will prove to be a hoax._(Lord Kelvin, while president of the Royal Society)
+If you're doing I/O, you're doing it wrong!_(Cannada "Drew" Lewis)
+The easiest way to scale well is to have bad single-core performance_(Blind Freddie)
+Heard a talk introducing a new language called Swift, from a guy named Wozniak, and it had nothing to do with Apple!_(Adam Cadien)
+When doing HPC, don't communica_(Jim Demmel)
+Today we're not going to optimize our CUDA code, cause that's just a rabbit hole of misery!_(Tim Warburton)
+Big Data is like teenage sex: everyone talks about it, nobody really knows how to do it, everyone thinks everyone else is doing it, so everyone claims they are doing it..._(Dan Ariely)
+It seems likely that significant software contributions to existing scientific software projects are not likely to be rewarded through the traditional reputation economy of science. Together these factors provide a reason to expect the over-production of independent scientific software packages, and the underproduction of collaborative projects in which later academics build on the work of earlier ones._(Howison & Herbsleb)
+On average, it takes twenty years for the world's largest super computer to shrink down to the size of your laptop._(Pete Beckman)
+When using an abacus, a human can achieve about 0.1 flops/watt. Super-computers achieve about 2 gigaflops/watt._(John Linford)
+Try to calculate the numbers that have been_(The Smoke Fairies)
+Please implement proper hep writing_(GROMACS)
+The three principal virtues of a programmer are Laziness, Impatience, and Hubris_(Larry Wall)
+You're like them scientists on TV explaining black holes. More you talk, less I get_(Jess Walter)
+Wedged as we are between two eternities of idleness, there is no excuse for being idle now_(Anthony Burgess)
+Even the *healthy* people move in clouds of cigarette smoke, women straining polyester, men in raggedly cutoffs slathering mayonnaise on foot-long hot dogs. It's as if the hotel were hosting a conference on adult onset diabetes_(Jess Walter)
+In practice, throwing traditional norms and values overboard results not in perfect freedom and relationships based on reason, but in chaos and fear_(Paul Verhaeghe)
+When I asked a younger colleague at the university how he had been able to change his research field several times within a decade or so, he answered: "It's just a question of new software"_(Paul Verhaeghe)
+Never mind, death professor, your structure's fine_(TV on the Radio)
+Come and play on the hospital roof, I got something that's yours_(Sherlock)
+Njuta men inte frossa, springa men inte fly_(Paganus)
+Misslycka kan man med all kod_(Mats Nylen)
+Two guys can move very fast when they're motivated enough and unemployed_(Eric Betzig)
+A protein is a chain of letters._(Julie Bernauer)
+The best way to obtain plausible negative examples is to run a docking program with a biophysics-based function._(Julie Bernauer)
index 5dbc1a89bce67ba081647ca88dbd62a88143f866..ce255af96ffa5eba78e52225c563a5b211d539f7 100644 (file)
  Fe2+       55.847    ; Iron. See Chem. Phys. Lett. 449, 144 (2007).
 ; Added by DvdS 05/2005 copied from GROMACS force field.       
  SI         28.080    ; Silicium in Glass etc.
+; tip4p-EW
+HW_tip4pew   1.008 
+OW_tip4pew   16.00 
index 5d5f0bfaa49e01dcb356aabe46effa40058f7d5f..6887f656eeed7a6412076e2b50e9d1e8cddfe8df 100644 (file)
  Fe2+       Fe2+   26  55.84700     2.000       A    2.59400e-01  5.43920e-02
 ; Added by DvdS 05/2005 copied from GROMACS force field.       
  SI         SI     14  28.08000     0.000       A    3.38550e-01  2.44704e+00
+; tip4p-EW
+HW_tip4pew   1       1.008   0.0000  A   0.00000e+00  0.00000e+00
+OW_tip4pew   8      16.00    0.0000  A   3.16435e-01  6.80946e-01
diff --git a/share/top/oplsaa.ff/tip4pew.itp b/share/top/oplsaa.ff/tip4pew.itp
new file mode 100644 (file)
index 0000000..019df92
--- /dev/null
@@ -0,0 +1,60 @@
+
+; Horn et al. (2004). J. Chem. Phys.120, 9665-9678
+; http://dx.doi.org/10.1063/1.1683075
+
+[ moleculetype ]
+; molname      nrexcl
+SOL            2
+
+[ atoms ]
+; id  at type     res nr  res name  at name  cg nr  charge    mass
+  1   OW_tip4pew  1       SOL       OW       1       0        16.00000
+  2   HW_tip4pew  1       SOL       HW1      1       0.52422   1.00800
+  3   HW_tip4pew  1       SOL       HW2      1       0.52422   1.00800
+  4   MW          1       SOL       MW       1      -1.04844   0.00000
+
+#ifndef FLEXIBLE
+
+[ settles ]
+; i    funct   doh     dhh
+1      1       0.09572 0.15139
+
+#else
+[ bonds ]
+; i     j       funct   length  force.c.
+1       2       1       0.09572 502416.0 0.09572        502416.0 
+1       3       1       0.09572 502416.0 0.09572        502416.0 
+        
+[ angles ]
+; i     j       k       funct   angle   force.c.
+2       1       3       1       104.52  628.02  104.52  628.02  
+
+#endif
+
+
+[ virtual_sites3 ]
+; Vsite from                    funct   a               b
+4       1       2       3       1       0.106676721     0.106676721
+
+
+[ exclusions ]
+1      2       3       4
+2      1       3       4
+3      1       2       4
+4      1       2       3
+
+
+; The position of the virtual site is computed as follows:
+;
+;              O
+;            
+;              V
+;        
+;      H               H
+;
+; Ewald tip4p:
+; const = distance (OV) / [ cos (angle(VOH))   * distance (OH) ]
+;        0.0125 nm     / [ cos (52.26 deg)     * 0.09572 nm    ]
+;      then a = b = 0.5 * const = 0.106676721
+;
+; Vsite pos x4 = x1 + a*(x2-x1) + b*(x3-x1)
index 420bb9225a6f49715a12eb298cc276eb6244b75e..a4764133340099a992a301ca7e9fbffa07761f44 100644 (file)
@@ -1,4 +1,5 @@
 tip4p   TIP4P  TIP 4-point, recommended
+tip4pew TIP4PEW TIP 4-point with Ewald
 tip3p   TIP3P  TIP 3-point
 tip5p   TIP5P  TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
 tip5pe  TIP5P  TIP 5-point improved for Ewald sums
index 22943e384bf668d4714733bf68d838a9a948f998..173d1bc1ce1dd8454df642f25052b2ebdece10e5 100644 (file)
@@ -188,7 +188,7 @@ T3H Water
 K      Ion
 NA     Ion
 CA     Ion
-MK     Ion
+MG     Ion
 CL     Ion
 ZN     Ion
 CU1    Ion
index 4764df0ac3e8536be4f593d108015120a4bba15a..a263d4f7217b62f8da1f461062a1cd6d8bd1f9f4 100644 (file)
@@ -43,6 +43,7 @@ if(GMX_GPU)
 endif()
 
 configure_file(config.h.cmakein config.h)
+configure_file(gmxpre-config.h.cmakein gmxpre-config.h)
 configure_file(buildinfo.h.cmakein buildinfo.h ESCAPE_QUOTES)
 
 if (BUILD_TESTING)
index a71fdad597d4afdb2f5d77b0018b247b4e7038ff..2459207232c2eb3db60b9db0935323b5a58fae2f 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,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.
  */
 #ifndef GMX_CONFIG_H
 #define GMX_CONFIG_H
-#include "gromacs/utility/gmx_header_config.h"
 
 /* TODO: For now, disable Doxygen warnings from here */
 /*! \cond */
 
-/* Default location of data files */
-#define GMXLIB_SEARCH_DIR "@GMXLIB_SEARCH_DIR@"
-
-/* Default location of data files */
-#define GMXLIB_FALLBACK "@GMXLIB_FALLBACK@"
-
 /* Binary suffix for the created binaries */
 #define GMX_BINARY_SUFFIX "@GMX_BINARY_SUFFIX@"
 
+/* Installation prefix (default location of data files) */
+#define CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
+
+/* Location of data files in the installation directory */
+#define DATA_INSTALL_DIR "@DATA_INSTALL_DIR@"
+
 /* Source directory for the build */
 #cmakedefine CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@"
 
 /* Binary directory for the build */
 #cmakedefine CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@"
 
-/* Turn off water-water neighborlist optimization only - not used right now */
-#cmakedefine DISABLE_WATERWATER_NLIST
-
-/* Turn off all water neighborlist optimization - not used right now */
-#cmakedefine DISABLE_WATER_NLIST
-
 /* IEEE754 floating-point format. Memory layout is defined by macros
  * GMX_IEEE754_BIG_ENDIAN_BYTE_ORDER and GMX_IEEE754_BIG_ENDIAN_WORD_ORDER. 
  */
 /* Target platform is BlueGene/Q */
 #cmakedefine GMX_TARGET_BGQ
 
+/** Define if we are building natively on Windows */
+#cmakedefine GMX_NATIVE_WINDOWS
+
+/** Define if we are building for Cygwin */
+#cmakedefine GMX_CYGWIN
+
+/** Define if we have sufficient C++11 support */
+#cmakedefine GMX_CXX11
+
 /* GCC bug in AVX maskload/maskstore arguments - worked around internally */
 #cmakedefine GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
 
 /* AVX2 256-bit SIMD instruction set level was selected */
 #cmakedefine GMX_SIMD_X86_AVX2_256
 
+/* MIC (Xeon Phi) SIMD instruction set level was selected */
+#cmakedefine GMX_SIMD_X86_MIC
+
+/* 32-bit ARM NEON SIMD instruction set level was selected */
+#cmakedefine GMX_SIMD_ARM_NEON
+
+/* ARM (AArch64) NEON Advanced SIMD instruction set level was selected */
+#cmakedefine GMX_SIMD_ARM_NEON_ASIMD
+
 /* IBM QPX was selected as SIMD instructions (e.g. BlueGene/Q) */
 #cmakedefine GMX_SIMD_IBM_QPX
 
+/* IBM VMX was selected as SIMD instructions (Power 6 and later) */
+#cmakedefine GMX_SIMD_IBM_VMX
+
+/* IBM VSX was selected as SIMD instructions (Power 7 and later) */
+#cmakedefine GMX_SIMD_IBM_VSX
 /* Fujitsu Sparc64 HPC-ACE SIMD acceleration */
 #cmakedefine GMX_SIMD_SPARC64_HPC_ACE
 
 /* Use MPI (with mpicc) for parallelization */
 #cmakedefine GMX_LIB_MPI
 
-/* MPI_IN_PLACE exists for collective operations */
-#cmakedefine MPI_IN_PLACE_EXISTS
+/* Use threads_mpi for parallelization */
+#cmakedefine GMX_THREAD_MPI
 
+#if defined GMX_LIB_MPI || defined GMX_THREAD_MPI
 /* Make a parallel version of GROMACS using message passing
    (MPI or thread_mpi) */
-#cmakedefine GMX_MPI
+#define GMX_MPI
+#endif
 
-/* Use threads_mpi for parallelization */
-#cmakedefine GMX_THREAD_MPI
+/* MPI_IN_PLACE exists for collective operations */
+#cmakedefine MPI_IN_PLACE_EXISTS
 
 /* Use OpenMP multithreading */
 #cmakedefine GMX_OPENMP
 
-/* Ignore calls to nice(3) */
-#cmakedefine GMX_NO_NICE
+/* Can and should use nice(3) to set priority */
+#cmakedefine GMX_USE_NICE
+
+/* Maximum number of OpenMP threads supported */
+#define GMX_OPENMP_MAX_THREADS @GMX_OPENMP_MAX_THREADS@
 
 /* Use if can't rename checkpoints */
 #cmakedefine GMX_NO_RENAME
 
-/* Ignore calls to system(3) */
-#cmakedefine GMX_NO_SYSTEM
-
 /* Use (modified) Gamess-UK for QM-MM calculations */
 #cmakedefine GMX_QMMM_GAMESS
 
 #cmakedefine TMPI_ATOMICS
 
 /* Define for busy wait option  */
+/* See gmxpre-config.h.cmakein for explanation for the #ifdef */
+#ifndef TMPI_WAIT_FOR_NO_ONE
 #cmakedefine TMPI_WAIT_FOR_NO_ONE
+#endif
 
 /* Define for copy buffer option */
 #cmakedefine TMPI_COPY_BUFFER
 /* Use GPU native acceleration */
 #cmakedefine GMX_GPU
 
+/* Use NVML */
+#cmakedefine HAVE_NVML
+
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #cmakedefine HAVE_FSEEKO
 
 /* Define if SIGUSR1 is present */
 #cmakedefine HAVE_SIGUSR1
 
-/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-#cmakedefine _LARGEFILE_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#cmakedefine _LARGE_FILES
-
-/* Some systems requires this to be set to 64 for large file support */
-#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
-
-/* Build special-purpose mdrun library */
-#cmakedefine GMX_FAHCORE   
-
 /* Enable gromacs quotes */
 #cmakedefine GMX_COOL_QUOTES
 
-#ifdef GMX_FAHCORE
-#define FULLINDIRECT 1
-#define USE_FAH_XDR  1
-#include "swindirect.h"
-#endif
-
 /* default name mangling maybe wrong on exotic plattforms */
 #define F77_FUNC(name,NAME) name ## _
 
 /* Define if we have pipes */
 #cmakedefine HAVE_PIPES
 
+/* Define if we have feenableexcept */
+#cmakedefine HAVE_FEENABLEEXCEPT
+
 /* Define if we have zlib */
 #cmakedefine HAVE_ZLIB
 
-#endif
-
 /*! \endcond */
+
+#endif
index c71140f3b97bbb7020ea6489137e090e2eee1b71..8267fea6b070684dfa4fd5971ca5b94af4f5cc0b 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
-#include "main.h"
+
 #include "macros.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "sysstuff.h"
 #include "txtdump.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/utility/smalloc.h"
@@ -54,7 +53,7 @@
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trnio.h"
 #include "txtdump.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 
 static char *nm[5]  = { "OW", "HW1", "HW2", "DW", "SW" };
   
@@ -138,9 +137,9 @@ static void list_trn(char *fn)
 int main(int argc,char *argv[])
 {
   static char *desc[] = {
-    "[TT]gmxdump[tt] reads a run input file ([TT].tpa[tt]/[TT].tpr[tt]/[TT].tpb[tt]),",
-    "a trajectory ([TT].trj[tt]/[TT].trr[tt]/[TT].xtc[tt]) or an energy",
-    "file ([TT].ene[tt]/[TT].edr[tt]) and prints that to standard",
+    "[TT]gmxdump[tt] reads a run input file ([TT].tpr[tt]),",
+    "a trajectory ([TT].trr[tt]/[TT].xtc[tt]) or an energy",
+    "file ([TT].edr[tt]) and prints that to standard",
     "output in a readable format. This program is essential for",
     "checking your run input file in case of problems.[PAR]"
   };
index 371156f7ee24ea4053201ccff219411d82f9a61b..ac2066f0582b561f6e65c30c8863e246d35cc9ce 100644 (file)
@@ -37,8 +37,7 @@
 #endif
 
 #include "typedefs.h"
-#include "main.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 #include "txtdump.h"
 
 void calc_force(int natom,rvec f[],rvec fff[])
index 923319e4e3652e491783b1f930ce185d6578c08b..0f1e4e4d83254f9c7106097791d89ae10a95b30e 100644 (file)
 #include "ns.h"
 #include "gromacs/utility/smalloc.h"
 #include "wnblist.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "gromacs/fileio/confio.h"
-#include "pbc.h"
-#include "vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/math/vec.h"
 
 int main(int argc,char *argv[])
 {
index 23459e1c55ea603e7a8b287fbf7273bd105cbea4..80474afb71aa50254b82b340ac4b8a854b94cec7 100644 (file)
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "mshift.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
-#include "gromacs/fileio/matio.h"
-#include "index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/topology/index.h"
 #include "gstat.h"
 #include "gromacs/fileio/tpxio.h"
 #include "viewit.h"
 #include "gbutil.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
 
@@ -226,7 +223,7 @@ int main(int argc,char *argv[])
 #define NFILE asize(fnm)
     
     CopyRight(stderr,argv[0]);
-    parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT | PCA_BE_NICE ,
+    parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT,
                      NFILE,fnm, asize(pa),pa, asize(desc),desc,
                      asize(bugs),bugs,&oenv
        );
@@ -350,9 +347,6 @@ int main(int argc,char *argv[])
                out=gmx_ffopen(TrjoutFile,filemode);
                break;
        }
-       if (outftp == efG87)
-           fprintf(gmx_fio_getfp(trx_get_fileio(trxout)),"Generated by %s. #atoms=%d, a BOX is"
-                   " stored in this file.\n",ShortProgram(),nout);
     }
     
     if (natoms > atoms->nr) {
index 5bea7c5fea22ac165ce693f6a8221f040f794897..fce2869ebb926dfdd4b76b03f1098ab510307429 100644 (file)
 
 #include <stdlib.h>
 #include "errno.h"
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "gromacs/utility/cstringutil.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "mshift.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gstat.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
 #include "gromacs/fileio/pdbio.h"
 
 void cat(FILE *out,char *fn,real t)
@@ -121,7 +119,7 @@ int main(int argc,char *argv[])
 #define NFILE asize(fnm)
 
   CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_BE_NICE ,NFILE,fnm,
+  parse_common_args(&argc,argv,PCA_CAN_TIME,NFILE,fnm,
                    asize(pa),pa,asize(desc),desc,asize(bugs),bugs);
                    
   top=read_top(ftp2fn(efTPX,NFILE,fnm));
index bd625ce29b4bd314c387cc1a63c527bce6168293..31c6870bb89b82c82ed7166fbca0e0869300698a 100644 (file)
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "random.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/futil.h"
-#include "physics.h"
-#include "xvgr.h"
-#include "vec.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/math/units.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/math/vec.h"
 #include "names.h"
 #include "ehdata.h"
 #include "gromacs/fileio/pdbio.h"
index f0f5d2c85ecb74896b7f3b5a9c31492635ff2342..4bc06da790f45cf8f0853bf628769f221f25c417 100644 (file)
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "random.h"
 #include "gromacs/fileio/strdb.h"
-#include "gromacs/fileio/futil.h"
-#include "physics.h"
+#include "gromacs/utility/futil.h"
 #include "ehdata.h"
 
 typedef struct {
index 39ac52b22e92bec7f82bf2ac4c64f5aaa57c65b1..d5510ecb5d3a3fc88d1b06d2ee6b3aac84ae1431 100644 (file)
 #include "macros.h"
 #include "copyrite.h"
 #include "gromacs/commandline/pargs.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "random.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/futil.h"
-#include "physics.h"
-#include "xvgr.h"
-#include "vec.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "names.h"
 #include "ehdata.h"
 
@@ -673,7 +672,7 @@ int main(int argc,char *argv[])
   int seed;
   
   CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv,PCA_BE_NICE,NFILE,fnm,
+  parse_common_args(&argc,argv,0,NFILE,fnm,
                    NPA,pa,asize(desc),desc,0,NULL);
   please_cite(stdout,"Timneanu2004a");
   
index 175b95cce4247bb8e7a5e6d5d8e4543d87447200..5646ab9a865a352f3a5c18c3f4ba0fe0379ccf1c 100644 (file)
 #include <config.h>
 #endif
 
-#include "sysstuff.h"
 #include "gromacs/utility/smalloc.h"
 #include "macros.h"
 #include "gromacs/commandline/pargs.h"
 #include "random.h"
 #include "names.h"
 #include "gromacs/fileio/matio.h"
-#include "physics.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/futil.h"
 #include "copyrite.h"
-#include "xvgr.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 
 int main(int argc,char *argv[])
@@ -94,7 +91,7 @@ int main(int argc,char *argv[])
 
   
   CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_BE_NICE ,NFILE,fnm,
+  parse_common_args(&argc,argv,PCA_CAN_TIME,NFILE,fnm,
                    asize(pa),pa,asize(desc),desc,0,NULL);
 
   top    = read_top(ftp2fn(efTPX,NFILE,fnm));
index a0942f7cb883a2aeab75e9bb09a8be2637cf379f..6c8f1bc7fab4a801314c4540755d8922b01f2dd0 100644 (file)
@@ -39,7 +39,7 @@
 #include "copyrite.h"
 #include "typedefs.h"
 #include "macros.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/commandline/pargs.h"
 #include "coulomb.h"
 
@@ -759,7 +759,7 @@ int main(int argc,char *argv[])
   int  eel=0,m=0;
   
   CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+  parse_common_args(&argc,argv,PCA_CAN_VIEW | PCA_CAN_TIME,
                    NFILE,fnm,NPA,pa,asize(desc),desc,0,NULL);
   
   if (strcmp(opt[0],"cut") == 0) 
index 03bbf17d5c3f198aabf0765717ed3eacddd73ff2..6950dd02d02294c589a0dc1b1e9dee43bb229edf 100644 (file)
 
 #include <math.h>
 
-#include "sysstuff.h"
 #include "typedefs.h"
 #include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "rmpbc.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
 #include "copyrite.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
-#include "index.h"
+#include "gromacs/topology/index.h"
 #include "gromacs/utility/smalloc.h"
 #include "nrnb.h"
 #include "gstat.h"
-#include "gromacs/fileio/matio.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 #define G_REF1      0
@@ -723,7 +721,7 @@ int gmx_sdf(int argc,char *argv[])
 #define NFILE asize(fnm)
   
   CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_BE_NICE,
+  parse_common_args(&argc,argv,PCA_CAN_TIME,
                     NFILE,fnm,NPA,pa,asize(desc),desc,0,NULL,&oenv);
 
 
index 1896bd00a6f4d6f65945cdc87265aaeaa239c7f6..e9091879bff4202dffaba61ae2a59b24f50644a3 100644 (file)
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include "typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 #include "gmx_random.h"
 #include "gmx_statistics.h"
 
index 986044be95bc23e7408cf1c4f9c3bdd9eb98e4e5..bd477eb91b52e89ae0e954da4e6acd82facfa5ab 100644 (file)
 
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
-#include "symtab.h"
 #include "gromacs/utility/smalloc.h"
-#include "symtab.h"
+#include "gromacs/topology/symtab.h"
 #include "macros.h"
 #include "copyrite.h"
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 #include "typedefs.h"
 #include "gbutil.h"
-#include "physics.h"
-#include "atomprop.h"
+#include "gromacs/math/units.h"
 
 void copy_atom(t_symtab *tab,t_atoms *a1,int i1,t_atoms *a2,int i2,
               rvec xin[],rvec xout[],rvec vin[],rvec vout[])
index 315fc5e6caeaf0209b5526658b07eaae58dacb5b..6fc113b603368689326461ec115fa42948f6ce28 100644 (file)
@@ -44,7 +44,7 @@
 #include "macros.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/confio.h"
-#include "vec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
 #include "gromacs/fileio/pdbio.h"
index 91fb0657ab5e47c6c73632dc3fd39700979405fd..a60b847cdd9b881be02bcde7221ec663c71cf627 100644 (file)
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/fileio/pdbio.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "pbc.h"
-#include "physics.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/math/units.h"
 #include "names.h"
 #include "txtdump.h"
 #include "gromacs/fileio/trnio.h"
-#include "symtab.h"
+#include "gromacs/topology/symtab.h"
 #include "gromacs/fileio/strdb.h"
-#include "atomprop.h"
 #include "gromacs/fileio/confio.h"
 
 #define TET   109.47
index 3bea84f5d96fe1da230d6d2de07681ea1d8b88b8..865f4b8b476812af1f80dfba784ccab4e7fcfcdc 100644 (file)
 #include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
 #include "copyrite.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/fileio/xvgr.h"
+#include "viewit.h"
 #include "gromacs/fileio/pdbio.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "pbc.h"
-#include "physics.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/units.h"
 #include "names.h"
 #include "txtdump.h"
 #include "gromacs/fileio/trnio.h"
-#include "symtab.h"
 #include "gromacs/fileio/confio.h"
 
 real pot(real x,real qq,real c6,real c12)
index b2e52fe23dca5452144fd81e9d10cdc5b5eb1b3a..c7f2849314adaa097ab13e7b4c0ae087812e270f 100644 (file)
@@ -1,4 +1,4 @@
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 void my_func(char *msg)
 {
index b97146db75b4b265a3a16d2621d00df88623c347..1f2f4936ac1fb2ea590c9e78a4bb543108145f59 100644 (file)
@@ -37,7 +37,7 @@
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "complex.h"
 #include "fftgrid.h"
 #include "mdrun.h"
index 247a7cd85334864e48957f91a84cb3b002a57ef8..f470e974c279eaf985b44eb302ad79aaa729a109 100644 (file)
@@ -35,8 +35,8 @@
 #include <math.h>
 #include <string.h>
 #include "typedefs.h"
-#include "vec.h"
-#include "physics.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/units.h"
 #include "macros.h"
 #include "names.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/writeps.h"
 #include "copyrite.h"
-#include "xvgr.h"
-#include "minvert.h"
 #include "pppm.h"
 #include "readinp.h"
-#include "main.h"
 #include "force.h"
 #include "nrnb.h"
 #include "coulomb.h"
-#include "mshift.h"
+#include "gromacs/pbcutil/mshift.h"
 #include "poisson.h"
 #include "mdatoms.h"
 
index 017604b6152ea7f6c395fd08dc088bf84bfb32c0..88811810af7d9208d6de84d642a0eebb8c0f16dc 100644 (file)
@@ -39,7 +39,7 @@
 #include "typedefs.h"
 #include "macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
+#include "gromacs/fileio/xvgr.h"
 #include "copyrite.h"
 #include "mdrun.h"
 #include "main.h"
@@ -87,8 +87,7 @@ int main(int argc,char *argv[])
   cr = init_par(&argc,&argv);
   if (MASTER(cr))
     CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv,
-                   PCA_CAN_SET_DEFFNM | (MASTER(cr) ? 0 : PCA_QUIET),
+  parse_common_args(&argc,argv, PCA_CAN_SET_DEFFNM,
                    NFILE,fnm,asize(pa),pa,0,NULL,0,NULL);
   gmx_log_open(ftp2fn(efLOG,NFILE,fnm),cr,1,0,&fplog);
 
index ad2a03b0bb1af9e57639ecb9c0edc2409d4e995c..24cfcc74ca516e114f26420e32f9dbc2e2a009b3 100644 (file)
@@ -1,2 +1,4 @@
-* !filter
+# Only recent versions of git support pattern matching rules that would allow
+# the first to be conveniently specified in the main .gitattributes file.
+*                               -filter -gmx-doxygen
 gmock-1.7.0/CMakeLists.txt      filter=copyright
index 3468b659a5b9e623b6dd5dc6f84088a387474444..f5f110209dae425979d17c947d46ed791fc77742 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <assert.h>
 
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 
 /* We only use the C interface of ThreeFry and r123array2x64. This file is a
    replacment for the original from the Random123 distribution. It sets all
@@ -49,7 +49,7 @@
 /* For "inline" use the Gromacs own gmx_inline */
 #define R123_STATIC_INLINE static gmx_inline
 /* force_inline isn't used in Gromacs - if it matters for a compiler it probably
-   not only matters here and should be defined in simple.h */
+   not only matters here and should be defined in basedefinitions.h */
 #define R123_FORCE_INLINE(decl) decl
 /* We assume in Gromacs that assert is available outside of Cuda */
 #define R123_ASSERT assert
index a41bac446d5a98edc01163b884ed118f676425c3..2f193803f39bd25aa642a2b46a85392174853706 100644 (file)
@@ -2,14 +2,16 @@ Steps to produce minimal version of BOOST:
 1) Download Boost (current minimal version is derived from 1.55.0)
 2) Extract
 3) Edit Boost files to uncomment unnessary includes (search for GMX in minimal version and copy all changes)
+   Alternative make a patch by diffing against unmodified version and applying patch. Such as
+   diff /path/to/boost_1_55_0 . -rwu |grep -v ^"Only in" > patch && patch -p? < patch
 4) Make sure our subset works even with compilers not listed
    among the boost ones (in particular, Fujistu in native mode):
    - Edit config/select_compiler_config.hpp to add the fallback
      to a generic compiler capability file at the end.
    - Add the generic compiler capability file config/compiler/generic.hpp
-5) run bcp with required files (currently exception/all.hpp, scoped_ptr.hpp)
+5) run bcp with required files (currently boost/exception/all.hpp boost/scoped_ptr.hpp)
 6) delete source files which are not required. Currently:
-   - libs/smart_ptr/src/sp_collector.cpp
-   - libs/smart_ptr/src/sp_debug_hooks.cpp
-   Make sure that they are really not needed.If any source files are added make sure to add them to cmake.
+   - libs/smart_ptr/
+   - libs/exception/
+   Make sure that they are really not needed. If any source files are added make sure to add them to cmake.
 
index bb9b86d014e8d3a8025aef12a717a66ddcdd3f0e..3df5b7a3f8e2df0fbdb3b0c380a23faf59e83754 100644 (file)
 
  ************************************************************/
 
-#include "types/simple.h"
-
 #ifndef _fftpack_h
 #define _fftpack_h
 
+#include "gromacs/utility/real.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -53,4 +53,5 @@ extern "C" {
 #ifdef __cplusplus
 }
 #endif
+
 #endif
index c31ccf06877d249fa46135673594ef12ea30d952..b9a0f2aada7b4c3182a86679eea043c33d261234 100644 (file)
@@ -37,8 +37,6 @@
 
 include(gmxGetGmockTupleWorkaround)
 get_gmock_tuple_workaround(GMOCK_COMPILE_DEFINITIONS)
-set(GMOCK_COMPILE_DEFINITIONS "_GNU_SOURCE=1;${GMOCK_COMPILE_DEFINITIONS}")
-set(GMOCK_COMPILE_DEFINITIONS ${GMOCK_COMPILE_DEFINITIONS} PARENT_SCOPE)
 
 # GTest/GMock suggest linking with pthreads when available for thread safety
 set(CMAKE_THREAD_PREFER_PTHREAD 1)
@@ -68,9 +66,11 @@ if (HAS_NO_UNUSED_VARIABLE)
 endif()
 
 add_library(gmock STATIC ${UNITTEST_TARGET_OPTIONS} ${GMOCK_SOURCES} ${GTEST_SOURCES})
-set_property(TARGET gmock APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS};GTEST_CAN_STREAM_RESULTS=0")
+set_property(TARGET gmock APPEND PROPERTY COMPILE_DEFINITIONS
+             "_GNU_SOURCE=1;${GMOCK_COMPILE_DEFINITIONS};GTEST_CAN_STREAM_RESULTS=0")
 
 set(GMOCK_LIBRARIES gmock ${PTHREADS_LIBRARIES} PARENT_SCOPE)
 set(GTEST_LIBRARIES ${GMOCK_LIBRARIES} PARENT_SCOPE)
 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)
index 6fa0a3925e7207b3087e0e3f202f343d4e408043..f76d8bea1eb45d265dbab007a217d826aed1a60c 100644 (file)
@@ -1443,6 +1443,8 @@ AssertionResult CmpHelperEQ(const char* expected_expression,
 # pragma warning(push)          // Saves the current warning state.
 # pragma warning(disable:4389)  // Temporarily disables warning on
                                 // signed/unsigned mismatch.
+# pragma warning(disable:4805)  // Temporarily disables warning on
+                                // unsafe mix of types
 #endif
 
   if (expected == actual) {
diff --git a/src/external/lmfit/README b/src/external/lmfit/README
new file mode 100644 (file)
index 0000000..618129e
--- /dev/null
@@ -0,0 +1,5 @@
+This directory contains only the barebone version of the
+lmfit package, version 5.1. Full version is available from
+http://apps.jcns.fz-juelich.de/doku/sc/lmfit
+
+License in gromacs root directory in file COPYING
diff --git a/src/external/lmfit/lmcurve.c b/src/external/lmfit/lmcurve.c
new file mode 100644 (file)
index 0000000..838f884
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Library:   lmfit (Levenberg-Marquardt least squares fitting)
+ *
+ * File:      lmcurve.c
+ *
+ * Contents:  Levenberg-Marquardt curve-fitting
+ *
+ * Copyright: Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
+ *
+ * License:   see ../COPYING (FreeBSD)
+ *
+ * Homepage:  apps.jcns.fz-juelich.de/lmfit
+ */
+
+#include "lmmin.h"
+#include "gromacs/utility/basedefinitions.h"
+
+typedef struct {
+    const double *t;
+    const double *y;
+    double (*f)(double t, const double *par);
+} lmcurve_data_struct;
+
+
+void lmcurve_evaluate( const double *par, int m_dat, const void *data,
+                       double *fvec, gmx_unused int *info )
+{
+    int i;
+    for (i = 0; i < m_dat; i++)
+    {
+        fvec[i] =
+            ((lmcurve_data_struct*)data)->y[i] -
+            ((lmcurve_data_struct*)data)->f(
+                    ((lmcurve_data_struct*)data)->t[i], par );
+    }
+}
+
+
+void lmcurve( int n_par, double *par, int m_dat,
+              const double *t, const double *y,
+              double (*f)( double t, const double *par ),
+              const lm_control_struct *control,
+              lm_status_struct *status )
+{
+    lmcurve_data_struct data;
+    data.t = t;
+    data.y = y;
+    data.f = f;
+
+    lmmin( n_par, par, m_dat, (const void*) &data,
+           lmcurve_evaluate, control, status );
+}
diff --git a/src/external/lmfit/lmcurve.h b/src/external/lmfit/lmcurve.h
new file mode 100644 (file)
index 0000000..d74114c
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Library:   lmfit (Levenberg-Marquardt least squares fitting)
+ *
+ * File:      lmcurve.h
+ *
+ * Contents:  Declarations for Levenberg-Marquardt curve fitting.
+ *
+ * Copyright: Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
+ *
+ * License:   see ../COPYING (FreeBSD)
+ *
+ * Homepage:  apps.jcns.fz-juelich.de/lmfit
+ */
+
+#ifndef LMCURVE_H
+#define LMCURVE_H
+#undef __BEGIN_DECLS
+#undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS   /* empty */
+#endif
+
+#include "lmstruct.h"
+
+__BEGIN_DECLS
+
+void lmcurve( int n_par, double *par, int m_dat,
+              const double *t, const double *y,
+              double (*f)( double t, const double *par ),
+              const lm_control_struct *control,
+              lm_status_struct *status );
+
+__END_DECLS
+#endif /* LMCURVE_H */
diff --git a/src/external/lmfit/lmmin.c b/src/external/lmfit/lmmin.c
new file mode 100644 (file)
index 0000000..b6b8dfc
--- /dev/null
@@ -0,0 +1,1389 @@
+/*
+ * Library:   lmfit (Levenberg-Marquardt least squares fitting)
+ *
+ * File:      lmmin.c
+ *
+ * Contents:  Levenberg-Marquardt minimization.
+ *
+ * Copyright: MINPACK authors, The University of Chikago (1980-1999)
+ *            Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
+ *
+ * License:   see ../COPYING (FreeBSD)
+ *
+ * Homepage:  apps.jcns.fz-juelich.de/lmfit
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <float.h>
+#include "lmmin.h"
+
+#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
+#define MAX(a, b) (((a) >= (b)) ? (a) : (b))
+#define SQR(x)   (x)*(x)
+
+/* function declarations (implemented below). */
+void lm_lmpar( int n, double *r, int ldr, int *ipvt, double *diag,
+               double *qtb, double delta, double *par, double *x,
+               double *sdiag, double *aux, double *xdi );
+void lm_qrfac( int m, int n, double *a, int *ipvt,
+               double *rdiag, double *acnorm, double *wa );
+void lm_qrsolv( int n, double *r, int ldr, int *ipvt, double *diag,
+                double *qtb, double *x, double *sdiag, double *wa );
+
+
+/*****************************************************************************/
+/*  Numeric constants                                                        */
+/*****************************************************************************/
+
+/* machine-dependent constants from float.h */
+#define LM_MACHEP     DBL_EPSILON   /* resolution of arithmetic */
+#define LM_DWARF      DBL_MIN       /* smallest nonzero number */
+#define LM_SQRT_DWARF sqrt(DBL_MIN) /* square should not underflow */
+#define LM_SQRT_GIANT sqrt(DBL_MAX) /* square should not overflow */
+#define LM_USERTOL    30*LM_MACHEP  /* users are recommended to require this */
+
+/* If the above values do not work, the following seem good for an x86:
+   LM_MACHEP     .555e-16
+   LM_DWARF      9.9e-324
+   LM_SQRT_DWARF 1.e-160
+   LM_SQRT_GIANT 1.e150
+   LM_USER_TOL   1.e-14
+   The following values should work on any machine:
+   LM_MACHEP     1.2e-16
+   LM_DWARF      1.0e-38
+   LM_SQRT_DWARF 3.834e-20
+   LM_SQRT_GIANT 1.304e19
+   LM_USER_TOL   1.e-14
+ */
+
+const lm_control_struct lm_control_double = {
+    LM_USERTOL, LM_USERTOL, LM_USERTOL, LM_USERTOL, 100., 100, 1,
+    NULL, 0, -1, -1
+};
+const lm_control_struct lm_control_float = {
+    1.e-7,      1.e-7,      1.e-7,      1.e-7,      100., 100, 1,
+    NULL, 0, -1, -1
+};
+
+
+/*****************************************************************************/
+/*  Message texts (indexed by status.info)                                   */
+/*****************************************************************************/
+
+const char *lm_infmsg[] = {
+    "found zero (sum of squares below underflow limit)",
+    "converged  (the relative error in the sum of squares is at most tol)",
+    "converged  (the relative error of the parameter vector is at most tol)",
+    "converged  (both errors are at most tol)",
+    "trapped    (by degeneracy; increasing epsilon might help)",
+    "exhausted  (number of function calls exceeding preset patience)",
+    "failed     (ftol<tol: cannot reduce sum of squares any further)",
+    "failed     (xtol<tol: cannot improve approximate solution any further)",
+    "failed     (gtol<tol: cannot improve approximate solution any further)",
+    "crashed    (not enough memory)",
+    "exploded   (fatal coding error: improper input parameters)",
+    "stopped    (break requested within function evaluation)"
+};
+
+const char *lm_shortmsg[] = {
+    "found zero",
+    "converged (f)",
+    "converged (p)",
+    "converged (2)",
+    "degenerate",
+    "call limit",
+    "failed (f)",
+    "failed (p)",
+    "failed (o)",
+    "no memory",
+    "invalid input",
+    "user break"
+};
+
+
+/*****************************************************************************/
+/*  Monitoring auxiliaries.                                                  */
+/*****************************************************************************/
+
+void lm_print_pars( int nout, const double *par, double fnorm, FILE* fout )
+{
+    int i;
+    for (i = 0; i < nout; ++i)
+    {
+        fprintf( fout, " %16.9g", par[i] );
+    }
+    fprintf( fout, " => %18.11g\n", fnorm );
+}
+
+
+/*****************************************************************************/
+/*  lmmin (main minimization routine)                                        */
+/*****************************************************************************/
+
+void lmmin( int n, double *x, int m, const void *data,
+            void (*evaluate) (const double *par, int m_dat, const void *data,
+                              double *fvec, int *userbreak),
+            const lm_control_struct *C, lm_status_struct *S )
+{
+    double       *fvec, *diag, *fjac, *qtf, *wa1, *wa2, *wa3, *wf;
+    int          *ipvt;
+    int           j, i;
+    double        actred, dirder, fnorm, fnorm1, gnorm, pnorm,
+                  prered, ratio, step, sum, temp, temp1, temp2, temp3;
+    static double p0001 = 1.0e-4;
+
+    int           maxfev = C->patience * (n+1);
+
+    int           outer, inner;  /* loop counters, for monitoring */
+    int           inner_success; /* flag for loop control */
+    double        lmpar = 0;     /* Levenberg-Marquardt parameter */
+    double        delta = 0;
+    double        xnorm = 0;
+    double        eps   = sqrt(MAX(C->epsilon, LM_MACHEP)); /* for forward differences */
+
+    int           nout = C->n_maxpri == -1 ? n : MIN( C->n_maxpri, n );
+
+    /* The workaround msgfile=NULL is needed for default initialization */
+    FILE* msgfile = C->msgfile ? C->msgfile : stdout;
+
+    /* Default status info; must be set ahead of first return statements */
+    S->outcome   = 0; /* status code */
+    S->userbreak = 0;
+    S->nfev      = 0; /* function evaluation counter */
+
+/***  Check input parameters for errors.  ***/
+
+    if (n <= 0)
+    {
+        fprintf( stderr, "lmmin: invalid number of parameters %i\n", n );
+        S->outcome = 10; /* invalid parameter */
+        return;
+    }
+    if (m < n)
+    {
+        fprintf( stderr, "lmmin: number of data points (%i) "
+                 "smaller than number of parameters (%i)\n", m, n );
+        S->outcome = 10;
+        return;
+    }
+    if (C->ftol < 0. || C->xtol < 0. || C->gtol < 0.)
+    {
+        fprintf( stderr,
+                 "lmmin: negative tolerance (at least one of %g %g %g)\n",
+                 C->ftol, C->xtol, C->gtol );
+        S->outcome = 10;
+        return;
+    }
+    if (maxfev <= 0)
+    {
+        fprintf( stderr, "lmmin: nonpositive function evaluations limit %i\n",
+                 maxfev );
+        S->outcome = 10;
+        return;
+    }
+    if (C->stepbound <= 0.)
+    {
+        fprintf( stderr, "lmmin: nonpositive stepbound %g\n", C->stepbound );
+        S->outcome = 10;
+        return;
+    }
+    if (C->scale_diag != 0 && C->scale_diag != 1)
+    {
+        fprintf( stderr, "lmmin: logical variable scale_diag=%i, "
+                 "should be 0 or 1\n", C->scale_diag );
+        S->outcome = 10;
+        return;
+    }
+
+/***  Allocate work space.  ***/
+    fvec = diag = fjac = qtf = wa1 = wa2 = wa3 = wf = NULL;
+    ipvt = NULL;
+    if ( (fvec = (double *) malloc(m * sizeof(double))) == NULL ||
+         (diag = (double *) malloc(n * sizeof(double))) == NULL ||
+         (qtf  = (double *) malloc(n * sizeof(double))) == NULL ||
+         (fjac = (double *) malloc(n*m*sizeof(double))) == NULL ||
+         (wa1  = (double *) malloc(n * sizeof(double))) == NULL ||
+         (wa2  = (double *) malloc(n * sizeof(double))) == NULL ||
+         (wa3  = (double *) malloc(n * sizeof(double))) == NULL ||
+         (wf  = (double *)  malloc(m * sizeof(double))) == NULL ||
+         (ipvt = (int *)    malloc(n * sizeof(int)   )) == NULL)
+    {
+        S->outcome = 9;
+        if (NULL != fvec)
+        {
+            free(fvec);
+        }
+        if (NULL != diag)
+        {
+            free(diag);
+        }
+        if (NULL != qtf)
+        {
+            free(qtf);
+        }
+        if (NULL != fjac)
+        {
+            free(fjac);
+        }
+        if (NULL != wa1)
+        {
+            free(wa1);
+        }
+        if (NULL != wa2)
+        {
+            free(wa2);
+        }
+        if (NULL != wa3)
+        {
+            free(wa3);
+        }
+        if (NULL != wf)
+        {
+            free(wf);
+        }
+        if (NULL != ipvt)
+        {
+            free(ipvt);
+        }
+        return;
+    }
+
+    if (!C->scale_diag)
+    {
+        for (j = 0; j < n; j++)
+        {
+            diag[j] = 1.;
+        }
+    }
+
+/***  Evaluate function at starting point and calculate norm.  ***/
+
+    (*evaluate)( x, m, data, fvec, &(S->userbreak) );
+    S->nfev = 1;
+    if (S->userbreak)
+    {
+        goto terminate;
+    }
+    fnorm = lm_enorm(m, fvec);
+    if (C->verbosity)
+    {
+        fprintf( msgfile, "lmmin start " );
+        lm_print_pars( nout, x, fnorm, msgfile );
+    }
+    if (fnorm <= LM_DWARF)
+    {
+        S->outcome = 0; /* sum of squares almost zero, nothing to do */
+        goto terminate;
+    }
+
+/***  The outer loop: compute gradient, then descend.  ***/
+
+    for (outer = 0;; ++outer)
+    {
+
+/***  [outer]  Calculate the Jacobian.  ***/
+
+        for (j = 0; j < n; j++)
+        {
+            temp  = x[j];
+            step  = MAX(eps*eps, eps * fabs(temp));
+            x[j] += step; /* replace temporarily */
+            (*evaluate)( x, m, data, wf, &(S->userbreak) );
+            ++(S->nfev);
+            if (S->userbreak)
+            {
+                goto terminate;
+            }
+            for (i = 0; i < m; i++)
+            {
+                fjac[j*m+i] = (wf[i] - fvec[i]) / step;
+            }
+            x[j] = temp; /* restore */
+        }
+        if (C->verbosity >= 10)
+        {
+            /* print the entire matrix */
+            printf("\nlmmin Jacobian\n");
+            for (i = 0; i < m; i++)
+            {
+                printf("  ");
+                for (j = 0; j < n; j++)
+                {
+                    printf("%.5e ", fjac[j*m+i]);
+                }
+                printf("\n");
+            }
+        }
+
+/***  [outer]  Compute the QR factorization of the Jacobian.  ***/
+
+/*      fjac is an m by n array. The upper n by n submatrix of fjac
+ *        is made to contain an upper triangular matrix r with diagonal
+ *        elements of nonincreasing magnitude such that
+ *
+ *              p^T*(jac^T*jac)*p = r^T*r
+ *
+ *              (NOTE: ^T stands for matrix transposition),
+ *
+ *        where p is a permutation matrix and jac is the final calculated
+ *        Jacobian. Column j of p is column ipvt(j) of the identity matrix.
+ *        The lower trapezoidal part of fjac contains information generated
+ *        during the computation of r.
+ *
+ *      ipvt is an integer array of length n. It defines a permutation
+ *        matrix p such that jac*p = q*r, where jac is the final calculated
+ *        Jacobian, q is orthogonal (not stored), and r is upper triangular
+ *        with diagonal elements of nonincreasing magnitude. Column j of p
+ *        is column ipvt(j) of the identity matrix.
+ */
+
+        lm_qrfac(m, n, fjac, ipvt, wa1, wa2, wa3);
+        /* return values are ipvt, wa1=rdiag, wa2=acnorm */
+
+/***  [outer]  Form q^T * fvec and store first n components in qtf.  ***/
+
+        for (i = 0; i < m; i++)
+        {
+            wf[i] = fvec[i];
+        }
+
+        for (j = 0; j < n; j++)
+        {
+            temp3 = fjac[j*m+j];
+            if (temp3 != 0.)
+            {
+                sum = 0;
+                for (i = j; i < m; i++)
+                {
+                    sum += fjac[j*m+i] * wf[i];
+                }
+                temp = -sum / temp3;
+                for (i = j; i < m; i++)
+                {
+                    wf[i] += fjac[j*m+i] * temp;
+                }
+            }
+            fjac[j*m+j] = wa1[j];
+            qtf[j]      = wf[j];
+        }
+
+/***  [outer]  Compute norm of scaled gradient and detect degeneracy.  ***/
+
+        gnorm = 0;
+        for (j = 0; j < n; j++)
+        {
+            if (wa2[ipvt[j]] == 0)
+            {
+                continue;
+            }
+            sum = 0.;
+            for (i = 0; i <= j; i++)
+            {
+                sum += fjac[j*m+i] * qtf[i];
+            }
+            gnorm = MAX( gnorm, fabs( sum / wa2[ipvt[j]] / fnorm ) );
+        }
+
+        if (gnorm <= C->gtol)
+        {
+            S->outcome = 4;
+            goto terminate;
+        }
+
+/***  [outer]  Initialize / update diag and delta. ***/
+
+        if (!outer)
+        {
+            /* first iteration only */
+            if (C->scale_diag)
+            {
+                /* diag := norms of the columns of the initial Jacobian */
+                for (j = 0; j < n; j++)
+                {
+                    diag[j] = wa2[j] ? wa2[j] : 1;
+                }
+                /* xnorm := || D x || */
+                for (j = 0; j < n; j++)
+                {
+                    wa3[j] = diag[j] * x[j];
+                }
+                xnorm = lm_enorm(n, wa3);
+                if (C->verbosity >= 2)
+                {
+                    fprintf( msgfile, "lmmin diag  " );
+                    lm_print_pars( nout, x, xnorm, msgfile );
+                }
+                /* only now print the header for the loop table */
+                if (C->verbosity >= 3)
+                {
+                    fprintf( msgfile, "  o  i     lmpar    prered"
+                             "          ratio    dirder      delta"
+                             "      pnorm                 fnorm" );
+                    for (i = 0; i < nout; ++i)
+                    {
+                        fprintf( msgfile, "               p%i", i );
+                    }
+                    fprintf( msgfile, "\n" );
+                }
+            }
+            else
+            {
+                xnorm = lm_enorm(n, x);
+            }
+            /* initialize the step bound delta. */
+            if (xnorm)
+            {
+                delta = C->stepbound * xnorm;
+            }
+            else
+            {
+                delta = C->stepbound;
+            }
+        }
+        else
+        {
+            if (C->scale_diag)
+            {
+                for (j = 0; j < n; j++)
+                {
+                    diag[j] = MAX( diag[j], wa2[j] );
+                }
+            }
+        }
+
+/***  The inner loop. ***/
+        inner = 0;
+        do
+        {
+
+/***  [inner]  Determine the Levenberg-Marquardt parameter.  ***/
+
+            lm_lmpar( n, fjac, m, ipvt, diag, qtf, delta, &lmpar,
+                      wa1, wa2, wf, wa3 );
+            /* used return values are fjac (partly), lmpar, wa1=x, wa3=diag*x */
+
+            /* predict scaled reduction */
+            pnorm = lm_enorm(n, wa3);
+            temp2 = lmpar * SQR( pnorm / fnorm );
+            for (j = 0; j < n; j++)
+            {
+                wa3[j] = 0;
+                for (i = 0; i <= j; i++)
+                {
+                    wa3[i] -= fjac[j*m+i] * wa1[ipvt[j]];
+                }
+            }
+            temp1  = SQR( lm_enorm(n, wa3) / fnorm );
+            prered = temp1 + 2 * temp2;
+            dirder = -temp1 + temp2; /* scaled directional derivative */
+
+            /* at first call, adjust the initial step bound. */
+            if (!outer && pnorm < delta)
+            {
+                delta = pnorm;
+            }
+
+/***  [inner]  Evaluate the function at x + p.  ***/
+
+            for (j = 0; j < n; j++)
+            {
+                wa2[j] = x[j] - wa1[j];
+            }
+
+            (*evaluate)( wa2, m, data, wf, &(S->userbreak) );
+            ++(S->nfev);
+            if (S->userbreak)
+            {
+                goto terminate;
+            }
+            fnorm1 = lm_enorm(m, wf);
+
+/***  [inner]  Evaluate the scaled reduction.  ***/
+
+            /* actual scaled reduction */
+            actred = 1 - SQR(fnorm1/fnorm);
+
+            /* ratio of actual to predicted reduction */
+            ratio = prered ? actred/prered : 0;
+
+            if (C->verbosity == 2)
+            {
+                fprintf( msgfile, "lmmin (%i:%i) ", outer, inner );
+                lm_print_pars( nout, wa2, fnorm1, msgfile );
+            }
+            else if (C->verbosity >= 3)
+            {
+                printf( "%3i %2i %9.2g %9.2g %14.6g"
+                        " %9.2g %10.3e %10.3e %21.15e",
+                        outer, inner, lmpar, prered, ratio,
+                        dirder, delta, pnorm, fnorm1 );
+                for (i = 0; i < nout; ++i)
+                {
+                    fprintf( msgfile, " %16.9g", wa2[i] );
+                }
+                fprintf( msgfile, "\n" );
+            }
+
+            /* update the step bound */
+            if        (ratio <= 0.25)
+            {
+                if      (actred >= 0)
+                {
+                    temp = 0.5;
+                }
+                else if (actred > -99)   /* -99 = 1-1/0.1^2 */
+                {
+                    temp = MAX( dirder / (2*dirder + actred), 0.1 );
+                }
+                else
+                {
+                    temp = 0.1;
+                }
+                delta  = temp * MIN(delta, pnorm / 0.1);
+                lmpar /= temp;
+            }
+            else if (ratio >= 0.75)
+            {
+                delta  = 2*pnorm;
+                lmpar *= 0.5;
+            }
+            else if (!lmpar)
+            {
+                delta = 2*pnorm;
+            }
+
+/***  [inner]  On success, update solution, and test for convergence.  ***/
+
+            inner_success = ratio >= p0001;
+            if (inner_success)
+            {
+
+                /* update x, fvec, and their norms */
+                if (C->scale_diag)
+                {
+                    for (j = 0; j < n; j++)
+                    {
+                        x[j]   = wa2[j];
+                        wa2[j] = diag[j] * x[j];
+                    }
+                }
+                else
+                {
+                    for (j = 0; j < n; j++)
+                    {
+                        x[j] = wa2[j];
+                    }
+                }
+                for (i = 0; i < m; i++)
+                {
+                    fvec[i] = wf[i];
+                }
+                xnorm = lm_enorm(n, wa2);
+                fnorm = fnorm1;
+            }
+
+            /* convergence tests */
+            S->outcome = 0;
+            if (fnorm <= LM_DWARF)
+            {
+                goto terminate;  /* success: sum of squares almost zero */
+            }
+            /* test two criteria (both may be fulfilled) */
+            if (fabs(actred) <= C->ftol && prered <= C->ftol && ratio <= 2)
+            {
+                S->outcome = 1;  /* success: x almost stable */
+            }
+            if (delta <= C->xtol * xnorm)
+            {
+                S->outcome += 2; /* success: sum of squares almost stable */
+            }
+            if (S->outcome != 0)
+            {
+                goto terminate;
+            }
+
+/***  [inner]  Tests for termination and stringent tolerances.  ***/
+
+            if (S->nfev >= maxfev)
+            {
+                S->outcome = 5;
+                goto terminate;
+            }
+            if (fabs(actred) <= LM_MACHEP &&
+                prered <= LM_MACHEP && ratio <= 2)
+            {
+                S->outcome = 6;
+                goto terminate;
+            }
+            if (delta <= LM_MACHEP*xnorm)
+            {
+                S->outcome = 7;
+                goto terminate;
+            }
+            if (gnorm <= LM_MACHEP)
+            {
+                S->outcome = 8;
+                goto terminate;
+            }
+
+/***  [inner]  End of the loop. Repeat if iteration unsuccessful.  ***/
+
+            ++inner;
+        }
+        while (!inner_success);
+
+/***  [outer]  End of the loop. ***/
+
+    }
+    ;
+
+terminate:
+    S->fnorm = lm_enorm(m, fvec);
+    if (C->verbosity >= 2)
+    {
+        printf("lmmin outcome (%i) xnorm %g ftol %g xtol %g\n",
+               S->outcome, xnorm, C->ftol, C->xtol );
+    }
+    if (C->verbosity & 1)
+    {
+        fprintf( msgfile, "lmmin final " );
+        lm_print_pars( nout, x, S->fnorm, msgfile );
+    }
+    if (S->userbreak)   /* user-requested break */
+    {
+        S->outcome = 11;
+    }
+
+/***  Deallocate the workspace.  ***/
+    free(fvec);
+    free(diag);
+    free(qtf);
+    free(fjac);
+    free(wa1);
+    free(wa2);
+    free(wa3);
+    free(wf);
+    free(ipvt);
+
+} /*** lmmin. ***/
+
+
+/*****************************************************************************/
+/*  lm_lmpar (determine Levenberg-Marquardt parameter)                       */
+/*****************************************************************************/
+
+void lm_lmpar(int n, double *r, int ldr, int *ipvt, double *diag,
+              double *qtb, double delta, double *par, double *x,
+              double *sdiag, double *aux, double *xdi)
+{
+/*     Given an m by n matrix a, an n by n nonsingular diagonal
+ *     matrix d, an m-vector b, and a positive number delta,
+ *     the problem is to determine a value for the parameter
+ *     par such that if x solves the system
+ *
+ *          a*x = b  and  sqrt(par)*d*x = 0
+ *
+ *     in the least squares sense, and dxnorm is the euclidean
+ *     norm of d*x, then either par=0 and (dxnorm-delta) < 0.1*delta,
+ *     or par>0 and abs(dxnorm-delta) < 0.1*delta.
+ *
+ *     Using lm_qrsolv, this subroutine completes the solution of the problem
+ *     if it is provided with the necessary information from the
+ *     qr factorization, with column pivoting, of a. That is, if
+ *     a*p = q*r, where p is a permutation matrix, q has orthogonal
+ *     columns, and r is an upper triangular matrix with diagonal
+ *     elements of nonincreasing magnitude, then lmpar expects
+ *     the full upper triangle of r, the permutation matrix p,
+ *     and the first n components of qT*b. On output
+ *     lmpar also provides an upper triangular matrix s such that
+ *
+ *          p^T*(a^T*a + par*d*d)*p = s^T*s.
+ *
+ *     s is employed within lmpar and may be of separate interest.
+ *
+ *     Only a few iterations are generally needed for convergence
+ *     of the algorithm. If, however, the limit of 10 iterations
+ *     is reached, then the output par will contain the best
+ *     value obtained so far.
+ *
+ *     parameters:
+ *
+ *      n is a positive integer input variable set to the order of r.
+ *
+ *      r is an n by n array. on input the full upper triangle
+ *        must contain the full upper triangle of the matrix r.
+ *        on OUTPUT the full upper triangle is unaltered, and the
+ *        strict lower triangle contains the strict upper triangle
+ *        (transposed) of the upper triangular matrix s.
+ *
+ *      ldr is a positive integer input variable not less than n
+ *        which specifies the leading dimension of the array r.
+ *
+ *      ipvt is an integer input array of length n which defines the
+ *        permutation matrix p such that a*p = q*r. column j of p
+ *        is column ipvt(j) of the identity matrix.
+ *
+ *      diag is an input array of length n which must contain the
+ *        diagonal elements of the matrix d.
+ *
+ *      qtb is an input array of length n which must contain the first
+ *        n elements of the vector (q transpose)*b.
+ *
+ *      delta is a positive input variable which specifies an upper
+ *        bound on the euclidean norm of d*x.
+ *
+ *      par is a nonnegative variable. on input par contains an
+ *        initial estimate of the levenberg-marquardt parameter.
+ *        on OUTPUT par contains the final estimate.
+ *
+ *      x is an OUTPUT array of length n which contains the least
+ *        squares solution of the system a*x = b, sqrt(par)*d*x = 0,
+ *        for the output par.
+ *
+ *      sdiag is an array of length n needed as workspace; on OUTPUT
+ *        it contains the diagonal elements of the upper triangular matrix s.
+ *
+ *      aux is a multi-purpose work array of length n.
+ *
+ *      xdi is a work array of length n. On OUTPUT: diag[j] * x[j].
+ *
+ */
+    int           i, iter, j, nsing;
+    double        dxnorm, fp, fp_old, gnorm, parc, parl, paru;
+    double        sum, temp;
+    static double p1 = 0.1;
+
+/*** lmpar: compute and store in x the gauss-newton direction. if the
+     jacobian is rank-deficient, obtain a least squares solution. ***/
+
+    nsing = n;
+    for (j = 0; j < n; j++)
+    {
+        aux[j] = qtb[j];
+        if (r[j * ldr + j] == 0 && nsing == n)
+        {
+            nsing = j;
+        }
+        if (nsing < n)
+        {
+            aux[j] = 0;
+        }
+    }
+    for (j = nsing - 1; j >= 0; j--)
+    {
+        aux[j] = aux[j] / r[j + ldr * j];
+        temp   = aux[j];
+        for (i = 0; i < j; i++)
+        {
+            aux[i] -= r[j * ldr + i] * temp;
+        }
+    }
+
+    for (j = 0; j < n; j++)
+    {
+        x[ipvt[j]] = aux[j];
+    }
+
+/*** lmpar: initialize the iteration counter, evaluate the function at the
+     origin, and test for acceptance of the gauss-newton direction. ***/
+
+    for (j = 0; j < n; j++)
+    {
+        xdi[j] = diag[j] * x[j];
+    }
+    dxnorm = lm_enorm(n, xdi);
+    fp     = dxnorm - delta;
+    if (fp <= p1 * delta)
+    {
+#ifdef LMFIT_DEBUG_MESSAGES
+        printf("debug lmpar nsing %d n %d, terminate (fp<p1*delta)\n",
+               nsing, n);
+#endif
+        *par = 0;
+        return;
+    }
+
+/*** lmpar: if the jacobian is not rank deficient, the newton
+     step provides a lower bound, parl, for the 0. of
+     the function. otherwise set this bound to 0.. ***/
+
+    parl = 0;
+    if (nsing >= n)
+    {
+        for (j = 0; j < n; j++)
+        {
+            aux[j] = diag[ipvt[j]] * xdi[ipvt[j]] / dxnorm;
+        }
+
+        for (j = 0; j < n; j++)
+        {
+            sum = 0.;
+            for (i = 0; i < j; i++)
+            {
+                sum += r[j * ldr + i] * aux[i];
+            }
+            aux[j] = (aux[j] - sum) / r[j + ldr * j];
+        }
+        temp = lm_enorm(n, aux);
+        parl = fp / delta / temp / temp;
+    }
+
+/*** lmpar: calculate an upper bound, paru, for the 0. of the function. ***/
+
+    for (j = 0; j < n; j++)
+    {
+        sum = 0;
+        for (i = 0; i <= j; i++)
+        {
+            sum += r[j * ldr + i] * qtb[i];
+        }
+        aux[j] = sum / diag[ipvt[j]];
+    }
+    gnorm = lm_enorm(n, aux);
+    paru  = gnorm / delta;
+    if (paru == 0.)
+    {
+        paru = LM_DWARF / MIN(delta, p1);
+    }
+
+/*** lmpar: if the input par lies outside of the interval (parl,paru),
+     set par to the closer endpoint. ***/
+
+    *par = MAX(*par, parl);
+    *par = MIN(*par, paru);
+    if (*par == 0.)
+    {
+        *par = gnorm / dxnorm;
+    }
+
+/*** lmpar: iterate. ***/
+
+    for (iter = 0;; iter++)
+    {
+
+        /** evaluate the function at the current value of par. **/
+
+        if (*par == 0.)
+        {
+            *par = MAX(LM_DWARF, 0.001 * paru);
+        }
+        temp = sqrt(*par);
+        for (j = 0; j < n; j++)
+        {
+            aux[j] = temp * diag[j];
+        }
+
+        lm_qrsolv( n, r, ldr, ipvt, aux, qtb, x, sdiag, xdi );
+        /* return values are r, x, sdiag */
+
+        for (j = 0; j < n; j++)
+        {
+            xdi[j] = diag[j] * x[j]; /* used as output */
+        }
+        dxnorm = lm_enorm(n, xdi);
+        fp_old = fp;
+        fp     = dxnorm - delta;
+
+        /** if the function is small enough, accept the current value
+            of par. Also test for the exceptional cases where parl
+            is zero or the number of iterations has reached 10. **/
+
+        if (fabs(fp) <= p1 * delta
+            || (parl == 0. && fp <= fp_old && fp_old < 0.)
+            || iter == 10)
+        {
+#ifdef LMFIT_DEBUG_MESSAGES
+            printf("debug lmpar nsing %d iter %d "
+                   "par %.4e [%.4e %.4e] delta %.4e fp %.4e\n",
+                   nsing, iter, *par, parl, paru, delta, fp);
+#endif
+            break; /* the only exit from the iteration. */
+        }
+
+        /** compute the Newton correction. **/
+
+        for (j = 0; j < n; j++)
+        {
+            aux[j] = diag[ipvt[j]] * xdi[ipvt[j]] / dxnorm;
+        }
+
+        for (j = 0; j < n; j++)
+        {
+            aux[j] = aux[j] / sdiag[j];
+            for (i = j + 1; i < n; i++)
+            {
+                aux[i] -= r[j * ldr + i] * aux[j];
+            }
+        }
+        temp = lm_enorm(n, aux);
+        parc = fp / delta / temp / temp;
+
+        /** depending on the sign of the function, update parl or paru. **/
+
+        if (fp > 0)
+        {
+            parl = MAX(parl, *par);
+        }
+        else if (fp < 0)
+        {
+            paru = MIN(paru, *par);
+        }
+        /* the case fp==0 is precluded by the break condition  */
+
+        /** compute an improved estimate for par. **/
+
+        *par = MAX(parl, *par + parc);
+
+    }
+
+} /*** lm_lmpar. ***/
+
+/*****************************************************************************/
+/*  lm_qrfac (QR factorization, from lapack)                                 */
+/*****************************************************************************/
+
+void lm_qrfac(int m, int n, double *a, int *ipvt,
+              double *rdiag, double *acnorm, double *wa)
+{
+/*
+ *     This subroutine uses Householder transformations with column
+ *     pivoting (optional) to compute a qr factorization of the
+ *     m by n matrix a. That is, qrfac determines an orthogonal
+ *     matrix q, a permutation matrix p, and an upper trapezoidal
+ *     matrix r with diagonal elements of nonincreasing magnitude,
+ *     such that a*p = q*r. The Householder transformation for
+ *     column k, k = 1,2,...,min(m,n), is of the form
+ *
+ *          i - (1/u(k))*u*uT
+ *
+ *     where u has zeroes in the first k-1 positions. The form of
+ *     this transformation and the method of pivoting first
+ *     appeared in the corresponding linpack subroutine.
+ *
+ *     Parameters:
+ *
+ *      m is a positive integer input variable set to the number
+ *        of rows of a.
+ *
+ *      n is a positive integer input variable set to the number
+ *        of columns of a.
+ *
+ *      a is an m by n array. On input a contains the matrix for
+ *        which the qr factorization is to be computed. On OUTPUT
+ *        the strict upper trapezoidal part of a contains the strict
+ *        upper trapezoidal part of r, and the lower trapezoidal
+ *        part of a contains a factored form of q (the non-trivial
+ *        elements of the u vectors described above).
+ *
+ *      ipvt is an integer OUTPUT array of length lipvt. This array
+ *        defines the permutation matrix p such that a*p = q*r.
+ *        Column j of p is column ipvt(j) of the identity matrix.
+ *
+ *      rdiag is an OUTPUT array of length n which contains the
+ *        diagonal elements of r.
+ *
+ *      acnorm is an OUTPUT array of length n which contains the
+ *        norms of the corresponding columns of the input matrix a.
+ *        If this information is not needed, then acnorm can coincide
+ *        with rdiag.
+ *
+ *      wa is a work array of length n.
+ *
+ */
+    int    i, j, k, kmax, minmn;
+    double ajnorm, sum, temp;
+
+/*** qrfac: compute initial column norms and initialize several arrays. ***/
+
+    for (j = 0; j < n; j++)
+    {
+        acnorm[j] = lm_enorm(m, &a[j*m]);
+        rdiag[j]  = acnorm[j];
+        wa[j]     = rdiag[j];
+        ipvt[j]   = j;
+    }
+#ifdef LMFIT_DEBUG_MESSAGES
+    printf("debug qrfac\n");
+#endif
+
+/*** qrfac: reduce a to r with Householder transformations. ***/
+
+    minmn = MIN(m, n);
+    for (j = 0; j < minmn; j++)
+    {
+
+        /** bring the column of largest norm into the pivot position. **/
+
+        kmax = j;
+        for (k = j + 1; k < n; k++)
+        {
+            if (rdiag[k] > rdiag[kmax])
+            {
+                kmax = k;
+            }
+        }
+        if (kmax == j)
+        {
+            goto pivot_ok;
+        }
+
+        for (i = 0; i < m; i++)
+        {
+            temp        = a[j*m+i];
+            a[j*m+i]    = a[kmax*m+i];
+            a[kmax*m+i] = temp;
+        }
+        rdiag[kmax] = rdiag[j];
+        wa[kmax]    = wa[j];
+        k           = ipvt[j];
+        ipvt[j]     = ipvt[kmax];
+        ipvt[kmax]  = k;
+
+pivot_ok:
+        /** compute the Householder transformation to reduce the
+            j-th column of a to a multiple of the j-th unit vector. **/
+
+        ajnorm = lm_enorm(m-j, &a[j*m+j]);
+        if (ajnorm == 0.)
+        {
+            rdiag[j] = 0;
+            continue;
+        }
+
+        if (a[j*m+j] < 0.)
+        {
+            ajnorm = -ajnorm;
+        }
+        for (i = j; i < m; i++)
+        {
+            a[j*m+i] /= ajnorm;
+        }
+        a[j*m+j] += 1;
+
+        /** apply the transformation to the remaining columns
+            and update the norms. **/
+
+        for (k = j + 1; k < n; k++)
+        {
+            sum = 0;
+
+            for (i = j; i < m; i++)
+            {
+                sum += a[j*m+i] * a[k*m+i];
+            }
+
+            temp = sum / a[j + m * j];
+
+            for (i = j; i < m; i++)
+            {
+                a[k*m+i] -= temp * a[j*m+i];
+            }
+
+            if (rdiag[k] != 0.)
+            {
+                temp      = a[m * k + j] / rdiag[k];
+                temp      = MAX(0., 1 - temp * temp);
+                rdiag[k] *= sqrt(temp);
+                temp      = rdiag[k] / wa[k];
+                if (0.05 * SQR(temp) <= LM_MACHEP)
+                {
+                    rdiag[k] = lm_enorm(m-j-1, &a[m*k+j+1]);
+                    wa[k]    = rdiag[k];
+                }
+            }
+        }
+
+        rdiag[j] = -ajnorm;
+    }
+} /*** lm_qrfac. ***/
+
+
+/*****************************************************************************/
+/*  lm_qrsolv (linear least-squares)                                         */
+/*****************************************************************************/
+
+void lm_qrsolv(int n, double *r, int ldr, int *ipvt, double *diag,
+               double *qtb, double *x, double *sdiag, double *wa)
+{
+/*
+ *     Given an m by n matrix a, an n by n diagonal matrix d,
+ *     and an m-vector b, the problem is to determine an x which
+ *     solves the system
+ *
+ *          a*x = b  and  d*x = 0
+ *
+ *     in the least squares sense.
+ *
+ *     This subroutine completes the solution of the problem
+ *     if it is provided with the necessary information from the
+ *     qr factorization, with column pivoting, of a. That is, if
+ *     a*p = q*r, where p is a permutation matrix, q has orthogonal
+ *     columns, and r is an upper triangular matrix with diagonal
+ *     elements of nonincreasing magnitude, then qrsolv expects
+ *     the full upper triangle of r, the permutation matrix p,
+ *     and the first n components of (q transpose)*b. The system
+ *     a*x = b, d*x = 0, is then equivalent to
+ *
+ *          r*z = q^T*b,  p^T*d*p*z = 0,
+ *
+ *     where x = p*z. If this system does not have full rank,
+ *     then a least squares solution is obtained. On output qrsolv
+ *     also provides an upper triangular matrix s such that
+ *
+ *          p^T *(a^T *a + d*d)*p = s^T *s.
+ *
+ *     s is computed within qrsolv and may be of separate interest.
+ *
+ *     Parameters
+ *
+ *      n is a positive integer input variable set to the order of r.
+ *
+ *      r is an n by n array. On input the full upper triangle
+ *        must contain the full upper triangle of the matrix r.
+ *        On OUTPUT the full upper triangle is unaltered, and the
+ *        strict lower triangle contains the strict upper triangle
+ *        (transposed) of the upper triangular matrix s.
+ *
+ *      ldr is a positive integer input variable not less than n
+ *        which specifies the leading dimension of the array r.
+ *
+ *      ipvt is an integer input array of length n which defines the
+ *        permutation matrix p such that a*p = q*r. Column j of p
+ *        is column ipvt(j) of the identity matrix.
+ *
+ *      diag is an input array of length n which must contain the
+ *        diagonal elements of the matrix d.
+ *
+ *      qtb is an input array of length n which must contain the first
+ *        n elements of the vector (q transpose)*b.
+ *
+ *      x is an OUTPUT array of length n which contains the least
+ *        squares solution of the system a*x = b, d*x = 0.
+ *
+ *      sdiag is an OUTPUT array of length n which contains the
+ *        diagonal elements of the upper triangular matrix s.
+ *
+ *      wa is a work array of length n.
+ *
+ */
+    int    i, kk, j, k, nsing;
+    double qtbpj, sum, temp;
+    double _sin, _cos, _tan, _cot; /* local variables, not functions */
+
+/*** qrsolv: copy r and q^T*b to preserve input and initialize s.
+     in particular, save the diagonal elements of r in x. ***/
+
+    for (j = 0; j < n; j++)
+    {
+        for (i = j; i < n; i++)
+        {
+            r[j * ldr + i] = r[i * ldr + j];
+        }
+        x[j]  = r[j * ldr + j];
+        wa[j] = qtb[j];
+    }
+/*** qrsolv: eliminate the diagonal matrix d using a Givens rotation. ***/
+
+    for (j = 0; j < n; j++)
+    {
+
+/*** qrsolv: prepare the row of d to be eliminated, locating the
+     diagonal element using p from the qr factorization. ***/
+
+        if (diag[ipvt[j]] == 0.)
+        {
+            goto L90;
+        }
+        for (k = j; k < n; k++)
+        {
+            sdiag[k] = 0.;
+        }
+        sdiag[j] = diag[ipvt[j]];
+
+/*** qrsolv: the transformations to eliminate the row of d modify only
+     a single element of qT*b beyond the first n, which is initially 0. ***/
+
+        qtbpj = 0.;
+        for (k = j; k < n; k++)
+        {
+
+            /** determine a Givens rotation which eliminates the
+                appropriate element in the current row of d. **/
+
+            if (sdiag[k] == 0.)
+            {
+                continue;
+            }
+            kk = k + ldr * k;
+            if (fabs(r[kk]) < fabs(sdiag[k]))
+            {
+                _cot = r[kk] / sdiag[k];
+                _sin = 1 / sqrt(1 + SQR(_cot));
+                _cos = _sin * _cot;
+            }
+            else
+            {
+                _tan = sdiag[k] / r[kk];
+                _cos = 1 / sqrt(1 + SQR(_tan));
+                _sin = _cos * _tan;
+            }
+
+            /** compute the modified diagonal element of r and
+                the modified element of ((q^T)*b,0). **/
+
+            r[kk] = _cos * r[kk] + _sin * sdiag[k];
+            temp  = _cos * wa[k] + _sin * qtbpj;
+            qtbpj = -_sin * wa[k] + _cos * qtbpj;
+            wa[k] = temp;
+
+            /** accumulate the tranformation in the row of s. **/
+
+            for (i = k + 1; i < n; i++)
+            {
+                temp           = _cos * r[k * ldr + i] + _sin * sdiag[i];
+                sdiag[i]       = -_sin * r[k * ldr + i] + _cos * sdiag[i];
+                r[k * ldr + i] = temp;
+            }
+        }
+
+L90:
+        /** store the diagonal element of s and restore
+            the corresponding diagonal element of r. **/
+
+        sdiag[j]       = r[j * ldr + j];
+        r[j * ldr + j] = x[j];
+    }
+
+/*** qrsolv: solve the triangular system for z. if the system is
+     singular, then obtain a least squares solution. ***/
+
+    nsing = n;
+    for (j = 0; j < n; j++)
+    {
+        if (sdiag[j] == 0. && nsing == n)
+        {
+            nsing = j;
+        }
+        if (nsing < n)
+        {
+            wa[j] = 0;
+        }
+    }
+
+    for (j = nsing - 1; j >= 0; j--)
+    {
+        sum = 0;
+        for (i = j + 1; i < nsing; i++)
+        {
+            sum += r[j * ldr + i] * wa[i];
+        }
+        wa[j] = (wa[j] - sum) / sdiag[j];
+    }
+
+/*** qrsolv: permute the components of z back to components of x. ***/
+
+    for (j = 0; j < n; j++)
+    {
+        x[ipvt[j]] = wa[j];
+    }
+
+} /*** lm_qrsolv. ***/
+
+
+/*****************************************************************************/
+/*  lm_enorm (Euclidean norm)                                                */
+/*****************************************************************************/
+
+double lm_enorm(int n, const double *x)
+{
+/*     Given an n-vector x, this function calculates the
+ *     euclidean norm of x.
+ *
+ *     The euclidean norm is computed by accumulating the sum of
+ *     squares in three different sums. The sums of squares for the
+ *     small and large components are scaled so that no overflows
+ *     occur. Non-destructive underflows are permitted. Underflows
+ *     and overflows do not occur in the computation of the unscaled
+ *     sum of squares for the intermediate components.
+ *     The definitions of small, intermediate and large components
+ *     depend on two constants, LM_SQRT_DWARF and LM_SQRT_GIANT. The main
+ *     restrictions on these constants are that LM_SQRT_DWARF**2 not
+ *     underflow and LM_SQRT_GIANT**2 not overflow.
+ *
+ *     Parameters
+ *
+ *      n is a positive integer input variable.
+ *
+ *      x is an input array of length n.
+ */
+    int    i;
+    double agiant, s1, s2, s3, xabs, x1max, x3max, temp;
+
+    s1     = 0;
+    s2     = 0;
+    s3     = 0;
+    x1max  = 0;
+    x3max  = 0;
+    agiant = LM_SQRT_GIANT / n;
+
+    /** sum squares. **/
+
+    for (i = 0; i < n; i++)
+    {
+        xabs = fabs(x[i]);
+        if (xabs > LM_SQRT_DWARF)
+        {
+            if (xabs < agiant)
+            {
+                s2 += xabs * xabs;
+            }
+            else if (xabs > x1max)
+            {
+                temp  = x1max / xabs;
+                s1    = 1 + s1 * SQR(temp);
+                x1max = xabs;
+            }
+            else
+            {
+                temp = xabs / x1max;
+                s1  += SQR(temp);
+            }
+        }
+        else if (xabs > x3max)
+        {
+            temp  = x3max / xabs;
+            s3    = 1 + s3 * SQR(temp);
+            x3max = xabs;
+        }
+        else if (xabs != 0.)
+        {
+            temp = xabs / x3max;
+            s3  += SQR(temp);
+        }
+    }
+
+    /** calculation of norm. **/
+
+    if (s1 != 0)
+    {
+        return x1max * sqrt(s1 + (s2 / x1max) / x1max);
+    }
+    else if (s2 != 0)
+    {
+        if (s2 >= x3max)
+        {
+            return sqrt(s2 * (1 + (x3max / s2) * (x3max * s3)));
+        }
+        else
+        {
+            return sqrt(x3max * ((s2 / x3max) + (x3max * s3)));
+        }
+    }
+    else
+    {
+        return x3max * sqrt(s3);
+    }
+
+} /*** lm_enorm. ***/
diff --git a/src/external/lmfit/lmmin.h b/src/external/lmfit/lmmin.h
new file mode 100644 (file)
index 0000000..3c8aa71
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Library:   lmfit (Levenberg-Marquardt least squares fitting)
+ *
+ * File:      lmmin.h
+ *
+ * Contents:  Declarations for Levenberg-Marquardt minimization.
+ *
+ * Copyright: Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
+ *
+ * License:   see ../COPYING (FreeBSD)
+ *
+ * Homepage:  apps.jcns.fz-juelich.de/lmfit
+ */
+
+#ifndef LMMIN_H
+#define LMMIN_H
+#undef __BEGIN_DECLS
+#undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS   /* empty */
+#endif
+
+#include "lmstruct.h"
+
+__BEGIN_DECLS
+
+/*! \brief
+ * Levenberg-Marquardt minimization.
+ *
+ *   This routine contains the core algorithm of our library.
+ *
+ *   It minimizes the sum of the squares of m nonlinear functions
+ *   in n variables by a modified Levenberg-Marquardt algorithm.
+ *   The function evaluation is done by the user-provided routine 'evaluate'.
+ *   The Jacobian is then calculated by a forward-difference approximation.
+ *
+ *   Parameters:
+ *
+ * \param[in] n_par The number of variables (INPUT, positive integer).
+ * \param par The parameters to be fitted
+ *      x is the solution vector (INPUT/OUTPUT, array of length n).
+ *        On input it must be set to an estimated solution.
+ *        On output it yields the final estimate of the solution.
+ *
+ *      m is the number of functions to be minimized (INPUT, positive integer).
+ *        It must fulfill m>=n.
+ *
+ *      data is a pointer that is ignored by lmmin; it is however forwarded
+ *        to the user-supplied functions evaluate and printout.
+ *        In a typical application, it contains experimental data to be fitted.
+ *
+ *      evaluate is a user-supplied function that calculates the m functions.
+ *        Parameters:
+ *          n, x, m, data as above.
+ *          fvec is an array of length m; on OUTPUT, it must contain the
+ *            m function values for the parameter vector x.
+ *          userbreak is an integer pointer. When *userbreak is set to a
+ *            nonzero value, lmmin will terminate.
+ *
+ *      control contains INPUT variables that control the fit algorithm,
+ *        as declared and explained in lmstruct.h
+ *
+ *      status contains OUTPUT variables that inform about the fit result,
+ *        as declared and explained in lmstruct.h
+ */
+void lmmin( int n_par, double *par, int m_dat, const void *data,
+            void (*evaluate) (const double *par, int m_dat, const void *data,
+                              double *fvec, int *userbreak),
+            const lm_control_struct *control, lm_status_struct *status );
+
+/* Refined calculation of Eucledian norm. */
+double lm_enorm( int, const double * );
+
+__END_DECLS
+#endif /* LMMIN_H */
diff --git a/src/external/lmfit/lmstruct.h b/src/external/lmfit/lmstruct.h
new file mode 100644 (file)
index 0000000..9a220e4
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Library:   lmfit (Levenberg-Marquardt least squares fitting)
+ *
+ * File:      lmstruct.h
+ *
+ * Contents:  Declarations of parameter records, used in lmmin.h and lmcurve.h
+ *
+ * Copyright: Joachim Wuttke, Forschungszentrum Juelich GmbH (2004-2013)
+ *
+ * License:   see ../COPYING (FreeBSD)
+ *
+ * Homepage:  apps.jcns.fz-juelich.de/lmfit
+ */
+
+#ifndef LMSTRUCT_H
+#define LMSTRUCT_H
+#undef __BEGIN_DECLS
+#undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS   /* empty */
+#endif
+__BEGIN_DECLS
+
+#include <stdio.h>
+
+/* Collection of input parameters for fit control. */
+typedef struct {
+    double ftol;      /* Relative error desired in the sum of squares.
+                         Termination occurs when both the actual and
+                         predicted relative reductions in the sum of squares
+                         are at most ftol. */
+    double xtol;      /* Relative error between last two approximations.
+                         Termination occurs when the relative error between
+                         two consecutive iterates is at most xtol. */
+    double gtol;      /* Orthogonality desired between fvec and its derivs.
+                         Termination occurs when the cosine of the angle
+                         between fvec and any column of the Jacobian is at
+                         most gtol in absolute value. */
+    double epsilon;   /* Step used to calculate the Jacobian, should be
+                         slightly larger than the relative error in the
+                         user-supplied functions. */
+    double stepbound; /* Used in determining the initial step bound. This
+                         bound is set to the product of stepbound and the
+                         Euclidean norm of diag*x if nonzero, or else to
+                         stepbound itself. In most cases stepbound should lie
+                         in the interval (0.1,100.0). Generally, the value
+                         100.0 is recommended. */
+    int   patience;   /* Used to set the maximum number of function evaluations
+                         to patience*(number_of_parameters+1). */
+    int   scale_diag; /* If 1, the variables will be rescaled internally.
+                         Recommended value is 1. */
+    FILE* msgfile;    /* Progress messages will be written to this file. */
+    int   verbosity;  /* OR'ed: 1: print some messages; 2: print Jacobian. */
+    int   n_maxpri;   /* -1, or max number of parameters to print. */
+    int   m_maxpri;   /* -1, or max number of residuals to print. */
+} lm_control_struct;
+
+/* Collection of output parameters for status info. */
+typedef struct {
+    double fnorm;     /* norm of the residue vector fvec. */
+    int    nfev;      /* actual number of iterations. */
+    int    outcome;   /* Status indicator. Nonnegative values are used as index
+                         for the message text lm_infmsg, set in lmmin.c. */
+    int    userbreak; /* Set when function evaluation requests termination. */
+} lm_status_struct;
+
+/* Preset (and recommended) control parameter settings. */
+extern const lm_control_struct lm_control_double;
+extern const lm_control_struct lm_control_float;
+
+/* Preset message texts. */
+
+extern const char *lm_infmsg[];
+extern const char *lm_shortmsg[];
+
+__END_DECLS
+#endif /* LMSTRUCT_H */
index 419ffb64a236c1de024ebf7bc93363d7d20c4995..f4cf02b9435a4006279aa3c5abc09d33a4735e8b 100644 (file)
@@ -38,6 +38,8 @@
 #ifndef TMPI_MPI_BINDINGS_H_
 #define TMPI_MPI_BINDINGS_H_
 
+#include "tmpi.h"
+
 /** \file
    \brief MPI bindings for thread_mpi/tmpi.h
 
index 3aee9c52e55c20a7520784c136a51c23ccb128c8..0c34919e7516cdd8a9123eb7d7ac3e1b06686843 100644 (file)
@@ -372,8 +372,9 @@ int tMPI_Thread_setaffinity_single(tMPI_Thread_t tmpi_unused thread,
     CPU_ZERO(&set);
     CPU_SET(nr, &set);
     return pthread_setaffinity_np(thread->th, sizeof(set), &set);
-#endif
+#else
     return 0;
+#endif
 }
 
 
index 594069660edc51188b7dc0ed5ba8356ab9191541..87c10be8be43ef8f6fdda77ec6536a176f62711f 100644 (file)
@@ -5,7 +5,7 @@ project(TNG_IO)
 
 if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
-elseif(WIN32 AND NOT CYGWIN)
+elseif(WIN32)
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W2")
 endif()
 
index 51c1d9b5935f89fa64dc6c2f78c020b21b2157cd..c607aad2c5d9849e4c66217a988903b664ed5ecb 100644 (file)
@@ -331,6 +331,9 @@ typedef unsigned __int64 uint64_t;
 #ifndef PRId64
 # define PRId64         __PRI64_PREFIX "d"
 #endif
+#ifndef PRIu64
+# define PRIu64         __PRI64_PREFIX "u"
+#endif
 
 #endif
 
index f6a2391635587c1178dd676ebf6103f2af8df416..774c0f6841218451a4765d82afa1cb86fd9a9e6e 100644 (file)
@@ -165,7 +165,6 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
 #else
     /* Define storage for little-endian or both types of CPUs. */
     md5_word_t xbuf[16];
-    /* cppcheck-suppress unassignedVariable */
     const md5_word_t *X;
 #endif
 
index 074b781317ebdc50c78b2455d25d9462affbe095..7702d23846c5d12cd5aa2351c0a7a4fe2a4f193e 100644 (file)
@@ -3222,7 +3222,7 @@ static tng_function_status tng_molecules_block_read
                           sizeof(struct tng_molecule));
     if(!tng_data->molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                tng_data->n_molecules * sizeof(struct tng_molecule),
                __FILE__, __LINE__);
         return(TNG_CRITICAL);
@@ -3238,7 +3238,7 @@ static tng_function_status tng_molecules_block_read
                                       tng_data->n_molecules);
         if(!tng_data->molecule_cnt_list)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    tng_data->n_molecules * sizeof(struct tng_molecule),
                    __FILE__, __LINE__);
             return(TNG_CRITICAL);
@@ -3354,7 +3354,7 @@ static tng_function_status tng_molecules_block_read
                                     sizeof(struct tng_chain));
             if(!molecule->chains)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     molecule->n_chains * sizeof(struct tng_chain),
                     __FILE__, __LINE__);
                 return(TNG_CRITICAL);
@@ -3373,7 +3373,7 @@ static tng_function_status tng_molecules_block_read
                                 sizeof(struct tng_residue));
             if(!molecule->residues)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     molecule->n_residues * sizeof(struct tng_residue),
                     __FILE__, __LINE__);
                 if(molecule->chains)
@@ -3395,7 +3395,7 @@ static tng_function_status tng_molecules_block_read
                                  sizeof(struct tng_atom));
         if(!molecule->atoms)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    molecule->n_atoms * sizeof(struct tng_atom),
                    __FILE__, __LINE__);
             if(molecule->chains)
@@ -3503,7 +3503,7 @@ static tng_function_status tng_molecules_block_read
                                            sizeof(struct tng_bond));
             if(!molecule->bonds)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                        molecule->n_bonds * sizeof(struct tng_bond),
                        __FILE__, __LINE__);
                 if(molecule->chains)
@@ -3997,7 +3997,7 @@ static tng_function_status tng_frame_set_block_read
 
                 if(!frame_set->molecule_cnt_list)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                            sizeof(int64_t) * tng_data->n_molecules,
                            __FILE__, __LINE__);
                     return(TNG_CRITICAL);
@@ -4199,7 +4199,7 @@ static tng_function_status tng_frame_set_block_write
         temp_name = realloc(block->name, name_len + 1);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
                    name_len+1, __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -4538,7 +4538,7 @@ static tng_function_status tng_trajectory_mapping_block_read
                                             sizeof(int64_t));
     if(!mapping->real_particle_numbers)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                 mapping->n_particles * sizeof(int64_t), __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -4614,7 +4614,7 @@ static tng_function_status tng_trajectory_mapping_block_write
         temp_name = realloc(block->name, name_len + 1);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n",
                    name_len+1, __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -5190,7 +5190,7 @@ static tng_function_status tng_gzip_compress(tng_trajectory_t tng_data,
     dest = malloc(max_len);
     if(!dest)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%ld bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%lu bytes). %s: %d\n",
                max_len, __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -5365,7 +5365,7 @@ static tng_function_status tng_allocate_particle_data_mem
                                     n_particles);
             if(!data->strings[i])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     sizeof(union data_values *) * n_particles,
                     __FILE__, __LINE__);
                 return(TNG_CRITICAL);
@@ -5376,7 +5376,7 @@ static tng_function_status tng_allocate_particle_data_mem
                                             n_values_per_frame);
                 if(!data->strings[i][j])
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                         sizeof(union data_values) * n_values_per_frame,
                         __FILE__, __LINE__);
                     return(TNG_CRITICAL);
@@ -6907,7 +6907,7 @@ static tng_function_status tng_data_block_write(tng_trajectory_t tng_data,
         temp_name = realloc(block->name, len);
         if(!temp_name)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%d bytes). %s: %d\n", len+1,
+            fprintf(stderr, "TNG library: Cannot allocate memory (%u bytes). %s: %d\n", len+1,
                    __FILE__, __LINE__);
             free(block->name);
             block->name = 0;
@@ -8009,7 +8009,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_w_id_add
 
     if(!new_molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_molecule) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecules);
@@ -8023,7 +8023,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_w_id_add
 
     if(!new_molecule_cnt_list)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecule_cnt_list);
@@ -8075,7 +8075,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_existing_add
 
     if(!new_molecules)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_molecule) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecules);
@@ -8089,7 +8089,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_existing_add
 
     if(!new_molecule_cnt_list)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (tng_data->n_molecules + 1),
                __FILE__, __LINE__);
         free(tng_data->molecule_cnt_list);
@@ -8320,7 +8320,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(tng_trajectory_t
                     sizeof(struct tng_molecule) * tng_data_src->n_molecules);
     if(!molecule_temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_molecule) * tng_data_src->n_molecules,
                __FILE__, __LINE__);
         free(tng_data_dest->molecules);
@@ -8331,7 +8331,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(tng_trajectory_t
                                      sizeof(int64_t) * tng_data_src->n_molecules);
     if(!list_temp)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * tng_data_src->n_molecules,
                __FILE__, __LINE__);
         free(tng_data_dest->molecule_cnt_list);
@@ -8401,7 +8401,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy(tng_trajectory_t
                                 molecule->n_bonds);
             if(!bond_temp)
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                        sizeof(struct tng_bond) * molecule->n_bonds,
                        __FILE__, __LINE__);
                 free(molecule_temp->bonds);
@@ -8601,7 +8601,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_w_id_add
 
     if(!new_chains)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_chain) * (molecule->n_chains + 1),
                __FILE__, __LINE__);
         free(molecule->chains);
@@ -8642,7 +8642,7 @@ tng_function_status DECLSPECDLLEXPORT tng_molecule_bond_add
 
     if(!new_bonds)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_bond) * (molecule->n_bonds + 1),
                __FILE__, __LINE__);
         *bond = 0;
@@ -8867,7 +8867,7 @@ tng_function_status DECLSPECDLLEXPORT tng_chain_residue_w_id_add
 
     if(!new_residues)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_residue) * (molecule->n_residues + 1),
                __FILE__, __LINE__);
         free(molecule->residues);
@@ -9079,7 +9079,7 @@ tng_function_status DECLSPECDLLEXPORT tng_residue_atom_w_id_add
 
     if(!new_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_atom) * (molecule->n_atoms + 1),
                __FILE__, __LINE__);
         free(molecule->atoms);
@@ -9343,14 +9343,14 @@ tng_function_status DECLSPECDLLEXPORT tng_molsystem_bonds_get
     *from_atoms = malloc(sizeof(int64_t) * (*n_bonds));
     if(!*from_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (*n_bonds), __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
     *to_atoms = malloc(sizeof(int64_t) * (*n_bonds));
     if(!*to_atoms)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * (*n_bonds), __FILE__, __LINE__);
         free(*from_atoms);
         *from_atoms = 0;
@@ -9732,7 +9732,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
 
     if(!mapping)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(struct tng_particle_mapping)*frame_set->n_mapping_blocks,
                __FILE__, __LINE__);
         free(frame_set->mappings);
@@ -9747,7 +9747,7 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add
     frame_set->mappings[frame_set->n_mapping_blocks - 1].real_particle_numbers = 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 (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(int64_t) * n_particles, __FILE__, __LINE__);
         return(TNG_CRITICAL);
     }
@@ -15113,7 +15113,7 @@ static tng_function_status tng_data_values_alloc
     *values = malloc(sizeof(union data_values *) * n_frames);
     if(!*values)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(union data_values **) * n_frames,
                __FILE__, __LINE__);
         return(TNG_CRITICAL);
@@ -15126,7 +15126,7 @@ static tng_function_status tng_data_values_alloc
                            n_values_per_frame);
         if(!(*values)[i])
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    sizeof(union data_values) * n_values_per_frame,
                    __FILE__, __LINE__);
             free(values);
@@ -15207,7 +15207,7 @@ static tng_function_status tng_particle_data_values_alloc
     *values = malloc(sizeof(union data_values **) * n_frames);
     if(!*values)
     {
-        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+        fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                sizeof(union data_values **) * n_frames,
                __FILE__, __LINE__);
         return(TNG_CRITICAL);
@@ -15220,7 +15220,7 @@ static tng_function_status tng_particle_data_values_alloc
                            n_particles);
         if(!(*values)[i])
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                    sizeof(union data_values *) * n_particles,
                    __FILE__, __LINE__);
             free(*values);
@@ -15233,7 +15233,7 @@ static tng_function_status tng_particle_data_values_alloc
                                   n_values_per_frame);
             if(!(*values)[i][j])
             {
-                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     sizeof(union data_values *) * n_particles,
                     __FILE__, __LINE__);
                 tng_particle_data_values_free(tng_data, *values, n_frames,
@@ -19163,7 +19163,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
         temp = realloc(*data_block_ids_in_next_frame, size);
         if(!temp)
         {
-            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+            fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                     sizeof(int64_t) * (*n_data_blocks_in_next_frame),
                     __FILE__, __LINE__);
             free(*data_block_ids_in_next_frame);
@@ -19305,7 +19305,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
                 temp = realloc(*data_block_ids_in_next_frame, size);
                 if(!temp)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                            sizeof(int64_t) * (*n_data_blocks_in_next_frame),
                            __FILE__, __LINE__);
                     free(*data_block_ids_in_next_frame);
@@ -19392,7 +19392,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat
                 temp = realloc(*data_block_ids_in_next_frame, size);
                 if(!temp)
                 {
-                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRId64" bytes). %s: %d\n",
+                    fprintf(stderr, "TNG library: Cannot allocate memory (%"PRIu64" bytes). %s: %d\n",
                            sizeof(int64_t) * (*n_data_blocks_in_next_frame),
                            __FILE__, __LINE__);
                     free(*data_block_ids_in_next_frame);
similarity index 58%
rename from src/gromacs/legacyheaders/gmx_fatal_collective.h
rename to src/gmxpre-config.h.cmakein
index c7e59575a5c50d4ae32112b25c9dba761d5e6854..2f840259d01080427afd3a322a9dfdc4b83577cb 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-2012, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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
+ * Configuration macros from the build system for gmxpre.h.
+ *
+ * This header is an internal implementation detail of gmxpre.h, and should not
+ * be included from anywhere else.
+ *
+ * \see gmxpre.h
+ */
 
-#ifndef _fatal_collective_h
-#define _fatal_collective_h
-
-#include "typedefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#cmakedefine _LARGEFILE_SOURCE
 
+/* Define for large files, on AIX-style hosts. */
+#cmakedefine _LARGE_FILES
 
-void
-gmx_fatal_collective(int f_errno, const char *file, int line,
-                     const t_commrec *cr, gmx_domdec_t *dd,
-                     const char *fmt, ...);
-/* As gmx_fatal declared in gmx_fatal.h,
- * but only the master process prints the error message.
- * This should only be called one of the following two situations:
- * 1) On all nodes in cr->mpi_comm_mysim, with cr!=NULL,dd==NULL.
- * 2) On all nodes in dd->mpi_comm_all,   with cr==NULL,dd!=NULL.
- * This will call MPI_Finalize instead of MPI_Abort when possible,
- * This is useful for handling errors in code that is executed identically
- * for all processes.
- */
+/* Some systems requires this to be set to 64 for large file support */
+#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
 
+/* Build special-purpose mdrun library */
+#cmakedefine GMX_FAHCORE
 
-#ifdef __cplusplus
-}
-#endif
+/* This is here for simplicity, since the layout for some thread-MPI structs
+ * declared in headers depend on this being consistently defined.
+ * But thread-MPI itself does not include gmxpre.h, so the same define is also
+ * set in config.h (which gets included by thread-MPI, but only in the source
+ * files). There are some other config.h defines that appear in thread-MPI
+ * headers, but currently Gromacs does not use any code that would depend on
+ * those, and for thread-MPI, config.h provides the definitions wherever
+ * required. */
+/* Define for busy wait option  */
+#cmakedefine TMPI_WAIT_FOR_NO_ONE
 
-#endif  /* _fatal_collective_h */
diff --git a/src/gmxpre.h b/src/gmxpre.h
new file mode 100644 (file)
index 0000000..0573e37
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Prerequisite header file for \Gromacs build.
+ *
+ * This header should be included as the first header in all source files, but
+ * not in header files.  It is intended to contain definitions that must appear
+ * before any other code to work properly (e.g., macro definitions that
+ * influence behavior of system headers).  This frees other code from include
+ * order dependencies that may raise from requirements of getting these
+ * definitions from some header.
+ *
+ * The definitions here should be kept to a minimum, and should be as static as
+ * possible (typically not change as a result of user choices in the build
+ * system), as any change will trigger a full rebuild.  Avoid including any
+ * actual headers to not hide problems with include-what-you-use, and to keep
+ * build times to a minimum.  Also, installer headers should avoid relying on
+ * the definitions from here (if possible), as this header will not be
+ * available to the user.
+ *
+ * \inlibraryapi
+ */
+//! \cond
+#ifdef HAVE_CONFIG_H
+#include "gmxpre-config.h"
+#endif
+
+/* We use a few GNU functions for thread affinity and other low-level stuff.
+ * However, all such uses should be accompanied by #ifdefs and a feature test
+ * at CMake level, so that the actual uses will be compiled only when available.
+ * But since the define affects system headers, it should be defined before
+ * including any system headers, and this is a robust location to do that.
+ * If this were defined only in source files that needed it, it would clutter
+ * the list of includes somewhere close to the beginning and make automatic
+ * sorting of the includes more difficult.
+ */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+
+/* Some C++(?) compilers require these to be defined to get the integer limits
+ * and format specifier macros from stdint.h and inttypes.h, respectively.
+ * The macros are in C99 and C++11, but not in C++98...
+ * As with _GNU_SOURCE, these need to be defined before these headers get first
+ * included.  Unlike _GNU_SOURCE, these headers are included indirectly in most
+ * header and source files (even though the macros are not used that often), so
+ * there is no easy alternative to defining them here, either.
+ * If someone happens to use such a compiler to compile against the installed
+ * Gromacs headers, they need for now take care to define the macros themselves
+ * (as there is no way Gromacs can do that consistently).
+ */
+#define __STDC_LIMIT_MACROS
+#define __STDC_FORMAT_MACROS
+
+#ifdef GMX_FAHCORE
+#define FULLINDIRECT 1
+#define USE_FAH_XDR  1
+#include "swindirect.h"
+#endif
+//! \endcond
index 6db37e2402e57b5ead038c6f4fe53bdebb24c2f1..a4ac6155837858e456e3408702e755c337190d2b 100644 (file)
 
 set(LIBGROMACS_SOURCES)
 
-function (gmx_install_headers DESTINATION)
+set_property(GLOBAL PROPERTY GMX_INSTALLED_HEADERS)
+
+function (gmx_install_headers)
     if (NOT GMX_BUILD_MDRUN_ONLY)
-        if (DESTINATION)
-            set(DESTINATION ${INCL_INSTALL_DIR}/gromacs/${DESTINATION})
+        file(RELATIVE_PATH _dest ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_LIST_DIR})
+        install(FILES       ${ARGN}
+                DESTINATION "${INCL_INSTALL_DIR}/${_dest}"
+                COMPONENT   development)
+    endif()
+    foreach (_file ${ARGN})
+        if (IS_ABSOLUTE "${_file}")
+            set_property(GLOBAL APPEND PROPERTY GMX_INSTALLED_HEADERS ${_file})
         else()
-            set(DESTINATION ${INCL_INSTALL_DIR}/gromacs)
+            set_property(GLOBAL APPEND PROPERTY GMX_INSTALLED_HEADERS
+                         ${CMAKE_CURRENT_LIST_DIR}/${_file})
         endif()
-        install(FILES ${ARGN} DESTINATION ${DESTINATION} COMPONENT development)
-    endif()
+    endforeach()
 endfunction ()
 
+function (gmx_write_installed_header_list)
+    get_property(_list GLOBAL PROPERTY GMX_INSTALLED_HEADERS)
+    string(REPLACE ";" "\n" _list "${_list}")
+    # TODO: Make this only update the file timestamp if the contents actually change.
+    file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt "${_list}")
+endfunction()
+
 if(GMX_USE_TNG)
     option(GMX_EXTERNAL_TNG "Use external TNG instead of compiling the version shipped with GROMACS."
            OFF)
@@ -77,14 +92,19 @@ endif()
 add_subdirectory(gmxlib)
 add_subdirectory(mdlib)
 add_subdirectory(gmxpreprocess)
+add_subdirectory(listed-forces)
 add_subdirectory(commandline)
+add_subdirectory(domdec)
+add_subdirectory(ewald)
 add_subdirectory(fft)
 add_subdirectory(linearalgebra)
 add_subdirectory(math)
 add_subdirectory(random)
 add_subdirectory(onlinehelp)
 add_subdirectory(options)
+add_subdirectory(pbcutil)
 add_subdirectory(timing)
+add_subdirectory(topology)
 add_subdirectory(utility)
 add_subdirectory(fileio)
 add_subdirectory(swap)
@@ -95,6 +115,7 @@ add_subdirectory(imd)
 if (NOT GMX_BUILD_MDRUN_ONLY)
     add_subdirectory(legacyheaders)
     add_subdirectory(gmxana)
+    add_subdirectory(correlationfunctions)
     add_subdirectory(statistics)
     add_subdirectory(analysisdata)
     add_subdirectory(selection)
@@ -114,50 +135,43 @@ list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES})
 tmpi_get_source_list(THREAD_MPI_SOURCES ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/src)
 list(APPEND LIBGROMACS_SOURCES ${THREAD_MPI_SOURCES})
 
-file(GLOB LIBGROMACS_HEADERS *.h)
 configure_file(version.h.cmakein version.h)
-gmx_install_headers("" ${LIBGROMACS_HEADERS})
-gmx_install_headers("" ${CMAKE_CURRENT_BINARY_DIR}/version.h)
-
-# Add target that generates baseversion-gen.c every time make is run
-# if git version info is requested, or create it statically.
-# This code is here instead of utility/CMakeLists.txt because CMake
-# ignores set_source_file_properties from subdirectories.
-set(GENERATED_VERSION_FILE
-    ${CMAKE_CURRENT_BINARY_DIR}/utility/baseversion-gen.c)
-set(GENERATED_VERSION_FILE_SOURCE
-    ${CMAKE_CURRENT_SOURCE_DIR}/utility/baseversion-gen.c.cmakein)
-if (GMX_GIT_VERSION_INFO)
-    add_custom_target(gmx-version ALL
-            COMMAND ${CMAKE_COMMAND}
-                -D GIT_EXECUTABLE="${GIT_EXECUTABLE}"
-                -D PROJECT_VERSION="${PROJECT_VERSION}"
-                -D PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}"
-                -D VERSION_CMAKEIN=${GENERATED_VERSION_FILE_SOURCE}
-                -D VERSION_OUT=${GENERATED_VERSION_FILE}
-                -P ${CMAKE_SOURCE_DIR}/cmake/gmxGenerateVersionInfo.cmake
-            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-            DEPENDS ${GENERATED_VERSION_FILE_SOURCE}
-            COMMENT "Generating git version information")
-    set_source_files_properties(${GENERATED_VERSION_FILE}
-                                PROPERTIES GENERATED true)
-else()
-    set(GMX_PROJECT_VERSION_STR ${PROJECT_VERSION})
-    configure_file(${GENERATED_VERSION_FILE_SOURCE} ${GENERATED_VERSION_FILE})
-endif()
+gmx_install_headers(
+    analysisdata.h
+    commandline.h
+    options.h
+    selection.h
+    trajectoryanalysis.h
+    utility.h
+    ${CMAKE_CURRENT_BINARY_DIR}/version.h
+    )
+
+# This code is here instead of utility/CMakeLists.txt, because CMake
+# custom commands and source file properties can only be set in the directory
+# that contains the target that uses them.
+# TODO: Generate a header instead that can be included from baseversion.c.
+# That probably simplifies things somewhat.
+set(GENERATED_VERSION_FILE utility/baseversion-gen.c)
+gmx_configure_version_file(
+    utility/baseversion-gen.c.cmakein ${GENERATED_VERSION_FILE}
+    REMOTE_HASH SOURCE_FILE)
 list(APPEND LIBGROMACS_SOURCES ${GENERATED_VERSION_FILE})
 
 # apply gcc 4.4.x bug workaround
 if(GMX_USE_GCC44_BUG_WORKAROUND)
    include(gmxGCC44O3BugWorkaround)
-   gmx_apply_gcc44_bug_workaround("gmxlib/bondfree.c")
+   gmx_apply_gcc44_bug_workaround("listed-forces/bonded.cpp")
    gmx_apply_gcc44_bug_workaround("mdlib/force.c")
    gmx_apply_gcc44_bug_workaround("mdlib/constr.c")
 endif()
 
-add_library(libgromacs ${LIBGROMACS_SOURCES})
-if (GMX_GIT_VERSION_INFO)
-    add_dependencies(libgromacs gmx-version)
+if (GMX_GPU)
+    cuda_add_library(libgromacs ${LIBGROMACS_SOURCES}
+            OPTIONS
+            RELWITHDEBINFO -g
+            DEBUG -g -D_DEBUG_=1)
+else()
+    add_library(libgromacs ${LIBGROMACS_SOURCES})
 endif()
 
 # Recent versions of gcc and clang give warnings on scanner.cpp, which
@@ -184,7 +198,6 @@ set_source_files_properties(selection/scanner.cpp PROPERTIES COMPILE_FLAGS "${_s
 
 target_link_libraries(libgromacs
                       ${EXTRAE_LIBRARIES}
-                      ${GMX_GPU_LIBRARIES}
                       ${GMX_EXTRA_LIBRARIES}
                       ${TNG_IO_LIBRARIES}
                       ${FFT_LIBRARIES} ${LINEAR_ALGEBRA_LIBRARIES}
@@ -196,23 +209,21 @@ set_target_properties(libgromacs PROPERTIES
                       VERSION ${LIBRARY_VERSION}
                       COMPILE_FLAGS "${OpenMP_C_FLAGS}")
 
+gmx_write_installed_header_list()
+
 # Only install the library in mdrun-only mode if it is actually necessary
 # for the binary
 if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
     install(TARGETS libgromacs
-        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
-        RUNTIME DESTINATION ${BIN_INSTALL_DIR}
-        ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-        COMPONENT libraries)
+            EXPORT libgromacs
+            LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+            RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+            ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+            COMPONENT libraries)
 endif()
 
 if (NOT GMX_BUILD_MDRUN_ONLY)
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgromacs.pc.cmakein
-                   ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc @ONLY)
-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc
-            DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
-            RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc"
-            COMPONENT development)
+    include(InstallLibInfo.cmake)
 endif()
 
 if (INSTALL_CUDART_LIB) #can be set manual by user
diff --git a/src/gromacs/InstallLibInfo.cmake b/src/gromacs/InstallLibInfo.cmake
new file mode 100644 (file)
index 0000000..58856f8
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+function (do_pkgconfig)
+    set(PKG_CFLAGS "")
+    foreach (_dir ${INSTALLED_HEADER_INCLUDE_DIRS})
+        if (IS_ABSOLUTE ${_dir})
+            set(PKG_CFLAGS "${PKG_CFLAGS} -I${_dir}")
+        else()
+            set(PKG_CFLAGS "${PKG_CFLAGS} -I${CMAKE_INSTALL_PREFIX}/${_dir}")
+        endif()
+    endforeach()
+    if (INSTALLED_HEADER_DEFINITIONS)
+        foreach (_def ${INSTALLED_HEADER_DEFINITIONS})
+            set(PKG_CFLAGS "${PKG_CFLAGS} ${_def}")
+        endforeach()
+    endif()
+    set(PKG_CFLAGS "${PKG_CFLAGS} ${OpenMP_C_FLAGS}")
+
+    configure_file(libgromacs.pc.cmakein
+                   libgromacs.pc @ONLY)
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc
+            DESTINATION ${PKGCONFIG_INSTALL_DIR}
+            RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc"
+            COMPONENT development)
+endfunction()
+
+function (do_cmake_config)
+    # Install everything into a subdirectory, because
+    #  1. CMake expects things to be there for CMAKE_PREFIX_PATH to work, and
+    #  2. This nicely isolates files for different suffixes from each other.
+    set(CMAKE_PACKAGE_DIR ${CMAKE_INSTALL_DIR}/gromacs${GMX_LIBS_SUFFIX})
+
+    # Install import definitions that take care of the library locations and
+    # library dependencies.
+    set(EXPORT_FILE_NAME libgromacs.cmake)
+    if (NOT BUILD_SHARED_LIBS)
+        set(EXPORT_FILE_NAME libgromacs_static.cmake)
+    endif()
+    install(EXPORT libgromacs
+            FILE ${EXPORT_FILE_NAME}
+            DESTINATION ${CMAKE_PACKAGE_DIR}
+            COMPONENT libraries)
+
+    get_filename_component(GROMACS_CXX_COMPILER ${CMAKE_CXX_COMPILER} REALPATH)
+    configure_file(gromacs-config.cmake.cmakein
+                   gromacs-config.cmake @ONLY)
+    configure_file(gromacs-config-version.cmake.cmakein
+                   gromacs-config-version.cmake @ONLY)
+    # The configuration files are also installed with the suffix, even though
+    # the directory already contains the suffix. This allows simple
+    # find_package(GROMACS NAMES gromacs_d) to find them, without also
+    # specifying CONFIGS.
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gromacs-config.cmake
+            DESTINATION ${CMAKE_PACKAGE_DIR}
+            RENAME "gromacs${GMX_LIBS_SUFFIX}-config.cmake"
+            COMPONENT development)
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gromacs-config-version.cmake
+            DESTINATION ${CMAKE_PACKAGE_DIR}
+            RENAME "gromacs${GMX_LIBS_SUFFIX}-config-version.cmake"
+            COMPONENT development)
+endfunction()
+
+do_pkgconfig()
+do_cmake_config()
index 51f2d44156bf4bafca88a7c300620858f7cc5b64..2b0f24601d38f51ccbbaec5546e3f8b9af5c6a87 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,6 +46,8 @@
  * that process frames in parallel: the functionality in this module takes care
  * of necessary synchronization and communication such that output from the
  * frames is collected and output in the correct order.
+ * See \ref page_analysisdata for an overview of the high-level functionality
+ * and the terminology used.
  *
  * This module consists of two main parts.  The first is formed by the
  * gmx::AbstractAnalysisData class and classes that derive from it:
@@ -53,8 +55,9 @@
  * process and store raw data as produced by the analysis tool.  They also
  * provide an interface to attach data modules that implement
  * gmx::AnalysisDataModuleInterface.
- * Modules that implement this interface form the second part of the module,
- * and they provide functionality to do processing operations on the data.
+ *
+ * Modules that implement gmx::AnalysisDataModuleInterface form the second part
+ * of the module, and they provide functionality to do processing on the data.
  * These modules can also derive from gmx::AbstractAnalysisData, allowing other
  * modules to be attached to them to form a processing chain that best suits
  * the analysis tool.  Typically, such a processing chain ends in a plotting
  * provide direct access to the processed data, allowing the analysis tool to
  * do custom postprocessing outside the module framework.
  *
- * The sequence chart below shows an overview of how analysis data objects
- * and modules interact (currently, multipoint data is an exception to this
- * diagram).
- * \msc
- *     caller,
- *     data [ label="AnalysisData", URL="\ref gmx::AnalysisData" ],
- *     module1 [ label="data module", URL="\ref gmx::AnalysisDataModuleInterface" ];
- *
- *     caller box module1 [ label="caller creates and initializes all objects" ];
- *     caller => data [ label="addModule(module1)",
- *                      URL="\ref gmx::AbstractAnalysisData::addModule() " ];
- *     caller => data [ label="startData()",
- *                      URL="\ref gmx::AnalysisData::startData()" ];
- *     data => module1 [ label="dataStarted()",
- *                       URL="\ref gmx::AnalysisDataModuleInterface::dataStarted()" ];
- *     caller << data [ label="handle",
- *                      URL="\ref gmx::AnalysisDataHandle" ];
- *     caller => data [ label="handle->startFrame(0)",
- *                      URL="\ref gmx::AnalysisDataHandle::startFrame()" ];
- *     caller => data [ label="add data for frame 0",
- *                      URL="\ref gmx::AnalysisDataHandle" ];
- *     caller => data [ label="handle->finishFrame() (frame 0)",
- *                      URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     data => module1 [ label="frameStarted(0)",
- *                       URL="\ref gmx::AnalysisDataModuleInterface::frameStarted()" ];
- *     data => module1 [ label="pointsAdded()",
- *                       URL="\ref gmx::AnalysisDataModuleInterface::pointsAdded()" ];
- *     data => module1 [ label="frameFinished(0)",
- *                       URL="\ref gmx::AnalysisDataModuleInterface::frameFinished()" ];
- *     caller => data [ label="handle->startFrame(1)",
- *                      URL="\ref gmx::AnalysisDataHandle::startFrame()" ];
- *     caller => data [ label="add data for frame 1",
- *                      URL="\ref gmx::AnalysisDataHandle" ];
- *     caller => data [ label="handle2->finishFrame() (frame 1)",
- *                      URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     data => module1 [ label="process frame 1" ];
- *     ... [ label="add more frames" ];
- *     caller => data [ label="handle->finishData()",
- *                      URL="\ref gmx::AnalysisDataHandle::finishData()" ];
- *     data => module1 [ label="dataFinished()",
- *                       URL="\ref gmx::AnalysisDataModuleInterface::dataFinished()" ];
- * \endmsc
- *
- * The second sequence chart below shows the interaction in the case of two
- * gmx::AnalysisDataHandle objects, which can be used to insert data
- * concurrently for multiple frames.  The gmx::AnalysisData object and the
- * handles take care to notify the module such that it always receives the
- * frames in the correct order.
- * \msc
- *     caller,
- *     handle1 [ label="handle1", URL="\ref gmx::AnalysisDataHandle" ],
- *     handle2 [ label="handle2", URL="\ref gmx::AnalysisDataHandle" ],
- *     module1 [ label="data module", URL="\ref gmx::AnalysisDataModuleInterface" ];
- *
- *     caller box handle2 [ label="caller has created both handles using startData()" ];
- *     caller => handle1 [ label="startFrame(0)",
- *                         URL="\ref gmx::AnalysisDataHandle::startFrame()" ];
- *     caller => handle2 [ label="startFrame(1)",
- *                         URL="\ref gmx::AnalysisDataHandle::startFrame()" ];
- *     caller => handle1 [ label="add data for frame 0",
- *                         URL="\ref gmx::AnalysisDataHandle" ];
- *     caller => handle2 [ label="add data for frame 1",
- *                         URL="\ref gmx::AnalysisDataHandle" ];
- *     caller => handle2 [ label="finishFrame() (frame 1)",
- *                         URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     caller => handle2 [ label="startFrame(2)",
- *                         URL="\ref gmx::AnalysisDataHandle::startFrame()" ];
- *     caller => handle1 [ label="finishFrame() (frame 0)",
- *                         URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     handle1 => module1 [ label="process frame 0" ];
- *     handle1 => module1 [ label="process frame 1" ];
- *     caller => handle2 [ label="add data for frame 2",
- *                         URL="\ref gmx::AnalysisDataHandle" ];
- *     caller => handle2 [ label="finishFrame() (frame 2)",
- *                         URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     handle2 => module1 [ label="process frame 2" ];
- *     ...;
- *     caller => handle1 [ label="finishData()",
- *                         URL="\ref gmx::AnalysisDataHandle::finishData()" ];
- *     caller => handle2 [ label="finishData()",
- *                         URL="\ref gmx::AnalysisDataHandle::finishData()" ];
- *     handle2 => module1 [ label="dataFinished()",
- *                          URL="\ref gmx::AnalysisDataModuleInterface::dataFinished()" ];
- * \endmsc
- *
  * <H3>Using Data Objects and Modules</H3>
  *
  * To use the functionality in this module, you typically declare one or more
  * one another using gmx::AbstractAnalysisData::addModule().  Then you add the
  * actual data values to the gmx::AnalysisData object, which automatically
  * passes it on to the modules.
- * After all data is added, you may optionally access some
- * results directly from the module objects.  However, in many cases it is
- * sufficient to initially add a plotting module to the processing chain, which
- * will then automatically write the results into a file.
+ * After all data is added, you may optionally access some results directly
+ * from the module objects or from the gmx::AnalysisData object itself.
+ * However, in many cases it is sufficient to initially add a plotting module
+ * to the processing chain, which will then automatically write the results
+ * into a file.
  *
  * For simple processing needs with a small amount of data, an
  * gmx::AnalysisArrayData class is also provided, which keeps all the data in an
  * in-memory array and allows you to manipulate the data as you wish before you
  * pass the data to the attached modules.
  *
+ * <H3>Data Modules</H3>
+ *
+ * Modules that derive from gmx::AnalysisDataModuleInterface can operate in two
+ * modes:
+ *  - In _serial_ mode, the frames are presented to the module always in the
+ *    order of increasing indices, even if they become ready in a different
+ *    order in the attached data.
+ *  - In _parallel_ mode, the frames are presented in the order that they
+ *    become available in the input data, which may not be sequential.
+ *    This mode allows the input data to optimize its behavior if it does not
+ *    need to store and sort the frames.
+ *
+ * The figure below shows the sequence of callbacks that the module receives.
+ * Arrows show a dependency between callbacks: the event at the start of the
+ * arrow always occurs before the event at the end.  The events in the box are
+ * repeated for each frame.  Dashed lines within this box show dependencies
+ * between these frames:
+ *  - In serial mode, all the events are called in a deterministic order, with
+ *    each frame completely processed before the next starts.
+ *  - In parallel mode, multiple frames can be in progress simultaneously, and
+ *    the events for different frames can occur even concurrently on different
+ *    threads.  However, frameFinishSerial() events will always occur in
+ *    deterministic, sequential order for the frames.  Also, the number of
+ *    concurrent frames is limited by the parallelization factor passed to
+ *    parallelDataStarted(): only M frames after the last frame for which
+ *    frameFinishSerial() has been called can be in progress
+ *
+ * \dot
+ *     digraph datamodule_events {
+ *         rankdir = LR
+ *         node [ shape=box ]
+ *
+ *         start  [ label="dataStarted()",
+ *                  URL="\ref gmx::AnalysisDataModuleInterface::dataStarted()" ]
+ *         pstart [ label="parallelDataStarted()",
+ *                  URL="\ref gmx::AnalysisDataModuleInterface::parallelDataStarted()" ]
+ *         subgraph cluster_frame {
+ *             label = "for each frame"
+ *             framestart   [ label="frameStarted()",
+ *                            URL="\ref gmx::AnalysisDataModuleInterface::frameStarted()" ]
+ *             pointsadd    [ label="pointsAdded()",
+ *                            URL="\ref gmx::AnalysisDataModuleInterface::pointsAdded()" ]
+ *             framefinish  [ label="frameFinished()",
+ *                            URL="\ref gmx::AnalysisDataModuleInterface::frameFinished()" ]
+ *             serialfinish [ label="frameFinishedSerial()",
+ *                            URL="\ref gmx::AnalysisDataModuleInterface::frameFinishedSerial()" ]
+ *         }
+ *         finish [ label="dataFinished()",
+ *                  URL="\ref gmx::AnalysisDataModuleInterface::dataFinished()" ]
+ *
+ *         start -> framestart
+ *         pstart -> framestart
+ *         framestart -> pointsadd
+ *         pointsadd -> pointsadd [ label="0..*", dir=back ]
+ *         pointsadd -> framefinish
+ *         framefinish -> serialfinish
+ *         serialfinish -> finish
+ *
+ *         framestart:se -> serialfinish:sw [ dir=back, style=dashed, weight=0,
+ *                                            label="serial: frame n+1\nparallel: frame n+M" ]
+ *         serialfinish -> serialfinish [ dir=back, style=dashed,
+ *                                        label="frame n+1" ]
+ *     }
+ * \enddot
+ *
+ * If the input data supports parallel mode, it calls parallelDataStarted().
+ * If the module returns `true` from this method, then it will process the
+ * frames in the parallel mode.  If the module returns `false`, it will get the
+ * frames in serial order.
+ * If the input data does not support parallel mode, it calls dataStarted(),
+ * and the module will always get the frames in order.
+ *
+ * The sequence of when the module methods are called with respect to when data
+ * is added to the data object depends on the type of the module and the type
+ * of the data.  However, generally the modules do not need to know the details
+ * of how this happens, as long as they work with the above state diagram.
+ *
+ * For parallel processing, the gmx::AnalysisData object itself only provides
+ * the infrastructure to support all of the above, including the reordering of
+ * the frames for serial processing.  However, the caller is still responsible
+ * of the actual thread synchronization, and must call
+ * gmx::AnalysisData::finishFrameSerial() for each frame from a suitable
+ * context where the serial processing for that frame can be done.  When using
+ * the data objects as part of the trajectory analysis framework
+ * (\ref page_analysisframework), these calls are handled by the framework.
+ *
  * \if libapi
  * <H3>Writing New Data and Module Objects</H3>
  *
 #ifndef GMX_ANALYSISDATA_H
 #define GMX_ANALYSISDATA_H
 
-#include "analysisdata/analysisdata.h"
-#include "analysisdata/arraydata.h"
-#include "analysisdata/dataframe.h"
-#include "analysisdata/modules/average.h"
-#include "analysisdata/modules/displacement.h"
-#include "analysisdata/modules/histogram.h"
-#include "analysisdata/modules/lifetime.h"
-#include "analysisdata/modules/plot.h"
+#include "gromacs/analysisdata/analysisdata.h"
+#include "gromacs/analysisdata/arraydata.h"
+#include "gromacs/analysisdata/dataframe.h"
+#include "gromacs/analysisdata/modules/average.h"
+#include "gromacs/analysisdata/modules/displacement.h"
+#include "gromacs/analysisdata/modules/histogram.h"
+#include "gromacs/analysisdata/modules/lifetime.h"
+#include "gromacs/analysisdata/modules/plot.h"
 
 #endif
index dabcba9a84e6e825292e79650a5895fafc6f7f9f..d03af36baacb6bbfec342062fba8dfdfa71bf0ee 100644 (file)
 file(GLOB ANALYSISDATA_SOURCES *.cpp modules/*.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ANALYSISDATA_SOURCES} PARENT_SCOPE)
 
-set(ANALYSISDATA_PUBLIC_HEADERS
+gmx_install_headers(
     abstractdata.h
     analysisdata.h
     arraydata.h
     dataframe.h
-    datamodule.h)
-gmx_install_headers(analysisdata ${ANALYSISDATA_PUBLIC_HEADERS})
+    datamodule.h
+    )
 
 add_subdirectory(modules)
 
index 3562cdf2ee1c70c58c119045b5138ddd2d1679c3..9d21ccad6c9c8d890e3d43fedea8db140b02017a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/abstractdata.h"
+#include "gmxpre.h"
+
+#include "abstractdata.h"
 
 #include <vector>
 
index a8bced1c1050a9c2a1e95ebac66510cf1dca15b1..fd1c99db56fa9a75f27a0da1e918aa112c11c947 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,9 +45,7 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include "../legacyheaders/types/simple.h"
-
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 7a4727435d69368bad54387926ed2587cd5f5937..3d528be711d4c8c933cfc4923fc6385fab68c067 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/analysisdata.h"
+#include "gmxpre.h"
+
+#include "analysisdata.h"
 
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/analysisdata/datastorage.h"
@@ -174,6 +176,13 @@ AnalysisData::startData(const AnalysisDataParallelOptions &opt)
 }
 
 
+void
+AnalysisData::finishFrameSerial(int frameIndex)
+{
+    impl_->storage_.finishFrameSerial(frameIndex);
+}
+
+
 void
 AnalysisData::finishData(AnalysisDataHandle handle)
 {
index 315e6ca3431d43b0687d4e440b2743eadc1f4b86..c04ae1807273ea6819abadcd652f6bd03207bfbe 100644 (file)
@@ -43,7 +43,8 @@
 #ifndef GMX_ANALYSISDATA_ANALYSISDATA_H
 #define GMX_ANALYSISDATA_ANALYSISDATA_H
 
-#include "abstractdata.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
@@ -61,11 +62,13 @@ class AnalysisDataParallelOptions;
  * AnalysisDataHandle objects can be created using startData().  Each data
  * handle can then be independently used to provide data frames (each frame
  * must be provided by a single handle, but different frames can be freely
- * mixed between the handles).  When all data has been provided, the handles
+ * mixed between the handles).  The finishFrameSerial() method must be called
+ * in serial for each frame, after one of the handles has been used to provide
+ * the data for that frame.  When all data has been provided, the handles
  * are destroyed using finishData() (or AnalysisDataHandle::finishData()).
- * The AnalysisData object takes care of internally sorting the frames and
- * passing them to the attached modules in the order in which the modules
- * expect them.
+ *
+ * When used through the trajectory analysis framework, calls to startData(),
+ * finishFrameSerial(), and finishData() are handled by the framework.
  *
  * \todo
  * Parallel implementation is not complete.
@@ -140,7 +143,7 @@ class AnalysisData : public AbstractAnalysisData
         virtual int frameCount() const;
 
         /*! \brief
-         * Create a handle for adding data.
+         * Creates a handle for adding data.
          *
          * \param[in]  opt     Options for setting how this handle will be
          *     used.
@@ -162,7 +165,21 @@ class AnalysisData : public AbstractAnalysisData
          */
         AnalysisDataHandle startData(const AnalysisDataParallelOptions &opt);
         /*! \brief
-         * Destroy a handle after all data has been added.
+         * Performs in-order sequential processing for the next frame.
+         *
+         * \param[in]  frameIndex Index of the frame that has been finished.
+         * \throws  unspecified  Any exception thrown by attached data modules
+         *      in AnalysisDataModuleInterface::frameFinishedSerial().
+         *
+         * This method should be called sequentially for each frame, after data
+         * for that frame has been produced.  It is not necessary to call this
+         * method if there is no parallelism, i.e., if only a single data
+         * handle is created and the parallelization options provided at that
+         * time do not indicate parallelism.
+         */
+        void finishFrameSerial(int frameIndex);
+        /*! \brief
+         * Destroys a handle after all data has been added.
          *
          * \param[in]  handle  Handle to destroy.
          * \throws  unspecified  Any exception thrown by attached data modules
index 55dc204df5c45c4da35c4c85fc1452ed600fdf83..60d4c89cfd906f28eed43237355de96d97c0ca90 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/arraydata.h"
+#include "gmxpre.h"
+
+#include "arraydata.h"
 
 #include <algorithm>
 
index 71efadf6edf385ce8424dce4a53cdc736b50b206..f255ae70f612e34f2e1dd7829fbccbdcb97854c0 100644 (file)
 
 #include <vector>
 
-#include "../utility/gmxassert.h"
-
-#include "abstractdata.h"
-#include "dataframe.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/analysisdata/dataframe.h"
+#include "gromacs/utility/gmxassert.h"
 
 namespace gmx
 {
index cfa09e86a3811889cfe6adbabfe52bd4f235e492..e080f5f1ab78212f471922b8cfb7f38d9d4b6a5d 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "dataframe.h"
 
 #include "gromacs/utility/gmxassert.h"
index f52252988afc98e1074d91612735abd6fee77c8e..5502063042bdf347db0e104c194bfd92ea28c926 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <vector>
 
-#include "../legacyheaders/types/simple.h"
-
-#include "../utility/arrayref.h"
-#include "../utility/flags.h"
-#include "../utility/gmxassert.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/flags.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
index e10859259a754a46d7232c0d2296fedc2907a36d..dde3922dbdd5f93398bb720dc8ec8657ab0d56ac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/datamodule.h"
+#include "gmxpre.h"
+
+#include "datamodule.h"
 
 #include "gromacs/analysisdata/paralleloptions.h"
 
index 4c60ac9a93d0cd799a7bff255d2821ddb19eb073..3fa7e02fdcac9046cbd2b990ab6a2ccd3da34c74 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,8 +43,6 @@
 #ifndef GMX_ANALYSISDATA_DATAMODULE_H
 #define GMX_ANALYSISDATA_DATAMODULE_H
 
-#include "../legacyheaders/types/simple.h"
-
 namespace gmx
 {
 
@@ -62,20 +60,8 @@ class AnalysisDataPointSetRef;
  * parallelDataStarted() methods (see below).
  * All other methods in the interface are callbacks that are called by the
  * data object to which the module is attached to describe the data.
- *
- * The modules can operate in two modes: serial or parallel.
- * In serial mode, the frames are presented to the module always in the order
- * of increasing indices, even if they become ready in a different order in the
- * attached data.
- * In parallel mode, the frames are presented in the order that they become
- * available in the input data, which may not be sequential.  This mode allows
- * the input data to optimize its behavior if it does not need to store and
- * sort the frames.
- * If the input data supports parallel mode, it calls parallelDataStarted().
- * If the module returns true from this method, then it will process the frames
- * in the parallel mode.  If the module returns false, it will get the frames
- * in serial order.
- * If the input data does not support parallel mode, it calls dataStarted().
+ * See \ref module_analysisdata for an overview of the notifications the
+ * modules receive, and \ref page_analysisdata for overview of the terminology.
  *
  * Concrete modules typically do not directly derive from this interface, but
  * from either AnalysisDataModuleSerial or AnalysisDataModuleParallel.
@@ -217,6 +203,21 @@ class AnalysisDataModuleInterface
          *      implementing class to report errors.
          */
         virtual void frameFinished(const AnalysisDataFrameHeader &header) = 0;
+        /*! \brief
+         * Called in sequential order for each frame after they are finished.
+         *
+         * \param[in] frameIndex   Index of the next finished frame.
+         * \throws    unspecified  Can throw any exception required by the
+         *      implementing class to report errors.
+         *
+         * This method is called after frameFinished(), but with an additional
+         * constraint that it is always called in serial and with an increasing
+         * \p frameIndex.  Parallel data modules need this to serialize their
+         * data for downsteam serial modules; AnalysisDataModuleSerial provides
+         * an empty implementation, as there frameFinished() can be used for
+         * the same purpose.
+         */
+        virtual void frameFinishedSerial(int frameIndex) = 0;
         /*! \brief
          * Called (once) when no more data is available.
          *
@@ -253,6 +254,7 @@ class AnalysisDataModuleSerial : public AnalysisDataModuleInterface
         virtual bool parallelDataStarted(
             AbstractAnalysisData              *data,
             const AnalysisDataParallelOptions &options);
+        virtual void frameFinishedSerial(int /*frameIndex*/) {}
 };
 
 /*! \brief
@@ -278,7 +280,8 @@ class AnalysisDataModuleParallel : public AnalysisDataModuleInterface
         virtual void frameStarted(const AnalysisDataFrameHeader &frame)   = 0;
         virtual void pointsAdded(const AnalysisDataPointSetRef &points)   = 0;
         virtual void frameFinished(const AnalysisDataFrameHeader &header) = 0;
-        virtual void dataFinished() = 0;
+        virtual void frameFinishedSerial(int index) = 0;
+        virtual void dataFinished()                 = 0;
 
     private:
         virtual void dataStarted(AbstractAnalysisData *data);
index 779e7ec05cfe949450f7beed59b9222039a9d75a..ab10252807edcbf6598b097e371e10c66568d2b2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/datamodulemanager.h"
+#include "gmxpre.h"
+
+#include "datamodulemanager.h"
 
 #include <vector>
 
@@ -247,6 +249,7 @@ AnalysisDataModuleManager::Impl::presentData(AbstractAnalysisData        *data,
             module->pointsAdded(frame.pointSet(j));
         }
         module->frameFinished(frame.header());
+        module->frameFinishedSerial(frame.header().index());
     }
     if (state_ == eFinished)
     {
@@ -500,6 +503,11 @@ AnalysisDataModuleManager::notifyFrameFinish(const AnalysisDataFrameHeader &head
             }
         }
     }
+    Impl::ModuleList::const_iterator i;
+    for (i = impl_->modules_.begin(); i != impl_->modules_.end(); ++i)
+    {
+        i->module->frameFinishedSerial(header.index());
+    }
 }
 
 
index 81ebbbbeee1ec429466e62380131934d4818a87d..65c159431692f201ad8c7e21c24c6140d0443e3f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,9 +43,8 @@
 #ifndef GMX_ANALYSISDATA_DATAMODULEMANAGER_H
 #define GMX_ANALYSISDATA_DATAMODULEMANAGER_H
 
-#include "abstractdata.h"
-
-#include "../utility/common.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -55,6 +54,9 @@ class AnalysisDataParallelOptions;
 /*! \libinternal \brief
  * Encapsulates handling of data modules attached to AbstractAnalysisData.
  *
+ * See AnalysisDataModuleInterface and \ref module_analysisdata for more
+ * details on the notifications and the order in which they should be raised.
+ *
  * \inlibraryapi
  * \ingroup module_analysisdata
  */
@@ -243,6 +245,8 @@ class AnalysisDataModuleManager
          * notifyPointsAdd() calls for the frame.
          * \p header should be identical to that used in the corresponding
          * notifyFrameStart() call.
+         *
+         * This method also notifies parallel modules about serial end of frame.
          */
         void notifyFrameFinish(const AnalysisDataFrameHeader &header) const;
         /*! \brief
index 57040f6fefefdf6940949d8453e56fac16d457d5..c495aa93989a7968c098d47a79dba8e6e9726b53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "dataproxy.h"
 
 #include "gromacs/analysisdata/dataframe.h"
@@ -168,6 +170,17 @@ AnalysisDataProxy::frameFinished(const AnalysisDataFrameHeader &header)
     }
 }
 
+void
+AnalysisDataProxy::frameFinishedSerial(int frameIndex)
+{
+    if (bParallel_)
+    {
+        // The x and dx values are unused in this case.
+        AnalysisDataFrameHeader header(frameIndex, 0.0, 0.0);
+        moduleManager().notifyFrameFinish(header);
+    }
+}
+
 
 void
 AnalysisDataProxy::dataFinished()
index 50f6d52d5b861ebeb55e1c6512fbf9b79fae5115..72e6c852ce5c7934a79f34f56b9186986fee6572 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,8 +45,8 @@
 #ifndef GMX_ANALYSISDATA_DATAPROXY_H
 #define GMX_ANALYSISDATA_DATAPROXY_H
 
-#include "abstractdata.h"
-#include "datamodule.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/analysisdata/datamodule.h"
 
 namespace gmx
 {
@@ -91,6 +91,7 @@ class AnalysisDataProxy : public AbstractAnalysisData,
         virtual void frameStarted(const AnalysisDataFrameHeader &frame);
         virtual void pointsAdded(const AnalysisDataPointSetRef &points);
         virtual void frameFinished(const AnalysisDataFrameHeader &header);
+        virtual void frameFinishedSerial(int frameIndex);
         virtual void dataFinished();
 
     private:
index 57dfea17c7bbd6564a1d5e11edaf3bfd52ed6415..383a271e08c9c194938543825d87941256b65906 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "datastorage.h"
 
 #include <algorithm>
@@ -192,20 +194,12 @@ class AnalysisDataStorageImpl
         {
             return storageLimit_ > 0 || (pendingLimit_ > 1 && modules_->hasSerialModules());
         }
-        /*! \brief
-         * Calls notification methods for new frames.
-         *
-         * \param[in] firstLocation  First frame to consider.
-         * \throws    unspecified  Any exception thrown by frame notification
-         *      methods in AbstractAnalysisData.
-         *
-         * Notifies \a data_ of new frames (from \p firstLocation and after
-         * that) if all previous frames have already been notified.
-         * Also rotates the \a frames_ buffer as necessary.
-         */
-        void notifyNextFrames(size_t firstLocation);
         //! Implementation for AnalysisDataStorage::finishFrame().
         void finishFrame(int index);
+        /*! \brief
+         * Implementation for AnalysisDataStorage::finishFrameSerial().
+         */
+        void finishFrameSerial(int index);
 
 
         //! Parent data object to access data dimensionality etc.
@@ -500,48 +494,6 @@ AnalysisDataStorageImpl::getFrameBuilder()
 }
 
 
-void
-AnalysisDataStorageImpl::notifyNextFrames(size_t firstLocation)
-{
-    if (frames_[firstLocation]->frameIndex() != firstUnnotifiedIndex_)
-    {
-        return;
-    }
-    size_t i   = firstLocation;
-    size_t end = endStorageLocation();
-    while (i != end)
-    {
-        AnalysisDataStorageFrameData &storedFrame = *frames_[i];
-        if (!storedFrame.isFinished())
-        {
-            break;
-        }
-        if (!storedFrame.isNotified())
-        {
-            // Increment before the notifications to make the frame available
-            // in the module callbacks.
-            ++firstUnnotifiedIndex_;
-            modules_->notifyFrameStart(storedFrame.header());
-            for (int j = 0; j < storedFrame.pointSetCount(); ++j)
-            {
-                modules_->notifyPointsAdd(storedFrame.pointSet(j));
-            }
-            modules_->notifyFrameFinish(storedFrame.header());
-            storedFrame.markNotified();
-            if (storedFrame.frameIndex() >= storageLimit_)
-            {
-                rotateBuffer();
-            }
-        }
-        ++i;
-        if (!storeAll() && i >= frames_.size())
-        {
-            i = 0;
-        }
-    }
-}
-
-
 void
 AnalysisDataStorageImpl::finishFrame(int index)
 {
@@ -557,18 +509,48 @@ AnalysisDataStorageImpl::finishFrame(int index)
                        "Inconsistent internal frame indexing");
     builders_.push_back(storedFrame.finishFrame(isMultipoint()));
     modules_->notifyParallelFrameFinish(storedFrame.header());
+    if (pendingLimit_ == 1)
+    {
+        finishFrameSerial(index);
+    }
+}
+
+
+void
+AnalysisDataStorageImpl::finishFrameSerial(int index)
+{
+    GMX_RELEASE_ASSERT(index == firstUnnotifiedIndex_,
+                       "Out of order finisFrameSerial() calls");
+    const int storageIndex = computeStorageLocation(index);
+    GMX_RELEASE_ASSERT(storageIndex >= 0, "Out of bounds frame index");
+
+    AnalysisDataStorageFrameData &storedFrame = *frames_[storageIndex];
+    GMX_RELEASE_ASSERT(storedFrame.frameIndex() == index,
+                       "Inconsistent internal frame indexing");
+    GMX_RELEASE_ASSERT(storedFrame.isFinished(),
+                       "finishFrameSerial() called before finishFrame()");
+    GMX_RELEASE_ASSERT(!storedFrame.isNotified(),
+                       "finishFrameSerial() called twice for the same frame");
+    // Increment before the notifications to make the frame available
+    // in the module callbacks.
+    ++firstUnnotifiedIndex_;
     if (shouldNotifyImmediately())
     {
-        ++firstUnnotifiedIndex_;
         modules_->notifyFrameFinish(storedFrame.header());
-        if (storedFrame.frameIndex() >= storageLimit_)
+    }
+    else
+    {
+        modules_->notifyFrameStart(storedFrame.header());
+        for (int j = 0; j < storedFrame.pointSetCount(); ++j)
         {
-            rotateBuffer();
+            modules_->notifyPointsAdd(storedFrame.pointSet(j));
         }
+        modules_->notifyFrameFinish(storedFrame.header());
     }
-    else
+    storedFrame.markNotified();
+    if (storedFrame.frameIndex() >= storageLimit_)
     {
-        notifyNextFrames(storageIndex);
+        rotateBuffer();
     }
 }
 
@@ -868,7 +850,7 @@ AnalysisDataStorage::startParallelDataStorage(
         AnalysisDataModuleManager         *modules,
         const AnalysisDataParallelOptions &options)
 {
-    const int pendingLimit = 2 * options.parallelizationFactor() - 1;
+    const int pendingLimit = options.parallelizationFactor();
     impl_->pendingLimit_   = pendingLimit;
     modules->notifyParallelDataStart(data, options);
     // Data needs to be set before calling extendBuffer()
@@ -948,6 +930,15 @@ AnalysisDataStorage::finishFrame(int index)
     impl_->finishFrame(index);
 }
 
+void
+AnalysisDataStorage::finishFrameSerial(int index)
+{
+    if (impl_->pendingLimit_ > 1)
+    {
+        impl_->finishFrameSerial(index);
+    }
+}
+
 void
 AnalysisDataStorage::finishDataStorage()
 {
index 1f3f0cc582db764c42dbe3c7d3c50903a1ab0764..7f7aeca5dcadca3a4c3d4282cbb0530ab5408d95 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <vector>
 
-#include "../legacyheaders/types/simple.h"
-
-#include "../utility/common.h"
-#include "../utility/gmxassert.h"
-
-#include "dataframe.h"
+#include "gromacs/analysisdata/dataframe.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
@@ -252,11 +250,12 @@ class AnalysisDataStorageFrame
  * forwarded to frameCount(), tryGetDataFrame() and requestStorage().
  * Storage properties should be set up, and then startDataStorage() or
  * startParallelDataStorage() called.
- * New frames can then be added using startFrame(), currentFrame() and
- * finishFrame() methods.  When all frames are ready, finishDataStorage() must
- * be called.  These methods (and AnalysisDataStorageFrame::finishPointSet())
- * take the responsibility of calling all the notification methods in
- * AnalysisDataModuleManager,
+ * New frames can then be added using startFrame(), currentFrame(),
+ * finishFrame(), and finishFrameSerial() methods (the last is only necessary
+ * if startParallelDataStorage() is used).  When all frames are ready,
+ * finishDataStorage() must be called.  These methods (and
+ * AnalysisDataStorageFrame::finishPointSet()) take the responsibility of
+ * calling all the notification methods in AnalysisDataModuleManager,
  *
  * \todo
  * Proper multi-threaded implementation.
@@ -370,7 +369,7 @@ class AnalysisDataStorage
          * far in the future:
          * If \c i is the index of the last frame such that all frames from
          * 0, ..., \c i have been finished, then \p header().index() should be
-         * at most \c 2*parallelizationFactor-1 larger than \c i, where
+         * at most \c parallelizationFactor larger than \c i, where
          * parallelizationFactor is the parallelization factor passed to
          * setParallelOptions().
          * Throws APIError if this constraint is violated.
@@ -387,7 +386,7 @@ class AnalysisDataStorage
          */
         AnalysisDataStorageFrame &startFrame(int index, real x, real dx);
         /*! \brief
-         * Obtain a frame object for an in-progress frame.
+         * Obtains a frame object for an in-progress frame.
          *
          * \param[in] index  Frame index.
          * \retval  Frame object corresponding to \p index.
@@ -410,6 +409,21 @@ class AnalysisDataStorage
          * \see AnalysisDataStorageFrame::finishFrame()
          */
         void finishFrame(int index);
+        /*! \brief
+         * Performs in-order sequential processing for a data frame.
+         *
+         * \param[in] index  Frame index.
+         *
+         * If startParallelDataStorage() has been called with options that
+         * indicate parallelism, this method must be called after
+         * `finishFrame(index)` (or the equivalent call in
+         * AnalysisDataStorageFrame), such that it is called in the correct
+         * order sequentially for each frame.
+         *
+         * If there is no parallelism, this method does nothing; the equivalent
+         * processing is done already during finishFrame().
+         */
+        void finishFrameSerial(int index);
         /*! \brief
          * Finishes storing data.
          *
diff --git a/src/gromacs/analysisdata/framelocaldata.h b/src/gromacs/analysisdata/framelocaldata.h
new file mode 100644 (file)
index 0000000..f6fa5ca
--- /dev/null
@@ -0,0 +1,308 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Defines gmx::AnalysisDataFrameLocalData and supporting types.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_analysisdata
+ */
+#ifndef GMX_ANALYSISDATA_FRAMELOCALDATA_H
+#define GMX_ANALYSISDATA_FRAMELOCALDATA_H
+
+#include <algorithm>
+#include <numeric>
+#include <vector>
+
+#include "gromacs/analysisdata/paralleloptions.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+//! \addtogroup module_analysisdata
+//! \{
+
+/*! \internal
+ * \brief
+ * Handle to a single data set within frame-local data array.
+ *
+ * Methods in this class do not throw.
+ *
+ * \see AnalysisDataFrameLocalData
+ */
+template<typename ValueType>
+class AnalysisDataFrameLocalDataSetHandle
+{
+    public:
+        //! Constructs a handle from an array of values.
+        explicit AnalysisDataFrameLocalDataSetHandle(ArrayRef<ValueType> values)
+            : values_(values)
+        {
+        }
+
+        //! Clears all values in the data set.
+        void clear()
+        {
+            std::fill(values_.begin(), values_.end(), ValueType());
+        }
+
+        //! Accesses a single value in the data set.
+        ValueType &value(int column)
+        {
+            GMX_ASSERT(column >= 0 && column < static_cast<int>(values_.size()),
+                       "Invalid column index");
+            return values_[column];
+        }
+
+    private:
+        ArrayRef<ValueType>  values_;
+};
+
+/*! \internal
+ * \brief
+ * Handle to a single frame data within frame-local data array.
+ *
+ * Methods in this class do not throw.
+ *
+ * \see AnalysisDataFrameLocalData
+ */
+template<typename ValueType>
+class AnalysisDataFrameLocalDataHandle
+{
+    public:
+        //! Shorthand for the internal array of values.
+        typedef std::vector<ValueType> ValueArray;
+        //! Shorthand for a handle to a single data set.
+        typedef AnalysisDataFrameLocalDataSetHandle<ValueType> DataSetHandle;
+
+        //! Constructs a handle from specified frame data.
+        AnalysisDataFrameLocalDataHandle(const std::vector<int> *dataSetIndices,
+                                         ValueArray             *values)
+            : dataSetIndices_(dataSetIndices), values_(values)
+        {
+        }
+
+        //! Returns the number of data sets in the array.
+        int dataSetCount() const
+        {
+            return dataSetIndices_->size() - 1;
+        }
+        //! Clears all values in the frame.
+        void clear()
+        {
+            std::fill(values_->begin(), values_->end(), ValueType());
+        }
+
+        //! Returns a handle for a single data set.
+        DataSetHandle dataSet(int dataSet)
+        {
+            GMX_ASSERT(dataSet >= 0 && dataSet < dataSetCount(),
+                       "Invalid data set index");
+            const int firstIndex = (*dataSetIndices_)[dataSet];
+            const int lastIndex  = (*dataSetIndices_)[dataSet + 1];
+            typename ValueArray::iterator begin = values_->begin() + firstIndex;
+            typename ValueArray::iterator end   = values_->begin() + lastIndex;
+            return DataSetHandle(arrayRefFromVector<ValueType>(begin, end));
+        }
+        //! Accesses a single value in the frame.
+        ValueType &value(int dataSet, int column)
+        {
+            GMX_ASSERT(dataSet >= 0 && dataSet < dataSetCount(),
+                       "Invalid data set index");
+            const int firstIndex = (*dataSetIndices_)[dataSet];
+            GMX_ASSERT(column >= 0
+                       && column < (*dataSetIndices_)[dataSet+1] - firstIndex,
+                       "Invalid column index");
+            return (*values_)[firstIndex + column];
+        }
+
+    private:
+        const std::vector<int> *dataSetIndices_;
+        ValueArray             *values_;
+};
+
+/*! \internal \brief
+ * Container for an array of frame-local values that supports parallel data
+ * processing.
+ *
+ * \tparam ValueType Type of values to store.
+ *
+ * This class provides a convenient interface to create an array of frame-local
+ * data for use in analysis data modules that support parallel processing.
+ * The object is initialized by setting the desired dimensionality with
+ * setDataSetCount() and setColumnCount(), followed by a call to init(),
+ * typically in AnalysisDataModuleInterface::parallelDataStarted(),
+ *
+ * After initialization, frameData() can be used to access the data for a given
+ * frame, independently from other frames.  This works if the assumptions about
+ * parallelism hold: if `N` is the parallelization factor given for init() with
+ * AnalysisDataParallelOptions::parallelizationFactor(), then frame `i+N` must
+ * not be accessed before all processing for frame `i` is finished.
+ * Technically, the data for different frames is kept in a ring buffer of size
+ * `N`.
+ *
+ * The data for a frame is not cleared after it is reused for a new frame (but
+ * is initially cleared).  This allows using the data for accumulating values
+ * over all frames in a lock-free manner.
+ *
+ * frameDataSet() is provided for convenience when only a single data set
+ * needs to be accessed (typically in AnalysisDataModuleInterface::pointsAdded()).
+ *
+ * Methods in this class do not throw except where indicated.
+ *
+ * \see AnalysisDataFrameLocalData
+ */
+template<typename ValueType>
+class AnalysisDataFrameLocalData
+{
+    public:
+        //! Shorthand for the internal array of values for a frame.
+        typedef std::vector<ValueType> ValueArray;
+        //! Shorthand for a handle to a single frame.
+        typedef AnalysisDataFrameLocalDataHandle<ValueType> FrameHandle;
+        //! Shorthand for a handle to a single data set.
+        typedef AnalysisDataFrameLocalDataSetHandle<ValueType> DataSetHandle;
+
+        //! Constructs an empty container with a single data set.
+        AnalysisDataFrameLocalData()
+        {
+            dataSetColumns_.resize(2);
+        }
+
+        //! Whether init() has been called.
+        bool isInitialized() const { return !values_.empty(); }
+        /*! \brief
+         * Returns number of independent data frames in this object.
+         *
+         * This supports looping over all the frame arrays to, e.g., sum them
+         * up at the end in accumulation scenarios.
+         */
+        int frameCount() const { return values_.size(); }
+
+        /*! \brief
+         * Sets the number of data sets stored for each frame.
+         *
+         * \throws std::bad_alloc if out of memory.
+         *
+         * If not called, there is a single data set in the object.
+         * Cannot be called after init().
+         */
+        void setDataSetCount(int dataSetCount)
+        {
+            GMX_RELEASE_ASSERT(!isInitialized(),
+                               "Cannot change value count after init()");
+            GMX_RELEASE_ASSERT(dataSetCount >= 0,
+                               "Invalid data set count");
+            dataSetColumns_.resize(dataSetCount + 1);
+        }
+        /*! \brief
+         * Sets the number of columns stored for a data set.
+         *
+         * Must be called for each data set that needs to have values,
+         * otherwise there will be zero columns for that data set.
+         * Cannot be called after init().
+         */
+        void setColumnCount(int dataSet, int columnCount)
+        {
+            GMX_RELEASE_ASSERT(!isInitialized(),
+                               "Cannot change value count after init()");
+            GMX_RELEASE_ASSERT(dataSet >= 0 && dataSet < static_cast<int>(dataSetColumns_.size()) - 1,
+                               "Invalid data set index");
+            GMX_RELEASE_ASSERT(columnCount >= 0,
+                               "Invalid column count");
+            dataSetColumns_[dataSet + 1] = columnCount;
+        }
+
+        /*! \brief
+         * Initializes the storage to support specified parallelism.
+         *
+         * \throws std::bad_alloc if out of memory.
+         */
+        void init(const AnalysisDataParallelOptions &opt)
+        {
+            GMX_RELEASE_ASSERT(!isInitialized(), "init() called multiple times");
+            std::partial_sum(dataSetColumns_.begin(), dataSetColumns_.end(),
+                             dataSetColumns_.begin());
+            values_.resize(opt.parallelizationFactor());
+            typename std::vector<ValueArray>::iterator i;
+            for (i = values_.begin(); i != values_.end(); ++i)
+            {
+                i->resize(dataSetColumns_.back());
+            }
+        }
+
+        //! Returns a handle to access data for a frame.
+        FrameHandle frameData(int frameIndex)
+        {
+            GMX_ASSERT(frameIndex >= 0, "Invalid frame index");
+            GMX_ASSERT(isInitialized(), "Cannot access data before init()");
+            return FrameHandle(&dataSetColumns_,
+                               &values_[frameIndex % values_.size()]);
+        }
+        //! Returns a handle to access a single data set within a frame.
+        DataSetHandle frameDataSet(int frameIndex, int dataSet)
+        {
+            return frameData(frameIndex).dataSet(dataSet);
+        }
+
+    private:
+        /*! \brief
+         * Index to find data sets within a per-frame array in `values_`.
+         *
+         * The first entry is always zero, followed by one entry for each data
+         * set.  Before init(), the data set entries hold the numbers set with
+         * setColumnCount().  After init(), the data set entries hold the
+         * indices of the first column for that data set in the per-frame
+         * arrays in `values_`.
+         */
+        std::vector<int>         dataSetColumns_;
+        /*! \brief
+         * Data array for each frame.
+         *
+         * This is a ring buffer whose size is specified by the desired
+         * parallelism level.  For each frame, there is a single array of
+         * values, where the individual data sets are indexed with
+         * `dataSetColumns_`.
+         */
+        std::vector<ValueArray>  values_;
+};
+
+//! \}
+
+} // namespace gmx
+
+#endif
index e865340e5dd4c357158e8b2a374f84bd032099e6..61d8bc59a7c5c0c482d1736858a777546f07712f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2013, by the GROMACS development team, led by
+# Copyright (c) 2010,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # 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(ANALYSISDATA_MODULES_PUBLIC_HEADERS
+gmx_install_headers(
     average.h
     displacement.h
     histogram.h
     lifetime.h
-    plot.h)
-gmx_install_headers(analysisdata/modules ${ANALYSISDATA_MODULES_PUBLIC_HEADERS})
+    plot.h
+    )
index b8ee98259a812e4168aebb877bd0a644335f08d0..b4b02b9bd5a581646df489cdf9a91349a69992f1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "average.h"
 
 #include <cmath>
index 3f8f583f06af68de7dbb3bb267cc35cf0d3daa87..2bf12e2f0409a16687aafa301af49710bbfe24d1 100644 (file)
 
 #include <vector>
 
-#include "../abstractdata.h"
-#include "../arraydata.h"
-#include "../datamodule.h"
-#include "../../utility/common.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/analysisdata/arraydata.h"
+#include "gromacs/analysisdata/datamodule.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 52fd4193ed9a3e2a5022ba787098c4fff9b25376..9b9b2f468d142476098947a1fc85a9f169308264 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/modules/displacement.h"
+#include "gmxpre.h"
+
+#include "displacement.h"
 
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/analysisdata/datamodulemanager.h"
index 911477accc24853f8f03e9ca9e07380d5b6dd187..398acf11ad1e0254e4b11335dbc257353ab23005 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,8 +43,9 @@
 #ifndef GMX_ANALYSISDATA_MODULES_DISPLACEMENT_H
 #define GMX_ANALYSISDATA_MODULES_DISPLACEMENT_H
 
-#include "../abstractdata.h"
-#include "../datamodule.h"
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/analysisdata/datamodule.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
index 061b5fd8a5f5066617e83000ac963e47ac045043..53ffd297c94e0811fb6dae27be8e27adc0608c92 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "frameaverager.h"
 
 #include "gromacs/analysisdata/dataframe.h"
index 2a2da99314b02156665d457573fefc3f351d44e0..61867c24c4c084750d1c785d72413bb3675ebb3d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,9 +44,8 @@
 
 #include <vector>
 
-#include "../../legacyheaders/types/simple.h"
-
-#include "../../utility/gmxassert.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
index e48ea1b4bd05f3d1a534905474765eaf4461d5ee..3af98c887049fd257c9d0d179fe56deca256939f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include "gromacs/analysisdata/modules/histogram.h"
+#include "gmxpre.h"
+
+#include "histogram.h"
 
 #include <cmath>
 
@@ -48,6 +50,8 @@
 
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/analysisdata/datastorage.h"
+#include "gromacs/analysisdata/framelocaldata.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 
@@ -282,7 +286,7 @@ AbstractAverageHistogram::resampleDoubleBinWidth(bool bIntegerBins) const
 
     AverageHistogramPointer dest(
             new StaticAverageHistogram(
-                    histogramFromBins(xstart(), nbins, 2*xstep())
+                    histogramFromBins(settings().firstEdge(), nbins, 2*xstep())
                         .integerBins(bIntegerBins)));
     dest->setColumnCount(columnCount());
     dest->allocateValues();
@@ -329,6 +333,7 @@ AbstractAverageHistogram::clone() const
 {
     AverageHistogramPointer dest(new StaticAverageHistogram());
     copyContents(this, dest.get());
+    dest->settings_ = settings_;
     return dest;
 }
 
@@ -338,7 +343,7 @@ AbstractAverageHistogram::normalizeProbability()
 {
     for (int c = 0; c < columnCount(); ++c)
     {
-        real sum = 0;
+        double sum = 0;
         for (int i = 0; i < rowCount(); ++i)
         {
             sum += value(i, c).value();
@@ -350,6 +355,24 @@ AbstractAverageHistogram::normalizeProbability()
     }
 }
 
+void
+AbstractAverageHistogram::makeCumulative()
+{
+    for (int c = 0; c < columnCount(); ++c)
+    {
+        double sum = 0;
+        for (int i = 0; i < rowCount(); ++i)
+        {
+            sum += value(i, c).value();
+            // Clear the error, as we don't cumulate that.
+            value(i, c).clear();
+            value(i, c).setValue(sum);
+        }
+    }
+    setXAxis(settings().firstEdge() + settings().binWidth(),
+             settings().binWidth());
+}
+
 
 void
 AbstractAverageHistogram::scaleSingle(int index, real factor)
@@ -502,9 +525,14 @@ BasicAverageHistogramModule::dataFinished()
  * BasicHistogramImpl
  */
 
-/*! \internal \brief
- * Private implementation class for AnalysisDataSimpleHistogramModule and
- * AnalysisDataWeightedHistogramModule.
+/*! \internal
+ * \brief
+ * Base class for private implementation classes for histogram modules.
+ *
+ * Actual implementation classes are derived from this and add an accumulation
+ * data member that is specific to the histogram type in question.
+ * This is done like this to keep implementation details out of the header, and
+ * to not unnecessarily duplicate code.
  *
  * \ingroup module_analysisdata
  */
@@ -518,16 +546,13 @@ class BasicHistogramImpl
         BasicHistogramImpl();
         //! Creates an histogram impl with defined bin parameters.
         explicit BasicHistogramImpl(const AnalysisHistogramSettings &settings);
-        ~BasicHistogramImpl();
+        // Virtual only for simplicity.
+        virtual ~BasicHistogramImpl();
 
         /*! \brief
          * (Re)initializes the histogram from settings.
          */
         void init(const AnalysisHistogramSettings &settings);
-        /*! \brief
-         * Initializes data storage frame when a new frame starts.
-         */
-        void initFrame(int dataSetCount, AnalysisDataStorageFrame *frame);
 
         //! Storage implementation object.
         AnalysisDataStorage                  storage_;
@@ -560,21 +585,6 @@ void BasicHistogramImpl::init(const AnalysisHistogramSettings &settings)
     averager_->init(settings);
 }
 
-
-void
-BasicHistogramImpl::initFrame(int dataSetCount, AnalysisDataStorageFrame *frame)
-{
-    for (int s = 0; s < dataSetCount; ++s)
-    {
-        frame->selectDataSet(s);
-        for (int i = 0; i < frame->columnCount(); ++i)
-        {
-            frame->setValue(i, 0.0);
-        }
-    }
-    frame->selectDataSet(0);
-}
-
 }   // namespace internal
 
 
@@ -582,15 +592,37 @@ BasicHistogramImpl::initFrame(int dataSetCount, AnalysisDataStorageFrame *frame)
  * AnalysisDataSimpleHistogramModule
  */
 
+/*! \internal \brief
+ * Private implementation class for AnalysisDataSimpleHistogramModule.
+ *
+ * \ingroup module_analysisdata
+ */
+class AnalysisDataSimpleHistogramModule::Impl : public internal::BasicHistogramImpl
+{
+    public:
+        //! Shorthand for the per-frame accumulation data structure type.
+        typedef AnalysisDataFrameLocalData<gmx_int64_t> FrameLocalData;
+
+        Impl() {}
+        //! Creates an histogram impl with defined bin parameters.
+        explicit Impl(const AnalysisHistogramSettings &settings)
+            : BasicHistogramImpl(settings)
+        {
+        }
+
+        //! Accumulates the histogram within a frame.
+        FrameLocalData  accumulator_;
+};
+
 AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule()
-    : impl_(new internal::BasicHistogramImpl())
+    : impl_(new Impl())
 {
 }
 
 
 AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(
         const AnalysisHistogramSettings &settings)
-    : impl_(new internal::BasicHistogramImpl(settings))
+    : impl_(new Impl(settings))
 {
 }
 
@@ -641,11 +673,16 @@ AnalysisDataSimpleHistogramModule::parallelDataStarted(
         const AnalysisDataParallelOptions &options)
 {
     addModule(impl_->averager_);
-    setDataSetCount(data->dataSetCount());
-    for (int i = 0; i < data->dataSetCount(); ++i)
+    const int dataSetCount = data->dataSetCount();
+    const int columnCount  = settings().binCount();
+    setDataSetCount(dataSetCount);
+    impl_->accumulator_.setDataSetCount(dataSetCount);
+    for (int i = 0; i < dataSetCount; ++i)
     {
-        setColumnCount(i, settings().binCount());
+        setColumnCount(i, columnCount);
+        impl_->accumulator_.setColumnCount(i, columnCount);
     }
+    impl_->accumulator_.init(options);
     impl_->storage_.startParallelDataStorage(this, &moduleManager(), options);
     return true;
 }
@@ -654,17 +691,15 @@ AnalysisDataSimpleHistogramModule::parallelDataStarted(
 void
 AnalysisDataSimpleHistogramModule::frameStarted(const AnalysisDataFrameHeader &header)
 {
-    AnalysisDataStorageFrame &frame = impl_->storage_.startFrame(header);
-    impl_->initFrame(dataSetCount(), &frame);
+    impl_->accumulator_.frameData(header.index()).clear();
 }
 
 
 void
 AnalysisDataSimpleHistogramModule::pointsAdded(const AnalysisDataPointSetRef &points)
 {
-    AnalysisDataStorageFrame &frame =
-        impl_->storage_.currentFrame(points.frameIndex());
-    frame.selectDataSet(points.dataSetIndex());
+    Impl::FrameLocalData::DataSetHandle handle
+        = impl_->accumulator_.frameDataSet(points.frameIndex(), points.dataSetIndex());
     for (int i = 0; i < points.columnCount(); ++i)
     {
         if (points.present(i))
@@ -672,7 +707,7 @@ AnalysisDataSimpleHistogramModule::pointsAdded(const AnalysisDataPointSetRef &po
             const int bin = settings().findBin(points.y(i));
             if (bin != -1)
             {
-                frame.value(bin) += 1;
+                handle.value(bin) += 1;
             }
         }
     }
@@ -682,7 +717,27 @@ AnalysisDataSimpleHistogramModule::pointsAdded(const AnalysisDataPointSetRef &po
 void
 AnalysisDataSimpleHistogramModule::frameFinished(const AnalysisDataFrameHeader &header)
 {
-    impl_->storage_.finishFrame(header.index());
+    Impl::FrameLocalData::FrameHandle  handle
+        = impl_->accumulator_.frameData(header.index());
+    AnalysisDataStorageFrame          &frame = impl_->storage_.startFrame(header);
+    const int columnCount                    = settings().binCount();
+    for (int s = 0; s < dataSetCount(); ++s)
+    {
+        Impl::FrameLocalData::DataSetHandle dataSet = handle.dataSet(s);
+        frame.selectDataSet(s);
+        for (int i = 0; i < columnCount; ++i)
+        {
+            frame.setValue(i, dataSet.value(i));
+        }
+    }
+    frame.finishFrame();
+}
+
+
+void
+AnalysisDataSimpleHistogramModule::frameFinishedSerial(int frameIndex)
+{
+    impl_->storage_.finishFrameSerial(frameIndex);
 }
 
 
@@ -711,15 +766,37 @@ AnalysisDataSimpleHistogramModule::requestStorageInternal(int nframes)
  * AnalysisDataWeightedHistogramModule
  */
 
+/*! \internal \brief
+ * Private implementation class for AnalysisDataWeightedHistogramModule.
+ *
+ * \ingroup module_analysisdata
+ */
+class AnalysisDataWeightedHistogramModule::Impl : public internal::BasicHistogramImpl
+{
+    public:
+        //! Shorthand for the per-frame accumulation data structure type.
+        typedef AnalysisDataFrameLocalData<double> FrameLocalData;
+
+        Impl() {}
+        //! Creates an histogram impl with defined bin parameters.
+        explicit Impl(const AnalysisHistogramSettings &settings)
+            : BasicHistogramImpl(settings)
+        {
+        }
+
+        //! Accumulates the histogram within a frame.
+        FrameLocalData  accumulator_;
+};
+
 AnalysisDataWeightedHistogramModule::AnalysisDataWeightedHistogramModule()
-    : impl_(new internal::BasicHistogramImpl())
+    : impl_(new Impl())
 {
 }
 
 
 AnalysisDataWeightedHistogramModule::AnalysisDataWeightedHistogramModule(
         const AnalysisHistogramSettings &settings)
-    : impl_(new internal::BasicHistogramImpl(settings))
+    : impl_(new Impl(settings))
 {
 }
 
@@ -769,11 +846,16 @@ AnalysisDataWeightedHistogramModule::parallelDataStarted(
         const AnalysisDataParallelOptions &options)
 {
     addModule(impl_->averager_);
-    setDataSetCount(data->dataSetCount());
-    for (int i = 0; i < data->dataSetCount(); ++i)
+    const int dataSetCount = data->dataSetCount();
+    const int columnCount  = settings().binCount();
+    setDataSetCount(dataSetCount);
+    impl_->accumulator_.setDataSetCount(dataSetCount);
+    for (int i = 0; i < dataSetCount; ++i)
     {
-        setColumnCount(i, settings().binCount());
+        setColumnCount(i, columnCount);
+        impl_->accumulator_.setColumnCount(i, columnCount);
     }
+    impl_->accumulator_.init(options);
     impl_->storage_.startParallelDataStorage(this, &moduleManager(), options);
     return true;
 }
@@ -782,8 +864,7 @@ AnalysisDataWeightedHistogramModule::parallelDataStarted(
 void
 AnalysisDataWeightedHistogramModule::frameStarted(const AnalysisDataFrameHeader &header)
 {
-    AnalysisDataStorageFrame &frame = impl_->storage_.startFrame(header);
-    impl_->initFrame(dataSetCount(), &frame);
+    impl_->accumulator_.frameData(header.index()).clear();
 }
 
 
@@ -797,12 +878,11 @@ AnalysisDataWeightedHistogramModule::pointsAdded(const AnalysisDataPointSetRef &
     int bin = settings().findBin(points.y(0));
     if (bin != -1)
     {
-        AnalysisDataStorageFrame &frame =
-            impl_->storage_.currentFrame(points.frameIndex());
-        frame.selectDataSet(points.dataSetIndex());
+        Impl::FrameLocalData::DataSetHandle  handle
+            = impl_->accumulator_.frameDataSet(points.frameIndex(), points.dataSetIndex());
         for (int i = 1; i < points.columnCount(); ++i)
         {
-            frame.value(bin) += points.y(i);
+            handle.value(bin) += points.y(i);
         }
     }
 }
@@ -811,7 +891,27 @@ AnalysisDataWeightedHistogramModule::pointsAdded(const AnalysisDataPointSetRef &
 void
 AnalysisDataWeightedHistogramModule::frameFinished(const AnalysisDataFrameHeader &header)
 {
-    impl_->storage_.finishFrame(header.index());
+    Impl::FrameLocalData::FrameHandle  handle
+        = impl_->accumulator_.frameData(header.index());
+    AnalysisDataStorageFrame          &frame = impl_->storage_.startFrame(header);
+    const int columnCount                    = settings().binCount();
+    for (int s = 0; s < dataSetCount(); ++s)
+    {
+        Impl::FrameLocalData::DataSetHandle dataSet = handle.dataSet(s);
+        frame.selectDataSet(s);
+        for (int i = 0; i < columnCount; ++i)
+        {
+            frame.setValue(i, dataSet.value(i));
+        }
+    }
+    frame.finishFrame();
+}
+
+
+void
+AnalysisDataWeightedHistogramModule::frameFinishedSerial(int frameIndex)
+{
+    impl_->storage_.finishFrameSerial(frameIndex);
 }
 
 
index 3b626cba259f45b6560dc66d6a91a55aa99ebf58..2811b72e03af5f9a69703fc9b213bbb27c0ce29b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_ANALYSISDATA_MODULES_HISTOGRAM_H
 #define GMX_ANALYSISDATA_MODULES_HISTOGRAM_H
 
-#include "../abstractdata.h"
-#include "../arraydata.h"
-#include "../datamodule.h"
-#include "../../utility/uniqueptr.h"
+#include <boost/shared_ptr.hpp>
+
+#include "gromacs/analysisdata/abstractdata.h"
+#include "gromacs/analysisdata/arraydata.h"
+#include "gromacs/analysisdata/datamodule.h"
 
 namespace gmx
 {
@@ -236,17 +237,10 @@ class AnalysisHistogramSettings
 };
 
 
-namespace internal
-{
-
-class BasicHistogramImpl;
-
-}   // namespace internal
-
 class AbstractAverageHistogram;
 
 //! Smart pointer to manage an AbstractAverageHistogram object.
-typedef gmx_unique_ptr<AbstractAverageHistogram>::type
+typedef boost::shared_ptr<AbstractAverageHistogram>
     AverageHistogramPointer;
 
 /*! \brief
@@ -261,6 +255,8 @@ typedef gmx_unique_ptr<AbstractAverageHistogram>::type
  *
  * This class can represent multiple histograms in one object: each column in
  * the data is an independent histogram.
+ * The X values correspond to center of the bins, except for a cumulative
+ * histogram made with makeCumulative().
  *
  * \inpublicapi
  * \ingroup module_analysisdata
@@ -276,6 +272,9 @@ class AbstractAverageHistogram : public AbstractAnalysisArrayData
         /*! \brief
          * Creates a copy of the histogram with double the bin width.
          *
+         * \param[in] bIntegerBins If `true`, the first bin in the result will
+         *     cover the first bin from the source. Otherwise, the first bin
+         *     will cover first two bins from the source.
          * \throws std::bad_alloc if out of memory.
          *
          * The caller is responsible of deleting the returned object.
@@ -295,6 +294,14 @@ class AbstractAverageHistogram : public AbstractAnalysisArrayData
         AverageHistogramPointer clone() const;
         //! Normalizes the histogram such that the integral over it is one.
         void normalizeProbability();
+        /*! \brief
+         * Makes the histograms cumulative by summing up each bin to all bins
+         * after it.
+         *
+         * The X values in the data are adjusted such that they match the right
+         * edges of bins instead of bin centers.
+         */
+        void makeCumulative();
         //! Scales a single histogram by a uniform scaling factor.
         void scaleSingle(int index, real factor);
         //! Scales all histograms by a uniform scaling factor.
@@ -343,6 +350,10 @@ class AbstractAverageHistogram : public AbstractAnalysisArrayData
  * The number of columns for all data sets equals the number of bins in the
  * histogram.
  *
+ * The histograms are accumulated as 64-bit integers within a frame and summed
+ * in double precision across frames, even if the output data is in single
+ * precision.
+ *
  * \inpublicapi
  * \ingroup module_analysisdata
  */
@@ -389,13 +400,16 @@ class AnalysisDataSimpleHistogramModule : public AbstractAnalysisData,
         virtual void frameStarted(const AnalysisDataFrameHeader &header);
         virtual void pointsAdded(const AnalysisDataPointSetRef &points);
         virtual void frameFinished(const AnalysisDataFrameHeader &header);
+        virtual void frameFinishedSerial(int frameIndex);
         virtual void dataFinished();
 
     private:
         virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
         virtual bool requestStorageInternal(int nframes);
 
-        PrivateImplPointer<internal::BasicHistogramImpl> impl_;
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
 
         // Copy and assign disallowed by base.
 };
@@ -416,6 +430,9 @@ class AnalysisDataSimpleHistogramModule : public AbstractAnalysisData,
  * The number of columns for all data sets equals the number of bins in the
  * histogram.
  *
+ * The histograms are accumulated in double precision, even if the output data
+ * is in single precision.
+ *
  * \inpublicapi
  * \ingroup module_analysisdata
  */
@@ -448,13 +465,16 @@ class AnalysisDataWeightedHistogramModule : public AbstractAnalysisData,
         virtual void frameStarted(const AnalysisDataFrameHeader &header);
         virtual void pointsAdded(const AnalysisDataPointSetRef &points);
         virtual void frameFinished(const AnalysisDataFrameHeader &header);
+        virtual void frameFinishedSerial(int frameIndex);
         virtual void dataFinished();
 
     private:
         virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
         virtual bool requestStorageInternal(int nframes);
 
-        PrivateImplPointer<internal::BasicHistogramImpl> impl_;
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
 
         // Copy and assign disallowed by base.
 };
index c6af8d597e953edc02735d67b1c1c3ba8e232e3d..b375fcf5b8bc78294d015dff82d12d11af5d76c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "lifetime.h"
 
 #include <cmath>
index 64560fdcdb525d058807c8bec034c050a35ea6cb..728b95683132590b406484cd53d25de5d95cbf15 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,9 +43,9 @@
 #ifndef GMX_ANALYSISDATA_MODULES_LIFETIME_H
 #define GMX_ANALYSISDATA_MODULES_LIFETIME_H
 
-#include "../arraydata.h"
-#include "../datamodule.h"
-#include "../../utility/common.h"
+#include "gromacs/analysisdata/arraydata.h"
+#include "gromacs/analysisdata/datamodule.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index ca66a1fdf75716ed9b2fa210f05570b4c2264ebe..e60648e4fa333b6275fca1396b92755817598e3a 100644 (file)
  * \ingroup module_analysisdata
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  */
-#include "gromacs/analysisdata/modules/plot.h"
+#include "gmxpre.h"
 
-#include <string>
-#include <vector>
+#include "plot.h"
 
 #include <cstdio>
 #include <cstring>
 
-#include <boost/shared_ptr.hpp>
+#include <string>
+#include <vector>
 
-#include "gromacs/legacyheaders/oenv.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "gromacs/legacyheaders/xvgr.h"
+#include <boost/shared_ptr.hpp>
 
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/options/timeunitmanager.h"
@@ -225,6 +226,12 @@ AbstractPlotModule::setTitle(const char *title)
     impl_->title_ = title;
 }
 
+void
+AbstractPlotModule::setTitle(const std::string &title)
+{
+    impl_->title_ = title;
+}
+
 
 void
 AbstractPlotModule::setSubtitle(const char *subtitle)
@@ -233,6 +240,13 @@ AbstractPlotModule::setSubtitle(const char *subtitle)
 }
 
 
+void
+AbstractPlotModule::setSubtitle(const std::string &subtitle)
+{
+    impl_->subtitle_ = subtitle;
+}
+
+
 void
 AbstractPlotModule::setXLabel(const char *label)
 {
@@ -331,7 +345,7 @@ AbstractPlotModule::dataStarted(AbstractAnalysisData * /* data */)
                    ? static_cast<xvg_format_t>(impl_->settings_.plotFormat())
                    : exvgNONE);
             output_env_t                  oenv;
-            output_env_init(&oenv, getProgramContext(), time_unit, FALSE, xvg_format, 0, 0);
+            output_env_init(&oenv, getProgramContext(), time_unit, FALSE, xvg_format, 0);
             boost::shared_ptr<output_env> oenvGuard(oenv, &output_env_done);
             impl_->fp_ = xvgropen(impl_->filename_.c_str(), impl_->title_.c_str(),
                                   impl_->xlabel_.c_str(), impl_->ylabel_.c_str(),
index 916fa4a151eaba6e3ebe6ced0a6b9474cbf8bb6b..78c48d5eecfe2957b58de860703487e8b7ff9e4f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,9 +47,9 @@
 
 #include <boost/shared_ptr.hpp>
 
-#include "../datamodule.h"
-#include "../../options/timeunitmanager.h"
-#include "../../utility/common.h"
+#include "gromacs/analysisdata/datamodule.h"
+#include "gromacs/options/timeunitmanager.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -177,10 +177,14 @@ class AbstractPlotModule : public AnalysisDataModuleSerial
          * Set plot title.
          */
         void setTitle(const char *title);
+        //! \copydoc setTitle(const char *)
+        void setTitle(const std::string &title);
         /*! \brief
          * Set plot subtitle.
          */
         void setSubtitle(const char *subtitle);
+        //! \copydoc setSubtitle(const char *)
+        void setSubtitle(const std::string &subtitle);
         /*! \brief
          * Set X axis label.
          */
index 6891bcef401e112d60e04fec3aa3c8d1f0b96142..4332f2764132026f0c21be6b643b5abed29b02f8 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
+#include "gromacs/analysisdata/analysisdata.h"
+
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/paralleloptions.h"
 #include "gromacs/utility/exceptions.h"
 
@@ -410,7 +413,10 @@ TYPED_TEST(AnalysisDataCommonTest, CallsModuleCorrectlyWithOutOfOrderFrames)
     ASSERT_NO_THROW_GMX(handle2 = this->data_.startData(options));
     ASSERT_NO_THROW_GMX(AnalysisDataTest::presentDataFrame(this->input_, 1, handle1));
     ASSERT_NO_THROW_GMX(AnalysisDataTest::presentDataFrame(this->input_, 0, handle2));
+    ASSERT_NO_THROW_GMX(this->data_.finishFrameSerial(0));
+    ASSERT_NO_THROW_GMX(this->data_.finishFrameSerial(1));
     ASSERT_NO_THROW_GMX(AnalysisDataTest::presentDataFrame(this->input_, 2, handle1));
+    ASSERT_NO_THROW_GMX(this->data_.finishFrameSerial(2));
     ASSERT_NO_THROW_GMX(handle1.finishData());
     ASSERT_NO_THROW_GMX(handle2.finishData());
 }
index 184a0ef631f53a15b79f00342a41efcf848479c7..a1d2755bf48e0f57de17e8d7411f7d498f253d62 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/analysisdata/arraydata.h"
 
+#include <gtest/gtest.h>
+
 #include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
 
index 7ee8b775dc3567a87e7757b9fbfa4550d298534f..cdeabbb77d0fa160f0761b1df16d4ba0e9b563b6 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
+#include "gromacs/analysisdata/modules/average.h"
+
 #include <gtest/gtest.h>
 
 #include "gromacs/analysisdata/analysisdata.h"
-#include "gromacs/analysisdata/modules/average.h"
 
 #include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
index 5093cdffec655e98b82e818f06af9e56d05f2761..b2a787bbbebc0dd9a483bd5d5ac0ba6bb1329725 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "datatest.h"
 
 #include <gmock/gmock.h>
index 09f41274706c6bc50863b15062b313f33706cdb2..6d85dd6b05c080827daef2ca26cb912b77ab9b2b 100644 (file)
 
 #include <gtest/gtest.h>
 
-#include "gromacs/legacyheaders/types/simple.h"
-
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 
 #include "testutils/refdata.h"
 
index 8a4cdacd1dfeee5937bda5630b8dcaaeeae8209b..3fef0ef42ceab21d90eb0770ea561cefdc9660f5 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
+#include "gromacs/analysisdata/modules/histogram.h"
+
 #include <gtest/gtest.h>
 
 #include "gromacs/analysisdata/analysisdata.h"
-#include "gromacs/analysisdata/modules/histogram.h"
 
 #include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
@@ -520,6 +523,24 @@ TEST_F(AbstractAverageHistogramTest, ClonesCorrectly)
 }
 
 
+TEST_F(AbstractAverageHistogramTest, ComputesCumulativeHistogram)
+{
+    const AnalysisDataTestInput &input = AverageInputData::get();
+    MockAverageHistogram         data(
+            gmx::histogramFromBins(1.0, input.frameCount(), 0.5).integerBins());
+    setupArrayData(input, &data);
+
+    ASSERT_NO_THROW_GMX(addStaticCheckerModule(input, &data));
+    ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data));
+    ASSERT_NO_THROW_GMX(data.done());
+
+    gmx::AverageHistogramPointer cumulative(data.clone());
+    cumulative->makeCumulative();
+    ASSERT_NO_THROW_GMX(addReferenceCheckerModule("CumulativeHistogram", cumulative.get()));
+    ASSERT_NO_THROW_GMX(cumulative->done());
+}
+
+
 TEST_F(AbstractAverageHistogramTest, ResamplesAtDoubleBinWidth)
 {
     const AnalysisDataTestInput &input = AverageInputData::get();
index 52a29833af5b00da307da147e773d97079baac4e..1549d2a89ad54ce65cfa3018c0e23ec2faaa9412 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
+#include "gromacs/analysisdata/modules/lifetime.h"
+
 #include <gtest/gtest.h>
 
 #include "gromacs/analysisdata/analysisdata.h"
-#include "gromacs/analysisdata/modules/lifetime.h"
 
 #include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
index ce4887ede0fe436eab75b336a8f4f03618bb1a5f..cdd1ec5490679060aaa43cf50916e1370db3b6e7 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_analysisdata
  */
+#include "gmxpre.h"
+
 #include "mock_datamodule.h"
 
 #include <gmock/gmock.h>
@@ -98,9 +100,16 @@ class MockAnalysisDataModule::Impl
          * Callback used to check frame finish against reference data.
          *
          * Called to check parameters and order of calls to frameFinished().
-         * \a frameIndex_ is incremented here.
          */
         void finishReferenceFrame(const AnalysisDataFrameHeader &header);
+        /*! \brief
+         * Callback used to check serial frame finish with reference data.
+         *
+         * Called to check parameters and order of calls to
+         * frameFinishedSerial().
+         * \a frameIndex_ is incremented here.
+         */
+        void finishReferenceFrameSerial(int frameIndex);
 
         /*! \brief
          * Reference data checker to use for checking frames.
@@ -214,11 +223,19 @@ MockAnalysisDataModule::Impl::finishReferenceFrame(
 {
     EXPECT_TRUE(frameChecker_.get() != NULL);
     EXPECT_EQ(frameIndex_, header.index());
-    ++frameIndex_;
     frameChecker_.reset();
 }
 
 
+void
+MockAnalysisDataModule::Impl::finishReferenceFrameSerial(int frameIndex)
+{
+    EXPECT_TRUE(frameChecker_.get() == NULL);
+    EXPECT_EQ(frameIndex_, frameIndex);
+    ++frameIndex_;
+}
+
+
 /********************************************************************
  * MockAnalysisDataModule
  */
@@ -524,6 +541,7 @@ MockAnalysisDataModule::setupStaticCheck(const AnalysisDataTestInput &data,
             EXPECT_CALL(*this, parallelDataStarted(source, _))
                 .WillOnce(Return(true));
         ::testing::ExpectationSet framesFinished;
+        ::testing::Expectation    prevFinish;
         for (int row = 0; row < data.frameCount(); ++row)
         {
             ::testing::InSequence frameSequence;
@@ -539,9 +557,20 @@ MockAnalysisDataModule::setupStaticCheck(const AnalysisDataTestInput &data,
                 EXPECT_CALL(*this, pointsAdded(Property(&AnalysisDataPointSetRef::frameIndex, row)))
                     .WillOnce(Invoke(checker));
             }
-            framesFinished +=
-                EXPECT_CALL(*this, frameFinished(Property(&AnalysisDataFrameHeader::index, row)))
-                    .WillOnce(Invoke(StaticDataFrameHeaderChecker(&frame)));
+            EXPECT_CALL(*this, frameFinished(Property(&AnalysisDataFrameHeader::index, row)))
+                .WillOnce(Invoke(StaticDataFrameHeaderChecker(&frame)));
+            ::testing::Expectation finish;
+            if (row > 0)
+            {
+                finish = EXPECT_CALL(*this, frameFinishedSerial(row))
+                        .After(prevFinish);
+            }
+            else
+            {
+                finish = EXPECT_CALL(*this, frameFinishedSerial(row));
+            }
+            framesFinished += finish;
+            prevFinish      = finish;
         }
         EXPECT_CALL(*this, dataFinished())
             .After(framesFinished);
@@ -565,6 +594,7 @@ MockAnalysisDataModule::setupStaticCheck(const AnalysisDataTestInput &data,
             }
             EXPECT_CALL(*this, frameFinished(_))
                 .WillOnce(Invoke(StaticDataFrameHeaderChecker(&frame)));
+            EXPECT_CALL(*this, frameFinishedSerial(row));
         }
         EXPECT_CALL(*this, dataFinished());
     }
@@ -601,6 +631,7 @@ MockAnalysisDataModule::setupStaticColumnCheck(
         }
         EXPECT_CALL(*this, frameFinished(_))
             .WillOnce(Invoke(StaticDataFrameHeaderChecker(&frame)));
+        EXPECT_CALL(*this, frameFinishedSerial(row));
     }
     EXPECT_CALL(*this, dataFinished());
 }
@@ -635,6 +666,7 @@ MockAnalysisDataModule::setupStaticStorageCheck(
         }
         EXPECT_CALL(*this, frameFinished(_))
             .WillOnce(Invoke(StaticDataFrameHeaderChecker(&frame)));
+        EXPECT_CALL(*this, frameFinishedSerial(row));
     }
     EXPECT_CALL(*this, dataFinished());
 }
@@ -669,8 +701,11 @@ MockAnalysisDataModule::setupReferenceCheck(const TestReferenceChecker &checker,
     Expectation frameFinish = EXPECT_CALL(*this, frameFinished(_))
             .After(dataStart)
             .WillRepeatedly(Invoke(impl_.get(), &Impl::finishReferenceFrame));
+    Expectation frameFinishSerial = EXPECT_CALL(*this, frameFinishedSerial(_))
+            .After(dataStart)
+            .WillRepeatedly(Invoke(impl_.get(), &Impl::finishReferenceFrameSerial));
     EXPECT_CALL(*this, dataFinished())
-        .After(frameStart, pointsAdd, frameFinish);
+        .After(frameStart, pointsAdd, frameFinish, frameFinishSerial);
 }
 
 } // namespace test
index bbc18bded7c085a19b6ff79782f0abe12bee8667..ebb4baa2f84b78ede83a17851986b2b01e5c9503 100644 (file)
@@ -51,7 +51,7 @@
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/analysisdata/datamodule.h"
 #include "gromacs/analysisdata/paralleloptions.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -76,6 +76,7 @@ class MockAnalysisDataModule : public AnalysisDataModuleInterface
         MOCK_METHOD1(frameStarted, void(const AnalysisDataFrameHeader &header));
         MOCK_METHOD1(pointsAdded, void(const AnalysisDataPointSetRef &points));
         MOCK_METHOD1(frameFinished, void(const AnalysisDataFrameHeader &header));
+        MOCK_METHOD1(frameFinishedSerial, void(int frameIndex));
         MOCK_METHOD0(dataFinished, void());
 
         void setupStaticCheck(const AnalysisDataTestInput &data,
diff --git a/src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ComputesCumulativeHistogram.xml b/src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ComputesCumulativeHistogram.xml
new file mode 100644 (file)
index 0000000..e7bd9d2
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <AnalysisData Name="InputData">
+    <DataFrame Name="Frame0">
+      <Real Name="X">1</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">2</Real>
+          <Real Name="Error">1</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame1">
+      <Real Name="X">1.5</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">1</Real>
+          <Real Name="Error">1</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame2">
+      <Real Name="X">2</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">3</Real>
+          <Real Name="Error">2</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame3">
+      <Real Name="X">2.5</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">4</Real>
+          <Real Name="Error">2</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame4">
+      <Real Name="X">3</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">2</Real>
+          <Real Name="Error">1</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame5">
+      <Real Name="X">3.5</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">0</Real>
+          <Real Name="Error">3</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame6">
+      <Real Name="X">4</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">1</Real>
+          <Real Name="Error">3</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+  </AnalysisData>
+  <AnalysisData Name="CumulativeHistogram">
+    <DataFrame Name="Frame0">
+      <Real Name="X">1.25</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">2</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame1">
+      <Real Name="X">1.75</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">3</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame2">
+      <Real Name="X">2.25</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">6</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame3">
+      <Real Name="X">2.75</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">10</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame4">
+      <Real Name="X">3.25</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">12</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame5">
+      <Real Name="X">3.75</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">12</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+    <DataFrame Name="Frame6">
+      <Real Name="X">4.25</Real>
+      <DataValues>
+        <Int Name="Count">1</Int>
+        <DataValue>
+          <Real Name="Value">13</Real>
+        </DataValue>
+      </DataValues>
+    </DataFrame>
+  </AnalysisData>
+</ReferenceData>
index c0784a5e4cedc26adcffffb9f8a5b85aaff8c272..02a3193019123f5813a276a0bf72d85b7b8dd3d5 100644 (file)
@@ -75,7 +75,7 @@
   </AnalysisData>
   <AnalysisData Name="ResampledHistogram">
     <DataFrame Name="Frame0">
-      <Real Name="X">1.5</Real>
+      <Real Name="X">1.25</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
@@ -85,7 +85,7 @@
       </DataValues>
     </DataFrame>
     <DataFrame Name="Frame1">
-      <Real Name="X">2.5</Real>
+      <Real Name="X">2.25</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
@@ -95,7 +95,7 @@
       </DataValues>
     </DataFrame>
     <DataFrame Name="Frame2">
-      <Real Name="X">3.5</Real>
+      <Real Name="X">3.25</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
index 211357e775840e5055f7a701d6da691ca898371f..ffebb62053227d41eb5c5de460a9d97d432b53dc 100644 (file)
@@ -75,7 +75,7 @@
   </AnalysisData>
   <AnalysisData Name="ResampledHistogram">
     <DataFrame Name="Frame0">
-      <Real Name="X">1</Real>
+      <Real Name="X">0.75</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
@@ -85,7 +85,7 @@
       </DataValues>
     </DataFrame>
     <DataFrame Name="Frame1">
-      <Real Name="X">2</Real>
+      <Real Name="X">1.75</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
@@ -95,7 +95,7 @@
       </DataValues>
     </DataFrame>
     <DataFrame Name="Frame2">
-      <Real Name="X">3</Real>
+      <Real Name="X">2.75</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
       </DataValues>
     </DataFrame>
     <DataFrame Name="Frame3">
-      <Real Name="X">4</Real>
+      <Real Name="X">3.75</Real>
       <DataValues>
         <Int Name="Count">1</Int>
         <DataValue>
index d29ba2668f63a35b2bae5a2cd1d9d17e67ba27c5..2b1c2df26f50f6d4814de56aa54d84186b84caa0 100644 (file)
@@ -47,7 +47,8 @@
  *  - Helper classes/functions for implementing the %main() function.
  *    See \ref page_usinglibrary for an overview of those available for user
  *    programs.  These are declared in cmdlineinit.h
- *    (gmx::CommandLineModuleInterface is declared in cmdlinemodule.h).
+ *    (gmx::CommandLineModuleInterface is declared in cmdlinemodule.h and
+ *    gmx::CommandLineOptionsInterface in cmdlineoptionsmodule.h).
  *    \if libapi
  *
  *    Additionally, for internal \Gromacs use, gmx::CommandLineModuleManager
 #ifndef GMX_COMMANDLINE_H
 #define GMX_COMMANDLINE_H
 
-#include "commandline/cmdlinehelpwriter.h"
-#include "commandline/cmdlineinit.h"
-#include "commandline/cmdlinemodule.h"
-#include "commandline/cmdlineparser.h"
-#include "commandline/pargs.h"
+#include "gromacs/commandline/cmdlinehelpwriter.h"
+#include "gromacs/commandline/cmdlineinit.h"
+#include "gromacs/commandline/cmdlinemodule.h"
+#include "gromacs/commandline/cmdlineoptionsmodule.h"
+#include "gromacs/commandline/cmdlineparser.h"
+#include "gromacs/commandline/pargs.h"
 
 #endif
index 5efde47341da86d99794c6110aa9b77f1c8bae44..f247402c525e2ca36a126782bae31e7cdf609304 100644 (file)
 file(GLOB COMMANDLINE_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${COMMANDLINE_SOURCES} PARENT_SCOPE)
 
-set(COMMANDLINE_PUBLIC_HEADERS
+gmx_install_headers(
     cmdlinehelpwriter.h
     cmdlineinit.h
     cmdlinemodule.h
+    cmdlineoptionsmodule.h
     cmdlineparser.h
     cmdlineprogramcontext.h
-    pargs.h)
-gmx_install_headers(commandline ${COMMANDLINE_PUBLIC_HEADERS})
+    pargs.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index b2ae873e47ac0d5c8c61990a597c048e14219dd4..e98997e5bf0aef0b68d44cc85f11d56bb82fcc2a 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
 #include "cmdlinehelpcontext.h"
 
-#include "gromacs/commandline/shellcompletions.h"
 #include "gromacs/utility/gmxassert.h"
 
+#include "shellcompletions.h"
+
 namespace gmx
 {
 
index 154facababb6da14390e4f388c45bdfecdfff4d0..f682e2206041db327ab38cc013d5e2e3ed54179c 100644 (file)
@@ -43,8 +43,8 @@
 #ifndef GMX_COMMANDLINE_CMDLINEHELPCONTEXT_H
 #define GMX_COMMANDLINE_CMDLINEHELPCONTEXT_H
 
-#include "../onlinehelp/helpwritercontext.h"
-#include "../utility/common.h"
+#include "gromacs/onlinehelp/helpwritercontext.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index f1cc893b11f342659159fc4cd6d7b30df6be9e81..3a67a1ff4ab4008f77a9d825c305bc561abca3ac 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
-#include "gromacs/commandline/cmdlinehelpmodule.h"
+#include "gmxpre.h"
+
+#include "cmdlinehelpmodule.h"
 
 #include <string>
 #include <vector>
@@ -49,7 +51,6 @@
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinehelpwriter.h"
 #include "gromacs/commandline/cmdlineparser.h"
-#include "gromacs/commandline/shellcompletions.h"
 #include "gromacs/onlinehelp/helpformat.h"
 #include "gromacs/onlinehelp/helpmanager.h"
 #include "gromacs/onlinehelp/helptopic.h"
@@ -63,6 +64,8 @@
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "shellcompletions.h"
+
 namespace gmx
 {
 
@@ -133,15 +136,15 @@ class RootHelpTopic : public CompositeHelpTopic<RootHelpText>
          *
          * Does not throw.
          */
-        explicit RootHelpTopic(const std::string &binaryName)
-            : binaryName_(binaryName)
+        explicit RootHelpTopic(const CommandLineHelpModuleImpl &helpModule)
+            : helpModule_(helpModule)
         {
         }
 
         virtual void writeHelp(const HelpWriterContext &context) const;
 
     private:
-        std::string                 binaryName_;
+        const CommandLineHelpModuleImpl  &helpModule_;
 
         GMX_DISALLOW_COPY_AND_ASSIGN(RootHelpTopic);
 };
@@ -157,11 +160,10 @@ void RootHelpTopic::writeHelp(const HelpWriterContext &context) const
     }
     {
         CommandLineCommonOptionsHolder optionsHolder;
-        CommandLineHelpContext         cmdlineContext(context);
+        CommandLineHelpContext         cmdlineContext(*helpModule_.context_);
+        cmdlineContext.setModuleDisplayName(helpModule_.binaryName_);
         optionsHolder.initOptions();
-        cmdlineContext.setModuleDisplayName(binaryName_);
         // TODO: Add <command> [<args>] into the synopsis.
-        // TODO: Propagate the -hidden option here.
         CommandLineHelpWriter(*optionsHolder.options())
             .writeHelp(cmdlineContext);
     }
@@ -722,7 +724,7 @@ CommandLineHelpModuleImpl::CommandLineHelpModuleImpl(
         const std::string                &binaryName,
         const CommandLineModuleMap       &modules,
         const CommandLineModuleGroupList &groups)
-    : rootTopic_(new RootHelpTopic(binaryName)), programContext_(programContext),
+    : rootTopic_(new RootHelpTopic(*this)), programContext_(programContext),
       binaryName_(binaryName), modules_(modules), groups_(groups),
       context_(NULL), moduleOverride_(NULL), bHidden_(false),
       outputOverride_(NULL)
index fa120c732e3498e7e384f3a5c89f03727d9f192d..25eb2376b29021285a63c97cee0fb86ba6238bdd 100644 (file)
 #ifndef GMX_COMMANDLINE_CMDLINEHELPMODULE_H
 #define GMX_COMMANDLINE_CMDLINEHELPMODULE_H
 
-#include "cmdlinemodule.h"
-#include "cmdlinemodulemanager-impl.h"
-
+#include "gromacs/commandline/cmdlinemodule.h"
 #include "gromacs/onlinehelp/helptopicinterface.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
+
+#include "cmdlinemodulemanager-impl.h"
 
 namespace gmx
 {
@@ -128,6 +128,10 @@ class CommandLineHelpModule : public CommandLineModuleInterface
             return "Print help information";
         }
 
+        virtual void init(CommandLineModuleSettings *settings)
+        {
+            settings->setDefaultNiceLevel(0);
+        }
         virtual int run(int argc, char *argv[]);
         virtual void writeHelp(const CommandLineHelpContext &context) const;
 
index 792d30d94908c77491e4fd6b4e40d5627e577095..0c79bd393451006b0e4c5161ced2b0ab4170a1dd 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
 #include "cmdlinehelpwriter.h"
 
 #include <cstring>
@@ -49,7 +51,6 @@
 #include <boost/scoped_ptr.hpp>
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
-#include "gromacs/commandline/shellcompletions.h"
 #include "gromacs/onlinehelp/helpformat.h"
 #include "gromacs/onlinehelp/helpwritercontext.h"
 #include "gromacs/options/basicoptions.h"
@@ -62,6 +63,8 @@
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "shellcompletions.h"
+
 namespace gmx
 {
 
index 1ab3add95268e8c93e084541a96bbda11c9be7d5..04fff38c9c7ae09fd20de267232513bbd1ec2b67 100644 (file)
@@ -43,7 +43,7 @@
 #ifndef GMX_COMMANDLINE_CMDLINEHELPWRITER_H
 #define GMX_COMMANDLINE_CMDLINEHELPWRITER_H
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index afac7d982bb1fde18f3e66903a6a769c7bcca724..49786a1033c78dce1cce4dda3b3fc1120311ca5d 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
-#include "gromacs/commandline/cmdlineinit.h"
+#include "gmxpre.h"
+
+#include "cmdlineinit.h"
+
+#include "config.h"
 
 #include <cstring>
 
 #include <boost/scoped_ptr.hpp>
 
-#include "gromacs/legacyheaders/network.h"
-#include "gromacs/legacyheaders/types/commrec.h"
-
 #include "gromacs/commandline/cmdlinemodulemanager.h"
+#include "gromacs/commandline/cmdlineoptionsmodule.h"
 #include "gromacs/commandline/cmdlineprogramcontext.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/datafilefinder.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/init.h"
 #include "gromacs/utility/programcontext.h"
@@ -67,6 +73,8 @@ namespace
 
 //! Global context instance initialized in initForCommandLine().
 boost::scoped_ptr<CommandLineProgramContext> g_commandLineContext;
+//! Global library data file finder that respects GMXLIB.
+boost::scoped_ptr<DataFileFinder>            g_libFileFinder;
 
 #ifdef GMX_LIB_MPI
 void broadcastArguments(const t_commrec *cr, int *argc, char ***argv)
@@ -121,6 +129,9 @@ CommandLineProgramContext &initForCommandLine(int *argc, char ***argv)
     {
         g_commandLineContext.reset(new CommandLineProgramContext(*argc, *argv));
         setProgramContext(g_commandLineContext.get());
+        g_libFileFinder.reset(new DataFileFinder());
+        g_libFileFinder->setSearchPathFromEnv("GMXLIB");
+        setLibraryFileFinder(g_libFileFinder.get());
     }
     catch (const std::exception &ex)
     {
@@ -133,14 +144,31 @@ CommandLineProgramContext &initForCommandLine(int *argc, char ***argv)
 void finalizeForCommandLine()
 {
     gmx::finalize();
+    setLibraryFileFinder(NULL);
+    g_libFileFinder.reset();
     setProgramContext(NULL);
     g_commandLineContext.reset();
 }
 
+int processExceptionAtExitForCommandLine(const std::exception &ex)
+{
+    int rc = processExceptionAtExit(ex); //Currently this aborts for GMX_LIB_MPI
+    finalizeForCommandLine();            //thus this MPI_Finalize doesn't matter
+    return rc;
+}
+
 int runCommandLineModule(int argc, char *argv[],
                          CommandLineModuleInterface *module)
 {
-    return gmx::CommandLineModuleManager::runAsMainSingleModule(argc, argv, module);
+    return CommandLineModuleManager::runAsMainSingleModule(argc, argv, module);
+}
+
+int runCommandLineModule(int argc, char *argv[],
+                         const char *name, const char *description,
+                         CommandLineOptionsModuleInterface *(*factory)())
+{
+    return CommandLineOptionsModuleInterface::runAsMain(
+            argc, argv, name, description, factory);
 }
 
 } // namespace gmx
index 5c0fc026eb2b3aae9c9b84c96242502b6916b76e..e1fb961a358216638e5efb43201a4f160d9d80d9 100644 (file)
 
 // Forward declaration of class CommandLineProgramContext is not sufficient for
 // MSVC if the return value of initForCommandLine() is ignored(!)
-#include "cmdlineprogramcontext.h"
+#include "gromacs/commandline/cmdlineprogramcontext.h"
 
 namespace gmx
 {
 
 class CommandLineModuleInterface;
+class CommandLineOptionsModuleInterface;
 
 /*! \brief
  * Initializes the \Gromacs library for command-line use.
@@ -92,7 +93,19 @@ CommandLineProgramContext &initForCommandLine(int *argc, char ***argv);
  * \ingroup module_commandline
  */
 void finalizeForCommandLine();
-
+/*! \brief
+ * Handles an exception and deinitializes after initForCommandLine.
+ *
+ * \param[in] ex  Exception that is the cause for terminating the program.
+ * \returns   Return code to return from main().
+ *
+ * This method should be called as the last thing before terminating the
+ * program because of an exception. See processExceptionAtExit() for details.
+ * Additionally this method undoes the work done by initForCommandLine.
+ *
+ * Does not throw.
+ */
+int processExceptionAtExitForCommandLine(const std::exception &ex);
 /*! \brief
  * Implements a main() method that runs a single module.
  *
@@ -125,6 +138,44 @@ void finalizeForCommandLine();
  */
 int runCommandLineModule(int argc, char *argv[],
                          CommandLineModuleInterface *module);
+/*! \brief
+ * Implements a main() method that runs a single module.
+ *
+ * \param     argc        \c argc passed to main().
+ * \param     argv        \c argv passed to main().
+ * \param[in] name        Name for the module.
+ * \param[in] description Short description for the module.
+ * \param     factory Factory method that creates the module to run.
+ *
+ * This method allows for uniform behavior for binaries that only
+ * contain a single module without duplicating any of the
+ * implementation from CommandLineModuleManager (startup headers,
+ * common options etc.).
+ *
+ * Usage:
+ * \code
+   class CustomCommandLineOptionsModule : public CommandLineOptionsModuleInterface
+   {
+       // <...>
+   };
+
+   static CommandLineOptionsModuleInterface *create()
+   {
+       return new CustomCommandLineOptionsModule();
+   }
+
+   int main(int argc, char *argv[])
+   {
+       return gmx::runCommandLineModule(
+               argc, argv, "mymodule", "short description", &create);
+   }
+   \endcode
+ *
+ * Does not throw.  All exceptions are caught and handled internally.
+ */
+int runCommandLineModule(int argc, char *argv[],
+                         const char *name, const char *description,
+                         CommandLineOptionsModuleInterface *(*factory)());
 
 } // namespace gmx
 
similarity index 56%
rename from src/gromacs/utility/gmx_header_config.h
rename to src/gromacs/commandline/cmdlinemodule.cpp
index d70c1efd672e75731eea3794a322785d0d04ee3e..0019a324da66df3b0408b503471c01e5d86a34ca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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
+/*! \internal \file
  * \brief
- * Include file for configuration macros that affect installed headers.
+ * Implements classes from cmdlinemodule.h.
  *
- * This include file (or rather, one that it includes) will configured by CMake
- * and installed with GROMACS header files so that they can refer to a central
- * location for \#defines that will be available for builds of projects that
- * depend on GROMACS.
- *
- * The actual defines are in gmx_header_config_gen.h to allow usage of relative
- * include paths before installation.
- *
- * \todo
- * It would be better to have the defines here such that they are not generated
- * from CMake, but instead detected using \#ifdefs (possible for some of the
- * macros currently used).
- * Even better would be to not have these defines at all.
- *
- * \inlibraryapi
- * \ingroup module_utility
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_commandline
  */
-#include "gmx_header_config_gen.h"
+#include "gmxpre.h"
+
+#include "cmdlinemodule.h"
+
+#include "gromacs/commandline/cmdlinehelpcontext.h"
+
+namespace gmx
+{
+
+class CommandLineModuleSettings::Impl
+{
+    public:
+        Impl() : defaultNiceLevel_(19) {}
+
+        int defaultNiceLevel_;
+};
+
+CommandLineModuleSettings::CommandLineModuleSettings()
+    : impl_(new Impl)
+{
+}
+
+CommandLineModuleSettings::~CommandLineModuleSettings()
+{
+}
+
+int CommandLineModuleSettings::defaultNiceLevel() const
+{
+    return impl_->defaultNiceLevel_;
+}
+
+void CommandLineModuleSettings::setDefaultNiceLevel(int niceLevel)
+{
+    impl_->defaultNiceLevel_ = niceLevel;
+}
+
+//! \cond libapi
+void writeCommandLineHelpCMain(
+        const CommandLineHelpContext &context, const char *name,
+        int (*mainFunction)(int argc, char *argv[]))
+{
+    char *argv[2];
+    int   argc = 1;
+    // TODO: The constness should not be cast away.
+    argv[0] = const_cast<char *>(name);
+    argv[1] = NULL;
+    GlobalCommandLineHelpContext global(context);
+    mainFunction(argc, argv);
+}
+//! \endcond
+
+} // namespace gmx
index a482046f82b6c4c93e164ffabf19aece97276e6a..f4252f1a1aa9e6c8b4266d48c737e2acdab62e52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -34,7 +34,7 @@
  */
 /*! \file
  * \brief
- * Declares gmx::CommandLineModuleInterface.
+ * Declares gmx::CommandLineModuleInterface and supporting classes.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inpublicapi
 #ifndef GMX_COMMANDLINE_CMDLINEMODULE_H
 #define GMX_COMMANDLINE_CMDLINEMODULE_H
 
+#include "gromacs/utility/classhelpers.h"
+
 namespace gmx
 {
 
 class CommandLineHelpContext;
 
+/*! \brief
+ * Settings to pass information between a module and the general runner.
+ *
+ * Methods in this class do not throw, except that construction may throw
+ * std::bad_alloc.
+ *
+ * \inpublicapi
+ * \ingroup module_commandline
+ */
+class CommandLineModuleSettings
+{
+    public:
+        CommandLineModuleSettings();
+        ~CommandLineModuleSettings();
+
+        //! Returns the default nice level for this module.
+        int defaultNiceLevel() const;
+
+        /*! \brief
+         * Sets the default nice level for this module.
+         *
+         * If not called, the module will be niced.
+         */
+        void setDefaultNiceLevel(int niceLevel);
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
 /*! \brief
  * Module that can be run from command line using CommandLineModuleManager.
  *
  * \see CommandLineModuleManager
+ * \see CommandLineOptionsModule
  *
  * \inpublicapi
  * \ingroup module_commandline
@@ -66,6 +100,15 @@ class CommandLineModuleInterface
         //! Returns a one-line description of the module.
         virtual const char *shortDescription() const = 0;
 
+        /*! \brief
+         * Initializes the module and provides settings for the runner.
+         *
+         * This will be called before run(), and can be used to adjust
+         * initialization that the runner does.
+         *
+         * This method is currently not called when writing the help.
+         */
+        virtual void init(CommandLineModuleSettings *settings) = 0;
         /*! \brief
          * Runs the module with the given arguments.
          *
@@ -85,10 +128,29 @@ class CommandLineModuleInterface
          * \param[in] context  Context object for writing the help.
          * \throws    std::bad_alloc if out of memory.
          * \throws    FileIOError on any I/O error.
+         *
+         * Note that for MPI-enabled builds, this is called only on the master
+         * rank.
          */
         virtual void writeHelp(const CommandLineHelpContext &context) const = 0;
 };
 
+//! \cond libapi
+/*! \libinternal \brief
+ * Helper to implement CommandLineModuleInterface::writeHelp() with a C-like
+ * main() function that calls parse_common_args().
+ *
+ * \param[in] context      Context object for writing the help.
+ * \param[in] name         Name of the module.
+ * \param[in] mainFunction C-like main() function that calls parse_common_args().
+ *
+ * \ingroup module_commandline
+ */
+void writeCommandLineHelpCMain(
+        const CommandLineHelpContext &context, const char *name,
+        int (*mainFunction)(int argc, char *argv[]));
+//! \endcond
+
 } // namespace gmx
 
 #endif
index b93d684ee3b6692ecb94922198b0a8e290c164a2..6ff6de239b349217c8d827c68a43a3bd80ca870b 100644 (file)
 #include <string>
 #include <vector>
 
-#include "cmdlinemodule.h"
-#include "cmdlinemodulemanager.h"
-
+#include "gromacs/commandline/cmdlinemodule.h"
+#include "gromacs/commandline/cmdlinemodulemanager.h"
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/options/options.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/uniqueptr.h"
 
@@ -154,6 +153,9 @@ class CommandLineCommonOptionsHolder
          */
         bool finishOptions();
 
+        //! Adjust defaults based on module settings.
+        void adjustFromSettings(const CommandLineModuleSettings &settings);
+
         //! Returns the internal Options object.
         Options *options() { return &options_; }
         //! Returns the settings for printing startup information.
@@ -179,6 +181,15 @@ class CommandLineCommonOptionsHolder
         {
             return bQuiet_ && !bVersion_;
         }
+        //! Returns whether backups should be made.
+        bool shouldBackup() const { return bBackup_; }
+
+        //! Returns the nice level.
+        int niceLevel() const { return niceLevel_; }
+        //! Returns whether floating-point exception should be enabled
+        bool enableFPExceptions() const { return bFpexcept_; }
+        //! Returns the debug level.
+        int debugLevel() const { return debugLevel_; }
 
         //! Returns the file to which startup information should be printed.
         FILE *startupInfoFile() const { return (bVersion_ ? stdout : stderr); }
@@ -192,6 +203,10 @@ class CommandLineCommonOptionsHolder
         bool                         bQuiet_;
         bool                         bVersion_;
         bool                         bCopyright_;
+        int                          niceLevel_;
+        bool                         bBackup_;
+        bool                         bFpexcept_;
+        int                          debugLevel_;
 
         GMX_DISALLOW_COPY_AND_ASSIGN(CommandLineCommonOptionsHolder);
 };
index 01d9fa7401cd23045722dbaede233a6edf66251c..d29a8212afe67c511256b1f9a8e409171660e315 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,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.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
 #include "cmdlinemodulemanager.h"
 
 #include <cstdio>
 #include <string>
 #include <utility>
 
-#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/network.h"
-
 #include "gromacs/commandline/cmdlinehelpcontext.h"
-#include "gromacs/commandline/cmdlinehelpmodule.h"
 #include "gromacs/commandline/cmdlineinit.h"
 #include "gromacs/commandline/cmdlinemodule.h"
-#include "gromacs/commandline/cmdlinemodulemanager-impl.h"
 #include "gromacs/commandline/cmdlineparser.h"
 #include "gromacs/commandline/cmdlineprogramcontext.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/math/utilities.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/sysinfo.h"
 
-// For GMX_BINARY_SUFFIX
-#include "config.h"
+#include "cmdlinehelpmodule.h"
+#include "cmdlinemodulemanager-impl.h"
 
 namespace gmx
 {
@@ -114,26 +117,22 @@ class CMainCommandLineModule : public CommandLineModuleInterface
             return shortDescription_;
         }
 
+        virtual void init(CommandLineModuleSettings * /*settings*/)
+        {
+        }
         virtual int run(int argc, char *argv[])
         {
             return mainFunction_(argc, argv);
         }
         virtual void writeHelp(const CommandLineHelpContext &context) const
         {
-            char *argv[2];
-            int   argc = 1;
-            // TODO: The constness should not be cast away.
-            argv[0] = const_cast<char *>(name_);
-            argv[1] = NULL;
-            GlobalCommandLineHelpContext global(context);
-            mainFunction_(argc, argv);
+            writeCommandLineHelpCMain(context, name_, mainFunction_);
         }
 
     private:
         const char             *name_;
         const char             *shortDescription_;
         CMainFunction           mainFunction_;
-
 };
 
 //! \}
@@ -146,7 +145,8 @@ class CMainCommandLineModule : public CommandLineModuleInterface
 
 CommandLineCommonOptionsHolder::CommandLineCommonOptionsHolder()
     : options_(NULL, NULL), bHelp_(false), bHidden_(false),
-      bQuiet_(false), bVersion_(false), bCopyright_(true)
+      bQuiet_(false), bVersion_(false), bCopyright_(true),
+      niceLevel_(19), bBackup_(true), bFpexcept_(false), debugLevel_(0)
 {
     binaryInfoSettings_.copyright(true);
 }
@@ -168,6 +168,16 @@ void CommandLineCommonOptionsHolder::initOptions()
                            .description("Print extended version information and quit"));
     options_.addOption(BooleanOption("copyright").store(&bCopyright_)
                            .description("Print copyright information on startup"));
+    options_.addOption(IntegerOption("nice").store(&niceLevel_)
+                           .description("Set the nicelevel (default depends on command)"));
+    options_.addOption(BooleanOption("backup").store(&bBackup_)
+                           .description("Write backups if output files exist"));
+    options_.addOption(BooleanOption("fpexcept").store(&bFpexcept_)
+                           .hidden().description("Enable floating-point exceptions"));
+    options_.addOption(IntegerOption("debug").store(&debugLevel_)
+                           .hidden().defaultValueIfSet(1)
+                           .description("Write file with debug information, "
+                                        "1: short (default), 2: also x and f"));
 }
 
 bool CommandLineCommonOptionsHolder::finishOptions()
@@ -180,6 +190,15 @@ bool CommandLineCommonOptionsHolder::finishOptions()
     return !bVersion_;
 }
 
+void CommandLineCommonOptionsHolder::adjustFromSettings(
+        const CommandLineModuleSettings &settings)
+{
+    if (!options_.isSet("nice"))
+    {
+        niceLevel_ = settings.defaultNiceLevel();
+    }
+}
+
 /********************************************************************
  * CommandLineModuleManager::Impl
  */
@@ -227,24 +246,6 @@ class CommandLineModuleManager::Impl
          */
         CommandLineModuleMap::const_iterator
         findModuleByName(const std::string &name) const;
-        /*! \brief
-         * Finds a module that the name of the binary.
-         *
-         * \param[in] invokedName  Name by which the program was invoked.
-         * \throws    std::bad_alloc if out of memory.
-         * \returns   Iterator to the found module, or
-         *      \c modules_.end() if not found.
-         *
-         * Checks whether the program is invoked through a symlink whose name
-         * is different from \a binaryName_, and if so, checks
-         * if a module name matches the name of the symlink.
-         *
-         * Note that the \p invokedName parameter is currently not necessary
-         * (as the program context object is also available and provides this
-         * value), but it clarifies the control flow.
-         */
-        CommandLineModuleMap::const_iterator
-        findModuleFromBinaryName(const char *invokedName) const;
 
         /*! \brief
          * Processes command-line options for the wrapper binary.
@@ -338,45 +339,12 @@ CommandLineModuleManager::Impl::findModuleByName(const std::string &name) const
     return modules_.find(name);
 }
 
-CommandLineModuleMap::const_iterator
-CommandLineModuleManager::Impl::findModuleFromBinaryName(
-        const char *invokedName) const
-{
-    std::string moduleName = invokedName;
-#ifdef GMX_BINARY_SUFFIX
-    moduleName = stripSuffixIfPresent(moduleName, GMX_BINARY_SUFFIX);
-#endif
-    if (moduleName == binaryName_)
-    {
-        return modules_.end();
-    }
-    if (startsWith(moduleName, "g_"))
-    {
-        moduleName.erase(0, 2);
-    }
-    if (startsWith(moduleName, "gmx"))
-    {
-        moduleName.erase(0, 3);
-    }
-    return findModuleByName(moduleName);
-}
-
 CommandLineModuleInterface *
 CommandLineModuleManager::Impl::processCommonOptions(
         CommandLineCommonOptionsHolder *optionsHolder, int *argc, char ***argv)
 {
     // Check if we are directly invoking a certain module.
     CommandLineModuleInterface *module = singleModule_;
-    if (module == NULL)
-    {
-        // Also check for invokation through named symlinks.
-        CommandLineModuleMap::const_iterator moduleIter
-            = findModuleFromBinaryName(programContext_.programName());
-        if (moduleIter != modules_.end())
-        {
-            module = moduleIter->second.get();
-        }
-    }
 
     // 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.
@@ -512,7 +480,7 @@ void CommandLineModuleManager::addHelpTopic(HelpTopicPointer topic)
 int CommandLineModuleManager::run(int argc, char *argv[])
 {
     CommandLineModuleInterface    *module;
-    const bool                     bMaster = (!gmx_mpi_initialized() || gmx_node_rank() == 0);
+    const bool                     bMaster = (gmx_node_rank() == 0);
     bool                           bQuiet  = impl_->bQuiet_ || !bMaster;
     CommandLineCommonOptionsHolder optionsHolder;
     try
@@ -542,7 +510,48 @@ int CommandLineModuleManager::run(int argc, char *argv[])
     {
         return 0;
     }
-    int rc = module->run(argc, argv);
+
+    CommandLineModuleSettings settings;
+    module->init(&settings);
+    optionsHolder.adjustFromSettings(settings);
+
+    gmx_set_max_backup_count(optionsHolder.shouldBackup() ? -1 : 0);
+
+    // Open the debug file.
+    if (optionsHolder.debugLevel() > 0)
+    {
+        std::string filename(impl_->programContext_.programName());
+        if (gmx_node_num() > 1)
+        {
+            filename.append(formatString("%d", gmx_node_rank()));
+        }
+        filename.append(".debug");
+
+        fprintf(stderr, "Will write debug log file: %s\n", filename.c_str());
+        gmx_init_debug(optionsHolder.debugLevel(), filename.c_str());
+    }
+    // Set the nice level unless disabled in the configuration.
+    if (optionsHolder.niceLevel() != 0)
+    {
+        static bool bNiceSet = false; // Only set it once.
+        if (!bNiceSet)
+        {
+            // TODO: Diagnostic if this fails and the user explicitly requested it.
+            gmx_set_nice(optionsHolder.niceLevel());
+            bNiceSet = true;
+        }
+    }
+    if (optionsHolder.enableFPExceptions())
+    {
+        //TODO: currently it is always enabled for mdrun (verlet) and tests.
+        gmx_feenableexcept();
+    }
+
+    int rc = 0;
+    if (!(module == impl_->helpModule_ && !bMaster))
+    {
+        rc = module->run(argc, argv);
+    }
     if (!bQuiet)
     {
         gmx_thanx(stderr);
@@ -566,7 +575,7 @@ int CommandLineModuleManager::runAsMainSingleModule(
     catch (const std::exception &ex)
     {
         printFatalErrorMessage(stderr, ex);
-        return processExceptionAtExit(ex);
+        return processExceptionAtExitForCommandLine(ex);
     }
 }
 
index 9fb4432f826cca2518897862e31ab3d12a1456cd..8a0522b595c7545989e7ca47a43d18adc10cce26 100644 (file)
@@ -43,9 +43,9 @@
 #ifndef GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H
 #define GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H
 
-#include "../onlinehelp/helptopicinterface.h"
-#include "../utility/common.h"
-#include "../utility/uniqueptr.h"
+#include "gromacs/onlinehelp/helptopicinterface.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -82,7 +82,7 @@ typedef gmx_unique_ptr<CommandLineModuleInterface>::type
        catch (const std::exception &ex)
        {
            gmx::printFatalErrorMessage(stderr, ex);
-           return gmx::processExceptionAtExit(ex);
+           return gmx::processExceptionAtExitForCommandLine(ex);
        }
    }
  * \endcode
diff --git a/src/gromacs/commandline/cmdlineoptionsmodule.cpp b/src/gromacs/commandline/cmdlineoptionsmodule.cpp
new file mode 100644 (file)
index 0000000..7ea4c25
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements supporting routines for gmx::CommandLineOptionsModuleInterface.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_commandline
+ */
+#include "gmxpre.h"
+
+#include "cmdlineoptionsmodule.h"
+
+#include <boost/scoped_ptr.hpp>
+
+#include "gromacs/commandline/cmdlinehelpwriter.h"
+#include "gromacs/commandline/cmdlinemodulemanager.h"
+#include "gromacs/commandline/cmdlineparser.h"
+#include "gromacs/options/filenameoptionmanager.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+/********************************************************************
+ * CommandLineOptionsModule
+ */
+
+class CommandLineOptionsModule : public CommandLineModuleInterface
+{
+    public:
+        //! Shorthand for the factory function pointer type.
+        typedef CommandLineOptionsModuleInterface::FactoryMethod FactoryMethod;
+
+        CommandLineOptionsModule(const char *name, const char *description,
+                                 FactoryMethod factory)
+            : name_(name), description_(description), factory_(factory)
+        {
+        }
+        virtual const char *name() const { return name_; }
+        virtual const char *shortDescription() const { return description_; }
+
+        virtual void init(CommandLineModuleSettings *settings);
+        virtual int run(int argc, char *argv[]);
+        virtual void writeHelp(const CommandLineHelpContext &context) const;
+
+    private:
+        void parseOptions(int argc, char *argv[]);
+
+        const char    *name_;
+        const char    *description_;
+        FactoryMethod  factory_;
+        boost::scoped_ptr<CommandLineOptionsModuleInterface> module_;
+};
+
+void CommandLineOptionsModule::init(CommandLineModuleSettings *settings)
+{
+    module_.reset(factory_());
+    module_->init(settings);
+}
+
+int CommandLineOptionsModule::run(int argc, char *argv[])
+{
+    GMX_RELEASE_ASSERT(module_, "init() has not been called");
+    parseOptions(argc, argv);
+    return module_->run();
+}
+
+void CommandLineOptionsModule::writeHelp(const CommandLineHelpContext &context) const
+{
+    boost::scoped_ptr<CommandLineOptionsModuleInterface> module(factory_());
+    Options options(name(), shortDescription());
+    module->initOptions(&options);
+    CommandLineHelpWriter(options)
+        .setShowDescriptions(true)
+        .writeHelp(context);
+}
+
+void CommandLineOptionsModule::parseOptions(int argc, char *argv[])
+{
+    FileNameOptionManager fileoptManager;
+    Options               options(name_, description_);
+
+    options.addManager(&fileoptManager);
+
+    module_->initOptions(&options);
+    {
+        CommandLineParser parser(&options);
+        parser.parse(&argc, argv);
+        options.finish();
+    }
+    module_->optionsFinished(&options);
+}
+
+}   // namespace
+
+/********************************************************************
+ * CommandLineOptionsModuleInterface
+ */
+
+CommandLineOptionsModuleInterface::~CommandLineOptionsModuleInterface()
+{
+}
+
+// static
+CommandLineModuleInterface *
+CommandLineOptionsModuleInterface::createModule(
+        const char *name, const char *description, FactoryMethod factory)
+{
+    return new CommandLineOptionsModule(name, description, factory);
+}
+
+// static
+int CommandLineOptionsModuleInterface::runAsMain(
+        int argc, char *argv[], const char *name, const char *description,
+        FactoryMethod factory)
+{
+    CommandLineOptionsModule module(name, description, factory);
+    return CommandLineModuleManager::runAsMainSingleModule(argc, argv, &module);
+}
+
+// static
+void CommandLineOptionsModuleInterface::registerModule(
+        CommandLineModuleManager *manager, const char *name,
+        const char *description, FactoryMethod factory)
+{
+    CommandLineModulePointer module(createModule(name, description, factory));
+    manager->addModule(move(module));
+}
+
+} // namespace gmx
diff --git a/src/gromacs/commandline/cmdlineoptionsmodule.h b/src/gromacs/commandline/cmdlineoptionsmodule.h
new file mode 100644 (file)
index 0000000..5958806
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::CommandLineOptionsModuleInterface and supporting routines.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inpublicapi
+ * \ingroup module_commandline
+ */
+#ifndef GMX_COMMANDLINE_CMDLINEOPTIONSMODULE_H
+#define GMX_COMMANDLINE_CMDLINEOPTIONSMODULE_H
+
+#include "gromacs/commandline/cmdlinemodule.h"
+
+namespace gmx
+{
+
+class CommandLineModuleInterface;
+class CommandLineModuleManager;
+class Options;
+
+/*! \brief
+ * Module that can be run from a command line and uses gmx::Options for
+ * argument processing.
+ *
+ * This class provides a higher-level interface on top of
+ * gmx::CommandLineModuleInterface for cases where gmx::Options will be used
+ * for declaring the command-line arguments.  The module only needs to declare
+ * the options it uses, and the framework takes care of command-line parsing
+ * and help output.  The module typically consists of the following parts:
+ *  - init() allows for some interaction between the module and the framework
+ *    when running the module; see CommandLineModuleInterface::init().  If no
+ *    such customization is necessary, an empty implementation is sufficient.
+ *  - initOptions() is called both for running the module and for printing help
+ *    for the module, and it should add the options that the module
+ *    understands.  Values provided for the options are typically stored in
+ *    member variables.
+ *  - optionsFinished() can be implemented in case additional processing is
+ *    needed (e.g., checking whether an option was set by the user).
+ *  - run() is called when running the module, after command-line options have
+ *    been parsed and their values stored in the corresponding member
+ *    variables.
+ *
+ * registerModule(), runAsMain(), or createModule() can be used to use modules
+ * of this type in all contexts where a gmx::CommandLineModuleInterface is
+ * expected.  These methods create a gmx::CommandLineModuleInterface
+ * implementation that contains the common code needed to parse command-line
+ * options and write help, based on the information provided from the methods
+ * in this class.
+ *
+ * \inpublicapi
+ * \ingroup module_commandline
+ */
+class CommandLineOptionsModuleInterface
+{
+    public:
+        /*! \brief
+         * Function pointer to a factory method that returns an interface of
+         * this type.
+         *
+         * \returns Module to run (should be allocated with `new`).
+         * \throws  std::bad_alloc if out of memory.
+         *
+         * The caller takes responsibility to `delete` the returned pointer.
+         */
+        typedef CommandLineOptionsModuleInterface *(*FactoryMethod)();
+
+        /*! \brief
+         * Creates a CommandLineModuleInterface to run the specified module.
+         *
+         * \param[in] name        Name for the module.
+         * \param[in] description Short description for the module.
+         * \param[in] factory     Factory that returns the module to run.
+         * \returns CommandLineModuleInterface object that runs the module
+         *     returned by \p factory.  Caller must `delete` the object.
+         * \throws  std::bad_alloc if out of memory.
+         *
+         * This is mainly used by unit tests that want to bypass
+         * CommandLineModuleManager.
+         */
+        static CommandLineModuleInterface *
+        createModule(const char *name, const char *description,
+                     FactoryMethod factory);
+        /*! \brief
+         * Implements a main() method that runs a single module.
+         *
+         * \param     argc    \c argc passed to main().
+         * \param     argv    \c argv passed to main().
+         * \param[in] name        Name for the module.
+         * \param[in] description Short description for the module.
+         * \param[in] factory     Factory that returns the module to run.
+         *
+         * This method allows for uniform behavior for binaries that only
+         * contain a single module without duplicating any of the
+         * implementation from CommandLineModuleManager (startup headers,
+         * common options etc.).
+         *
+         * \see runCommandLineModule()
+         */
+        static int
+        runAsMain(int argc, char *argv[], const char *name,
+                  const char *description, FactoryMethod factory);
+        /*! \brief
+         * Registers a module of a certain type to this manager.
+         *
+         * \param     manager     Manager to register to.
+         * \param[in] name        Name for the module.
+         * \param[in] description Short description for the module.
+         * \param[in] factory     Factory that returns the module to register.
+         * \throws  std::bad_alloc if out of memory.
+         *
+         * This method internally creates a CommandLineModuleInterface module
+         * with the given \p name and \p description, and adds that to
+         * \p manager.  When run or asked to write the help, the module calls
+         * \p factory to get the actual module, and forwards the necessary
+         * calls.
+         */
+        static void
+        registerModule(CommandLineModuleManager *manager,
+                       const char *name, const char *description,
+                       FactoryMethod factory);
+
+        virtual ~CommandLineOptionsModuleInterface();
+
+        //! \copydoc gmx::CommandLineModuleInterface::init()
+        virtual void init(CommandLineModuleSettings *settings) = 0;
+        /*! \brief
+         * Initializes command-line arguments understood by the module.
+         *
+         * \param[in,out] options  Options object to add the options to.
+         *
+         * When running the module, this method is called after init().
+         * When printing help, there is no call to init(), and this is the only
+         * method called.
+         * In both cases, the implementation should add options understood by
+         * the module to \p options.  Output values from options should be
+         * stored in member variables.
+         */
+        virtual void initOptions(Options *options)             = 0;
+        /*! \brief
+         * Called after all option values have been set.
+         *
+         * \param[in,out] options  Options object in which options are stored.
+         *
+         * When running the module, this method is called after all
+         * command-line arguments have been parsed, but while the Options
+         * object still exists.
+         *
+         * If the module needs to call, e.g., Options::isSet(), this is the
+         * place to do that.
+         */
+        virtual void optionsFinished(Options *options)         = 0;
+
+        /*! \brief
+         * Runs the module.
+         *
+         * \throws   unspecified  May throw exceptions to indicate errors.
+         * \returns  Exit code for the program.
+         * \retval   0 on successful termination.
+         *
+         * This method is called after optionsFinished() when running the
+         * module, and should do all the processing for the module.
+         */
+        virtual int run() = 0;
+};
+
+} // namespace gmx
+
+#endif
index e93ec92f0a7809cccf374c841dfeb9d9ada120cb..61f69d69f75b8a5047eaa8642cd372afb3681845 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
 #include "cmdlineparser.h"
 
 #include <cstdlib>
@@ -47,7 +49,7 @@
 #include <vector>
 
 #include "gromacs/options/optionsassigner.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 
 namespace gmx
index 7f4768c04ede6b0e0e7f50c8db7f97530de75d48..e599ed0ab0ce70230d49b2252c44f36267e958d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,7 +46,7 @@
 #include <string>
 #include <vector>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 0a24deacbd517cecdb26403f9c8cf9f868c95092..9368e3c9251bbd8728ceefc4784a0c64588f5373 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
 #include "cmdlineprogramcontext.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <cstdlib>
 #include <cstring>
 
 #include "thread_mpi/mutex.h"
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/stringutil.h"
 
 namespace gmx
@@ -178,59 +178,57 @@ bool isAcceptableLibraryPath(const std::string &path)
  * Returns whether given path prefix contains files from `share/top/`.
  *
  * \param[in]  path   Path prefix to check.
- * \param[out] result If return value is `true`, the pointee is set to the
- *     actual data directory. Otherwise, the pointee is not modified.
  * \returns  `true` if \p path contains the data files.
  *
  * Checks whether \p path could be the installation prefix where `share/top/`
  * files have been installed:  appends the relative installation path of the
  * data files and calls isAcceptableLibraryPath().
  */
-bool isAcceptableLibraryPathPrefix(const std::string &path, std::string *result)
+bool isAcceptableLibraryPathPrefix(const std::string &path)
 {
-    std::string testPath = Path::join(path, GMXLIB_SEARCH_DIR);
+    std::string testPath = Path::join(path, DATA_INSTALL_DIR, "top");
     if (isAcceptableLibraryPath(testPath))
     {
-        *result = testPath;
         return true;
     }
     return false;
 }
 
 /*! \brief
- * Returns a fallback data path.
+ * Returns a fallback installation prefix path.
  *
  * Checks a few standard locations for the data files before returning a
  * configure-time hard-coded path.  The hard-coded path is preferred if it
  * actually contains the data files, though.
  */
-std::string findFallbackLibraryDataPath()
+std::string findFallbackInstallationPrefixPath()
 {
 #ifndef GMX_NATIVE_WINDOWS
-    if (!isAcceptableLibraryPath(GMXLIB_FALLBACK))
+    if (!isAcceptableLibraryPathPrefix(CMAKE_INSTALL_PREFIX))
     {
-        std::string foundPath;
-        if (isAcceptableLibraryPathPrefix("/usr/local", &foundPath))
+        if (isAcceptableLibraryPathPrefix("/usr/local"))
         {
-            return foundPath;
+            return "/usr/local";
         }
-        if (isAcceptableLibraryPathPrefix("/usr", &foundPath))
+        if (isAcceptableLibraryPathPrefix("/usr"))
         {
-            return foundPath;
+            return "/usr";
         }
-        if (isAcceptableLibraryPathPrefix("/opt", &foundPath))
+        if (isAcceptableLibraryPathPrefix("/opt"))
         {
-            return foundPath;
+            return "/opt";
         }
     }
 #endif
-    return GMXLIB_FALLBACK;
+    return CMAKE_INSTALL_PREFIX;
 }
 
 /*! \brief
  * Finds the library data files based on path of the binary.
  *
- * \param[in] binaryPath  Absolute path to the binary.
+ * \param[in]  binaryPath     Absolute path to the binary.
+ * \param[out] bSourceLayout  Set to `true` if the binary is run from
+ *     the build tree and the original source directory can be found.
  * \returns  Path to the `share/top/` data files.
  *
  * The search based on the path only works if the binary is in the same
@@ -241,8 +239,10 @@ std::string findFallbackLibraryDataPath()
  * Extra logic is present to allow running binaries from the build tree such
  * that they use up-to-date data files from the source tree.
  */
-std::string findDefaultLibraryDataPath(const std::string &binaryPath)
+std::string findInstallationPrefixPath(const std::string &binaryPath,
+                                       bool              *bSourceLayout)
 {
+    *bSourceLayout = false;
     // If the input path is not absolute, the binary could not be found.
     // Don't search anything.
     if (Path::isAbsolute(binaryPath))
@@ -252,23 +252,30 @@ std::string findDefaultLibraryDataPath(const std::string &binaryPath)
         // If running directly from the build tree, try to use the source
         // directory.
 #if (defined CMAKE_SOURCE_DIR && defined CMAKE_BINARY_DIR)
-        if (Path::startsWith(searchPath, CMAKE_BINARY_DIR))
+        std::string buildBinPath;
+#ifdef CMAKE_INTDIR
+        buildBinPath = Path::join(CMAKE_BINARY_DIR, "bin", CMAKE_INTDIR);
+#else
+        buildBinPath = Path::join(CMAKE_BINARY_DIR, "bin");
+#endif
+        if (Path::isEquivalent(searchPath, buildBinPath))
         {
             std::string testPath = Path::join(CMAKE_SOURCE_DIR, "share/top");
             if (isAcceptableLibraryPath(testPath))
             {
-                return testPath;
+                *bSourceLayout = true;
+                return CMAKE_SOURCE_DIR;
             }
         }
 #endif
 
         // Use the executable path to (try to) find the library dir.
+        // TODO: Consider only going up exactly the required number of levels.
         while (!searchPath.empty())
         {
-            std::string testPath = Path::join(searchPath, GMXLIB_SEARCH_DIR);
-            if (isAcceptableLibraryPath(testPath))
+            if (isAcceptableLibraryPathPrefix(searchPath))
             {
-                return testPath;
+                return searchPath;
             }
             searchPath = Path::getParentPath(searchPath);
         }
@@ -276,7 +283,7 @@ std::string findDefaultLibraryDataPath(const std::string &binaryPath)
 
     // End of smart searching. If we didn't find it in our parent tree,
     // or if the program name wasn't set, return a fallback.
-    return findFallbackLibraryDataPath();
+    return findFallbackInstallationPrefixPath();
 }
 
 //! \}
@@ -310,18 +317,19 @@ class CommandLineProgramContext::Impl
         std::string                   displayName_;
         std::string                   commandLine_;
         mutable std::string           fullBinaryPath_;
-        mutable std::string           defaultLibraryDataPath_;
+        mutable std::string           installationPrefix_;
+        mutable bool                  bSourceLayout_;
         mutable tMPI::mutex           binaryPathMutex_;
 };
 
 CommandLineProgramContext::Impl::Impl()
-    : programName_("GROMACS")
+    : programName_("GROMACS"), bSourceLayout_(false)
 {
 }
 
 CommandLineProgramContext::Impl::Impl(int argc, const char *const argv[],
                                       ExecutableEnvironmentPointer env)
-    : executableEnv_(move(env))
+    : executableEnv_(env), bSourceLayout_(false)
 {
     invokedName_ = (argc != 0 ? argv[0] : "");
     programName_ = Path::getFilename(invokedName_);
@@ -370,7 +378,7 @@ CommandLineProgramContext::CommandLineProgramContext(
 
 CommandLineProgramContext::CommandLineProgramContext(
         int argc, const char *const argv[], ExecutableEnvironmentPointer env)
-    : impl_(new Impl(argc, argv, move(env)))
+    : impl_(new Impl(argc, argv, env))
 {
 }
 
@@ -409,16 +417,19 @@ const char *CommandLineProgramContext::fullBinaryPath() const
     return impl_->fullBinaryPath_.c_str();
 }
 
-const char *CommandLineProgramContext::defaultLibraryDataPath() const
+InstallationPrefixInfo CommandLineProgramContext::installationPrefix() const
 {
     tMPI::lock_guard<tMPI::mutex> lock(impl_->binaryPathMutex_);
-    if (impl_->defaultLibraryDataPath_.empty())
+    if (impl_->installationPrefix_.empty())
     {
         impl_->findBinaryPath();
-        impl_->defaultLibraryDataPath_ =
-            Path::normalize(findDefaultLibraryDataPath(impl_->fullBinaryPath_));
+        impl_->installationPrefix_ =
+            Path::normalize(findInstallationPrefixPath(impl_->fullBinaryPath_,
+                                                       &impl_->bSourceLayout_));
     }
-    return impl_->defaultLibraryDataPath_.c_str();
+    return InstallationPrefixInfo(
+            impl_->installationPrefix_.c_str(),
+            impl_->bSourceLayout_);
 }
 
 } // namespace gmx
index 09b05bf300242a2c658f167d409c4c27b2bcc318..e08f3508958a9eb234680abd8f2c2e61ccba1734 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,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.
 #include <string>
 #include <vector>
 
-#include "../utility/common.h"
-#include "../utility/programcontext.h"
-#include "../utility/uniqueptr.h"
+#include <boost/shared_ptr.hpp>
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/programcontext.h"
 
 namespace gmx
 {
@@ -90,7 +91,7 @@ class ExecutableEnvironmentInterface
 };
 
 //! Shorthand for a smart pointer to ExecutableEnvironmentInterface.
-typedef gmx_unique_ptr<ExecutableEnvironmentInterface>::type
+typedef boost::shared_ptr<ExecutableEnvironmentInterface>
     ExecutableEnvironmentPointer;
 
 /*! \libinternal \brief
@@ -195,7 +196,7 @@ class CommandLineProgramContext : public ProgramContextInterface
          */
         virtual const char *fullBinaryPath() const;
         /*! \brief
-         * Returns the default path for \Gromacs data files.
+         * Returns the installation prefix (for finding \Gromacs data files).
          *
          * \throws std::bad_alloc if out of memory.
          * \throws tMPI::system_error on thread synchronization errors.
@@ -203,7 +204,7 @@ class CommandLineProgramContext : public ProgramContextInterface
          * Returns a hardcoded path set during configuration time if there is
          * an error in finding the library data files.
          */
-        virtual const char *defaultLibraryDataPath() const;
+        virtual InstallationPrefixInfo installationPrefix() const;
         /*! \brief
          * Returns the full command line used to invoke the binary.
          *
index acd27b0f01ab743461ce70ec8c1c9f1ebf3ec15e..0b3538f395cb29afbd229c532ff8a5abd2f3ff3f 100644 (file)
@@ -3,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,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.
  * 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 "gromacs/commandline/pargs.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "pargs.h"
 
-#include <cctype>
-#include <cstdio>
 #include <cstdlib>
 #include <cstring>
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "thread_mpi/threads.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/network.h"
+#include <algorithm>
+#include <list>
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinehelpwriter.h"
-#include "gromacs/commandline/shellcompletions.h"
+#include "gromacs/commandline/cmdlineparser.h"
 #include "gromacs/fileio/timecontrol.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
+#include "gromacs/options/filenameoptionmanager.h"
 #include "gromacs/options/options.h"
+#include "gromacs/options/timeunitmanager.h"
 #include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 /* The source code in this file should be thread-safe.
       Please keep it that way. */
 
-static void usage(const char *type, const char *arg)
-{
-    GMX_ASSERT(arg != NULL, "NULL command-line argument should not occur");
-    gmx_fatal(FARGS, "Expected %s argument for option %s\n", type, arg);
-}
-
-/* Scan an int for argument argv[*i] from argument at argv[*i + 1].
- * eg: -p 32.  argv[*i] is only used for error reporting.
- * If there is no value, or the conversion is not successful, the
- * routine exits with an error, otherwise it returns the value found.
- * *i is incremented once.
- */
-static int iscan(int argc, char *argv[], int *i)
-{
-    const char *const arg = argv[*i];
-    if (argc <= (*i)+1)
-    {
-        usage("an integer", arg);
-    }
-    const char *const value = argv[++(*i)];
-    char             *endptr;
-    int               var = std::strtol(value, &endptr, 10);
-    if (*value == '\0' || *endptr != '\0')
-    {
-        usage("an integer", arg);
-    }
-    return var;
-}
-
-/* Same as above, but for large integer values */
-static gmx_int64_t istepscan(int argc, char *argv[], int *i)
-{
-    const char *const arg = argv[*i];
-    if (argc <= (*i)+1)
-    {
-        usage("an integer", arg);
-    }
-    const char *const value = argv[++(*i)];
-    char             *endptr;
-    gmx_int64_t       var = str_to_int64_t(value, &endptr);
-    if (*value == '\0' || *endptr != '\0')
-    {
-        usage("an integer", arg);
-    }
-    return var;
-}
-
-/* Routine similar to the above, but working on doubles. */
-static double dscan(int argc, char *argv[], int *i)
-{
-    const char *const arg = argv[*i];
-    if (argc <= (*i)+1)
-    {
-        usage("a real", arg);
-    }
-    const char *const value = argv[++(*i)];
-    char             *endptr;
-    double            var = std::strtod(value, &endptr);
-    if (*value == '\0' || *endptr != '\0')
-    {
-        usage("a real", arg);
-    }
-    return var;
-}
-
-/* Routine similar to the above, but working on strings. The pointer
- * returned is a pointer to the argv field.
- */
-static char *sscan(int argc, char *argv[], int *i)
-{
-    if (argc > (*i)+1)
-    {
-        if ( (argv[(*i)+1][0] == '-') && (argc > (*i)+2) &&
-             (argv[(*i)+2][0] != '-') )
-        {
-            fprintf(stderr, "Possible missing string argument for option %s\n\n",
-                    argv[*i]);
-        }
-    }
-    else
-    {
-        usage("a string", argv[*i]);
-    }
-
-    return argv[++(*i)];
-}
-
-static gmx_bool is_hidden(t_pargs *pa)
-{
-    return (strstr(pa->desc, "HIDDEN") != NULL);
-}
-
 int nenum(const char *const enumc[])
 {
     int i;
@@ -180,140 +82,6 @@ int nenum(const char *const enumc[])
     return i;
 }
 
-/* Read a number of arguments from the command line.
- * For etINT, etREAL and etCHAR an extra argument is read (when present)
- * for etBOOL the gmx_boolean option is changed to the negate value
- */
-static void get_pargs(int *argc, char *argv[], int nparg, t_pargs pa[])
-{
-    int       i, j, k, match;
-    gmx_bool *bKeep;
-    char      buf[32];
-    char     *ptr;
-
-    snew(bKeep, *argc+1);
-    bKeep[0]     = TRUE;
-    bKeep[*argc] = TRUE;
-
-    for (i = 1; (i < *argc); i++)
-    {
-        bKeep[i] = TRUE;
-        for (j = 0; (j < nparg); j++)
-        {
-            if (pa[j].type == etBOOL)
-            {
-                sprintf(buf, "-no%s", pa[j].option+1);
-                if (strcmp(pa[j].option, argv[i]) == 0)
-                {
-                    *pa[j].u.b = TRUE;
-                    pa[j].bSet = TRUE;
-                    bKeep[i]   = FALSE;
-                }
-                else if (strcmp(buf, argv[i]) == 0)
-                {
-                    *pa[j].u.b = FALSE;
-                    pa[j].bSet = TRUE;
-                    bKeep[i]   = FALSE;
-                }
-            }
-            else if (strcmp(pa[j].option, argv[i]) == 0)
-            {
-                if (pa[j].bSet)
-                {
-                    fprintf(stderr, "Setting option %s more than once!\n",
-                            pa[j].option);
-                }
-                pa[j].bSet = TRUE;
-                bKeep[i]   = FALSE;
-                switch (pa[j].type)
-                {
-                    case etINT:
-                        *pa[j].u.i = iscan(*argc, argv, &i);
-                        break;
-                    case etINT64:
-                        *pa[j].u.is = istepscan(*argc, argv, &i);
-                        break;
-                    case etTIME:
-                    case etREAL:
-                        *pa[j].u.r = dscan(*argc, argv, &i);
-                        break;
-                    case etSTR:
-                        *(pa[j].u.c) = sscan(*argc, argv, &i);
-                        break;
-                    case etENUM:
-                        match = -1;
-                        ptr   = sscan(*argc, argv, &i);
-                        for (k = 1; (pa[j].u.c[k] != NULL); k++)
-                        {
-                            /* only check ptr against beginning of
-                               pa[j].u.c[k] */
-                            if (gmx_strncasecmp(ptr, pa[j].u.c[k], strlen(ptr)) == 0)
-                            {
-                                if ( ( match == -1 ) ||
-                                     ( strlen(pa[j].u.c[k]) <
-                                       strlen(pa[j].u.c[match]) ) )
-                                {
-                                    match = k;
-                                }
-                            }
-                        }
-                        if (match != -1)
-                        {
-                            pa[j].u.c[0] = pa[j].u.c[match];
-                        }
-                        else
-                        {
-                            gmx_fatal(FARGS, "Invalid argument %s for option %s",
-                                      ptr, pa[j].option);
-                        }
-                        break;
-                    case etRVEC:
-                        (*pa[j].u.rv)[0] = dscan(*argc, argv, &i);
-                        if ( (i+1 == *argc) ||
-                             ( (argv[i+1][0] == '-') &&
-                               !isdigit(argv[i+1][1]) ) )
-                        {
-                            (*pa[j].u.rv)[1]     =
-                                (*pa[j].u.rv)[2] =
-                                    (*pa[j].u.rv)[0];
-                        }
-                        else
-                        {
-                            bKeep[i]         = FALSE;
-                            (*pa[j].u.rv)[1] = dscan(*argc, argv, &i);
-                            if ( (i+1 == *argc) ||
-                                 ( (argv[i+1][0] == '-') &&
-                                   !isdigit(argv[i+1][1]) ) )
-                            {
-                                gmx_fatal(FARGS,
-                                          "%s: vector must have 1 or 3 real parameters",
-                                          pa[j].option);
-                            }
-                            bKeep[i]         = FALSE;
-                            (*pa[j].u.rv)[2] = dscan(*argc, argv, &i);
-                        }
-                        break;
-                    default:
-                        gmx_fatal(FARGS, "Invalid type %d in pargs", pa[j].type);
-                }
-                /* i may be incremented, so set it to not keep */
-                bKeep[i] = FALSE;
-            }
-        }
-    }
-
-    /* Remove used entries */
-    for (i = j = 0; (i <= *argc); i++)
-    {
-        if (bKeep[i])
-        {
-            argv[j++] = argv[i];
-        }
-    }
-    (*argc) = j-1;
-    sfree(bKeep);
-}
-
 int opt2parg_int(const char *option, int nparg, t_pargs pa[])
 {
     int i;
@@ -420,175 +188,286 @@ const char *opt2parg_enum(const char *option, int nparg, t_pargs pa[])
  * parse_common_args()
  */
 
-static void set_default_time_unit(const char *time_list[], gmx_bool bCanTime)
+namespace gmx
 {
-    int         i      = 0;
-    const char *select = NULL;
-
-    if (bCanTime)
-    {
-        select = getenv("GMXTIMEUNIT");
-        if (select != NULL)
-        {
-            i = 1;
-            while (time_list[i] && strcmp(time_list[i], select) != 0)
-            {
-                i++;
-            }
-        }
-    }
-    if (!bCanTime || select == NULL ||
-        time_list[i] == NULL || strcmp(time_list[i], select) != 0)
-    {
-        /* Set it to the default: ps */
-        i = 1;
-        while (time_list[i] && strcmp(time_list[i], "ps") != 0)
-        {
-            i++;
-        }
 
-    }
-    time_list[0] = time_list[i];
-}
-
-static void set_default_xvg_format(const char *xvg_list[])
+namespace
 {
-    int         i;
-    const char *select;
 
-    select = getenv("GMX_VIEW_XVG");
-    if (select == NULL)
-    {
-        /* The default is the first option */
-        xvg_list[0] = xvg_list[1];
-    }
-    else
+/*! \brief
+ * Returns the index of the default xvg format.
+ *
+ * \ingroup module_commandline
+ */
+int getDefaultXvgFormat(gmx::ConstArrayRef<const char *> xvgFormats)
+{
+    const char *const select = getenv("GMX_VIEW_XVG");
+    if (select != NULL)
     {
-        i = 1;
-        while (xvg_list[i] && strcmp(xvg_list[i], select) != 0)
+        ConstArrayRef<const char *>::const_iterator i =
+            std::find(xvgFormats.begin(), xvgFormats.end(), std::string(select));
+        if (i != xvgFormats.end())
         {
-            i++;
-        }
-        if (xvg_list[i] != NULL)
-        {
-            xvg_list[0] = xvg_list[i];
+            return i - xvgFormats.begin();
         }
         else
         {
-            xvg_list[0] = xvg_list[exvgNONE];
+            return exvgNONE - 1;
         }
     }
+    /* The default is the first option */
+    return 0;
 }
 
-static int add_parg(int npargs, t_pargs *pa, t_pargs *pa_add)
-{
-    memcpy(&(pa[npargs]), pa_add, sizeof(*pa_add));
-
-    return npargs+1;
-}
-
-namespace gmx
-{
-
-namespace
-{
-
 /*! \brief
- * Converts a t_filenm option into an Options option.
+ * Conversion helper between t_pargs/t_filenm and Options.
  *
- * \param     options Options object to add the new option to.
- * \param[in] fnm     t_filenm option to convert.
+ * This class holds the necessary mapping between the old C structures and
+ * the new C++ options to allow copying values back after parsing for cases
+ * where the C++ options do not directly provide the type of value required for
+ * the C structures.
  *
  * \ingroup module_commandline
  */
-void filenmToOptions(Options *options, const t_filenm *fnm)
+class OptionsAdapter
+{
+    public:
+        /*! \brief
+         * Initializes the adapter to convert from a specified command line.
+         *
+         * The command line is required, because t_pargs wants to return
+         * strings by reference to the original command line.
+         * OptionsAdapter creates a copy of the `argv` array (but not the
+         * strings) to make this possible, even if the parser removes
+         * options it has recognized.
+         */
+        OptionsAdapter(int argc, const char *const argv[])
+            : argv_(argv, argv + argc)
+        {
+        }
+
+        /*! \brief
+         * Converts a t_filenm option into an Options option.
+         *
+         * \param options Options object to add the new option to.
+         * \param fnm     t_filenm option to convert.
+         */
+        void filenmToOptions(Options *options, t_filenm *fnm);
+        /*! \brief
+         * Converts a t_pargs option into an Options option.
+         *
+         * \param     options Options object to add the new option to.
+         * \param     pa      t_pargs option to convert.
+         */
+        void pargsToOptions(Options *options, t_pargs *pa);
+
+        /*! \brief
+         * Copies values back from options to t_pargs/t_filenm.
+         */
+        void copyValues(bool bReadNode);
+
+    private:
+        struct FileNameData
+        {
+            //! Creates a conversion helper for a given `t_filenm` struct.
+            explicit FileNameData(t_filenm *fnm) : fnm(fnm), optionInfo(NULL)
+            {
+            }
+
+            //! t_filenm structure to receive the final values.
+            t_filenm                 *fnm;
+            //! Option info object for the created FileNameOption.
+            FileNameOptionInfo       *optionInfo;
+            //! Value storage for the created FileNameOption.
+            std::vector<std::string>  values;
+        };
+        struct ProgramArgData
+        {
+            //! Creates a conversion helper for a given `t_pargs` struct.
+            explicit ProgramArgData(t_pargs *pa)
+                : pa(pa), optionInfo(NULL), enumIndex(0), boolValue(false)
+            {
+            }
+
+            //! t_pargs structure to receive the final values.
+            t_pargs                 *pa;
+            //! Option info object for the created option.
+            OptionInfo              *optionInfo;
+            //! Value storage for a non-enum StringOption (unused for other types).
+            std::string              stringValue;
+            //! Value storage for an enum option (unused for other types).
+            int                      enumIndex;
+            //! Value storage for a BooleanOption (unused for other types).
+            bool                     boolValue;
+        };
+
+        std::vector<const char *>    argv_;
+        // These are lists instead of vectors to avoid relocating existing
+        // objects in case the container is reallocated (the Options object
+        // contains pointes to members of the objects, which would get
+        // invalidated).
+        std::list<FileNameData>      fileNameOptions_;
+        std::list<ProgramArgData>    programArgs_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(OptionsAdapter);
+};
+
+void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
 {
+    if (fnm->opt == NULL)
+    {
+        // Existing code may use opt2fn() instead of ftp2fn() for
+        // options that use the default option name, so we need to
+        // keep the old behavior instead of fixing opt2fn().
+        // TODO: Check that this is not the case, remove this, and make
+        // opt2*() work even if fnm->opt is NULL for some options.
+        fnm->opt = ftp2defopt(fnm->ftp);
+    }
     const bool        bRead     = ((fnm->flag & ffREAD)  != 0);
     const bool        bWrite    = ((fnm->flag & ffWRITE) != 0);
     const bool        bOptional = ((fnm->flag & ffOPT)   != 0);
     const bool        bLibrary  = ((fnm->flag & ffLIB)   != 0);
     const bool        bMultiple = ((fnm->flag & ffMULT)  != 0);
+    const bool        bMissing  = ((fnm->flag & ffALLOW_MISSING) != 0);
     const char *const name      = &fnm->opt[1];
     const char *      defName   = fnm->fn;
+    int               defType   = -1;
     if (defName == NULL)
     {
         defName = ftp2defnm(fnm->ftp);
     }
-    // Since we are not (yet) using this for actual parsing, we don't need to
-    // set any storage.
-    options->addOption(
-            FileNameOption(name).defaultBasename(defName).legacyType(fnm->ftp)
-                .readWriteFlags(bRead, bWrite).required(!bOptional)
-                .libraryFile(bLibrary).multiValue(bMultiple)
-                .description(ftp2desc(fnm->ftp)));
+    else if (Path::hasExtension(defName))
+    {
+        defType = fn2ftp(defName);
+        GMX_RELEASE_ASSERT(defType != efNR,
+                           "File name option specifies an invalid extension");
+    }
+    fileNameOptions_.push_back(FileNameData(fnm));
+    FileNameData &data = fileNameOptions_.back();
+    data.optionInfo = options->addOption(
+                FileNameOption(name).storeVector(&data.values)
+                    .defaultBasename(defName).defaultType(defType)
+                    .legacyType(fnm->ftp).legacyOptionalBehavior()
+                    .readWriteFlags(bRead, bWrite).required(!bOptional)
+                    .libraryFile(bLibrary).multiValue(bMultiple)
+                    .allowMissing(bMissing)
+                    .description(ftp2desc(fnm->ftp)));
 }
 
-/*! \brief
- * Converts a t_pargs option into an Options option.
- *
- * \param     options Options object to add the new option to.
- * \param[in] pa      t_pargs option to convert.
- *
- * \ingroup module_commandline
- */
-void pargsToOptions(Options *options, t_pargs *pa)
+void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
 {
-    const bool        bHidden = is_hidden(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);
-    // Since we are not (yet) using this for actual parsing, we can take some
-    // shortcuts and not set any storage where there is no direct
-    // correspondence in the types.
+    programArgs_.push_back(ProgramArgData(pa));
+    ProgramArgData   &data = programArgs_.back();
     switch (pa->type)
     {
         case etINT:
-            options->addOption(
-                IntegerOption(name).store(pa->u.i)
-                    .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        IntegerOption(name).store(pa->u.i)
+                            .description(desc).hidden(bHidden));
             return;
         case etINT64:
-            options->addOption(
-                Int64Option(name).store(pa->u.is)
-                    .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        Int64Option(name).store(pa->u.is)
+                            .description(desc).hidden(bHidden));
             return;
         case etREAL:
-            options->addOption(
-                RealOption(name).store(pa->u.r)
-                    .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        RealOption(name).store(pa->u.r)
+                            .description(desc).hidden(bHidden));
             return;
         case etTIME:
-            options->addOption(
-                RealOption(name).store(pa->u.r).timeValue()
-                    .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        RealOption(name).store(pa->u.r).timeValue()
+                            .description(desc).hidden(bHidden));
             return;
         case etSTR:
         {
             const char *const defValue = (*pa->u.c != NULL ? *pa->u.c : "");
-            options->addOption(
-                    StringOption(name).defaultValue(defValue)
-                        .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        StringOption(name).store(&data.stringValue)
+                            .defaultValue(defValue)
+                            .description(desc).hidden(bHidden));
             return;
         }
         case etBOOL:
-            options->addOption(
-                BooleanOption(name).defaultValue(*pa->u.b)
-                    .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        BooleanOption(name).store(&data.boolValue)
+                            .defaultValue(*pa->u.b)
+                            .description(desc).hidden(bHidden));
             return;
         case etRVEC:
-            options->addOption(
-                RealOption(name).store(*pa->u.rv).vector()
-                    .description(desc).hidden(bHidden));
+            data.optionInfo = options->addOption(
+                        RealOption(name).store(*pa->u.rv).vector()
+                            .description(desc).hidden(bHidden));
             return;
         case etENUM:
-            options->addOption(
-                StringOption(name).defaultEnumIndex(nenum(pa->u.c) - 1)
-                    .enumValueFromNullTerminatedArray(pa->u.c + 1)
-                    .description(desc).hidden(bHidden));
+        {
+            const int defaultIndex = (pa->u.c[0] != NULL ? nenum(pa->u.c) - 1 : 0);
+            data.optionInfo = options->addOption(
+                        StringOption(name).storeEnumIndex(&data.enumIndex)
+                            .defaultEnumIndex(defaultIndex)
+                            .enumValueFromNullTerminatedArray(pa->u.c + 1)
+                            .description(desc).hidden(bHidden));
             return;
+        }
     }
     GMX_THROW(NotImplementedError("Argument type not implemented"));
 }
 
+void OptionsAdapter::copyValues(bool bReadNode)
+{
+    std::list<FileNameData>::const_iterator file;
+    for (file = fileNameOptions_.begin(); file != fileNameOptions_.end(); ++file)
+    {
+        if (!bReadNode && (file->fnm->flag & ffREAD))
+        {
+            continue;
+        }
+        if (file->optionInfo->isSet())
+        {
+            file->fnm->flag |= ffSET;
+        }
+        file->fnm->nfiles = file->values.size();
+        snew(file->fnm->fns, file->fnm->nfiles);
+        for (int i = 0; i < file->fnm->nfiles; ++i)
+        {
+            file->fnm->fns[i] = gmx_strdup(file->values[i].c_str());
+        }
+    }
+    std::list<ProgramArgData>::const_iterator arg;
+    for (arg = programArgs_.begin(); arg != programArgs_.end(); ++arg)
+    {
+        arg->pa->bSet = arg->optionInfo->isSet();
+        switch (arg->pa->type)
+        {
+            case etSTR:
+            {
+                if (arg->pa->bSet)
+                {
+                    std::vector<const char *>::const_iterator pos =
+                        std::find(argv_.begin(), argv_.end(), arg->stringValue);
+                    GMX_RELEASE_ASSERT(pos != argv_.end(),
+                                       "String argument got a value not in argv");
+                    *arg->pa->u.c = *pos;
+                }
+                break;
+            }
+            case etBOOL:
+                *arg->pa->u.b = arg->boolValue;
+                break;
+            case etENUM:
+                *arg->pa->u.c = arg->pa->u.c[arg->enumIndex + 1];
+                break;
+            default:
+                // For other types, there is nothing type-specific to do.
+                break;
+        }
+    }
+}
+
 } // namespace
 
 } // namespace gmx
@@ -600,280 +479,132 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
                            output_env_t *oenv)
 {
     /* This array should match the order of the enum in oenv.h */
-    const char *xvg_format[] = { NULL, "xmgrace", "xmgr", "none", NULL };
-    /* This array should match the order of the enum in oenv.h */
-    const char *time_units[] = {
-        NULL, "fs", "ps", "ns", "us", "ms", "s",
-        NULL
-    };
-    int         nicelevel = 0, debug_level = 0;
-    char       *deffnm    = NULL;
-    real        tbegin    = 0, tend = 0, tdelta = 0;
-    gmx_bool    bView     = FALSE;
-
-    t_pargs    *all_pa = NULL;
-
-    t_pargs     nice_pa   = {
-        "-nice", FALSE, etINT,   {&nicelevel},
-        "Set the nicelevel"
-    };
-    t_pargs     deffnm_pa = {
-        "-deffnm", FALSE, etSTR, {&deffnm},
-        "Set the default filename for all file options"
-    };
-    t_pargs     begin_pa  = {
-        "-b",    FALSE, etTIME,  {&tbegin},
-        "First frame (%t) to read from trajectory"
-    };
-    t_pargs     end_pa    = {
-        "-e",    FALSE, etTIME,  {&tend},
-        "Last frame (%t) to read from trajectory"
-    };
-    t_pargs     dt_pa     = {
-        "-dt",   FALSE, etTIME,  {&tdelta},
-        "Only use frame when t MOD dt = first time (%t)"
-    };
-    t_pargs     view_pa   = {
-        "-w",    FALSE, etBOOL,  {&bView},
-        "View output [TT].xvg[tt], [TT].xpm[tt], [TT].eps[tt] and [TT].pdb[tt] files"
-    };
-    t_pargs     xvg_pa    = {
-        "-xvg",  FALSE, etENUM,  {xvg_format},
-        "xvg plot formatting"
-    };
-    t_pargs     time_pa   = {
-        "-tu",   FALSE, etENUM,  {time_units},
-        "Time unit"
-    };
-    /* Maximum number of extra arguments */
-#define EXTRA_PA 16
-
-    t_pargs  pca_pa[] = {
-        { "-debug", FALSE, etINT, {&debug_level},
-          "HIDDENWrite file with debug information, 1: short, 2: also x and f" },
-    };
-#define NPCA_PA asize(pca_pa)
-    gmx_bool bXvgr;
-    int      i, j, k, npall, max_pa;
+    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)
 
-    /* Check for double arguments */
-    for (i = 1; (i < *argc); i++)
-    {
-        if (argv[i] && (strlen(argv[i]) > 1) && (!std::isdigit(argv[i][1])))
-        {
-            for (j = i+1; (j < *argc); j++)
-            {
-                if ( (argv[i][0] == '-') && (argv[j][0] == '-') &&
-                     (strcmp(argv[i], argv[j]) == 0) )
-                {
-                    if (FF(PCA_NOEXIT_ON_ARGS))
-                    {
-                        fprintf(stderr, "Double command line argument %s\n",
-                                argv[i]);
-                    }
-                    else
-                    {
-                        gmx_fatal(FARGS, "Double command line argument %s\n",
-                                  argv[i]);
-                    }
-                }
-            }
-        }
-    }
-    debug_gmx();
-
-    /* Check ALL the flags ... */
-    max_pa = NPCA_PA + EXTRA_PA + npargs+1;
-    snew(all_pa, max_pa);
-
-    for (i = npall = 0; (i < static_cast<int>(NPCA_PA)); i++)
-    {
-        npall = add_parg(npall, all_pa, &(pca_pa[i]));
-    }
-
-    if (FF(PCA_BE_NICE))
-    {
-        nicelevel = 19;
-    }
-    npall = add_parg(npall, all_pa, &nice_pa);
-
-    if (FF(PCA_CAN_SET_DEFFNM))
-    {
-        npall = add_parg(npall, all_pa, &deffnm_pa);
-    }
-    if (FF(PCA_CAN_BEGIN))
-    {
-        npall = add_parg(npall, all_pa, &begin_pa);
-    }
-    if (FF(PCA_CAN_END))
-    {
-        npall = add_parg(npall, all_pa, &end_pa);
-    }
-    if (FF(PCA_CAN_DT))
-    {
-        npall = add_parg(npall, all_pa, &dt_pa);
-    }
-    if (FF(PCA_TIME_UNIT))
-    {
-        npall = add_parg(npall, all_pa, &time_pa);
-    }
-    if (FF(PCA_CAN_VIEW))
-    {
-        npall = add_parg(npall, all_pa, &view_pa);
-    }
-
-    bXvgr = FALSE;
-    for (i = 0; (i < nfile); i++)
-    {
-        bXvgr = bXvgr ||  (fnm[i].ftp == efXVG);
-    }
-    if (bXvgr)
+    try
     {
-        npall = add_parg(npall, all_pa, &xvg_pa);
-    }
+        double                     tbegin    = 0.0, tend = 0.0, tdelta = 0.0;
+        bool                       bView     = false;
+        int                        xvgFormat = 0;
+        gmx::TimeUnitManager       timeUnitManager;
+        gmx::OptionsAdapter        adapter(*argc, argv);
+        gmx::Options               options(NULL, NULL);
+        gmx::FileNameOptionManager fileOptManager;
 
-    /* Now append the program specific arguments */
-    for (i = 0; (i < npargs); i++)
-    {
-        npall = add_parg(npall, all_pa, &(pa[i]));
-    }
+        fileOptManager.disableInputOptionChecking(
+                FF(PCA_NOT_READ_NODE) || FF(PCA_DISABLE_INPUT_FILE_CHECKING));
+        options.addManager(&fileOptManager);
+        options.setDescription(gmx::constArrayRefFromArray<const char *>(desc, ndesc));
 
-    /* set etENUM options to default */
-    for (i = 0; (i < npall); i++)
-    {
-        if (all_pa[i].type == etENUM)
+        if (FF(PCA_CAN_SET_DEFFNM))
         {
-            all_pa[i].u.c[0] = all_pa[i].u.c[1];
+            fileOptManager.addDefaultFileNameOption(&options, "deffnm");
         }
-    }
-    set_default_time_unit(time_units, FF(PCA_TIME_UNIT));
-    set_default_xvg_format(xvg_format);
-
-    /* Now parse all the command-line options */
-    get_pargs(argc, argv, npall, all_pa);
-
-    /* set program name, command line, and default values for output options */
-    output_env_init(oenv, gmx::getProgramContext(), (time_unit_t)nenum(time_units), bView,
-                    (xvg_format_t)nenum(xvg_format), 0, debug_level);
-
-    /* Parse the file args */
-    parse_file_args(argc, argv, nfile, fnm, deffnm, !FF(PCA_NOT_READ_NODE));
-
-    /* Open the debug file */
-    if (debug_level > 0)
-    {
-        char buf[256];
-
-        if (gmx_mpi_initialized())
+        if (FF(PCA_CAN_BEGIN))
         {
-            sprintf(buf, "%s%d.debug", output_env_get_short_program_name(*oenv),
-                    gmx_node_rank());
+            options.addOption(
+                    gmx::DoubleOption("b").store(&tbegin).timeValue()
+                        .description("First frame (%t) to read from trajectory"));
         }
-        else
+        if (FF(PCA_CAN_END))
         {
-            sprintf(buf, "%s.debug", output_env_get_short_program_name(*oenv));
+            options.addOption(
+                    gmx::DoubleOption("e").store(&tend).timeValue()
+                        .description("Last frame (%t) to read from trajectory"));
+        }
+        if (FF(PCA_CAN_DT))
+        {
+            options.addOption(
+                    gmx::DoubleOption("dt").store(&tdelta).timeValue()
+                        .description("Only use frame when t MOD dt = first time (%t)"));
+        }
+        if (FF(PCA_TIME_UNIT))
+        {
+            timeUnitManager.setTimeUnitFromEnvironment();
+            timeUnitManager.addTimeUnitOption(&options, "tu");
+        }
+        if (FF(PCA_CAN_VIEW))
+        {
+            options.addOption(
+                    gmx::BooleanOption("w").store(&bView)
+                        .description("View output [TT].xvg[tt], [TT].xpm[tt], "
+                                     "[TT].eps[tt] and [TT].pdb[tt] files"));
         }
 
-        init_debug(debug_level, buf);
-        fprintf(stderr, "Opening debug file %s (src code file %s, line %d)\n",
-                buf, __FILE__, __LINE__);
-    }
+        bool bXvgr = false;
+        for (int i = 0; i < nfile; i++)
+        {
+            bXvgr = bXvgr || (fnm[i].ftp == efXVG);
+        }
+        xvgFormat = gmx::getDefaultXvgFormat(xvg_formats);
+        if (bXvgr)
+        {
+            options.addOption(
+                    gmx::StringOption("xvg").enumValue(xvg_formats)
+                        .storeEnumIndex(&xvgFormat)
+                        .description("xvg plot formatting"));
+        }
 
-    /* Now copy the results back... */
-    for (i = 0, k = npall-npargs; (i < npargs); i++, k++)
-    {
-        memcpy(&(pa[i]), &(all_pa[k]), (size_t)sizeof(pa[i]));
-    }
+        /* Now append the program specific arguments */
+        for (int i = 0; i < nfile; i++)
+        {
+            adapter.filenmToOptions(&options, &fnm[i]);
+        }
+        for (int i = 0; i < npargs; i++)
+        {
+            adapter.pargsToOptions(&options, &pa[i]);
+        }
 
-    bool bExit = false;
-    try
-    {
         const gmx::CommandLineHelpContext *context =
             gmx::GlobalCommandLineHelpContext::get();
-        bExit = (context != NULL);
-        if (context != NULL && !(FF(PCA_QUIET)))
+        if (context != NULL)
         {
-            gmx::Options options(NULL, NULL);
-            options.setDescription(gmx::constArrayRefFromArray(desc, ndesc));
-            for (i = 0; i < nfile; i++)
-            {
-                gmx::filenmToOptions(&options, &fnm[i]);
-            }
-            for (i = 0; i < npall; i++)
-            {
-                gmx::pargsToOptions(&options, &all_pa[i]);
-            }
+            GMX_RELEASE_ASSERT(gmx_node_rank() == 0,
+                               "Help output should be handled higher up and "
+                               "only get called only on the master rank");
             gmx::CommandLineHelpWriter(options)
                 .setShowDescriptions(true)
-                .setTimeUnitString(output_env_get_time_unit(*oenv))
+                .setTimeUnitString(timeUnitManager.timeUnitAsString())
                 .setKnownIssues(gmx::constArrayRefFromArray(bugs, nbugs))
                 .writeHelp(*context);
+            return FALSE;
         }
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
-    /* Set the nice level */
-#if defined(HAVE_UNISTD_H) && !defined(__MINGW32__)
-#ifndef GMX_NO_NICE
-    /* The some system, e.g. the catamount kernel on cray xt3 do not have nice(2). */
-    if (nicelevel != 0 && !bExit)
-    {
-        static gmx_bool            nice_set   = FALSE; /* only set it once */
-        static tMPI_Thread_mutex_t init_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
-        tMPI_Thread_mutex_lock(&init_mutex);
-        if (!nice_set)
-        {
-            if (nice(nicelevel) == -1)
-            {
-                /* Do nothing, but use the return value to avoid warnings. */
-            }
-            nice_set = TRUE;
-        }
-        tMPI_Thread_mutex_unlock(&init_mutex);
-    }
-#endif
-#endif
+        /* Now parse all the command-line options */
+        gmx::CommandLineParser(&options).skipUnknown(FF(PCA_NOEXIT_ON_ARGS))
+            .parse(argc, argv);
+        options.finish();
 
-    /* convert time options, must be done after printing! */
+        /* set program name, command line, and default values for output options */
+        output_env_init(oenv, gmx::getProgramContext(),
+                        (time_unit_t)(timeUnitManager.timeUnit() + 1), bView,
+                        (xvg_format_t)(xvgFormat + 1), 0);
 
-    for (i = 0; i < npall; i++)
-    {
-        if (all_pa[i].type == etTIME && all_pa[i].bSet)
+        timeUnitManager.scaleTimeOptions(&options);
+
+        /* Extract Time info from arguments */
+        // TODO: Use OptionInfo objects instead of string constants
+        if (FF(PCA_CAN_BEGIN) && options.isSet("b"))
         {
-            *all_pa[i].u.r *= output_env_get_time_invfactor(*oenv);
+            setTimeValue(TBEGIN, tbegin);
         }
-    }
-
-    /* Extract Time info from arguments */
-    if (FF(PCA_CAN_BEGIN) && opt2parg_bSet("-b", npall, all_pa))
-    {
-        setTimeValue(TBEGIN, opt2parg_real("-b", npall, all_pa));
-    }
-
-    if (FF(PCA_CAN_END) && opt2parg_bSet("-e", npall, all_pa))
-    {
-        setTimeValue(TEND, opt2parg_real("-e", npall, all_pa));
-    }
-
-    if (FF(PCA_CAN_DT) && opt2parg_bSet("-dt", npall, all_pa))
-    {
-        setTimeValue(TDELTA, opt2parg_real("-dt", npall, all_pa));
-    }
-
-    /* clear memory */
-    sfree(all_pa);
-
-    if (!FF(PCA_NOEXIT_ON_ARGS))
-    {
-        if (*argc > 1)
+        if (FF(PCA_CAN_END) && options.isSet("e"))
+        {
+            setTimeValue(TEND, tend);
+        }
+        if (FF(PCA_CAN_DT) && options.isSet("dt"))
         {
-            gmx_cmd(argv[1]);
+            setTimeValue(TDELTA, tdelta);
         }
+
+        adapter.copyValues(!FF(PCA_NOT_READ_NODE));
+
+        return TRUE;
     }
-    return !bExit;
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 #undef FF
 }
index 3a9217aa36b0e95a4b0e8834f938581438863565..9c81a77cb229eb2e14d01cf4289da62b71e3e06a 100644 (file)
 #ifndef GMX_COMMANDLINE_PARGS_H
 #define GMX_COMMANDLINE_PARGS_H
 
-#include "../legacyheaders/types/simple.h"
-#include "../legacyheaders/oenv.h"
-#include "../fileio/filenm.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -228,12 +230,10 @@ gmx_bool opt2parg_bSet(const char *option, int nparg, t_pargs pa[]);
 #define PCA_CAN_SET_DEFFNM (1<<10)
 /** Do not raise a fatal error when invalid options are encountered. */
 #define PCA_NOEXIT_ON_ARGS (1<<11)
-/** Do not print help output (used for non-master nodes). */
-#define PCA_QUIET          (1<<12)
-/** Default to low priority. */
-#define PCA_BE_NICE        (1<<13)
 /** Is this node not reading: for parallel all nodes but the master */
 #define PCA_NOT_READ_NODE  (1<<16)
+/** Don't do any special processing for ffREAD files */
+#define PCA_DISABLE_INPUT_FILE_CHECKING (1<<17)
 
 /*! \brief
  * Parse command-line arguments.
@@ -243,6 +243,17 @@ gmx_bool opt2parg_bSet(const char *option, int nparg, t_pargs pa[]);
  * by \p Flags.
  *
  * Recognized arguments are removed from the list.
+ *
+ * For full functionality, this function needs to be used within a function
+ * that is passed to gmx_run_cmain().  It should be called as the first thing in
+ * that function.  Initialization code can be executed before it, but you need
+ * to be aware that if the program is executed with -h and MPI, the code before
+ * parse_common_args() only executes on the master node.
+ *
+ * If the return value is `FALSE`, the program should return immediately (this
+ * is necessary for -h and a few other cases).
+ *
+ * \see gmx_run_cmain().
  */
 gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
                            int nfile, t_filenm fnm[], int npargs, t_pargs *pa,
index f5b705944f581cca84affd9fa3d205d8031d04e0..1eefeda1cf6fd282965b63511aab391030368ca4 100644 (file)
@@ -41,7 +41,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
-#include "gromacs/commandline/shellcompletions.h"
+#include "gmxpre.h"
+
+#include "shellcompletions.h"
 
 #include <cstdio>
 
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/filenm.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/optionsvisitor.h"
-#include "gromacs/fileio/filenm.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
index b2f01cfbb8148ff3e393e94f961075dc5da5ed98..88435475436e8a4951eaf6e893ebbfccb4f3b15b 100644 (file)
@@ -47,7 +47,7 @@
 #include <string>
 #include <vector>
 
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -57,7 +57,7 @@ class File;
 class Options;
 
 //! \cond internal
-//! \addtogroup module_onlinehelp
+//! \addtogroup module_commandline
 //! \{
 
 //! Output format for ShellCompletionWriter.
index 1a4b4d463dcbd58e81a806000494b328a7d518fd..a545dcc835556abd1b4c2bfaf3883ed2c7c55bf7 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/commandline/cmdlinehelpwriter.h"
+
+#include <gtest/gtest.h>
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
-#include "gromacs/commandline/cmdlinehelpwriter.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
@@ -224,15 +226,15 @@ TEST_F(CommandLineHelpWriterTest, HandlesSelectionOptions)
     using gmx::SelectionFileOption;
     using gmx::SelectionOption;
 
-    gmx::Options options(NULL, NULL);
+    gmx::Options                options(NULL, NULL);
+    gmx::SelectionCollection    selections;
+    gmx::SelectionOptionManager manager(&selections);
+    options.addManager(&manager);
     options.addOption(SelectionFileOption("sf"));
     options.addOption(SelectionOption("refsel").required()
                           .description("Reference selection option"));
     options.addOption(SelectionOption("sel").required().valueCount(2)
                           .description("Selection option"));
-    gmx::SelectionCollection    selections;
-    gmx::SelectionOptionManager manager(&selections);
-    setManagerForSelectionOptions(&options, &manager);
     options.finish();
     manager.parseRequestedFromString(
             "resname SOL;"
index 9be6c2886a026a70d89b4e96da0d585c3b60824d..6a420e921ed7bc7ae6ee98245156990013c12352 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,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.
  * \ingroup module_commandline
  */
 // For GMX_BINARY_SUFFIX
-#ifdef HAVE_CONFIG_H
+#include "gmxpre.h"
+
+#include "gromacs/commandline/cmdlinemodulemanager.h"
+
 #include "config.h"
-#endif
 
 #include <vector>
 
@@ -50,7 +52,6 @@
 
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinemodule.h"
-#include "gromacs/commandline/cmdlinemodulemanager.h"
 #include "gromacs/commandline/cmdlineprogramcontext.h"
 #include "gromacs/utility/file.h"
 
@@ -83,6 +84,7 @@ class MockModule : public gmx::CommandLineModuleInterface
         virtual const char *name() const { return name_; }
         virtual const char *shortDescription() const { return descr_; }
 
+        MOCK_METHOD1(init, void(gmx::CommandLineModuleSettings *settings));
         MOCK_METHOD2(run, int(int argc, char *argv[]));
         MOCK_CONST_METHOD1(writeHelp, void(const gmx::CommandLineHelpContext &context));
 
@@ -93,6 +95,11 @@ class MockModule : public gmx::CommandLineModuleInterface
         }
 
     private:
+        //! Disable nice() calls for tests.
+        void disableNice(gmx::CommandLineModuleSettings *settings)
+        {
+            settings->setDefaultNiceLevel(0);
+        }
         //! Checks the context passed to writeHelp().
         void checkHelpContext(const gmx::CommandLineHelpContext &context) const;
 
@@ -107,6 +114,8 @@ MockModule::MockModule(const char *name, const char *description)
     using ::testing::_;
     using ::testing::Invoke;
     using ::testing::WithArg;
+    ON_CALL(*this, init(_))
+        .WillByDefault(WithArg<0>(Invoke(this, &MockModule::disableNice)));
     ON_CALL(*this, writeHelp(_))
         .WillByDefault(WithArg<0>(Invoke(this, &MockModule::checkHelpContext)));
 }
@@ -209,6 +218,7 @@ TEST_F(CommandLineModuleManagerTest, RunsModule)
     using ::testing::_;
     using ::testing::Args;
     using ::testing::ElementsAreArray;
+    EXPECT_CALL(mod1, init(_));
     EXPECT_CALL(mod1, run(_, _))
         .With(Args<1, 0>(ElementsAreArray(args.argv() + 1, args.argc() - 1)));
     int rc = 0;
@@ -250,23 +260,6 @@ TEST_F(CommandLineModuleManagerTest, RunsModuleHelpWithDashH)
     ASSERT_EQ(0, rc);
 }
 
-TEST_F(CommandLineModuleManagerTest, RunsModuleHelpWithDashHWithSymLink)
-{
-    const char *const cmdline[] = {
-        "g_module", "-h"
-    };
-    CommandLine       args(cmdline);
-    initManager(args, "test");
-    MockModule       &mod1 = addModule("module", "First module");
-    addModule("other", "Second module");
-    using ::testing::_;
-    EXPECT_CALL(mod1, writeHelp(_));
-    mod1.setExpectedDisplayName("test module");
-    int rc = 0;
-    ASSERT_NO_THROW_GMX(rc = manager().run(args.argc(), args.argv()));
-    ASSERT_EQ(0, rc);
-}
-
 TEST_F(CommandLineModuleManagerTest, RunsModuleHelpWithDashHWithSingleModule)
 {
     const char *const cmdline[] = {
@@ -300,44 +293,6 @@ TEST_F(CommandLineModuleManagerTest, PrintsHelpOnTopic)
     ASSERT_EQ(0, rc);
 }
 
-TEST_F(CommandLineModuleManagerTest, RunsModuleBasedOnBinaryName)
-{
-    const char *const cmdline[] = {
-        "g_module", "-flag", "yes"
-    };
-    CommandLine       args(cmdline);
-    initManager(args, "test");
-    MockModule       &mod1 = addModule("module", "First module");
-    addModule("other", "Second module");
-    using ::testing::_;
-    using ::testing::Args;
-    using ::testing::ElementsAreArray;
-    EXPECT_CALL(mod1, run(_, _))
-        .With(Args<1, 0>(ElementsAreArray(args.argv(), args.argc())));
-    int rc = 0;
-    ASSERT_NO_THROW_GMX(rc = manager().run(args.argc(), args.argv()));
-    ASSERT_EQ(0, rc);
-}
-
-TEST_F(CommandLineModuleManagerTest, RunsModuleBasedOnBinaryNameWithPathAndSuffix)
-{
-    const char *const cmdline[] = {
-        "/usr/local/gromacs/bin/g_module" GMX_BINARY_SUFFIX ".exe", "-flag", "yes"
-    };
-    CommandLine       args(cmdline);
-    initManager(args, "test");
-    MockModule       &mod1 = addModule("module", "First module");
-    addModule("other", "Second module");
-    using ::testing::_;
-    using ::testing::Args;
-    using ::testing::ElementsAreArray;
-    EXPECT_CALL(mod1, run(_, _))
-        .With(Args<1, 0>(ElementsAreArray(args.argv(), args.argc())));
-    int rc = 0;
-    ASSERT_NO_THROW_GMX(rc = manager().run(args.argc(), args.argv()));
-    ASSERT_EQ(0, rc);
-}
-
 TEST_F(CommandLineModuleManagerTest, HandlesConflictingBinaryAndModuleNames)
 {
     const char *const cmdline[] = {
@@ -350,6 +305,7 @@ TEST_F(CommandLineModuleManagerTest, HandlesConflictingBinaryAndModuleNames)
     using ::testing::_;
     using ::testing::Args;
     using ::testing::ElementsAreArray;
+    EXPECT_CALL(mod1, init(_));
     EXPECT_CALL(mod1, run(_, _))
         .With(Args<1, 0>(ElementsAreArray(args.argv() + 1, args.argc() - 1)));
     int rc = 0;
index d46af114e219a94886247c16a1c47b8f7b1d2552..719e69d34f71917e67a1c1a2198387b44eee4e99 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
+#include "gromacs/commandline/cmdlineparser.h"
+
 #include <vector>
 
 #include <gtest/gtest.h>
 
-#include "gromacs/commandline/cmdlineparser.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 
index befb5c991f4e2fbadc9e11713b293bdd0e3dc6b8..edfb9491d160afd22d02a0542e7cf10025f3c4b6 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
+#include "gmxpre.h"
+
+#include "gromacs/commandline/cmdlineprogramcontext.h"
+
+#include "config.h"
+
 #include <string>
 #include <vector>
 
+#include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
 
-#include "gromacs/commandline/cmdlineprogramcontext.h"
-#include "gromacs/fileio/path.h"
-#include "gromacs/utility/common.h"
-#include "gromacs/utility/uniqueptr.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/path.h"
 
 #include "testutils/cmdlinetest.h"
 
-#include "config.h"
-
 using gmx::test::CommandLine;
 using gmx::Path;
 
@@ -93,7 +96,7 @@ class TestExecutableEnvironment : public gmx::ExecutableEnvironmentInterface
 };
 
 //! Shorthand for a smart pointer to TestExecutableEnvironment.
-typedef gmx::gmx_unique_ptr<TestExecutableEnvironment>::type
+typedef boost::shared_ptr<TestExecutableEnvironment>
     TestExecutableEnvironmentPointer;
 
 class CommandLineProgramContextTest : public ::testing::Test
@@ -111,7 +114,7 @@ class CommandLineProgramContextTest : public ::testing::Test
         void testBinaryPathSearch(const char *argv0)
         {
             ASSERT_TRUE(env_.get() != NULL);
-            gmx::CommandLineProgramContext  info(1, &argv0, move(env_));
+            gmx::CommandLineProgramContext  info(1, &argv0, env_);
             EXPECT_EQ(expectedExecutable_, info.fullBinaryPath());
         }
         void testBinaryPathSearch(const std::string &argv0)
index e11113ea6f1ee8d1752510717e267173747839d1..d74f12f9877b437e37aa97e6dc8a13f98449ba0d 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,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.
  * Currently, negative tests are not possible, because those trigger
  * gmx_fatal() and terminate the whole test binary.
  *
- * \todo
- * Add tests that exercise the machinery triggered by ffREAD to detect the
- * extension for certain types of files.  Also some other paths in the file
- * name logic may not get tested by the current set.
- *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_commandline
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/commandline/pargs.h"
+
+#include <string>
+
+#include <gtest/gtest.h>
+
 #include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/stringutil.h"
 
 #include "testutils/cmdlinetest.h"
 #include "testutils/testasserts.h"
+#include "testutils/testfilemanager.h"
 
 namespace
 {
@@ -63,6 +67,13 @@ using gmx::test::CommandLine;
 class ParseCommonArgsTest : public ::testing::Test
 {
     public:
+        enum FileArgumentType
+        {
+            efFull,
+            efNoExtension,
+            efEmptyValue
+        };
+
         ParseCommonArgsTest()
             : oenv_(NULL), fileCount_(0)
         {
@@ -74,12 +85,10 @@ class ParseCommonArgsTest : public ::testing::Test
 
         int nfile() const { return fileCount_; }
 
-        void parse(gmx::ConstArrayRef<const char *> cmdline,
-                   unsigned long                    flags,
-                   gmx::ArrayRef<t_filenm>          fnm,
-                   gmx::ArrayRef<t_pargs>           pa)
+        void parseFromArgs(unsigned long           flags,
+                           gmx::ArrayRef<t_filenm> fnm,
+                           gmx::ArrayRef<t_pargs>  pa)
         {
-            args_.initFromArray(cmdline);
             fileCount_ = fnm.size();
             bool bOk = parse_common_args(&args_.argc(), args_.argv(), flags,
                                          fnm.size(), fnm.data(),
@@ -87,12 +96,45 @@ class ParseCommonArgsTest : public ::testing::Test
                                          0, NULL, 0, NULL, &oenv_);
             EXPECT_TRUE(bOk);
         }
+        void parseFromArray(gmx::ConstArrayRef<const char *> cmdline,
+                            unsigned long                    flags,
+                            gmx::ArrayRef<t_filenm>          fnm,
+                            gmx::ArrayRef<t_pargs>           pa)
+        {
+            args_.initFromArray(cmdline);
+            parseFromArgs(flags, fnm, pa);
+        }
+        std::string addFileArg(const char *name, const char *extension,
+                               FileArgumentType type)
+        {
+            std::string filename(tempFiles_.getTemporaryFilePath(extension));
+            gmx::File::writeFileFromString(filename, "Dummy file");
+            if (name != NULL)
+            {
+                args_.append(name);
+                switch (type)
+                {
+                    case efFull:
+                        args_.append(filename);
+                        break;
+                    case efNoExtension:
+                        args_.append(gmx::Path::stripExtension(filename));
+                        break;
+                    case efEmptyValue:
+                        break;
+                }
+            }
+            return filename;
+        }
 
-        CommandLine              args_;
-        output_env_t             oenv_;
+        // This must be a member that persists until the end of the test,
+        // because string arguments are not duplicated in the output.
+        CommandLine                 args_;
 
     private:
-        size_t                   fileCount_;
+        output_env_t                oenv_;
+        size_t                      fileCount_;
+        gmx::test::TestFileManager  tempFiles_;
 };
 
 /********************************************************************
@@ -110,7 +152,7 @@ TEST_F(ParseCommonArgsTest, ParsesIntegerArgs)
     const char *const cmdline[] = {
         "test", "-i1", "2", "-i2", "-3"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_EQ( 2, value1);
     EXPECT_EQ(-3, value2);
     EXPECT_EQ( 3, value3);
@@ -127,7 +169,7 @@ TEST_F(ParseCommonArgsTest, ParsesInt64Args)
     const char *const cmdline[] = {
         "test", "-i1", "2", "-i2", "-3"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_EQ( 2, value1);
     EXPECT_EQ(-3, value2);
     EXPECT_EQ( 3, value3);
@@ -144,7 +186,7 @@ TEST_F(ParseCommonArgsTest, ParsesRealArgs)
     const char *const cmdline[] = {
         "test", "-r1", "2", "-r2", "-.5"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_EQ( 2.0, value1);
     EXPECT_EQ(-0.5, value2);
     EXPECT_EQ( 2.5, value3);
@@ -161,7 +203,7 @@ TEST_F(ParseCommonArgsTest, ParsesStringArgs)
     const char *const cmdline[] = {
         "test", "-s1", "", "-s2", "test"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_STREQ("", value1);
     EXPECT_STREQ("test", value2);
     EXPECT_STREQ("default", value3);
@@ -178,7 +220,7 @@ TEST_F(ParseCommonArgsTest, ParsesBooleanArgs)
     const char *const cmdline[] = {
         "test", "-nob1", "-b2"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_FALSE(value1);
     EXPECT_TRUE(value2);
     EXPECT_TRUE(value3);
@@ -195,7 +237,7 @@ TEST_F(ParseCommonArgsTest, ParsesVectorArgs)
     const char *const cmdline[] = {
         "test", "-v1", "2", "1", "3", "-v2", "1"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_EQ(2.0, value1[XX]);
     EXPECT_EQ(1.0, value1[YY]);
     EXPECT_EQ(3.0, value1[ZZ]);
@@ -218,7 +260,7 @@ TEST_F(ParseCommonArgsTest, ParsesTimeArgs)
     const char *const cmdline[] = {
         "test", "-t1", "2", "-t2", "-.5"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_EQ( 2.0, value1);
     EXPECT_EQ(-0.5, value2);
     EXPECT_EQ( 2.5, value3);
@@ -235,7 +277,7 @@ TEST_F(ParseCommonArgsTest, ParsesTimeArgsWithTimeUnit)
     const char *const cmdline[] = {
         "test", "-t1", "2", "-t2", "-.5", "-tu", "ns"
     };
-    parse(cmdline, PCA_TIME_UNIT, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, PCA_TIME_UNIT, gmx::EmptyArrayRef(), pa);
     EXPECT_EQ( 2000.0, value1);
     EXPECT_EQ(-500.0, value2);
     EXPECT_EQ( 2.5, value3);
@@ -254,7 +296,7 @@ TEST_F(ParseCommonArgsTest, ParsesEnumArgs)
     const char *const cmdline[] = {
         "test", "-s1", "off", "-s2", "val"
     };
-    parse(cmdline, 0, gmx::EmptyArrayRef(), pa);
+    parseFromArray(cmdline, 0, gmx::EmptyArrayRef(), pa);
     EXPECT_STREQ("off", value1[0]);
     EXPECT_STREQ("value", value2[0]);
     EXPECT_STREQ("default", value3[0]);
@@ -264,7 +306,7 @@ TEST_F(ParseCommonArgsTest, ParsesEnumArgs)
 }
 
 /********************************************************************
- * Tests for file name options
+ * Tests for file name options (output files, not dependent on file system)
  */
 
 TEST_F(ParseCommonArgsTest, ParsesFileArgs)
@@ -273,18 +315,22 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgs)
         { efXVG, "-o1", "out1", ffOPTWR },
         { efXVG, "-o2", "out2", ffOPTWR },
         { efXVG, "-om", "outm", ffWRMULT },
-        { efXVG, "-om2", "outm2", ffWRMULT },
+        { efXVG, "-om2", "outm2", ffWRMULT }
     };
     const char *const cmdline[] = {
         "test", "-o1", "-o2", "test", "-om", "test1", "test2.xvg", "-om2"
     };
-    parse(cmdline, 0, fnm, gmx::EmptyArrayRef());
+    parseFromArray(cmdline, 0, fnm, gmx::EmptyArrayRef());
     EXPECT_STREQ("out1.xvg", opt2fn_null("-o1", nfile(), fnm));
     EXPECT_STREQ("test.xvg", opt2fn_null("-o2", nfile(), fnm));
     char **files;
     EXPECT_EQ(2, opt2fns(&files, "-om", nfile(), fnm));
-    EXPECT_STREQ("test1.xvg", files[0]);
-    EXPECT_STREQ("test2.xvg", files[1]);
+    EXPECT_TRUE(files != NULL);
+    if (files != NULL)
+    {
+        EXPECT_STREQ("test1.xvg", files[0]);
+        EXPECT_STREQ("test2.xvg", files[1]);
+    }
     EXPECT_STREQ("outm2.xvg", opt2fn("-om2", nfile(), fnm));
     done_filenms(nfile(), fnm);
 }
@@ -296,12 +342,12 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaults)
         { efTRX, "-f2", NULL,   ffOPTWR },
         { efTRX, "-f3", "trj3", ffWRITE },
         { efXVG, "-o",  "out",  ffWRITE },
-        { efXVG, "-om", "outm", ffWRMULT },
+        { efXVG, "-om", "outm", ffWRMULT }
     };
     const char *const cmdline[] = {
         "test"
     };
-    parse(cmdline, 0, fnm, gmx::EmptyArrayRef());
+    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));
@@ -318,12 +364,12 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaultFileName)
         { efTRX, "-f2", NULL,   ffWRITE },
         { efTRX, "-f3", "trj3", ffWRITE },
         { efXVG, "-o",  "out",  ffWRITE },
-        { efXVG, "-om", "outm", ffWRMULT },
+        { efXVG, "-om", "outm", ffWRMULT }
     };
     const char *const cmdline[] = {
         "test", "-deffnm", "def", "-f2", "other", "-o"
     };
-    parse(cmdline, PCA_CAN_SET_DEFFNM, fnm, gmx::EmptyArrayRef());
+    parseFromArray(cmdline, PCA_CAN_SET_DEFFNM, fnm, gmx::EmptyArrayRef());
     EXPECT_STREQ("def.tpr", ftp2fn(efTPS, nfile(), fnm));
     EXPECT_STREQ("other.xtc", opt2fn("-f2", nfile(), fnm));
     EXPECT_STREQ("def.xtc", opt2fn("-f3", nfile(), fnm));
@@ -332,10 +378,202 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaultFileName)
     done_filenms(nfile(), fnm);
 }
 
+TEST_F(ParseCommonArgsTest, ParseFileArgsWithCustomDefaultExtension)
+{
+    t_filenm          fnm[] = {
+        { efTRX, "-o1", "conf1.gro", ffWRITE },
+        { efTRX, "-o2", "conf2.pdb", ffWRITE },
+        { efTRX, "-o3", "conf3.gro", ffWRITE }
+    };
+    const char *const cmdline[] = {
+        "test", "-o2", "-o3", "test"
+    };
+    parseFromArray(cmdline, PCA_CAN_SET_DEFFNM, fnm, gmx::EmptyArrayRef());
+    EXPECT_STREQ("conf1.gro", opt2fn("-o1", nfile(), fnm));
+    EXPECT_STREQ("conf2.pdb", opt2fn("-o2", nfile(), fnm));
+    EXPECT_STREQ("test.gro", opt2fn("-o3", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+/********************************************************************
+ * Tests for file name options (input files, dependent on file system contents)
+ */
+
+TEST_F(ParseCommonArgsTest, HandlesNonExistentInputFiles)
+{
+    t_filenm          fnm[] = {
+        { efTPS, "-s",  NULL,   ffREAD },
+        { efTRX, "-f",  "trj",  ffREAD },
+        { efTRX, "-f2", "trj2", ffREAD },
+        { efTRX, "-f3", "trj3", ffREAD },
+        { efTRX, "-f4", "trj4", ffREAD },
+        { efGRO, "-g",  "cnf",  ffREAD },
+        { efGRO, "-g2", "cnf2", ffREAD }
+    };
+    const char *const cmdline[] = {
+        "test", "-f2", "-f3", "other", "-f4", "trj.gro", "-g2", "foo"
+    };
+    parseFromArray(cmdline, PCA_DISABLE_INPUT_FILE_CHECKING, fnm, gmx::EmptyArrayRef());
+    EXPECT_STREQ("topol.tpr", ftp2fn(efTPS, nfile(), fnm));
+    EXPECT_STREQ("trj.xtc", opt2fn("-f", nfile(), fnm));
+    EXPECT_STREQ("trj2.xtc", opt2fn("-f2", nfile(), fnm));
+    EXPECT_STREQ("other.xtc", opt2fn("-f3", nfile(), fnm));
+    EXPECT_STREQ("trj.gro", opt2fn("-f4", nfile(), fnm));
+    EXPECT_STREQ("cnf.gro", opt2fn("-g", nfile(), fnm));
+    EXPECT_STREQ("foo.gro", opt2fn("-g2", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, HandlesNonExistentOptionalInputFiles)
+{
+    t_filenm          fnm[] = {
+        { efTPS, "-s",  NULL,   ffOPTRD },
+        { efTRX, "-f",  "trj",  ffOPTRD }
+    };
+    const char *const cmdline[] = {
+        "test"
+    };
+    parseFromArray(cmdline, 0, fnm, gmx::EmptyArrayRef());
+    EXPECT_STREQ("topol.tpr", ftp2fn(efTPS, nfile(), fnm));
+    EXPECT_STREQ("trj.xtc", opt2fn("-f", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, AcceptsNonExistentInputFilesIfSpecified)
+{
+    t_filenm          fnm[] = {
+        { efCPT, "-c",  "file1", ffOPTRD | ffALLOW_MISSING },
+        { efCPT, "-c2", "file2", ffOPTRD | ffALLOW_MISSING },
+        { efCPT, "-c3", "file3", ffOPTRD | ffALLOW_MISSING },
+        { efCPT, "-c4", "file4", ffOPTRD | ffALLOW_MISSING },
+        { efTRX, "-f",  "trj",   ffOPTRD | ffALLOW_MISSING }
+    };
+    const char *const cmdline[] = {
+        "test", "-c2", "-c3", "nonexistent", "-c4", "nonexistent.cpt", "-f", "nonexistent"
+    };
+    parseFromArray(cmdline, 0, fnm, gmx::EmptyArrayRef());
+    EXPECT_STREQ("file1.cpt", opt2fn("-c", nfile(), fnm));
+    EXPECT_STREQ("file2.cpt", opt2fn("-c2", nfile(), fnm));
+    EXPECT_STREQ("nonexistent.cpt", opt2fn("-c3", nfile(), fnm));
+    EXPECT_STREQ("nonexistent.cpt", opt2fn("-c4", nfile(), fnm));
+    EXPECT_STREQ("nonexistent.xtc", opt2fn("-f", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, HandlesCompressedFiles)
+{
+    t_filenm          fnm[] = {
+        { efTRX, "-f", NULL, ffREAD },
+        { efGRO, "-g", NULL, ffREAD }
+    };
+    args_.append("test");
+    std::string       expectedF = addFileArg("-f", ".pdb.gz", efFull);
+    std::string       expectedG = addFileArg("-g", ".gro.Z", efFull);
+    expectedF = gmx::Path::stripExtension(expectedF);
+    expectedG = gmx::Path::stripExtension(expectedG);
+    parseFromArgs(0, fnm, gmx::EmptyArrayRef());
+    EXPECT_EQ(expectedF, opt2fn("-f", nfile(), fnm));
+    EXPECT_EQ(expectedG, opt2fn("-g", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, AcceptsUnknownTrajectoryExtension)
+{
+    t_filenm          fnm[] = {
+        { efTRX, "-f", NULL, ffREAD }
+    };
+    args_.append("test");
+    std::string       expected = addFileArg("-f", ".foo", efFull);
+    parseFromArgs(0, fnm, gmx::EmptyArrayRef());
+    EXPECT_EQ(expected, opt2fn("-f", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFile)
+{
+    t_filenm          fnm[] = {
+        { efTRX, "-f1", NULL, ffREAD },
+        { efTRX, "-f2", NULL, ffREAD },
+        { efTRX, "-f3", NULL, ffREAD },
+        { efTRX, "-f4", NULL, ffREAD }
+    };
+    args_.append("test");
+    std::string       expected1 = addFileArg("-f1", "1.xtc", efNoExtension);
+    std::string       expected2 = addFileArg("-f2", "2.gro", efNoExtension);
+    std::string       expected3 = addFileArg("-f3", "3.tng", efNoExtension);
+    std::string       expected4 = addFileArg("-f4", ".gro", efEmptyValue);
+    std::string       def4      = gmx::Path::stripExtension(expected4);
+    fnm[3].fn = def4.c_str();
+    parseFromArgs(0, fnm, gmx::EmptyArrayRef());
+    EXPECT_EQ(expected1, opt2fn("-f1", nfile(), fnm));
+    EXPECT_EQ(expected2, opt2fn("-f2", nfile(), fnm));
+    EXPECT_EQ(expected3, opt2fn("-f3", nfile(), fnm));
+    EXPECT_EQ(expected4, opt2fn("-f4", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileName)
+{
+    t_filenm          fnm[] = {
+        { efTRX, "-f1", NULL,  ffREAD },
+        { efSTO, "-f2", "foo", ffREAD },
+        { efTRX, "-f3", NULL,  ffREAD },
+        { efSTX, "-f4", NULL,  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       deffnm    = gmx::Path::stripExtension(expected3);
+    args_.append("-deffnm");
+    args_.append(deffnm);
+    parseFromArgs(PCA_CAN_SET_DEFFNM, fnm, gmx::EmptyArrayRef());
+    EXPECT_EQ(expected1, opt2fn("-f1", nfile(), fnm));
+    EXPECT_EQ(expected2, opt2fn("-f2", nfile(), fnm));
+    EXPECT_EQ(expected3, opt2fn("-f3", nfile(), fnm));
+    EXPECT_EQ(expected4, opt2fn("-f4", nfile(), fnm));
+    done_filenms(nfile(), fnm);
+}
+
 /********************************************************************
  * Tests for general behavior
  */
 
+TEST_F(ParseCommonArgsTest, HandlesNonReadNode)
+{
+    t_filenm          fnm[] = {
+        { efTPS, "-s",  NULL,  ffREAD },
+        { efTRX, "-f",  NULL,  ffREAD },
+        { efTRX, "-f2", NULL,  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);
+    done_filenms(nfile(), fnm);
+}
+
+TEST_F(ParseCommonArgsTest, HandlesNonReadNodeWithDefaultFileName)
+{
+    t_filenm          fnm[] = {
+        { efTPS, "-s",  NULL,  ffREAD },
+        { efTRX, "-f",  NULL,  ffREAD },
+        { efTRX, "-f2", NULL,  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);
+    done_filenms(nfile(), fnm);
+}
+
 TEST_F(ParseCommonArgsTest, CanKeepUnknownArgs)
 {
     int               ivalue = 0;
@@ -352,7 +590,7 @@ TEST_F(ParseCommonArgsTest, CanKeepUnknownArgs)
         "test", "foo", "-unk", "-o1", "-unk2", "-o2", "test",
         "-i", "2", "-unk3", "-b", "-unk4"
     };
-    parse(cmdline, PCA_NOEXIT_ON_ARGS, fnm, pa);
+    parseFromArray(cmdline, PCA_NOEXIT_ON_ARGS, fnm, pa);
     EXPECT_EQ(2, ivalue);
     EXPECT_TRUE(bvalue);
     EXPECT_STREQ("out1.xvg", opt2fn_null("-o1", nfile(), fnm));
index 64dcfe4606a69d305ece8e537272e583077733ec..8ac10f83fe5a6747b20285b2a3ec97c63de7aee8 100644 (file)
@@ -12,12 +12,11 @@ OPTIONS
 Options to specify input and output files:
 
  -f     [<.xtc/.trr/...>] (path/to/long/trajectory/name.xtc) (Input)
-     File name option with a long value: xtc trr cpt trj gro g96 pdb tng
+     File name option with a long value: xtc trr cpt gro g96 pdb tng
  -f2    [<.xtc/.trr/...>] (path/to/long/trajectory.xtc) (Input)
-     File name option with a long value: xtc trr cpt trj gro g96 pdb tng
+     File name option with a long value: xtc trr cpt gro g96 pdb tng
  -lib   [<.xtc/.trr/...>] (path/to/long/trajectory/name.xtc) (Input, Opt., Lib.)
-     File name option with a long value and type: xtc trr cpt trj gro g96 pdb
-     tng
+     File name option with a long value and type: xtc trr cpt gro g96 pdb tng
  -longfileopt [<.dat>] (deffile.dat) (Input, Opt.)
      File name option with a long name
  -longfileopt2 [<.dat>] (path/to/long/file/name.dat) (Input, Opt., Lib.)
index c4abb113cf4473a25f8849c208fa2abd63c5ed61..d60500d2bf4cf2fec35c14c28e63db1fc6641822 100644 (file)
@@ -14,9 +14,9 @@ OPTIONS
 Options to specify input and output files:
 
  -f     [<.xtc/.trr/...>] (traj.xtc) (Input)
-     Input file description: xtc trr cpt trj gro g96 pdb tng
+     Input file description: xtc trr cpt gro g96 pdb tng
  -mult  [<.xtc/.trr/...> [...]] (traj.xtc) (Input, Opt.)
-     Multiple file description: xtc trr cpt trj gro g96 pdb tng
+     Multiple file description: xtc trr cpt gro g96 pdb tng
  -lib   [<.dat>] (libdata.dat) (Input, Opt., Lib.) Library file description
  -io    [<.dat>] (inout.dat) (In/Out, Opt.) Input/Output file description
  -o     <.xvg>   (Output, Opt.) Output file description
diff --git a/src/gromacs/correlationfunctions/CMakeLists.txt b/src/gromacs/correlationfunctions/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6c6718a
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+file(GLOB GMXCORRFUNC_SOURCES *.c *.cpp)
+file(GLOB LMFIT_SOURCES ${CMAKE_SOURCE_DIR}/src/external/lmfit/*.c)
+
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXCORRFUNC_SOURCES}  ${LMFIT_SOURCES} PARENT_SCOPE)
+if (BUILD_TESTING)
+    add_subdirectory(tests)
+endif()
similarity index 71%
rename from src/gromacs/gmxana/autocorr.c
rename to src/gromacs/correlationfunctions/autocorr.c
index 5aca984fc62c2d03de44757fb8fdc1ddba03964c..72966978ce38d0a90f5fef87c4e35d1f6ffbcf61 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ * \brief
+ * Implements function to compute many autocorrelation functions
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "autocorr.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "macros.h"
-#include "typedefs.h"
-#include "physics.h"
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/correlationfunctions/integrate.h"
+#include "gromacs/correlationfunctions/manyautocorrelation.h"
+#include "gromacs/correlationfunctions/polynomials.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "correl.h"
 
+/*! \brief Shortcut macro to select modes. */
 #define MODE(x) ((mode & (x)) == (x))
 
 typedef struct {
@@ -63,33 +72,22 @@ typedef struct {
     real          tbeginfit, tendfit;
 } t_acf;
 
+/*! \brief Global variable set true if initialization routines are called. */
 static gmx_bool  bACFinit = FALSE;
+
+/*! \brief Data structure for storing command line variables. */
 static t_acf     acf;
 
 enum {
     enNorm, enCos, enSin
 };
 
-int sffn2effn(const char **sffn)
-{
-    int eFitFn, i;
-
-    eFitFn = 0;
-    for (i = 0; i < effnNR; i++)
-    {
-        if (sffn[i+1] && strcmp(sffn[0], sffn[i+1]) == 0)
-        {
-            eFitFn = i;
-        }
-    }
-
-    return eFitFn;
-}
-
+/*! \brief Routine to compute ACF using FFT. */
 static void low_do_four_core(int nfour, int nframes, real c1[], real cfour[],
-                             int nCos, gmx_bool bPadding)
+                             int nCos)
 {
     int  i = 0;
+    int  fftcode;
     real aver, *ans;
 
     aver = 0.0;
@@ -117,49 +115,18 @@ static void low_do_four_core(int nfour, int nframes, real c1[], real cfour[],
         default:
             gmx_fatal(FARGS, "nCos = %d, %s %d", nCos, __FILE__, __LINE__);
     }
-    for (; (i < nfour); i++)
-    {
-        cfour[i] = 0.0;
-    }
-
-    if (bPadding)
-    {
-        aver /= nframes;
-        /* printf("aver = %g\n",aver); */
-        for (i = 0; (i < nframes); i++)
-        {
-            cfour[i] -= aver;
-        }
-    }
-
-    snew(ans, 2*nfour);
-    correl(cfour-1, cfour-1, nfour, ans-1);
 
-    if (bPadding)
-    {
-        for (i = 0; (i < nfour); i++)
-        {
-            cfour[i] = ans[i]+sqr(aver);
-        }
-    }
-    else
-    {
-        for (i = 0; (i < nfour); i++)
-        {
-            cfour[i] = ans[i];
-        }
-    }
-
-    sfree(ans);
+    fftcode = many_auto_correl(1, nframes, nfour, &cfour);
 }
 
+/*! \brief Routine to comput ACF without FFT. */
 static void do_ac_core(int nframes, int nout,
                        real corr[], real c1[], int nrestart,
                        unsigned long mode)
 {
     int     j, k, j3, jk3, m, n;
     real    ccc, cth;
-    rvec    xj, xk, rr;
+    rvec    xj, xk;
 
     if (nrestart < 1)
     {
@@ -208,6 +175,8 @@ static void do_ac_core(int nframes, int nout,
             }
             else if (MODE(eacP1) || MODE(eacP2) || MODE(eacP3))
             {
+                unsigned int mmm;
+
                 for (m = 0; (m < DIM); m++)
                 {
                     xj[m] = c1[j3+m];
@@ -220,11 +189,20 @@ static void do_ac_core(int nframes, int nout,
                     printf("j: %d, k: %d, xj:(%g,%g,%g), xk:(%g,%g,%g)\n",
                            j, k, xj[XX], xj[YY], xj[ZZ], xk[XX], xk[YY], xk[ZZ]);
                 }
-
-                corr[k] += LegendreP(cth, mode); /* 1.5*cth*cth-0.5; */
+                mmm = 1;
+                if (MODE(eacP2))
+                {
+                    mmm = 2;
+                }
+                else if (MODE(eacP3))
+                {
+                    mmm = 3;
+                }
+                corr[k] += LegendreP(cth, mmm); /* 1.5*cth*cth-0.5; */
             }
             else if (MODE(eacRcross))
             {
+                rvec xj, xk, rr;
                 for (m = 0; (m < DIM); m++)
                 {
                     xj[m] = c1[j3+m];
@@ -259,10 +237,11 @@ 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[])
 {
-    int  j;
-    real c0;
+    int    j;
+    double c0;
 
     if (debug)
     {
@@ -276,7 +255,7 @@ void normalize_acf(int nout, real corr[])
     /* Normalisation makes that c[0] = 1.0 and that other points are scaled
      * accordingly.
      */
-    if (corr[0] == 0.0)
+    if (fabs(corr[0]) < 1e-5)
     {
         c0 = 1.0;
     }
@@ -299,6 +278,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)
 {
     real c0;
@@ -320,6 +300,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)
 {
     int   j, m;
@@ -336,7 +317,8 @@ void norm_and_scale_vectors(int nframes, real c1[], real scale)
     }
 }
 
-void dump_tmp(char *s, int n, real c[])
+/*! \brief Debugging */
+static void dump_tmp(char *s, int n, real c[])
 {
     FILE *fp;
     int   i;
@@ -349,99 +331,7 @@ void dump_tmp(char *s, int n, real c[])
     gmx_ffclose(fp);
 }
 
-real print_and_integrate(FILE *fp, int n, real dt, real c[], real *fit, int nskip)
-{
-    real c0, sum;
-    int  j;
-
-    /* Use trapezoidal rule for calculating integral */
-    sum = 0.0;
-    for (j = 0; (j < n); j++)
-    {
-        c0 = c[j];
-        if (fp && (nskip == 0 || j % nskip == 0))
-        {
-            fprintf(fp, "%10.3f  %10.5f\n", j*dt, c0);
-        }
-        if (j > 0)
-        {
-            sum += dt*(c0+c[j-1]);
-        }
-    }
-    if (fp)
-    {
-        fprintf(fp, "&\n");
-        if (fit)
-        {
-            for (j = 0; (j < n); j++)
-            {
-                if (nskip == 0 || j % nskip == 0)
-                {
-                    fprintf(fp, "%10.3f  %10.5f\n", j*dt, fit[j]);
-                }
-            }
-            fprintf(fp, "&\n");
-        }
-    }
-    return sum*0.5;
-}
-
-real evaluate_integral(int n, real x[], real y[], real dy[], real aver_start,
-                       real *stddev)
-{
-    double sum, sum_var, w;
-    double sum_tail = 0, sum2_tail = 0;
-    int    j, nsum_tail = 0;
-
-    /* Use trapezoidal rule for calculating integral */
-    if (n <= 0)
-    {
-        gmx_fatal(FARGS, "Evaluating integral: n = %d (file %s, line %d)",
-                  n, __FILE__, __LINE__);
-    }
-
-    sum     = 0;
-    sum_var = 0;
-    for (j = 0; (j < n); j++)
-    {
-        w = 0;
-        if (j > 0)
-        {
-            w += 0.5*(x[j] - x[j-1]);
-        }
-        if (j < n-1)
-        {
-            w += 0.5*(x[j+1] - x[j]);
-        }
-        sum += w*y[j];
-        if (dy)
-        {
-            /* Assume all errors are uncorrelated */
-            sum_var += sqr(w*dy[j]);
-        }
-
-        if ((aver_start > 0) && (x[j] >= aver_start))
-        {
-            sum_tail  += sum;
-            sum2_tail += sqrt(sum_var);
-            nsum_tail += 1;
-        }
-    }
-
-    if (nsum_tail > 0)
-    {
-        sum = sum_tail/nsum_tail;
-        /* This is a worst case estimate, assuming all stddev's are correlated. */
-        *stddev = sum2_tail/nsum_tail;
-    }
-    else
-    {
-        *stddev = sqrt(sum_var);
-    }
-
-    return sum;
-}
-
+/*! \brief High level ACF routine. */
 void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
                   real c1[], real csum[], real ctmp[])
 {
@@ -457,7 +347,7 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
         /********************************************
          *  N O R M A L
          ********************************************/
-        low_do_four_core(nfour, nf2, c1, csum, enNorm, FALSE);
+        low_do_four_core(nfour, nf2, c1, csum, enNorm);
     }
     else if (MODE(eacCos))
     {
@@ -473,14 +363,14 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
         }
 
         /* Cosine term of AC function */
-        low_do_four_core(nfour, nf2, ctmp, cfour, enCos, FALSE);
+        low_do_four_core(nfour, nf2, ctmp, cfour, enCos);
         for (j = 0; (j < nf2); j++)
         {
             c1[j]  = cfour[j];
         }
 
         /* Sine term of AC function */
-        low_do_four_core(nfour, nf2, ctmp, cfour, enSin, FALSE);
+        low_do_four_core(nfour, nf2, ctmp, cfour, enSin);
         for (j = 0; (j < nf2); j++)
         {
             c1[j]  += cfour[j];
@@ -547,7 +437,7 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
                 dump_tmp(buf, nf2, ctmp);
             }
 
-            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm, FALSE);
+            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm);
 
             if (debug)
             {
@@ -575,7 +465,7 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
                 sprintf(buf, "c1off%d.xvg", m);
                 dump_tmp(buf, nf2, ctmp);
             }
-            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm, FALSE);
+            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm);
             if (debug)
             {
                 sprintf(buf, "c1ofout%d.xvg", m);
@@ -614,7 +504,7 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
             {
                 ctmp[j] = c1[DIM*j+m];
             }
-            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm, FALSE);
+            low_do_four_core(nfour, nf2, ctmp, cfour, enNorm);
             for (j = 0; (j < nf2); j++)
             {
                 csum[j] += cfour[j];
@@ -633,146 +523,6 @@ void do_four_core(unsigned long mode, int nfour, int nf2, int nframes,
     }
 }
 
-real fit_acf(int ncorr, int fitfn, const output_env_t oenv, gmx_bool bVerbose,
-             real tbeginfit, real tendfit, real dt, real c1[], real *fit)
-{
-    real        fitparm[3];
-    real        tStart, tail_corr, sum, sumtot = 0, c_start, ct_estimate, *sig;
-    int         i, j, jmax, nf_int;
-    gmx_bool    bPrint;
-
-    bPrint = bVerbose || bDebugMode();
-
-    if (bPrint)
-    {
-        printf("COR:\n");
-    }
-
-    if (tendfit <= 0)
-    {
-        tendfit = ncorr*dt;
-    }
-    nf_int = min(ncorr, (int)(tendfit/dt));
-    sum    = print_and_integrate(debug, nf_int, dt, c1, NULL, 1);
-
-    /* Estimate the correlation time for better fitting */
-    ct_estimate = 0.5*c1[0];
-    for (i = 1; (i < ncorr) && (c1[i] > 0); i++)
-    {
-        ct_estimate += c1[i];
-    }
-    ct_estimate *= dt/c1[0];
-
-    if (bPrint)
-    {
-        printf("COR: Correlation time (plain integral from %6.3f to %6.3f ps) = %8.5f ps\n",
-               0.0, dt*nf_int, sum);
-        printf("COR: Relaxation times are computed as fit to an exponential:\n");
-        printf("COR:   %s\n", longs_ffn[fitfn]);
-        printf("COR: Fit to correlation function from %6.3f ps to %6.3f ps, results in a\n", tbeginfit, min(ncorr*dt, tendfit));
-    }
-
-    tStart = 0;
-    if (bPrint)
-    {
-        printf("COR:%11s%11s%11s%11s%11s%11s%11s\n",
-               "Fit from", "Integral", "Tail Value", "Sum (ps)", " a1 (ps)",
-               (nfp_ffn[fitfn] >= 2) ? " a2 ()" : "",
-               (nfp_ffn[fitfn] >= 3) ? " a3 (ps)" : "");
-    }
-
-    snew(sig, ncorr);
-
-    if (tbeginfit > 0)
-    {
-        jmax = 3;
-    }
-    else
-    {
-        jmax = 1;
-    }
-    for (j = 0; ((j < jmax) && (tStart < tendfit) && (tStart < ncorr*dt)); j++)
-    {
-        /* Estimate the correlation time for better fitting */
-        c_start     = -1;
-        ct_estimate = 0;
-        for (i = 0; (i < ncorr) && (dt*i < tStart || c1[i] > 0); i++)
-        {
-            if (c_start < 0)
-            {
-                if (dt*i >= tStart)
-                {
-                    c_start     = c1[i];
-                    ct_estimate = 0.5*c1[i];
-                }
-            }
-            else
-            {
-                ct_estimate += c1[i];
-            }
-        }
-        if (c_start > 0)
-        {
-            ct_estimate *= dt/c_start;
-        }
-        else
-        {
-            /* The data is strange, so we need to choose somehting */
-            ct_estimate = tendfit;
-        }
-        if (debug)
-        {
-            fprintf(debug, "tStart %g ct_estimate: %g\n", tStart, ct_estimate);
-        }
-
-        if (fitfn == effnEXP3)
-        {
-            fitparm[0] = 0.002*ncorr*dt;
-            fitparm[1] = 0.95;
-            fitparm[2] = 0.2*ncorr*dt;
-        }
-        else
-        {
-            /* Good initial guess, this increases the probability of convergence */
-            fitparm[0] = ct_estimate;
-            fitparm[1] = 1.0;
-            fitparm[2] = 1.0;
-        }
-
-        /* Generate more or less appropriate sigma's */
-        for (i = 0; i < ncorr; i++)
-        {
-            sig[i] = sqrt(ct_estimate+dt*i);
-        }
-
-        nf_int    = 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);
-        sumtot = sum+tail_corr;
-        if (fit && ((jmax == 1) || (j == 1)))
-        {
-            for (i = 0; (i < ncorr); i++)
-            {
-                fit[i] = fit_function(fitfn, fitparm, i*dt);
-            }
-        }
-        if (bPrint)
-        {
-            printf("COR:%11.4e%11.4e%11.4e%11.4e", tStart, sum, tail_corr, sumtot);
-            for (i = 0; (i < nfp_ffn[fitfn]); i++)
-            {
-                printf(" %11.4e", fitparm[i]);
-            }
-            printf("\n");
-        }
-        tStart += tbeginfit;
-    }
-    sfree(sig);
-
-    return sumtot;
-}
-
 void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title,
                      int nframes, int nitem, int nout, real **c1,
                      real dt, unsigned long mode, int nrestart,
@@ -805,7 +555,10 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title,
     }
     if ((MODE(eacP3) || MODE(eacRcross)) && bFour)
     {
-        fprintf(stderr, "Can't combine mode %lu with FFT, turning off FFT\n", mode);
+        if (bVerbose)
+        {
+            fprintf(stderr, "Can't combine mode %lu with FFT, turning off FFT\n", mode);
+        }
         bFour = FALSE;
     }
     if (MODE(eacNormal) && MODE(eacVector))
@@ -951,7 +704,7 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title,
         }
         if (debug)
         {
-            gmx_ffclose(gp);
+            xvgrclose(gp);
         }
         if (nitem > 1)
         {
@@ -964,11 +717,12 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title,
     }
     if (fp)
     {
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     sfree(fit);
 }
 
+/*! \brief Legend for selecting Legendre polynomials. */
 static const char *Leg[]   = { NULL, "0", "1", "2", "3", NULL };
 
 t_pargs *add_acf_pargs(int *npargs, t_pargs *pa)
@@ -991,20 +745,20 @@ t_pargs *add_acf_pargs(int *npargs, t_pargs *pa)
         { "-endfit",   FALSE, etREAL, {&acf.tendfit},
           "Time where to end the exponential fit of the correlation function, -1 is until the end" },
     };
-#define NPA asize(acfpa)
     t_pargs *ppa;
-    int      i;
+    int      i, npa;
 
-    snew(ppa, *npargs+NPA);
+    npa = asize(acfpa);
+    snew(ppa, *npargs+npa);
     for (i = 0; (i < *npargs); i++)
     {
         ppa[i] = pa[i];
     }
-    for (i = 0; (i < NPA); i++)
+    for (i = 0; (i < npa); i++)
     {
         ppa[*npargs+i] = acfpa[i];
     }
-    (*npargs) += NPA;
+    (*npargs) += npa;
 
     acf.mode       = 0;
     acf.nrestart   = 1;
@@ -1074,24 +828,3 @@ int get_acffitfn(void)
 
     return sffn2effn(s_ffn);
 }
-
-void cross_corr(int n, real f[], real g[], real corr[])
-{
-    int i, j;
-
-    if (acf.bFour)
-    {
-        correl(f-1, g-1, n, corr-1);
-    }
-    else
-    {
-        for (i = 0; (i < n); i++)
-        {
-            for (j = i; (j < n); j++)
-            {
-                corr[j-i] += f[i]*g[j];
-            }
-            corr[i] /= (real)(n-i);
-        }
-    }
-}
diff --git a/src/gromacs/correlationfunctions/autocorr.h b/src/gromacs/correlationfunctions/autocorr.h
new file mode 100644 (file)
index 0000000..e408b67
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal
+ * \defgroup module_correlationfunctions Correlation functions
+ * \ingroup group_analysismodules
+ * \brief
+ * Compute correlation functions and fit analytical functions to the result.
+ */
+/*! \libinternal
+ * \file
+ * \brief
+ * Declares routine for computing autocorrelation functions
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \inlibraryapi
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_AUTOCORR_H
+#define GMX_AUTOCORR_H
+
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Normal correlation f(t)*f(t+dt) */
+#define eacNormal (1<<0)
+/*! \brief Cosine correlation cos(f(t)-f(t+dt)) */
+#define eacCos    (1<<1)
+/*! \brief Vector correlation f(t).f(t+dt) */
+#define eacVector (1<<2)
+/*! \brief Norm of cross product |f(t) (x) f(t+dt)| */
+#define eacRcross (1<<3  | eacVector)
+/*! \brief Vector with Legendre polynomial of order 0 (same as vector) */
+#define eacP0     (1<<4  | eacVector)
+/*! \brief Vector with Legendre polynomial of order P_1(f(t).f(t+dt)) */
+#define eacP1     (1<<5  | eacVector)
+/*! \brief Vector with Legendre polynomial of order P_2(f(t).f(t+dt)) */
+#define eacP2     (1<<6  | eacVector)
+/*! \brief Vector with Legendre polynomial of order P_3(f(t).f(t+dt)) */
+#define eacP3     (1<<7  | eacVector)
+/*! \brief Vector with Legendre polynomial of order P_4(f(t).f(t+dt)) */
+#define eacP4     (1<<8  | eacVector)
+/*! \brief Binary identy correlation (f(t) == f(t+dt)) */
+#define eacIden   (1<<9) //Not supported for multiple cores
+
+/*! \brief
+ * Add commandline arguments related to autocorrelations to the existing array.
+ * *npargs must be initialised to the number of elements in pa,
+ * it will be incremented appropriately.
+ *
+ * \param npargs The number of arguments before and after (is changed in this function)
+ * \param[in] pa The initial argument list
+ * \return the new array
+ */
+t_pargs *add_acf_pargs(int *npargs, t_pargs *pa);
+
+/*! \brief
+ * Returns the number of points to output from a correlation function.
+ * Works only AFTER do_auto_corr has been called!
+ * \return the output length for the correlation function
+ */
+int get_acfnout(void);
+
+/*! \brief
+ * Returns the fitting function selected.
+ * Works only AFTER do_auto_corr has been called!
+ * \return the fit function type.
+ */
+int get_acffitfn(void);
+
+/*! \brief
+ * Calls low_do_autocorr (see below). add_acf_pargs has to be called before this
+ * can be used.
+ * \param[in] fn File name for xvg output (may this be NULL)?
+ * \param[in] oenv The output environment information
+ * \param[in] title is the title in the output file
+ * \param[in] nframes is the number of frames in the time series
+ * \param[in] nitem is the number of items
+ * \param[inout] c1 is an array of dimension [ 0 .. nitem-1 ] [ 0 .. nframes-1 ]
+ *          on output, this array is filled with the correlation function
+ *          to reduce storage
+ * \param[in] dt is the time between frames
+ * \param[in] mode Different types of ACF can be done, see above
+ * \param[in] bAver    If set, all ndih C(t) functions are averaged into a single
+ *          C(t)
+ */
+void do_autocorr(const char *fn, const output_env_t oenv,
+                 const char *title,
+                 int nframes, int nitem, real **c1,
+                 real dt, unsigned long mode, gmx_bool bAver);
+
+/*! \brief
+ * Low level computation of autocorrelation functions
+ *
+ * do_autocorr calculates autocorrelation functions for many things.
+ * It takes a 2 d array containing nitem arrays of length nframes
+ * for each item the ACF is calculated.
+ *
+ * A number of "modes" exist for computation of the ACF controlled
+ * by variable mode, with the following meaning.
+ *
+ * Mode       | Function
+ * -----------|------------
+ * eacNormal  | C(t) = < X (tau) * X (tau+t) >
+ * eacCos     | C(t) = < cos (X(tau) - X(tau+t)) >
+ * eacIden    | C(t) = < (X(tau) == X(tau+t)) > (not fully supported yet)
+ * eacVector  | C(t) = < X(tau) * X(tau+t)
+ * eacP1      | C(t) = < cos (X(tau) * X(tau+t) >
+ * eacP2      | C(t) = 1/2 * < 3 cos (X(tau) * X(tau+t) - 1 >
+ * eacRcross  | C(t) = < ( X(tau) * X(tau+t) )^2 >
+ *
+ * For modes eacVector, eacP1, eacP2 and eacRcross the input should be
+ * 3 x nframes long, where each triplet is taken as a 3D vector
+ *
+ * For mode eacCos inputdata must be in radians, not degrees!
+ *
+ * Other parameters are:
+ *
+ * \param[in] fn is output filename (.xvg) where the correlation function(s) are printed
+ * \param[in] oenv controls output file properties
+ * \param[in] title is the title in the output file
+ * \param[in] nframes is the number of frames in the time series
+ * \param[in] nitem is the number of items
+ * \param[in] nout
+ * \param[inout] c1 is an array of dimension [ 0 .. nitem-1 ] [ 0 .. nframes-1 ]
+ *          on output, this array is filled with the correlation function
+ *          to reduce storage
+ * \param[in] dt is the time between frames
+ * \param[in] mode Different types of ACF can be done, see above
+ * \param[in] nrestart     is the number of steps between restarts for direct ACFs
+ *              (i.e. without FFT) When set to 1 all points are used as
+ *              time origin for averaging
+ * \param[in] bAver    If set, all ndih C(t) functions are averaged into a single
+ *          C(t)
+ * \param[in] bNormalize   If set, all ACFs will be normalized to start at 0
+ * \param[in] bVerbose If set output to console will be generated
+ * \param[in] tbeginfit Time to start fitting to the ACF
+ * \param[in] tendfit Time to end fitting to the ACF
+ * \param[in] nfitparm Number of fitting parameters in a multi-exponential fit
+ */
+void low_do_autocorr(const char *fn, const output_env_t oenv,
+                     const char *title, int  nframes, int nitem,
+                     int nout, real **c1, real dt, unsigned long mode,
+                     int nrestart, gmx_bool bAver, gmx_bool bNormalize,
+                     gmx_bool bVerbose, real tbeginfit, real tendfit,
+                     int nfitparm);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/correlationfunctions/crosscorr.c b/src/gromacs/correlationfunctions/crosscorr.c
new file mode 100644 (file)
index 0000000..1911b5b
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal
+ * \file
+ * \brief
+ * Implements routine for computing a cross correlation between two data sets
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "crosscorr.h"
+
+#include "gromacs/fft/fft.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/smalloc.h"
+
+/*! \brief
+ * return the size witch the array should be after zero padding
+ *
+ * \param[in] n Factor to multiply by 2
+ * \return zeroPaddingSize
+ */
+static int zeroPaddingSize(int n)
+{
+    return 2*n;
+}
+
+/*! \brief
+ * Compute complex conjugate. Output in the first input variable.
+ *
+ * \param[in] in1 first complex number
+ * \param[in] in2 second complex number
+ */
+static void complexConjugatMult(double in1[], double in2[])
+{
+    double res[2];
+    res[0]  = in1[0] * in2[0] + in1[1] * in2[1];
+    res[1]  = in1[0] * -in2[1] + in1[1] * in2[0];
+    in1[0]  = res[0];
+    in1[1]  = res[1];
+}
+
+/*! \brief
+ * Compute one cross correlation corr = f x g using FFT.
+ *
+ * \param[in] n number of data point
+ * \param[in] f first function
+ * \param[in] g second function
+ * \param[out] corr output correlation
+ * \param[in] fft FFT data structure
+ */
+static void cross_corr_low(int n, real f[], real g[], real corr[], gmx_fft_t fft)
+{
+    int             i;
+    const int       size = zeroPaddingSize(n);
+    double    **    in1, ** in2;
+    snew(in1, size);
+    snew(in2, size);
+
+    for (i = 0; i < size; i++)
+    {
+        snew(in1[i], 2);
+        snew(in2[i], 2);
+    }
+
+    for (i = 0; i < n; i++)
+    {
+        in1[i][0]  = (double)f[i];
+        in1[i][1]  = 0;
+        in2[i][0]  = (double)g[i];
+        in2[i][1]  = 0;
+    }
+    for (; i < size; i++)
+    {
+        in1[i][0]  = 0;
+        in1[i][1]  = 0;
+        in2[i][0]  = 0;
+        in2[i][1]  = 0;
+    }
+
+
+    gmx_fft_1d(fft, GMX_FFT_FORWARD, in1, in1);
+    gmx_fft_1d(fft, GMX_FFT_FORWARD, in2, in2);
+
+    for (i = 0; i < size; i++)
+    {
+        complexConjugatMult(in1[i], in2[i]);
+        in1[i][0] /= size;
+    }
+    gmx_fft_1d(fft, GMX_FFT_BACKWARD, in1, in1);
+
+    for (i = 0; i < n; i++)
+    {
+        corr[i] = (real)(in1[i][0]);
+    }
+
+    for (i = 0; i < size; i++)
+    {
+        sfree(in1[i]);
+        sfree(in2[i]);
+    }
+
+    sfree(in1);
+    sfree(in2);
+
+}
+
+void cross_corr(int n, real f[], real g[], real corr[])
+{
+    gmx_fft_t fft;
+    gmx_fft_init_1d(&fft, zeroPaddingSize(n), GMX_FFT_FLAG_CONSERVATIVE);
+    cross_corr_low( n,  f,  g, corr, fft);
+    gmx_fft_destroy(fft);
+    gmx_fft_cleanup();
+}
+
+void many_cross_corr(int nFunc, int * nData, real ** f, real ** g, real ** corr)
+{
+#pragma omp parallel
+    //gmx_fft_t is not thread safe, so structure are allocated per thread.
+    {
+        int i;
+
+#pragma omp for
+        for (i = 0; i < nFunc; i++)
+        {
+            gmx_fft_t fft;
+            gmx_fft_init_1d(&fft, zeroPaddingSize(nData[i]), GMX_FFT_FLAG_CONSERVATIVE);
+            cross_corr_low( nData[i],  f[i],  g[i], corr[i], fft);
+            gmx_fft_destroy(fft);
+        }
+    }
+    gmx_fft_cleanup();
+
+}
diff --git a/src/gromacs/correlationfunctions/crosscorr.h b/src/gromacs/correlationfunctions/crosscorr.h
new file mode 100644 (file)
index 0000000..232e50f
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal
+ * \file
+ * \brief
+ * Declares routine for computing a cross correlation between two data sets
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \inlibraryapi
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_CROSSCORR_H
+#define GMX_CROSSCORR_H
+
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief
+ * fft cross correlation algorithm.
+ * Computes corr = f (.) g
+ *
+ * \param[in] n number of data point
+ * \param[in] f First function
+ * \param[in] g Second function
+ * \param[out] corr The cross correlation
+ */
+void cross_corr(int n, real f[], real g[], real corr[]);
+
+/*! \brief
+ * fft cross correlation algorithm.
+ *
+ * Computes corr[n] = f[n][i] (.) g[n][i], that is for nFunc
+ * pairs of arrays n the cross correlation is computed in parallel
+ * using OpenMP.
+ *
+ * \param[in] nFunc nuber of function to crosscorrelate
+ * \param[in] nData number of data point in eatch function
+ * \param[in] f 2D array of first function to crosscorrelate
+ * \param[in] g 2D array of second function to crosscorrelate
+ * \param[out] corr 2D array of the cross correlations
+ */
+void many_cross_corr(int nFunc, int * nData, real ** f, real ** g, real ** corr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/correlationfunctions/expfit.c b/src/gromacs/correlationfunctions/expfit.c
new file mode 100644 (file)
index 0000000..490e0be
--- /dev/null
@@ -0,0 +1,698 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 routine for fitting a data set to a curve
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "expfit.h"
+
+#include <math.h>
+#include <string.h>
+
+#include "external/lmfit/lmcurve.h"
+
+#include "gromacs/correlationfunctions/integrate.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
+
+/*! \brief Number of parameters for each fitting function */
+static const int   nfp_ffn[effnNR] = { 0, 1, 2, 3, 2, 5, 7, 9, 4, 3, 6};
+
+const char        *s_ffn[effnNR+2] = {
+    NULL, "none", "exp", "aexp", "exp_exp", "vac",
+    "exp5", "exp7", "exp9", "erffit", "effnPRES", NULL, NULL
+};
+/* We don't allow errest as a choice on the command line */
+
+/*! \brief Long description for each fitting function type */
+static const char *longs_ffn[effnNR] = {
+    "no fit",
+    "y = exp(-x/a1)",
+    "y = a2 exp(-x/a1)",
+    "y = a2 exp(-x/a1) + (1-a2) exp(-x/a3)",
+    "y = exp(-v) (cosh(wv) + 1/w sinh(wv)), v = x/(2 a1), w = sqrt(1 - a2)",
+    "y = a1 exp(-x/a2) +  a3 exp(-x/a4) + a5",
+    "y = a1 exp(-x/a2) +  a3 exp(-x/a4) + a5 exp(-x/a6) + a7",
+    "y = a1 exp(-x/a2) +  a3 exp(-x/a4) + a5 exp(-x/a6) + a7 exp(-x/a8) + a9",
+    "y = 1/2*(a1+a2) - 1/2*(a1-a2)*erf( (x-a3) /a4^2)",
+    "y = a2 *2*a1*((exp(-x/a1)-1)*(a1/x)+1)+(1-a2)*2*a3*((exp(-x/a3)-1)*(a3/x)+1)",
+    "y = (1-a1) * exp(-(x/a3)^a4)*cos(x*a2) + a1*exp(-(x/a5)^a6)"
+};
+
+int effnNparams(int effn)
+{
+    if ((0 <= effn) && (effn < effnNR))
+    {
+        return nfp_ffn[effn];
+    }
+    else
+    {
+        return -1;
+    }
+}
+
+const char *effnDescription(int effn)
+{
+    if ((0 <= effn) && (effn < effnNR))
+    {
+        return longs_ffn[effn];
+    }
+    else
+    {
+        return NULL;
+    }
+}
+
+int sffn2effn(const char **sffn)
+{
+    int eFitFn, i;
+
+    eFitFn = 0;
+    for (i = 0; i < effnNR; i++)
+    {
+        if (sffn[i+1] && strcmp(sffn[0], sffn[i+1]) == 0)
+        {
+            eFitFn = i;
+        }
+    }
+
+    return eFitFn;
+}
+
+/*! \brief Compute exponential function A exp(-x/tau) */
+static double myexp(double x, double A, double tau)
+{
+    if ((A == 0) || (tau == 0))
+    {
+        return 0;
+    }
+    return A*exp(-x/tau);
+}
+
+/*! \brief Compute y=(a0+a1)/2-(a0-a1)/2*erf((x-a2)/a3^2) */
+static double lmc_erffit (double x, const double *a)
+{
+    double erfarg;
+
+    erfarg  = (x-a[2])/(a[3]*a[3]);
+    return (a[0]+a[1])/2-(a[0]-a[1])*gmx_erf(erfarg);
+}
+
+/*! \brief Compute y = exp(-x/a0) */
+static double lmc_exp_one_parm(double x, const double *a)
+{
+    return exp(-x/a[0]);
+}
+
+/*! \brief Compute y = a1 exp(-x/a0) */
+static double lmc_exp_two_parm(double x, const double *a)
+{
+    return a[1]*exp(-x/a[0]);
+}
+
+/*! \brief Compute y = a1 exp(-x/a0) + (1-a1) exp(-x/a2) */
+static double lmc_exp_3_parm(double x, const double *a)
+{
+    double e1, e2;
+
+    e1      = exp(-x/a[0]);
+    e2      = exp(-x/a[2]);
+    return a[1]*e1 + (1-a[1])*e2;
+}
+
+/*! \brief Compute y = a0 exp(-x/a1) + a2 exp(-x/a3) + a4 */
+static double lmc_exp_5_parm(double x, const double *a)
+{
+    double e1, e2;
+
+    e1      = exp(-x/a[1]);
+    e2      = exp(-x/a[3]);
+    return a[0]*e1 + a[2]*e2 + a[4];
+}
+
+/*! \brief Compute y = a0 exp(-x/a1) + a2 exp(-x/a3) + a4 exp(-x/a5) + a6 */
+static double lmc_exp_7_parm(double x, const double *a)
+{
+    double e1, e2, e3;
+
+    e1      = exp(-x/a[1]);
+    e2      = exp(-x/a[3]);
+    e3      = exp(-x/a[5]);
+    return a[0]*e1 + a[2]*e2 + a[4]*e3 + a[6];
+}
+
+/*! \brief Compute y = a0 exp(-x/a1) + a2 exp(-x/a3) + a4 exp(-x/a5) + a6 exp(-x/a7) + a8 */
+static double lmc_exp_9_parm(double x, const double *a)
+{
+    double e1, e2, e3, e4;
+
+    e1      = exp(-x/a[1]);
+    e2      = exp(-x/a[3]);
+    e3      = exp(-x/a[5]);
+    e4      = exp(-x/a[7]);
+    return a[0]*e1 + a[2]*e2 + a[4]*e3 + a[6]*e4 + a[8];
+}
+
+/*! \brief Compute y = (1-a1) * exp(-(x/a3)^a4)*cos(x*a2) + a1*exp(-(x/a5)^a6) */
+static double effnPRES_fun(double x, const double *a)
+{
+    double term1, term2, term3;
+
+    if (a[0] != 0)
+    {
+        term3 = a[0] * exp(-pow((x/a[4]), a[5]));
+    }
+    else
+    {
+        term3 = 0;
+    }
+
+    term1 = 1-a[0];
+    if (term1 != 0)
+    {
+        term2 = exp(-pow((x/a[2]), a[3])) * cos(x*a[1]);
+    }
+    else
+    {
+        term2 = 0;
+    }
+
+    return term1*term2 + term3;
+}
+
+/*! \brief Compute vac function */
+static double lmc_vac_2_parm(double x, const double *a)
+{
+    /* Fit to function
+     *
+     * y = 1/2 (1 - 1/w) exp(-(1+w)v) + 1/2 (1 + 1/w) exp(-(1-w)v)
+     *
+     *   = exp(-v) (cosh(wv) + 1/w sinh(wv))
+     *
+     *    v = x/(2 a1)
+     *    w = sqrt(1 - a2)
+     *
+     *    For tranverse current autocorrelation functions:
+     *       a1 = tau
+     *       a2 = 4 tau (eta/rho) k^2
+     *
+     */
+
+    double y, v, det, omega, omega2, em, ec, es;
+
+    v   = x/(2*a[0]);
+    det = 1 - a[1];
+    em  = exp(-v);
+    if (det != 0)
+    {
+        omega2  = fabs(det);
+        omega   = sqrt(omega2);
+        if (det > 0)
+        {
+            ec = em*0.5*(exp(omega*v)+exp(-omega*v));
+            es = em*0.5*(exp(omega*v)-exp(-omega*v))/omega;
+        }
+        else
+        {
+            ec = em*cos(omega*v);
+            es = em*sin(omega*v)/omega;
+        }
+        y      = ec + es;
+    }
+    else
+    {
+        y      = (1+v)*em;
+    }
+    return y;
+}
+
+/*! \brief Compute error estimate */
+static double lmc_errest_3_parm(double x, const double *a)
+{
+    /*
+       e1 = (exp(-x/a1) - 1)
+       e2 = (exp(-x/a3) - 1)
+       v1=  2*a1 * (e1*a1/x + 1)
+       v2 = 2*a3 * (e2*a3/x + 1)
+       fun = a2*v1 + (1 - a2) * v2
+     */
+    double e1, e2, v1, v2;
+
+    if (a[0] != 0)
+    {
+        e1 = gmx_expm1(-x/a[0]);
+    }
+    else
+    {
+        e1 = 0;
+    }
+    if (a[2] != 0)
+    {
+        e2 = gmx_expm1(-x/a[2]);
+    }
+    else
+    {
+        e2 = 0;
+    }
+
+    if (x > 0)
+    {
+        v1      = 2*a[0]*(e1*a[0]/x + 1);
+        v2      = 2*a[2]*(e2*a[2]/x + 1);
+        return a[1]*v1 + (1-a[1])*v2;
+    }
+    else
+    {
+        return 0;
+    }
+}
+
+/*! \brief function type for passing to fitting routine */
+typedef double (*t_lmcurve)(double x, const double *a);
+
+/*! \brief array of fitting functions corresponding to the pre-defined types */
+t_lmcurve lmcurves[effnNR] = {
+    lmc_exp_one_parm, lmc_exp_one_parm, lmc_exp_two_parm,
+    lmc_exp_3_parm, lmc_vac_2_parm,
+    lmc_exp_5_parm,   lmc_exp_7_parm,
+    lmc_exp_9_parm, lmc_erffit,  lmc_errest_3_parm, effnPRES_fun
+};
+
+double fit_function(int eFitFn, double *parm, double x)
+{
+    // TODO: check that eFitFn is within bounds
+    return lmcurves[eFitFn](x, parm);
+}
+
+/*! \brief lmfit_exp supports up to 3 parameter fitting of exponential functions */
+static gmx_bool lmfit_exp(int nfit, double x[], double y[],
+                          real ftol, int maxiter,
+                          double parm[], gmx_bool bVerbose,
+                          int eFitFn)
+{
+    double             chisq, ochisq;
+    gmx_bool           bCont;
+    int                i, j;
+    lm_control_struct *control;
+    lm_status_struct  *status;
+
+    if ((eFitFn < 0) || (eFitFn >= effnNR))
+    {
+        gmx_fatal(FARGS, "fitfn = %d, should be in 0..%d (%s,%d)",
+                  effnNR-1, eFitFn, __FILE__, __LINE__);
+    }
+
+    snew(control, 1);
+    control->ftol       = ftol;
+    control->xtol       = ftol;
+    control->gtol       = ftol;
+    control->epsilon    = 0.1;
+    control->stepbound  = 100;
+    control->patience   = maxiter;
+    control->scale_diag = 1;
+    control->msgfile    = stdout;
+    control->verbosity  = (bVerbose ? 1 : 0);
+    control->n_maxpri   = nfp_ffn[eFitFn];
+    control->m_maxpri   = 0;
+    snew(status, 1);
+    /* Initial params */
+    chisq  = 1e12;
+    j      = 0;
+    if (bVerbose)
+    {
+        fprintf(stderr, "%4s  %10s  Parameters\n",
+                "Step", "chi^2");
+    }
+    do
+    {
+        ochisq = chisq;
+
+        lmcurve(nfp_ffn[eFitFn], parm, nfit, x, y,
+                lmcurves[eFitFn], control, status);
+        chisq = sqr(status->fnorm);
+        if (bVerbose)
+        {
+            int mmm;
+            fprintf(stderr, "%4d  %10.5e", j, chisq);
+            for (mmm = 0; (mmm < nfp_ffn[eFitFn]); mmm++)
+            {
+                fprintf(stderr, "  %10.5e", parm[mmm]);
+            }
+            fprintf(stderr, "\n");
+        }
+        j++;
+        bCont = ((fabs(ochisq - chisq) > fabs(ftol*chisq)) ||
+                 ((ochisq == chisq)));
+    }
+    while (bCont && (j < maxiter));
+    if (bVerbose)
+    {
+        fprintf(stderr, "\n");
+    }
+
+    sfree(control);
+    sfree(status);
+
+    return TRUE;
+}
+
+/*! \brief See description in header file. */
+real do_lmfit(int ndata, real c1[], real sig[], real dt, real x0[],
+              real begintimefit, real endtimefit, const output_env_t oenv,
+              gmx_bool bVerbose, int eFitFn, double fitparms[], int fix)
+{
+    FILE    *fp;
+    char     buf[32];
+
+    int      i, j, nparm, nfitpnts;
+    double   integral, ttt;
+    double  *parm, *dparm;
+    double  *x, *y, *dy;
+#ifdef GMX_DOUBLE
+    real     ftol    = 1e-16;
+#else
+    real     ftol    = 1e-8;
+#endif
+    int      maxiter = 50;
+
+    if (0 != fix)
+    {
+        fprintf(stderr, "Using fixed parameters in curve fitting is not working anymore\n");
+    }
+    nparm = nfp_ffn[eFitFn];
+    if (debug)
+    {
+        fprintf(debug, "There are %d points to fit %d vars!\n", ndata, nparm);
+        fprintf(debug, "Fit to function %d from %g through %g, dt=%g\n",
+                eFitFn, begintimefit, endtimefit, dt);
+    }
+
+    snew(x, ndata);
+    snew(y, ndata);
+    snew(dy, ndata);
+
+    j = 0;
+    for (i = 0; i < ndata; i++)
+    {
+        ttt = x0 ? x0[i] : dt*i;
+        if (ttt >= begintimefit && ttt <= endtimefit)
+        {
+            x[j] = ttt;
+            y[j] = c1[i];
+
+            /* mrqmin does not like sig to be zero */
+            if (sig[i] < 1.0e-7)
+            {
+                dy[j] = 1.0e-7;
+            }
+            else
+            {
+                dy[j] = sig[i];
+            }
+            if (debug)
+            {
+                fprintf(debug, "j= %d, i= %d, x= %g, y= %g, dy= %g\n",
+                        j, i, x[j], y[j], dy[j]);
+            }
+            j++;
+        }
+    }
+    nfitpnts = j;
+    integral = 0;
+    if (nfitpnts < nparm)
+    {
+        fprintf(stderr, "Not enough data points for fitting!\n");
+    }
+    else
+    {
+        snew(parm, nparm);
+        snew(dparm, nparm);
+        if (fitparms)
+        {
+            for (i = 0; (i < nparm); i++)
+            {
+                parm[i] = fitparms[i];
+            }
+        }
+
+        if (!lmfit_exp(nfitpnts, x, y, ftol, maxiter, parm, bVerbose, eFitFn))
+        {
+            fprintf(stderr, "Fit failed!\n");
+        }
+        else if (nparm <= 3)
+        {
+            /* Compute the integral from begintimefit */
+            if (nparm == 3)
+            {
+                integral = (parm[0]*myexp(begintimefit, parm[1],  parm[0]) +
+                            parm[2]*myexp(begintimefit, 1-parm[1], parm[2]));
+            }
+            else if (nparm == 2)
+            {
+                integral = parm[0]*myexp(begintimefit, parm[1],  parm[0]);
+            }
+            else if (nparm == 1)
+            {
+                integral = parm[0]*myexp(begintimefit, 1,  parm[0]);
+            }
+            else
+            {
+                gmx_fatal(FARGS, "nparm = %d in file %s, line %d",
+                          nparm, __FILE__, __LINE__);
+            }
+
+            /* Generate THE output */
+            if (bVerbose)
+            {
+                fprintf(stderr, "FIT: # points used in fit is: %d\n", nfitpnts);
+                fprintf(stderr, "FIT: %21s%21s%21s\n",
+                        "parm0     ", "parm1 (ps)   ", "parm2 (ps)    ");
+                fprintf(stderr, "FIT: ------------------------------------------------------------\n");
+                fprintf(stderr, "FIT: %8.3g +/- %8.3g%9.4g +/- %8.3g%8.3g +/- %8.3g\n",
+                        parm[0], dparm[0], parm[1], dparm[1], parm[2], dparm[2]);
+                fprintf(stderr, "FIT: Integral (calc with fitted function) from %g ps to inf. is: %g\n",
+                        begintimefit, integral);
+
+                sprintf(buf, "test%d.xvg", nfitpnts);
+                fp = xvgropen(buf, "C(t) + Fit to C(t)", "Time (ps)", "C(t)", oenv);
+                fprintf(fp, "# parm0 = %g, parm1 = %g, parm2 = %g\n",
+                        parm[0], parm[1], parm[2]);
+                for (j = 0; (j < nfitpnts); j++)
+                {
+                    ttt = x0 ? x0[j] : dt*j;
+                    fprintf(fp, "%10.5e  %10.5e  %10.5e\n",
+                            ttt, c1[j],
+                            lmcurves[eFitFn](ttt, parm));
+                }
+                xvgrclose(fp);
+            }
+        }
+        if (fitparms)
+        {
+            for (i = 0; (i < nparm); i++)
+            {
+                fitparms[i] = parm[i];
+            }
+        }
+        sfree(parm);
+        sfree(dparm);
+    }
+
+    sfree(x);
+    sfree(y);
+    sfree(dy);
+
+    return integral;
+}
+
+/*! See description in header file. */
+real fit_acf(int ncorr, int fitfn, const output_env_t oenv, gmx_bool bVerbose,
+             real tbeginfit, real tendfit, real dt, real c1[], real *fit)
+{
+    double      fitparm[3];
+    double      tStart, tail_corr, sum, sumtot = 0, c_start, ct_estimate;
+    real       *sig;
+    int         i, j, jmax, nf_int;
+    gmx_bool    bPrint;
+
+    bPrint = bVerbose || bDebugMode();
+
+    if (bPrint)
+    {
+        printf("COR:\n");
+    }
+
+    if (tendfit <= 0)
+    {
+        tendfit = ncorr*dt;
+    }
+    nf_int = min(ncorr, (int)(tendfit/dt));
+    sum    = print_and_integrate(debug, nf_int, dt, c1, NULL, 1);
+
+    /* Estimate the correlation time for better fitting */
+    ct_estimate = 0.5*c1[0];
+    for (i = 1; (i < ncorr) && (c1[i] > 0); i++)
+    {
+        ct_estimate += c1[i];
+    }
+    ct_estimate *= dt/c1[0];
+
+    if (bPrint)
+    {
+        printf("COR: Correlation time (plain integral from %6.3f to %6.3f ps) = %8.5f ps\n",
+               0.0, dt*nf_int, sum);
+        printf("COR: Relaxation times are computed as fit to an exponential:\n");
+        printf("COR:   %s\n", longs_ffn[fitfn]);
+        printf("COR: Fit to correlation function from %6.3f ps to %6.3f ps, results in a\n", tbeginfit, min(ncorr*dt, tendfit));
+    }
+
+    tStart = 0;
+    if (bPrint)
+    {
+        printf("COR:%11s%11s%11s%11s%11s%11s%11s\n",
+               "Fit from", "Integral", "Tail Value", "Sum (ps)", " a1 (ps)",
+               (nfp_ffn[fitfn] >= 2) ? " a2 ()" : "",
+               (nfp_ffn[fitfn] >= 3) ? " a3 (ps)" : "");
+    }
+
+    snew(sig, ncorr);
+
+    if (tbeginfit > 0)
+    {
+        jmax = 3;
+    }
+    else
+    {
+        jmax = 1;
+    }
+    for (j = 0; ((j < jmax) && (tStart < tendfit) && (tStart < ncorr*dt)); j++)
+    {
+        /* Estimate the correlation time for better fitting */
+        c_start     = -1;
+        ct_estimate = 0;
+        for (i = 0; (i < ncorr) && (dt*i < tStart || c1[i] > 0); i++)
+        {
+            if (c_start < 0)
+            {
+                if (dt*i >= tStart)
+                {
+                    c_start     = c1[i];
+                    ct_estimate = 0.5*c1[i];
+                }
+            }
+            else
+            {
+                ct_estimate += c1[i];
+            }
+        }
+        if (c_start > 0)
+        {
+            ct_estimate *= dt/c_start;
+        }
+        else
+        {
+            /* The data is strange, so we need to choose somehting */
+            ct_estimate = tendfit;
+        }
+        if (debug)
+        {
+            fprintf(debug, "tStart %g ct_estimate: %g\n", tStart, ct_estimate);
+        }
+
+        if (fitfn == effnEXP3)
+        {
+            fitparm[0] = 0.002*ncorr*dt;
+            fitparm[1] = 0.95;
+            fitparm[2] = 0.2*ncorr*dt;
+        }
+        else
+        {
+            /* Good initial guess, this increases the probability of convergence */
+            fitparm[0] = ct_estimate;
+            fitparm[1] = 1.0;
+            fitparm[2] = 1.0;
+        }
+
+        /* Generate more or less appropriate sigma's */
+        for (i = 0; i < ncorr; i++)
+        {
+            sig[i] = sqrt(ct_estimate+dt*i);
+        }
+
+        nf_int    = 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);
+        sumtot = sum+tail_corr;
+        if (fit && ((jmax == 1) || (j == 1)))
+        {
+            double mfp[3];
+            for (i = 0; (i < 3); i++)
+            {
+                mfp[i] = fitparm[i];
+            }
+            for (i = 0; (i < ncorr); i++)
+            {
+                fit[i] = lmcurves[fitfn](i*dt, mfp);
+            }
+        }
+        if (bPrint)
+        {
+            printf("COR:%11.4e%11.4e%11.4e%11.4e", tStart, sum, tail_corr, sumtot);
+            for (i = 0; (i < nfp_ffn[fitfn]); i++)
+            {
+                printf(" %11.4e", fitparm[i]);
+            }
+            printf("\n");
+        }
+        tStart += tbeginfit;
+    }
+    sfree(sig);
+
+    return sumtot;
+}
diff --git a/src/gromacs/correlationfunctions/expfit.h b/src/gromacs/correlationfunctions/expfit.h
new file mode 100644 (file)
index 0000000..ee75f8d
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal
+ * \file
+ * \brief
+ * Declares routine for fitting a data set to a curve
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \inlibraryapi
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_EXPFIT_H
+#define GMX_EXPFIT_H
+
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief
+ * Enum to select fitting functions
+ */
+enum {
+    effnNONE, effnEXP1, effnEXP2, effnEXP3,   effnVAC,
+    effnEXP5, effnEXP7, effnEXP9, effnERF, effnERREST, effnPRES, effnNR
+};
+
+/*! \brief
+ * Short name of each function type.
+ * This is exported for now in order to use when
+ * calling parse_common_args.
+ */
+extern const char *s_ffn[effnNR+2];
+
+/*! \brief
+ * Returns  description corresponding to the enum above, or NULL if out of range
+ * \param[in] effn Index
+ * \return Description or NULL
+ */
+const char *effnDescription(int effn);
+
+/*! \brief
+ * Returns  number of function parameters associated with a fitting function.
+ * \param[in] effn Index
+ * \return number or -1 if index out of range
+ */
+int effnNparams(int effn);
+
+/*! \brief
+ * Returns  corresponding to the selected enum option in sffn
+ * \param[in] sffn Two dimensional string array coming from parse_common_args
+ * \return the ffn enum
+ */
+int sffn2effn(const char **sffn);
+
+/*! \brief
+ * Returns the value of fit function eFitFn at x
+ * \param[in] eFitFn the index to the fitting function (0 .. effnNR)
+ * \param[in] parm Array of parameters, the length of which depends on eFitFn
+ * \param[in] x The value of x
+ * \return the value of the fit
+ */
+double fit_function(int eFitFn, double *parm, double x);
+
+/*! \brief
+ * Use Levenberg-Marquardt method to fit to a nfitparm parameter exponential
+ * or to a transverse current autocorrelation function.
+ *
+ * If x == NULL, the timestep dt will be used to create a time axis.
+ * \param[in] ndata Number of data points
+ * \param[in] c1 The data points
+ * \param[in] sig The standard deviation in the points
+ * \param[in] dt The time step
+ * \param[in] x The X-axis (may be NULL, see above)
+ * \param[in] begintimefit Starting time for fitting
+ * \param[in] endtimefit Ending time for fitting
+ * \param[in] oenv Output formatting information
+ * \param[in] bVerbose Should the routine write to console?
+ * \param[in] eFitFn Fitting function (0 .. effnNR)
+ * \param[out] fitparms[]
+ * \param[in] fix Constrains fit parameter i at it's starting value, when the i'th bit
+ * of fix is set.
+ * \return integral.
+ */
+real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x,
+              real begintimefit, real endtimefit, const output_env_t oenv,
+              gmx_bool bVerbose, int eFitFn, double fitparms[], int fix);
+
+/*! \brief
+ * Fit an autocorrelation function to a pre-defined functional form
+ *
+ * \todo check parameters
+ * \param[in] ncorr
+ * \param[in] fitfn Fitting function (0 .. effnNR)
+ * \param[in] oenv Output formatting information
+ * \param[in] bVerbose Should the routine write to console?
+ * \param[in] tbeginfit Starting time for fitting
+ * \param[in] tendfit Ending time for fitting
+ * \param[in] dt The time step
+ * \param[in] c1 The data points
+ * \param[out] fit The fitting parameters
+ * \return the integral over the autocorrelation function?
+ */
+real fit_acf(int ncorr, int fitfn, const output_env_t oenv, gmx_bool bVerbose,
+             real tbeginfit, real tendfit, real dt, real c1[], real *fit);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/correlationfunctions/integrate.c b/src/gromacs/correlationfunctions/integrate.c
new file mode 100644 (file)
index 0000000..dc0a7ae
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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.
+ */
+/*! \brief
+ * Implement routines for integrating a data set
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ */
+#include "gmxpre.h"
+
+#include "integrate.h"
+
+#include <math.h>
+#include <stdio.h>
+
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+
+/*! \brief Integrate a function and printe the integral value. */
+real print_and_integrate(FILE *fp, int n, real dt, const real c[],
+                         const real *fit, int nskip)
+{
+    real c0, sum;
+    int  j;
+
+    /* Use trapezoidal rule for calculating integral */
+    sum = 0.0;
+    for (j = 0; (j < n); j++)
+    {
+        c0 = c[j];
+        if (fp && (nskip == 0 || j % nskip == 0))
+        {
+            fprintf(fp, "%10.3f  %10.5f\n", j*dt, c0);
+        }
+        if (j > 0)
+        {
+            sum += dt*(c0+c[j-1]);
+        }
+    }
+    if (fp)
+    {
+        fprintf(fp, "&\n");
+        if (fit)
+        {
+            for (j = 0; (j < n); j++)
+            {
+                if (nskip == 0 || j % nskip == 0)
+                {
+                    fprintf(fp, "%10.3f  %10.5f\n", j*dt, fit[j]);
+                }
+            }
+            fprintf(fp, "&\n");
+        }
+    }
+    return sum*0.5;
+}
+
+/*! \brief Compute and return the integral of a function. */
+real evaluate_integral(int n, const real x[], const real y[],
+                       const real dy[], real aver_start,
+                       real *stddev)
+{
+    double sum, sum_var, w;
+    double sum_tail = 0, sum2_tail = 0;
+    int    j, nsum_tail = 0;
+
+    /* Use trapezoidal rule for calculating integral */
+    if (n <= 0)
+    {
+        gmx_fatal(FARGS, "Evaluating integral: n = %d (file %s, line %d)",
+                  n, __FILE__, __LINE__);
+    }
+
+    sum     = 0;
+    sum_var = 0;
+    for (j = 0; (j < n); j++)
+    {
+        w = 0;
+        if (j > 0)
+        {
+            w += 0.5*(x[j] - x[j-1]);
+        }
+        if (j < n-1)
+        {
+            w += 0.5*(x[j+1] - x[j]);
+        }
+        sum += w*y[j];
+        if (dy)
+        {
+            /* Assume all errors are uncorrelated */
+            sum_var += sqr(w*dy[j]);
+        }
+
+        if ((aver_start > 0) && (x[j] >= aver_start))
+        {
+            sum_tail  += sum;
+            sum2_tail += sqrt(sum_var);
+            nsum_tail += 1;
+        }
+    }
+
+    if (nsum_tail > 0)
+    {
+        sum = sum_tail/nsum_tail;
+        /* This is a worst case estimate, assuming all stddev's are correlated. */
+        *stddev = sum2_tail/nsum_tail;
+    }
+    else
+    {
+        *stddev = sqrt(sum_var);
+    }
+
+    return sum;
+}
diff --git a/src/gromacs/correlationfunctions/integrate.h b/src/gromacs/correlationfunctions/integrate.h
new file mode 100644 (file)
index 0000000..2159cb9
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal
+ * \file
+ * \brief
+ * Declares routines for integrating a data set
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \inlibraryapi
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_INTEGRATE_H
+#define GMX_INTEGRATE_H
+
+#include <stdio.h>
+
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief
+ * Integrate the equispaced data in c[] from 0 to n using trapezium rule.
+ * If fit != NULL the fit is written as well.
+ * \param[in] fp File pointer to write to (maybe NULL)
+ * \param[in] n Number of data points
+ * \param[in] dt The time step between data points
+ * \param[in] c The data set
+ * \param[in] fit Fit to the function that is printed too if not a NULL pointer is passed.
+ * \param[in] nskip Determines whether all elements are written to the output file
+ * (written when i % nskip == 0)
+ * \return The integral
+ */
+real print_and_integrate(FILE *fp, int n, real dt, const real c[], const real *fit, int nskip);
+
+/*! \brief
+ * Integrate data in y using the trapezium rule, and, if given, use dy as weighting
+ *
+ * \param[in] n The number of data points
+ * \param[in] x The x coordinate
+ * \param[in] y The y data (function values)
+ * \param[in] dy The uncertainties (can be NULL)
+ * \param[in] aver_start should be set to a value where the function has
+ * converged to 0.
+ * \param[out] stddev The standard deviation in the integral
+ * \return the integral
+ */
+real evaluate_integral(int n, const real x[], const real y[], const real dy[], real aver_start,
+                       real *stddev);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/correlationfunctions/manyautocorrelation.c b/src/gromacs/correlationfunctions/manyautocorrelation.c
new file mode 100644 (file)
index 0000000..c4fb7db
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements function to compute many autocorrelation functions
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "manyautocorrelation.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gromacs/fft/fft.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
+
+int many_auto_correl(int nfunc, int ndata, int nfft, real **c)
+{
+    #pragma omp parallel
+    {
+        typedef real complex[2];
+        int          i, t, j, fftcode;
+        gmx_fft_t    fft1;
+        complex     *in, *out;
+        int          i0, i1;
+        int          nthreads, thread_id;
+
+        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 = min(nfunc, (thread_id+1)*nfunc/nthreads);
+
+        fftcode = 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++)
+        {
+            for (j = 0; j < ndata; j++)
+            {
+                in[j][0] = c[i][j];
+                in[j][1] = 0;
+            }
+            for (; (j < nfft); j++)
+            {
+                in[j][0] = in[j][1] = 0;
+            }
+
+            fftcode = gmx_fft_1d(fft1, GMX_FFT_BACKWARD, (void *)in, (void *)out);
+            for (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;
+            }
+            for (; (j < nfft); j++)
+            {
+                in[j][0] = in[j][1] = 0;
+            }
+
+            fftcode = gmx_fft_1d(fft1, GMX_FFT_FORWARD, (void *)in, (void *)out);
+            for (j = 0; (j < nfft); j++)
+            {
+                c[i][j] = out[j][0]/ndata;
+            }
+        }
+        /* Free the memory */
+        gmx_fft_destroy(fft1);
+        sfree(in);
+        sfree(out);
+    }
+    // gmx_fft_cleanup();
+    return 0;
+}
diff --git a/src/gromacs/correlationfunctions/manyautocorrelation.h b/src/gromacs/correlationfunctions/manyautocorrelation.h
new file mode 100644 (file)
index 0000000..160f2da
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal
+ * \file
+ * \brief
+ * Declares routine for computing many correlation functions using OpenMP
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \inlibraryapi
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_MANYAUTOCORRELATION_H
+#define GMX_MANYAUTOCORRELATION_H
+
+#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
+ * a symmetric function that is useful for further FFT:ing, for instance in order to
+ * compute spectra.
+ *
+ * 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
+ * \return fft error code, or zero if everything went fine (see fft/fft.h)
+ */
+int many_auto_correl(int nfunc, int ndata, int nfft, real **c);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 75%
rename from src/gromacs/gmxana/polynomials.c
rename to src/gromacs/correlationfunctions/polynomials.c
index de47f1aa7ad2880dd5c159d7fcb97bc06892ffba..c5f499a17daf50f92fbd1b2a13d3db484427c02c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ * \brief
+ * Implements help function to compute Legendre polynomials
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \author Anders G&auml;rden&auml;s <anders.gardenas@gmail.com>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "polynomials.h"
 
-#include <stdio.h>
-#include <math.h>
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "gstat.h"
+#include "gromacs/utility/fatalerror.h"
 
-real LegendreP(real x, unsigned long m)
+real LegendreP(real x, unsigned int m)
 
 {
     real polynomial = 0, x2, x3;
 
     switch (m)
     {
-        case eacP0:
+        case 0:
             polynomial = 1.0;
             break;
-        case eacP1:
+        case 1:
             polynomial = x;
             break;
-        case eacP2:
+        case 2:
             x2         = x*x;
             polynomial = 1.5*x2 - 0.5;
             break;
-        case eacP3:
+        case 3:
+            x2         = x*x;
+            polynomial = (5*x2*x - 3*x )* 0.5;
+            break;
+        case 4:
             x2         = x*x;
             polynomial = (35*x2*x2 - 30*x2 + 3)/8;
             break;
-        case eacP4:
+        case 5:
             x2         = x*x;
             x3         = x2*x;
             polynomial = (63*x3*x2 - 70*x3 + 15*x)/8;
             break;
         default:
-            gmx_fatal(FARGS, "Legendre polynomials of order %d are not supported, %s %d",
-                      m, __FILE__, __LINE__);
+            gmx_fatal(FARGS, "Legendre polynomials of order %u are not supported", m);
     }
     return (polynomial);
 }
diff --git a/src/gromacs/correlationfunctions/polynomials.h b/src/gromacs/correlationfunctions/polynomials.h
new file mode 100644 (file)
index 0000000..5bb494e
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal
+ * \file
+ * \brief
+ * Declares routine for computing a Legendre polynomial
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \inlibraryapi
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_POLYNOMIALS_H
+#define GMX_POLYNOMIALS_H
+
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief
+ * Return Legendre polynomial value Pm(x)
+ * http://en.wikipedia.org/wiki/Legendre_polynomials
+ * \param[in] x The value
+ * \param[in] m The order of the polynomial (0-4 are supported)
+ * \return Pm(x)
+ */
+real LegendreP(real x, unsigned int m);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/correlationfunctions/tests/CMakeLists.txt b/src/gromacs/correlationfunctions/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5bb3ad4
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+gmx_add_unit_test(CorrelationsTest  correlations-test
+  autocorr.cpp
+  correlationdataset.cpp
+  expfit.cpp)
+
diff --git a/src/gromacs/correlationfunctions/tests/autocorr.cpp b/src/gromacs/correlationfunctions/tests/autocorr.cpp
new file mode 100644 (file)
index 0000000..0bc95b3
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements test of autocorrelation function routines
+ *
+ * \author Anders G&auml;rden&auml;s <anders.gardenas@gmail.com>
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "gromacs/correlationfunctions/autocorr.h"
+
+#include <cmath>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/fft/fft.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/uniqueptr.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+#include "testutils/testfilemanager.h"
+
+#include "correlationdataset.h"
+
+namespace gmx
+{
+namespace
+{
+
+//! Definition of pointer to class containing test data.
+typedef gmx_unique_ptr<CorrelationDataSet>::type CorrelationDataSetPointer;
+
+class AutocorrTest : public ::testing::Test
+{
+    protected:
+
+        static int                                  nrFrames_;
+        static CorrelationDataSetPointer            data_;
+        // Need raw pointer for passing this to C routines
+        static t_pargs                            * tempArgs_;
+
+        test::TestReferenceData                     refData_;
+        test::TestReferenceChecker                  checker_;
+
+        // Use erefdataCreateMissing for creating new files
+        AutocorrTest( )
+            : checker_(refData_.rootChecker())
+        {
+#ifdef GMX_DOUBLE
+            checker_.setDefaultTolerance(test::relativeToleranceAsFloatingPoint(1, 1e-6));
+#else
+            checker_.setDefaultTolerance(test::relativeToleranceAsFloatingPoint(1, 1e-3));
+#endif
+        }
+
+        // Static initiation, only run once every test.
+        static void SetUpTestCase()
+        {
+            int         n        = 0;
+            std::string fileName = "testCOS3.xvg";
+            data_                = CorrelationDataSetPointer(new CorrelationDataSet(fileName));
+            nrFrames_            = data_->getNrLines();
+            tempArgs_            = add_acf_pargs(&n, NULL);
+        }
+
+        static void TearDownTestCase()
+        {
+
+            sfree(tempArgs_);
+            tempArgs_ = NULL;
+            gmx_fft_cleanup();
+        }
+
+        void test(unsigned long mode)
+        {
+            bool              bAverage      = false;
+            bool              bNormalize    = true;
+            bool              bVerbose      = false;
+            int               nrRestart     = 1;
+            int               dim           = getDim(mode);
+            std::vector<real> result;
+
+            for (int i = 0; i < nrFrames_; i++)
+            {
+                for (int m = 0; m < dim; m++)
+                {
+                    result.push_back(data_->getValue(m, i));
+                }
+            }
+            real *ptr = static_cast<real*>(&(result[0]));
+            low_do_autocorr(0, 0, 0,   nrFrames_, 1,
+                            get_acfnout(), &ptr, data_->getDt(), mode,
+                            nrRestart, bAverage, bNormalize,
+                            bVerbose, data_->getStartTime(), data_->getEndTime(),
+                            effnNONE);
+
+            double testResult = 0;
+            for (int i = 0; i < nrFrames_; i++)
+            {
+                testResult += result[i];
+            }
+            checker_.checkSequenceArray(nrFrames_, ptr,
+                                        "AutocorrelationFunction");
+            checker_.checkReal(testResult, "Integral");
+        }
+
+        int getDim(unsigned long type)
+        {
+            switch (type)
+            {
+                case eacNormal:
+                    return 1;
+                case eacVector:
+                    return 3;
+                case eacCos:
+                    return 1;
+                case eacRcross:
+                    return 3;
+                case eacP0:
+                    return 3;
+                case eacP1:
+                    return 3;
+                case eacP2:
+                    return 3;
+                case eacP3:
+                    return 3;
+                case eacP4:
+                    return 3;
+                case eacIden:
+                    return 1;
+                default:
+                    GMX_RELEASE_ASSERT(false, "Invalid auto correlation option");
+                    return -1;
+            }
+
+        }
+
+};
+
+int                         AutocorrTest::nrFrames_;
+CorrelationDataSetPointer   AutocorrTest::data_;
+t_pargs                   * AutocorrTest::tempArgs_;
+
+TEST_F (AutocorrTest, EacNormal)
+{
+    test(eacNormal);
+}
+
+TEST_F (AutocorrTest, EacCos)
+{
+    test(eacCos);
+}
+
+TEST_F (AutocorrTest, EacVector)
+{
+    test(eacVector);
+}
+
+TEST_F (AutocorrTest, EacRcross)
+{
+    test(eacRcross);
+}
+
+TEST_F (AutocorrTest, EacP0)
+{
+    test(eacP0);
+}
+
+TEST_F (AutocorrTest, EacP1)
+{
+    test(eacP1);
+}
+
+TEST_F (AutocorrTest, EacP2)
+{
+    test(eacP2);
+}
+
+TEST_F (AutocorrTest, EacP3)
+{
+    test(eacP3);
+}
+
+TEST_F (AutocorrTest, EacP4)
+{
+    test(eacP4);
+}
+
+
+}
+
+}
diff --git a/src/gromacs/correlationfunctions/tests/correlationdataset.cpp b/src/gromacs/correlationfunctions/tests/correlationdataset.cpp
new file mode 100644 (file)
index 0000000..371ba0e
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements helper class for autocorrelation tests
+ *
+ * \author Anders G&auml;rden&auml;s <anders.gardenas@gmail.com>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "correlationdataset.h"
+
+#include <cmath>
+
+#include <sstream>
+
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "testutils/testfilemanager.h"
+
+CorrelationDataSet::CorrelationDataSet(const std::string &fileName)
+{
+    std::string fileNm = gmx::test::TestFileManager::getInputFilePath(fileName.c_str());
+    nrLines_    = read_xvg(fileNm.c_str(), &tempValues_, &nrColumns_);
+
+    dt_         = tempValues_[0][1] - tempValues_[0][0];
+    startTime_  = tempValues_[0][0];
+    endTime_    = tempValues_[0][nrLines_-1];
+}
+
+CorrelationDataSet::~CorrelationDataSet()
+{
+    // Allocated in read_xvg, destroyed here.
+    for (int i = 0; i < nrColumns_; i++)
+    {
+        sfree(tempValues_[i]);
+        tempValues_[i] = NULL;
+    }
+    sfree(tempValues_);
+    tempValues_ = NULL;
+}
+
+real CorrelationDataSet::getValue(int set, int time) const
+{
+    if (set+1 < nrColumns_)
+    {
+        return tempValues_[set+1][time];
+    }
+    else
+    {
+        return 0;
+    }
+}
diff --git a/src/gromacs/correlationfunctions/tests/correlationdataset.h b/src/gromacs/correlationfunctions/tests/correlationdataset.h
new file mode 100644 (file)
index 0000000..db73201
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Declares helper class for autocorrelation tests
+ *
+ * \author Anders G&auml;rden&auml;s <anders.gardenas@gmail.com>
+ * \ingroup module_correlationfunctions
+ */
+#ifndef GMX_CORRELATIONDATASET_H
+#define GMX_CORRELATIONDATASET_H
+
+#include <string>
+#include <vector>
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/real.h"
+
+class CorrelationDataSet
+{
+    double         ** tempValues_;
+
+    int               nrLines_;
+    int               nrColumns_;
+    double            startTime_;
+    double            endTime_;
+    double            dt_;
+
+    public:
+
+        /*! \brief
+         * Constructor
+         * \param[in] fileName containing function to test. *.xvg
+         */
+        explicit CorrelationDataSet(const std::string &fileName);
+
+        /*! \brief
+         * Return a value at an index
+         * \param[in] set the set number
+         * \param[in] t the time index of the value
+         */
+        real getValue(int set, int t) const;
+
+        /*! \brief
+         * Return the nummber of columns
+         */
+        int getNrColumns() const { return nrColumns_; }
+
+        /*! \brief
+         * Return the nummber of Lines
+         */
+        int getNrLines() const { return nrLines_; }
+
+        /*! \brief
+         * Return the time witch the function starts at
+         */
+        real getStartTime() const { return startTime_; }
+
+        /*! \brief
+         * Return the time the function ends at
+         */
+        real getEndTime() const { return endTime_; }
+
+        /*! \brief
+         * return delta time
+         */
+        real getDt() const { return dt_; }
+
+        /*! \brief
+         * Destructor
+         */
+        ~CorrelationDataSet();
+
+    private:
+        //! This class should not be copyable or assignable
+        GMX_DISALLOW_COPY_AND_ASSIGN(CorrelationDataSet);
+};
+
+#endif
diff --git a/src/gromacs/correlationfunctions/tests/expfit.cpp b/src/gromacs/correlationfunctions/tests/expfit.cpp
new file mode 100755 (executable)
index 0000000..c9f518b
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements test of exponential fitting routines
+ *
+ * \author Anders G&auml;rden&auml;s <anders.gardenas@gmail.com>
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_correlationfunctions
+ */
+#include "gmxpre.h"
+
+#include "gromacs/correlationfunctions/expfit.h"
+
+#include <cmath>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+#include "testutils/testfilemanager.h"
+
+//! Number of data files for testing.
+#define expTestNrTypes 3
+
+namespace gmx
+{
+
+namespace
+{
+
+class ExpfitTest : public ::testing::Test
+{
+
+    protected:
+        static int                 nrLines_;
+        static std::vector<real>   values_[expTestNrTypes];
+        static int                 nrColumns_;
+        static std::vector<real>   standardDev_;
+        static real                startTime_;
+        static real                endTime_;
+        static real                timeDeriv_;
+        test::TestReferenceData    refData_;
+        test::TestReferenceChecker checker_;
+        ExpfitTest( )
+            : checker_(refData_.rootChecker())
+        {
+        }
+
+        // Static initiation, only run once every test.
+        static void SetUpTestCase()
+        {
+            double   ** tempValues;
+            std::string fileName[expTestNrTypes];
+            fileName[0] = test::TestFileManager::getInputFilePath("testINVEXP.xvg");
+            fileName[1] = test::TestFileManager::getInputFilePath("testPRES.xvg");
+            fileName[2] = test::TestFileManager::getInputFilePath("testEXP.xvg");
+            for (int i = 0; i < expTestNrTypes; i++)
+            {
+                const char * name = fileName[i].c_str();
+                // TODO: this assumes all files have the same length.
+                nrLines_     = read_xvg(name, &tempValues, &nrColumns_);
+
+                // Generating standard deviation
+                if (i == 0)
+                {
+                    double fac = 1.0/nrLines_;
+                    for (int j = 0; j < nrLines_; j++)
+                    {
+                        standardDev_.push_back(fac);
+                    }
+                    timeDeriv_ = tempValues[0][1] - tempValues[0][0];
+                    startTime_ = tempValues[0][0];
+                    endTime_   = tempValues[0][nrLines_-1];
+                }
+
+                for (int j = 0; j  < nrLines_; j++)
+                {
+                    values_[i].push_back((real)tempValues[1][j]);
+                }
+
+                // Free memory that was allocated in read_xvg
+                for (int i = 0; i < nrColumns_; i++)
+                {
+                    sfree(tempValues[i]);
+                    tempValues[i] = NULL;
+                }
+                sfree(tempValues);
+                tempValues = NULL;
+            }
+        }
+
+        static void TearDownTestCase()
+        {
+        }
+
+        void test(int type, double result[], double tolerance, int testType)
+        {
+            int     nfitparm = effnNparams(type);
+
+            do_lmfit(nrLines_, &values_[testType][0], &standardDev_[0], timeDeriv_,
+                     NULL, startTime_, endTime_, NULL, false, type, result, 0);
+
+            checker_.setDefaultTolerance(test::relativeToleranceAsFloatingPoint(1, tolerance));
+            checker_.checkSequenceArray(nfitparm, result, "result");
+        }
+};
+
+
+//static var
+int               ExpfitTest::nrLines_;
+//cppcheck-suppress arrayIndexOutOfBounds fixed in 1.68-dev
+std::vector<real> ExpfitTest::values_[expTestNrTypes];
+int               ExpfitTest::nrColumns_;
+std::vector<real> ExpfitTest::standardDev_;
+real              ExpfitTest::startTime_;
+real              ExpfitTest::endTime_;
+real              ExpfitTest::timeDeriv_;
+
+TEST_F (ExpfitTest, EffnEXP1) {
+    double  param[] = {25};
+    test(effnEXP1, param, 1e-6, 0);
+}
+
+TEST_F (ExpfitTest, EffnEXP2) {
+    double  param[] = {35, 0.5};
+    test(effnEXP2, param, 1e-6, 0);
+}
+
+TEST_F (ExpfitTest, EffnEXP3) {
+    double param[] = {45, 0.5, 5};
+    test(effnEXP3, param, 1e-4, 0);
+}
+
+TEST_F (ExpfitTest, EffnEXP5) {
+    double  param[] = {0.5, 5, 0.5, 50, 0.002};
+    test(effnEXP5, param, 1e-4, 0);
+}
+
+TEST_F (ExpfitTest, EffnEXP7) {
+    double  param[] = {0.5, 5, -0.02, 0.5, 0.5, 50, -0.002};
+    test(effnEXP7, param, 1e-4, 0);
+}
+
+TEST_F (ExpfitTest, EffnEXP9) {
+    double  param[] = {2, 1200, -1, 300, 0.7, 70, 0.5, 6, -0.5};
+    test(effnEXP9, param, 4e-2, 0);
+}
+
+TEST_F (ExpfitTest, EffnERF) {
+    double  param[] = {0.5, 0.5, 0.5, 1};
+    test(effnERF, param, 1e-2, 0);
+}
+
+TEST_F (ExpfitTest, EffnERREST) {
+    double  param[] = {0.5, 0.7, 0.3};
+    test(effnERREST, param, 1e-4, 2);
+}
+
+TEST_F (ExpfitTest, EffnVAC) {
+    double param[] = {0.5, 0.05};
+    test(effnVAC, param, 1e-4, 0);
+}
+
+TEST_F (ExpfitTest, DISABLED_EffnPRES) {
+    //TODO: This test is prodocues NaNs and INFs. Fix and then reactivate.
+    double param[] = {0, 10, 4, 1, 0.5, 1};
+    test(effnPRES, param, 1e-4, 1);
+}
+
+}
+
+}
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacCos.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacCos.xml
new file mode 100644 (file)
index 0000000..34cba40
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.99659538</Real>
+    <Real>0.99595559</Real>
+    <Real>0.9944247</Real>
+    <Real>0.99254024</Real>
+    <Real>0.99074072</Real>
+    <Real>0.98782086</Real>
+    <Real>0.98476714</Real>
+    <Real>0.98145622</Real>
+    <Real>0.97775453</Real>
+    <Real>0.97388524</Real>
+    <Real>0.96959651</Real>
+    <Real>0.96521682</Real>
+    <Real>0.96071005</Real>
+    <Real>0.95656222</Real>
+    <Real>0.95218587</Real>
+    <Real>0.94799894</Real>
+    <Real>0.94426513</Real>
+    <Real>0.94049501</Real>
+    <Real>0.93681264</Real>
+    <Real>0.93319356</Real>
+    <Real>0.93034834</Real>
+    <Real>0.92801505</Real>
+    <Real>0.92570525</Real>
+    <Real>0.92359954</Real>
+    <Real>0.92197412</Real>
+    <Real>0.92073542</Real>
+    <Real>0.92040521</Real>
+    <Real>0.91959125</Real>
+    <Real>0.91971552</Real>
+    <Real>0.91937882</Real>
+    <Real>0.92004192</Real>
+    <Real>0.92134565</Real>
+    <Real>0.92249507</Real>
+    <Real>0.92415452</Real>
+    <Real>0.92598462</Real>
+    <Real>0.92835307</Real>
+    <Real>0.93056071</Real>
+    <Real>0.93232888</Real>
+    <Real>0.93553138</Real>
+    <Real>0.93841678</Real>
+    <Real>0.94149232</Real>
+    <Real>0.9445464</Real>
+    <Real>0.94751155</Real>
+    <Real>0.95099658</Real>
+    <Real>0.95437491</Real>
+    <Real>0.95766789</Real>
+    <Real>0.96085715</Real>
+    <Real>0.96405703</Real>
+    <Real>0.96722084</Real>
+    <Real>0.97044915</Real>
+    <Real>0.97360796</Real>
+    <Real>0.97608888</Real>
+    <Real>0.97839665</Real>
+    <Real>0.98092067</Real>
+    <Real>0.98309362</Real>
+    <Real>0.9850989</Real>
+    <Real>0.98661345</Real>
+    <Real>0.98806572</Real>
+    <Real>0.98921531</Real>
+    <Real>0.989797</Real>
+    <Real>0.99024576</Real>
+    <Real>0.99059737</Real>
+    <Real>0.99045819</Real>
+    <Real>0.99015921</Real>
+    <Real>0.98907006</Real>
+    <Real>0.98829621</Real>
+    <Real>0.98710001</Real>
+    <Real>0.98538107</Real>
+    <Real>0.98345906</Real>
+    <Real>0.98124063</Real>
+    <Real>0.97880316</Real>
+    <Real>0.97668463</Real>
+    <Real>0.97459376</Real>
+    <Real>0.97177458</Real>
+    <Real>0.9690451</Real>
+    <Real>0.96629435</Real>
+    <Real>0.96378684</Real>
+    <Real>0.96081358</Real>
+    <Real>0.95825708</Real>
+    <Real>0.95578271</Real>
+    <Real>0.95307195</Real>
+    <Real>0.95074266</Real>
+    <Real>0.94830912</Real>
+    <Real>0.94601887</Real>
+    <Real>0.94421709</Real>
+    <Real>0.94242907</Real>
+    <Real>0.94094354</Real>
+    <Real>0.93951678</Real>
+    <Real>0.93832368</Real>
+    <Real>0.93808126</Real>
+    <Real>0.93739355</Real>
+    <Real>0.93729556</Real>
+    <Real>0.93707997</Real>
+    <Real>0.93724543</Real>
+    <Real>0.93773413</Real>
+    <Real>0.93849856</Real>
+    <Real>0.93898928</Real>
+    <Real>0.94032645</Real>
+    <Real>0.94162965</Real>
+    <Real>0.94294119</Real>
+    <Real>0.94477904</Real>
+    <Real>0.94679701</Real>
+    <Real>0.94860345</Real>
+    <Real>0.95079654</Real>
+    <Real>0.95264018</Real>
+    <Real>0.95462155</Real>
+    <Real>0.95684212</Real>
+    <Real>0.95912236</Real>
+    <Real>0.96142673</Real>
+    <Real>0.96361393</Real>
+    <Real>0.96516949</Real>
+    <Real>0.96719009</Real>
+    <Real>0.96904653</Real>
+    <Real>0.97105813</Real>
+    <Real>0.97231489</Real>
+    <Real>0.97363442</Real>
+    <Real>0.9752683</Real>
+    <Real>0.97622961</Real>
+    <Real>0.97773701</Real>
+    <Real>0.9781059</Real>
+    <Real>0.97861946</Real>
+    <Real>0.97946876</Real>
+    <Real>0.97965133</Real>
+    <Real>0.98004115</Real>
+    <Real>0.97992533</Real>
+    <Real>0.97962075</Real>
+    <Real>0.97891223</Real>
+    <Real>0.97828108</Real>
+    <Real>0.97720605</Real>
+    <Real>0.97623944</Real>
+    <Real>0.97527778</Real>
+    <Real>0.97370166</Real>
+    <Real>0.97211659</Real>
+    <Real>0.97065586</Real>
+    <Real>0.96862853</Real>
+    <Real>0.96749282</Real>
+    <Real>0.96519589</Real>
+    <Real>0.96352464</Real>
+    <Real>0.96173507</Real>
+    <Real>0.9598251</Real>
+    <Real>0.9585008</Real>
+    <Real>0.95661891</Real>
+    <Real>0.95462286</Real>
+    <Real>0.95305181</Real>
+    <Real>0.951231</Real>
+    <Real>0.95024604</Real>
+    <Real>0.94892341</Real>
+    <Real>0.94788772</Real>
+    <Real>0.94696826</Real>
+    <Real>0.94605809</Real>
+    <Real>0.94519788</Real>
+    <Real>0.94469965</Real>
+    <Real>0.94453776</Real>
+    <Real>0.94388711</Real>
+    <Real>0.94351792</Real>
+    <Real>0.94364196</Real>
+    <Real>0.94375587</Real>
+    <Real>0.94424397</Real>
+    <Real>0.94460499</Real>
+    <Real>0.94499773</Real>
+    <Real>0.94563341</Real>
+    <Real>0.94637001</Real>
+    <Real>0.94729853</Real>
+    <Real>0.94789016</Real>
+    <Real>0.9492957</Real>
+    <Real>0.95013034</Real>
+    <Real>0.95128489</Real>
+    <Real>0.95289272</Real>
+    <Real>0.9538911</Real>
+    <Real>0.95517474</Real>
+    <Real>0.95651346</Real>
+    <Real>0.95739591</Real>
+    <Real>0.95905453</Real>
+    <Real>0.95995909</Real>
+    <Real>0.96129471</Real>
+    <Real>0.96225822</Real>
+    <Real>0.96320486</Real>
+    <Real>0.96370006</Real>
+    <Real>0.96436906</Real>
+    <Real>0.96505266</Real>
+    <Real>0.96569002</Real>
+    <Real>0.96630496</Real>
+    <Real>0.96670491</Real>
+    <Real>0.96745616</Real>
+    <Real>0.96741182</Real>
+    <Real>0.96750134</Real>
+    <Real>0.96715963</Real>
+    <Real>0.96682173</Real>
+    <Real>0.96666759</Real>
+    <Real>0.96608764</Real>
+    <Real>0.96583378</Real>
+    <Real>0.96554524</Real>
+    <Real>0.9645654</Real>
+    <Real>0.96389264</Real>
+    <Real>0.96256238</Real>
+    <Real>0.96151811</Real>
+    <Real>0.96107018</Real>
+    <Real>0.96008974</Real>
+    <Real>0.95841819</Real>
+    <Real>0.95736814</Real>
+    <Real>0.95627117</Real>
+    <Real>0.95525789</Real>
+    <Real>0.95427847</Real>
+    <Real>0.9530521</Real>
+    <Real>0.95182502</Real>
+    <Real>0.95049888</Real>
+    <Real>0.94935501</Real>
+    <Real>0.94850504</Real>
+    <Real>0.9477604</Real>
+    <Real>0.94666183</Real>
+    <Real>0.9459089</Real>
+    <Real>0.94507974</Real>
+    <Real>0.94467252</Real>
+    <Real>0.94344991</Real>
+    <Real>0.9432252</Real>
+    <Real>0.94265378</Real>
+    <Real>0.94217145</Real>
+    <Real>0.94254112</Real>
+    <Real>0.94218564</Real>
+    <Real>0.94258451</Real>
+    <Real>0.94247329</Real>
+    <Real>0.94219875</Real>
+    <Real>0.94211328</Real>
+    <Real>0.94299912</Real>
+    <Real>0.94275576</Real>
+    <Real>0.94383633</Real>
+    <Real>0.94452924</Real>
+    <Real>0.94524854</Real>
+    <Real>0.94583327</Real>
+    <Real>0.9464516</Real>
+    <Real>0.94671708</Real>
+    <Real>0.94742924</Real>
+    <Real>0.94788718</Real>
+    <Real>0.94856435</Real>
+    <Real>0.94880164</Real>
+    <Real>0.94944811</Real>
+    <Real>0.94974619</Real>
+    <Real>0.95041901</Real>
+    <Real>0.95081389</Real>
+    <Real>0.95117909</Real>
+    <Real>0.95128679</Real>
+    <Real>0.95191312</Real>
+    <Real>0.95196861</Real>
+    <Real>0.95284516</Real>
+    <Real>0.95309955</Real>
+    <Real>0.9532634</Real>
+    <Real>0.95333052</Real>
+    <Real>0.95380241</Real>
+    <Real>0.95404249</Real>
+    <Real>0.9541797</Real>
+    <Real>0.0019043376</Real>
+    <Real>0.0019041657</Real>
+    <Real>0.0019034834</Real>
+    <Real>0.00190268</Real>
+    <Real>0.0019021333</Real>
+    <Real>0.0019006877</Real>
+    <Real>0.0018999804</Real>
+    <Real>0.0018984226</Real>
+    <Real>0.0018965704</Real>
+    <Real>0.0018964604</Real>
+    <Real>0.0018947892</Real>
+    <Real>0.0018918787</Real>
+    <Real>0.0018907072</Real>
+    <Real>0.0018881153</Real>
+    <Real>0.0018871488</Real>
+    <Real>0.0018849894</Real>
+    <Real>0.0018837301</Real>
+    <Real>0.0018808114</Real>
+    <Real>0.0018789673</Real>
+    <Real>0.0018766357</Real>
+    <Real>0.0018757449</Real>
+    <Real>0.0018735129</Real>
+    <Real>0.0018722961</Real>
+    <Real>0.0018701779</Real>
+    <Real>0.001869004</Real>
+    <Real>0.0018674148</Real>
+    <Real>0.0018670724</Real>
+    <Real>0.0018658802</Real>
+    <Real>0.0018650054</Real>
+    <Real>0.0018644506</Real>
+    <Real>0.0018642544</Real>
+    <Real>0.0018643636</Real>
+    <Real>0.0018631493</Real>
+    <Real>0.0018632679</Real>
+    <Real>0.0018620805</Real>
+    <Real>0.0018617192</Real>
+    <Real>0.0018613907</Real>
+    <Real>0.0018620746</Real>
+    <Real>0.0018608437</Real>
+    <Real>0.0018616359</Real>
+    <Real>0.0018607891</Real>
+    <Real>0.001861356</Real>
+    <Real>0.0018617494</Real>
+    <Real>0.001862596</Real>
+    <Real>0.0018628497</Real>
+    <Real>0.0018639539</Real>
+    <Real>0.0018633736</Real>
+    <Real>0.0018630736</Real>
+    <Real>0.0018636734</Real>
+    <Real>0.001863839</Real>
+    <Real>0.0018648139</Real>
+    <Real>0.0018641106</Real>
+    <Real>0.0018644318</Real>
+    <Real>0.0018650938</Real>
+    <Real>0.0018654467</Real>
+    <Real>0.0018659889</Real>
+    <Real>0.0018662841</Real>
+    <Real>0.0018667069</Real>
+    <Real>0.0018669292</Real>
+    <Real>0.0018671628</Real>
+    <Real>0.0018675444</Real>
+    <Real>0.0018667035</Real>
+    <Real>0.0018655404</Real>
+    <Real>0.0018652284</Real>
+    <Real>0.0018667565</Real>
+    <Real>0.0018661944</Real>
+    <Real>0.0018663721</Real>
+    <Real>0.0018655302</Real>
+    <Real>0.0018643311</Real>
+    <Real>0.0018638286</Real>
+    <Real>0.0018621223</Real>
+    <Real>0.0018611329</Real>
+    <Real>0.0018599476</Real>
+    <Real>0.0018590478</Real>
+    <Real>0.0018587873</Real>
+    <Real>0.0018562102</Real>
+    <Real>0.0018557633</Real>
+    <Real>0.0018540745</Real>
+    <Real>0.001852081</Real>
+    <Real>0.0018499735</Real>
+    <Real>0.0018468326</Real>
+    <Real>0.0018452632</Real>
+    <Real>0.0018442717</Real>
+    <Real>0.0018425027</Real>
+    <Real>0.001839547</Real>
+    <Real>0.0018376643</Real>
+    <Real>0.001836191</Real>
+    <Real>0.0018344159</Real>
+    <Real>0.0018318044</Real>
+    <Real>0.0018301884</Real>
+    <Real>0.0018287364</Real>
+    <Real>0.0018269665</Real>
+    <Real>0.0018269968</Real>
+    <Real>0.0018270178</Real>
+    <Real>0.001825763</Real>
+    <Real>0.001825764</Real>
+    <Real>0.0018249867</Real>
+    <Real>0.0018219111</Real>
+    <Real>0.0018208193</Real>
+    <Real>0.0018213706</Real>
+    <Real>0.0018203714</Real>
+    <Real>0.0018217162</Real>
+    <Real>0.0018197326</Real>
+    <Real>0.0018210115</Real>
+    <Real>0.0018215602</Real>
+    <Real>0.0018208514</Real>
+    <Real>0.0018214376</Real>
+    <Real>0.0018191702</Real>
+    <Real>0.0018200848</Real>
+    <Real>0.0018206243</Real>
+    <Real>0.0018204382</Real>
+    <Real>0.001820185</Real>
+    <Real>0.0018186562</Real>
+    <Real>0.001817708</Real>
+    <Real>0.0018170066</Real>
+    <Real>0.0018171553</Real>
+    <Real>0.0018157695</Real>
+    <Real>0.0018159969</Real>
+    <Real>0.0018166977</Real>
+    <Real>0.0018168332</Real>
+    <Real>0.0018161659</Real>
+    <Real>0.0018163385</Real>
+    <Real>0.0018147173</Real>
+    <Real>0.0018156185</Real>
+    <Real>0.0018148925</Real>
+    <Real>0.0018124133</Real>
+    <Real>0.0018126937</Real>
+    <Real>0.0018113267</Real>
+    <Real>0.0018111287</Real>
+    <Real>0.0018093445</Real>
+    <Real>0.0018067171</Real>
+    <Real>0.0018067758</Real>
+    <Real>0.0018042427</Real>
+    <Real>0.0018018567</Real>
+    <Real>0.0017997391</Real>
+    <Real>0.0017981781</Real>
+    <Real>0.0017945498</Real>
+    <Real>0.001792311</Real>
+    <Real>0.0017904965</Real>
+    <Real>0.0017866502</Real>
+    <Real>0.0017860316</Real>
+    <Real>0.0017839982</Real>
+    <Real>0.0017814568</Real>
+    <Real>0.0017791466</Real>
+    <Real>0.0017781249</Real>
+    <Real>0.0017757714</Real>
+    <Real>0.0017761824</Real>
+    <Real>0.0017732615</Real>
+    <Real>0.0017709045</Real>
+    <Real>0.001768977</Real>
+    <Real>0.0017683667</Real>
+    <Real>0.0017667006</Real>
+    <Real>0.0017635585</Real>
+    <Real>0.0017620071</Real>
+    <Real>0.0017606486</Real>
+    <Real>0.0017580282</Real>
+    <Real>0.0017592428</Real>
+    <Real>0.0017556297</Real>
+    <Real>0.0017555061</Real>
+    <Real>0.001757534</Real>
+    <Real>0.0017574723</Real>
+    <Real>0.0017552145</Real>
+    <Real>0.0017545033</Real>
+    <Real>0.0017526622</Real>
+    <Real>0.0017496244</Real>
+    <Real>0.0017489279</Real>
+    <Real>0.0017457242</Real>
+    <Real>0.0017463452</Real>
+    <Real>0.0017450341</Real>
+    <Real>0.0017423715</Real>
+    <Real>0.001740228</Real>
+    <Real>0.0017355961</Real>
+    <Real>0.0017338913</Real>
+    <Real>0.0017318379</Real>
+    <Real>0.0017262439</Real>
+    <Real>0.0017226909</Real>
+    <Real>0.0017175399</Real>
+    <Real>0.0017158915</Real>
+    <Real>0.0017132005</Real>
+    <Real>0.0017120165</Real>
+    <Real>0.0017087469</Real>
+    <Real>0.0017068728</Real>
+    <Real>0.0017077745</Real>
+    <Real>0.0017095149</Real>
+    <Real>0.0017067558</Real>
+    <Real>0.0017066813</Real>
+    <Real>0.0017082159</Real>
+    <Real>0.0017052331</Real>
+    <Real>0.0017099206</Real>
+    <Real>0.0017054603</Real>
+    <Real>0.0017075579</Real>
+    <Real>0.001708627</Real>
+    <Real>0.0017047788</Real>
+    <Real>0.0017065253</Real>
+    <Real>0.0017045407</Real>
+    <Real>0.0017063328</Real>
+    <Real>0.001704243</Real>
+    <Real>0.001700534</Real>
+    <Real>0.0016963967</Real>
+    <Real>0.0016906861</Real>
+    <Real>0.0016869787</Real>
+    <Real>0.0016800896</Real>
+    <Real>0.001670838</Real>
+    <Real>0.0016614879</Real>
+    <Real>0.001651187</Real>
+    <Real>0.0016429743</Real>
+    <Real>0.0016380887</Real>
+    <Real>0.0016310038</Real>
+    <Real>0.0016253163</Real>
+    <Real>0.0016181563</Real>
+    <Real>0.0016086341</Real>
+    <Real>0.0016025983</Real>
+    <Real>0.0016049559</Real>
+    <Real>0.0016046603</Real>
+    <Real>0.0016040681</Real>
+    <Real>0.0016056809</Real>
+    <Real>0.0016082647</Real>
+    <Real>0.0016130897</Real>
+    <Real>0.0016240891</Real>
+    <Real>0.0016315721</Real>
+    <Real>0.0016403538</Real>
+    <Real>0.0016394467</Real>
+    <Real>0.0016503835</Real>
+    <Real>0.001656802</Real>
+    <Real>0.0016618307</Real>
+    <Real>0.0016678922</Real>
+    <Real>0.0016689304</Real>
+    <Real>0.0016764619</Real>
+    <Real>0.0016659491</Real>
+    <Real>0.0016657002</Real>
+    <Real>0.0016543285</Real>
+    <Real>0.0016382602</Real>
+    <Real>0.001622049</Real>
+    <Real>0.0015983427</Real>
+    <Real>0.00157369</Real>
+    <Real>0.0015392378</Real>
+    <Real>0.0014979994</Real>
+    <Real>0.0014626513</Real>
+    <Real>0.0014293678</Real>
+    <Real>0.0013948255</Real>
+    <Real>0.001376386</Real>
+    <Real>0.0013290521</Real>
+    <Real>0.0013200026</Real>
+    <Real>0.0012772934</Real>
+    <Real>0.0012205912</Real>
+    <Real>0.0011777489</Real>
+    <Real>0.0011112116</Real>
+    <Real>0.0010400851</Real>
+    <Real>0.00094952446</Real>
+    <Real>0.00096428557</Real>
+  </Sequence>
+  <Real Name="Integral">240.60057076136582</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacNormal.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacNormal.xml
new file mode 100644 (file)
index 0000000..415cf1f
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.92333996</Real>
+    <Real>0.89544791</Real>
+    <Real>0.85506064</Real>
+    <Real>0.80770195</Real>
+    <Real>0.76355565</Real>
+    <Real>0.70085573</Real>
+    <Real>0.63575351</Real>
+    <Real>0.56621635</Real>
+    <Real>0.49021092</Real>
+    <Real>0.41346616</Real>
+    <Real>0.32695487</Real>
+    <Real>0.23947404</Real>
+    <Real>0.15114491</Real>
+    <Real>0.068911292</Real>
+    <Real>-0.018343732</Real>
+    <Real>-0.10222372</Real>
+    <Real>-0.17851034</Real>
+    <Real>-0.2556752</Real>
+    <Real>-0.33233142</Real>
+    <Real>-0.40906069</Real>
+    <Real>-0.47129509</Real>
+    <Real>-0.52546626</Real>
+    <Real>-0.577564</Real>
+    <Real>-0.62862134</Real>
+    <Real>-0.66793829</Real>
+    <Real>-0.70031446</Real>
+    <Real>-0.71649045</Real>
+    <Real>-0.73871797</Real>
+    <Real>-0.74570811</Real>
+    <Real>-0.75775838</Real>
+    <Real>-0.75111836</Real>
+    <Real>-0.73185968</Real>
+    <Real>-0.71327382</Real>
+    <Real>-0.68468153</Real>
+    <Real>-0.65119308</Real>
+    <Real>-0.60643828</Real>
+    <Real>-0.56428039</Real>
+    <Real>-0.52878588</Real>
+    <Real>-0.46647781</Real>
+    <Real>-0.40880191</Real>
+    <Real>-0.34746397</Real>
+    <Real>-0.28559166</Real>
+    <Real>-0.22607948</Real>
+    <Real>-0.15521984</Real>
+    <Real>-0.087527938</Real>
+    <Real>-0.021420239</Real>
+    <Real>0.042880654</Real>
+    <Real>0.10628833</Real>
+    <Real>0.169659</Real>
+    <Real>0.23284768</Real>
+    <Real>0.29287171</Real>
+    <Real>0.33996987</Real>
+    <Real>0.3846795</Real>
+    <Real>0.4326345</Real>
+    <Real>0.47152123</Real>
+    <Real>0.50605392</Real>
+    <Real>0.53039247</Real>
+    <Real>0.552634</Real>
+    <Real>0.57193202</Real>
+    <Real>0.57857972</Real>
+    <Real>0.58289105</Real>
+    <Real>0.5867179</Real>
+    <Real>0.57858908</Real>
+    <Real>0.57083881</Real>
+    <Real>0.54604369</Real>
+    <Real>0.52723479</Real>
+    <Real>0.50264382</Real>
+    <Real>0.4660213</Real>
+    <Real>0.42628899</Real>
+    <Real>0.38307241</Real>
+    <Real>0.33706102</Real>
+    <Real>0.29605037</Real>
+    <Real>0.25652972</Real>
+    <Real>0.20322086</Real>
+    <Real>0.15179904</Real>
+    <Real>0.1005994</Real>
+    <Real>0.053715136</Real>
+    <Real>-0.0024519849</Real>
+    <Real>-0.051181242</Real>
+    <Real>-0.098006107</Real>
+    <Real>-0.15021549</Real>
+    <Real>-0.19438037</Real>
+    <Real>-0.2419212</Real>
+    <Real>-0.28681141</Real>
+    <Real>-0.32269096</Real>
+    <Real>-0.35785615</Real>
+    <Real>-0.38878986</Real>
+    <Real>-0.41733515</Real>
+    <Real>-0.44138661</Real>
+    <Real>-0.44811302</Real>
+    <Real>-0.46269119</Real>
+    <Real>-0.46645734</Real>
+    <Real>-0.47144547</Real>
+    <Real>-0.47026828</Real>
+    <Real>-0.46132591</Real>
+    <Real>-0.44804862</Real>
+    <Real>-0.43905067</Real>
+    <Real>-0.41386977</Real>
+    <Real>-0.38871932</Real>
+    <Real>-0.36298344</Real>
+    <Real>-0.32728449</Real>
+    <Real>-0.28807318</Real>
+    <Real>-0.25138158</Real>
+    <Real>-0.20809993</Real>
+    <Real>-0.17095725</Real>
+    <Real>-0.13121751</Real>
+    <Real>-0.086369112</Real>
+    <Real>-0.040557165</Real>
+    <Real>0.0057886061</Real>
+    <Real>0.050152354</Real>
+    <Real>0.082554683</Real>
+    <Real>0.12262377</Real>
+    <Real>0.15991174</Real>
+    <Real>0.19901413</Real>
+    <Real>0.22433081</Real>
+    <Real>0.25093538</Real>
+    <Real>0.28274411</Real>
+    <Real>0.30066779</Real>
+    <Real>0.33021459</Real>
+    <Real>0.33629516</Real>
+    <Real>0.34645689</Real>
+    <Real>0.3629137</Real>
+    <Real>0.36620525</Real>
+    <Real>0.37430125</Real>
+    <Real>0.37234989</Real>
+    <Real>0.36795545</Real>
+    <Real>0.35466814</Real>
+    <Real>0.34249428</Real>
+    <Real>0.32283241</Real>
+    <Real>0.30485228</Real>
+    <Real>0.28708842</Real>
+    <Real>0.25817123</Real>
+    <Real>0.22833388</Real>
+    <Real>0.20199309</Real>
+    <Real>0.16451561</Real>
+    <Real>0.14491151</Real>
+    <Real>0.10192882</Real>
+    <Real>0.071294688</Real>
+    <Real>0.03886297</Real>
+    <Real>0.0038909942</Real>
+    <Real>-0.020299936</Real>
+    <Real>-0.055376183</Real>
+    <Real>-0.092676423</Real>
+    <Real>-0.12172776</Real>
+    <Real>-0.15591128</Real>
+    <Real>-0.17435807</Real>
+    <Real>-0.19855703</Real>
+    <Real>-0.21759604</Real>
+    <Real>-0.2342567</Real>
+    <Real>-0.2501609</Real>
+    <Real>-0.26639262</Real>
+    <Real>-0.27480033</Real>
+    <Real>-0.2769354</Real>
+    <Real>-0.28888217</Real>
+    <Real>-0.29434624</Real>
+    <Real>-0.29110822</Real>
+    <Real>-0.28738263</Real>
+    <Real>-0.27644756</Real>
+    <Real>-0.26865044</Real>
+    <Real>-0.26017156</Real>
+    <Real>-0.24633232</Real>
+    <Real>-0.22993366</Real>
+    <Real>-0.21036342</Real>
+    <Real>-0.19680807</Real>
+    <Real>-0.16794714</Real>
+    <Real>-0.14982072</Real>
+    <Real>-0.1253354</Real>
+    <Real>-0.091874786</Real>
+    <Real>-0.070614971</Real>
+    <Real>-0.043464452</Real>
+    <Real>-0.01496042</Real>
+    <Real>0.0054097059</Real>
+    <Real>0.039536409</Real>
+    <Real>0.058995754</Real>
+    <Real>0.087431222</Real>
+    <Real>0.10856776</Real>
+    <Real>0.12864889</Real>
+    <Real>0.14001396</Real>
+    <Real>0.15372792</Real>
+    <Real>0.16890197</Real>
+    <Real>0.1832682</Real>
+    <Real>0.19547278</Real>
+    <Real>0.20601526</Real>
+    <Real>0.22224233</Real>
+    <Real>0.22276327</Real>
+    <Real>0.22658545</Real>
+    <Real>0.22071175</Real>
+    <Real>0.21529464</Real>
+    <Real>0.21472976</Real>
+    <Real>0.20628634</Real>
+    <Real>0.2043854</Real>
+    <Real>0.20099047</Real>
+    <Real>0.18452412</Real>
+    <Real>0.17380331</Real>
+    <Real>0.15045828</Real>
+    <Real>0.13115592</Real>
+    <Real>0.1251017</Real>
+    <Real>0.10887553</Real>
+    <Real>0.079097189</Real>
+    <Real>0.061385516</Real>
+    <Real>0.043582208</Real>
+    <Real>0.026112026</Real>
+    <Real>0.01028904</Real>
+    <Real>-0.011082372</Real>
+    <Real>-0.031485982</Real>
+    <Real>-0.055357713</Real>
+    <Real>-0.075118855</Real>
+    <Real>-0.088119961</Real>
+    <Real>-0.098915316</Real>
+    <Real>-0.11735611</Real>
+    <Real>-0.12887773</Real>
+    <Real>-0.14123638</Real>
+    <Real>-0.1465044</Real>
+    <Real>-0.16701357</Real>
+    <Real>-0.16918446</Real>
+    <Real>-0.17741001</Real>
+    <Real>-0.18355082</Real>
+    <Real>-0.17439707</Real>
+    <Real>-0.17841232</Real>
+    <Real>-0.16846335</Real>
+    <Real>-0.16889346</Real>
+    <Real>-0.17227842</Real>
+    <Real>-0.17070685</Real>
+    <Real>-0.15092036</Real>
+    <Real>-0.15334848</Real>
+    <Real>-0.12954405</Real>
+    <Real>-0.11295433</Real>
+    <Real>-0.09564729</Real>
+    <Real>-0.080270432</Real>
+    <Real>-0.06479656</Real>
+    <Real>-0.055495787</Real>
+    <Real>-0.03828676</Real>
+    <Real>-0.026680976</Real>
+    <Real>-0.0092150476</Real>
+    <Real>-0.0018779703</Real>
+    <Real>0.014258126</Real>
+    <Real>0.023644734</Real>
+    <Real>0.040185757</Real>
+    <Real>0.050761189</Real>
+    <Real>0.060287103</Real>
+    <Real>0.065608293</Real>
+    <Real>0.080362737</Real>
+    <Real>0.083356142</Real>
+    <Real>0.10414003</Real>
+    <Real>0.11332227</Real>
+    <Real>0.12000805</Real>
+    <Real>0.12286837</Real>
+    <Real>0.13463314</Real>
+    <Real>0.14336015</Real>
+    <Real>0.15017572</Real>
+    <Real>1.6947948e-05</Real>
+    <Real>1.720169e-05</Real>
+    <Real>1.6974916e-05</Real>
+    <Real>1.6350099e-05</Real>
+    <Real>1.6009559e-05</Real>
+    <Real>1.4935715e-05</Real>
+    <Real>1.4739877e-05</Real>
+    <Real>1.3568673e-05</Real>
+    <Real>1.1884022e-05</Real>
+    <Real>1.2356072e-05</Real>
+    <Real>1.0829273e-05</Real>
+    <Real>8.1364569e-06</Real>
+    <Real>7.3827168e-06</Real>
+    <Real>5.0695448e-06</Real>
+    <Real>4.5629454e-06</Real>
+    <Real>2.6695732e-06</Real>
+    <Real>1.858061e-06</Real>
+    <Real>-7.2692512e-07</Real>
+    <Real>-2.3541625e-06</Real>
+    <Real>-4.3265563e-06</Real>
+    <Real>-4.8195097e-06</Real>
+    <Real>-6.7002338e-06</Real>
+    <Real>-7.7089944e-06</Real>
+    <Real>-9.5448968e-06</Real>
+    <Real>-1.0355448e-05</Real>
+    <Real>-1.1747778e-05</Real>
+    <Real>-1.1522758e-05</Real>
+    <Real>-1.2354542e-05</Real>
+    <Real>-1.2857619e-05</Real>
+    <Real>-1.2877535e-05</Real>
+    <Real>-1.2482141e-05</Real>
+    <Real>-1.186068e-05</Real>
+    <Real>-1.2711519e-05</Real>
+    <Real>-1.2115619e-05</Real>
+    <Real>-1.2809192e-05</Real>
+    <Real>-1.266307e-05</Real>
+    <Real>-1.2433168e-05</Real>
+    <Real>-1.1129104e-05</Real>
+    <Real>-1.1863392e-05</Real>
+    <Real>-1.0522874e-05</Real>
+    <Real>-1.081662e-05</Real>
+    <Real>-9.6362273e-06</Real>
+    <Real>-8.5478041e-06</Real>
+    <Real>-7.0708343e-06</Real>
+    <Real>-6.063261e-06</Real>
+    <Real>-4.2370298e-06</Real>
+    <Real>-4.242017e-06</Real>
+    <Real>-3.9379211e-06</Real>
+    <Real>-2.6455057e-06</Real>
+    <Real>-1.8623408e-06</Real>
+    <Real>-1.7964911e-07</Real>
+    <Real>-3.1073461e-07</Real>
+    <Real>7.3710947e-07</Real>
+    <Real>2.2396036e-06</Real>
+    <Real>3.2355663e-06</Real>
+    <Real>4.1354356e-06</Real>
+    <Real>4.9965174e-06</Real>
+    <Real>6.2143517e-06</Real>
+    <Real>7.0087376e-06</Real>
+    <Real>7.9398487e-06</Real>
+    <Real>9.170898e-06</Real>
+    <Real>8.7619237e-06</Real>
+    <Real>8.1867083e-06</Real>
+    <Real>8.5060901e-06</Real>
+    <Real>1.0517992e-05</Real>
+    <Real>1.0658181e-05</Real>
+    <Real>1.1446352e-05</Real>
+    <Real>1.1257342e-05</Real>
+    <Real>1.0835259e-05</Real>
+    <Real>1.072865e-05</Real>
+    <Real>9.7357661e-06</Real>
+    <Real>9.4389143e-06</Real>
+    <Real>8.8261058e-06</Real>
+    <Real>8.7821072e-06</Real>
+    <Real>9.2549853e-06</Real>
+    <Real>7.5013804e-06</Real>
+    <Real>7.9371293e-06</Real>
+    <Real>6.941314e-06</Real>
+    <Real>5.6119507e-06</Real>
+    <Real>4.2042116e-06</Real>
+    <Real>1.5770001e-06</Real>
+    <Real>7.5386652e-07</Real>
+    <Real>8.054601e-07</Real>
+    <Real>-3.8413035e-07</Real>
+    <Real>-2.7380775e-06</Real>
+    <Real>-3.8733256e-06</Real>
+    <Real>-4.4854164e-06</Real>
+    <Real>-5.4874358e-06</Real>
+    <Real>-7.7627155e-06</Real>
+    <Real>-8.8810702e-06</Real>
+    <Real>-9.6242529e-06</Real>
+    <Real>-1.0713777e-05</Real>
+    <Real>-9.7594111e-06</Real>
+    <Real>-9.1061747e-06</Real>
+    <Real>-9.9740464e-06</Real>
+    <Real>-9.1629045e-06</Real>
+    <Real>-9.3594572e-06</Real>
+    <Real>-1.1867382e-05</Real>
+    <Real>-1.2593795e-05</Real>
+    <Real>-1.108304e-05</Real>
+    <Real>-1.1341308e-05</Real>
+    <Real>-9.0508356e-06</Real>
+    <Real>-1.0283045e-05</Real>
+    <Real>-7.9569845e-06</Real>
+    <Real>-6.1125238e-06</Real>
+    <Real>-5.6901622e-06</Real>
+    <Real>-3.8499225e-06</Real>
+    <Real>-5.0997382e-06</Real>
+    <Real>-2.6763032e-06</Real>
+    <Real>-6.1861641e-07</Real>
+    <Real>5.3073882e-07</Real>
+    <Real>1.6471934e-06</Real>
+    <Real>1.2461007e-06</Real>
+    <Real>1.3127881e-06</Real>
+    <Real>1.6117941e-06</Real>
+    <Real>3.1619384e-06</Real>
+    <Real>2.479977e-06</Real>
+    <Real>3.9845995e-06</Real>
+    <Real>5.5477849e-06</Real>
+    <Real>6.7357323e-06</Real>
+    <Real>6.96196e-06</Real>
+    <Real>8.1697226e-06</Real>
+    <Real>7.3396232e-06</Real>
+    <Real>9.1672227e-06</Real>
+    <Real>9.2835489e-06</Real>
+    <Real>7.8686735e-06</Real>
+    <Real>9.2934297e-06</Real>
+    <Real>9.3312292e-06</Real>
+    <Real>1.0179395e-05</Real>
+    <Real>9.534755e-06</Real>
+    <Real>7.9119627e-06</Real>
+    <Real>8.8005272e-06</Real>
+    <Real>7.683404e-06</Real>
+    <Real>6.0959087e-06</Real>
+    <Real>5.5420546e-06</Real>
+    <Real>5.3878371e-06</Real>
+    <Real>3.0048875e-06</Real>
+    <Real>2.3013924e-06</Real>
+    <Real>2.1645042e-06</Real>
+    <Real>-1.686885e-07</Real>
+    <Real>1.1400354e-06</Real>
+    <Real>8.5925473e-07</Real>
+    <Real>-9.5177079e-08</Real>
+    <Real>-4.9476733e-07</Real>
+    <Real>1.9566522e-07</Real>
+    <Real>-5.2322918e-07</Real>
+    <Real>1.5911113e-06</Real>
+    <Real>-2.2981799e-07</Real>
+    <Real>-1.546277e-06</Real>
+    <Real>-2.5809338e-06</Real>
+    <Real>-2.1874198e-06</Real>
+    <Real>-2.8447707e-06</Real>
+    <Real>-6.003168e-06</Real>
+    <Real>-7.5685598e-06</Real>
+    <Real>-7.4805835e-06</Real>
+    <Real>-9.8007476e-06</Real>
+    <Real>-7.5790431e-06</Real>
+    <Real>-1.0517209e-05</Real>
+    <Real>-9.3698382e-06</Real>
+    <Real>-6.0820844e-06</Real>
+    <Real>-4.513266e-06</Real>
+    <Real>-6.1426217e-06</Real>
+    <Real>-6.0664988e-06</Real>
+    <Real>-5.9408303e-06</Real>
+    <Real>-7.6888364e-06</Real>
+    <Real>-5.7454145e-06</Real>
+    <Real>-6.4514843e-06</Real>
+    <Real>-2.5307936e-06</Real>
+    <Real>-7.7979479e-07</Real>
+    <Real>-4.4557851e-07</Real>
+    <Real>5.4281566e-07</Real>
+    <Real>-1.0177969e-06</Real>
+    <Real>6.5963206e-07</Real>
+    <Real>2.0811055e-06</Real>
+    <Real>-2.8522754e-07</Real>
+    <Real>-6.4073208e-07</Real>
+    <Real>-2.8998365e-06</Real>
+    <Real>-1.901788e-06</Real>
+    <Real>-1.4455151e-06</Real>
+    <Real>-2.8910372e-07</Real>
+    <Real>-1.1323684e-06</Real>
+    <Real>-1.4292134e-06</Real>
+    <Real>5.0386113e-08</Real>
+    <Real>1.6381324e-06</Real>
+    <Real>-2.2276123e-07</Real>
+    <Real>-2.6079434e-07</Real>
+    <Real>8.866005e-07</Real>
+    <Real>-6.5319233e-07</Real>
+    <Real>3.4602701e-06</Real>
+    <Real>-1.2270907e-07</Real>
+    <Real>2.7422018e-06</Real>
+    <Real>4.2824836e-06</Real>
+    <Real>2.1185413e-06</Real>
+    <Real>4.1770027e-06</Real>
+    <Real>2.8447578e-06</Real>
+    <Real>6.3908592e-06</Real>
+    <Real>7.3948709e-06</Real>
+    <Real>8.2409342e-06</Real>
+    <Real>9.704383e-06</Real>
+    <Real>8.35023e-06</Real>
+    <Real>9.6003869e-06</Real>
+    <Real>9.2930559e-06</Real>
+    <Real>6.1146638e-06</Real>
+    <Real>3.3621252e-06</Real>
+    <Real>-9.8457065e-07</Real>
+    <Real>-1.8718846e-06</Real>
+    <Real>3.0094341e-07</Real>
+    <Real>4.6674396e-07</Real>
+    <Real>4.4797812e-07</Real>
+    <Real>-1.0786407e-06</Real>
+    <Real>-7.5938456e-06</Real>
+    <Real>-1.1059399e-05</Real>
+    <Real>-8.3233581e-06</Real>
+    <Real>-3.8355511e-06</Real>
+    <Real>-2.1474427e-06</Real>
+    <Real>-5.2963392e-06</Real>
+    <Real>-7.1621521e-06</Real>
+    <Real>-6.4974288e-06</Real>
+    <Real>-2.2986844e-06</Real>
+    <Real>-1.416352e-06</Real>
+    <Real>-2.1892388e-06</Real>
+    <Real>-7.1828599e-06</Real>
+    <Real>-2.4088042e-06</Real>
+    <Real>3.2049647e-06</Real>
+    <Real>7.2408707e-06</Real>
+    <Real>7.6889664e-06</Real>
+    <Real>8.6848986e-06</Real>
+    <Real>2.0444573e-05</Real>
+    <Real>1.4390439e-05</Real>
+    <Real>2.2760736e-05</Real>
+    <Real>2.4064513e-05</Real>
+    <Real>2.2546323e-05</Real>
+    <Real>2.7139242e-05</Real>
+    <Real>2.466367e-05</Real>
+    <Real>2.6582289e-05</Real>
+    <Real>1.9750434e-05</Real>
+    <Real>9.4496218e-06</Real>
+    <Real>6.6170951e-06</Real>
+    <Real>1.0806426e-05</Real>
+    <Real>7.6765937e-06</Real>
+    <Real>1.8425069e-05</Real>
+    <Real>1.2401573e-05</Real>
+    <Real>3.9162929e-05</Real>
+    <Real>2.2949267e-05</Real>
+    <Real>-6.7865421e-06</Real>
+    <Real>-1.1479357e-05</Real>
+    <Real>-5.3619879e-05</Real>
+    <Real>-0.00011380042</Real>
+    <Real>-0.00016269117</Real>
+    <Real>-0.00016905692</Real>
+  </Sequence>
+  <Real Name="Integral">0.049695708357404555</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP0.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP0.xml
new file mode 100644 (file)
index 0000000..d318d51
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.91440845</Real>
+    <Real>0.89127165</Real>
+    <Real>0.85387266</Real>
+    <Real>0.81370103</Real>
+    <Real>0.7681002</Real>
+    <Real>0.70884496</Real>
+    <Real>0.65127754</Real>
+    <Real>0.58396322</Real>
+    <Real>0.50845456</Real>
+    <Real>0.43051061</Real>
+    <Real>0.35105249</Real>
+    <Real>0.26587203</Real>
+    <Real>0.18143819</Real>
+    <Real>0.097567506</Real>
+    <Real>0.015512385</Real>
+    <Real>-0.068423927</Real>
+    <Real>-0.1456465</Real>
+    <Real>-0.22284648</Real>
+    <Real>-0.29907748</Real>
+    <Real>-0.37475094</Real>
+    <Real>-0.4380517</Real>
+    <Real>-0.49662268</Real>
+    <Real>-0.55154026</Real>
+    <Real>-0.60047692</Real>
+    <Real>-0.64397019</Real>
+    <Real>-0.67695993</Real>
+    <Real>-0.69747227</Real>
+    <Real>-0.71946371</Real>
+    <Real>-0.73064023</Real>
+    <Real>-0.73969084</Real>
+    <Real>-0.73910058</Real>
+    <Real>-0.72273451</Real>
+    <Real>-0.70480442</Real>
+    <Real>-0.68460542</Real>
+    <Real>-0.65121585</Real>
+    <Real>-0.61127657</Real>
+    <Real>-0.56959647</Real>
+    <Real>-0.53186774</Real>
+    <Real>-0.47233477</Real>
+    <Real>-0.42289308</Real>
+    <Real>-0.36013916</Real>
+    <Real>-0.30238953</Real>
+    <Real>-0.23851043</Real>
+    <Real>-0.17228492</Real>
+    <Real>-0.10760929</Real>
+    <Real>-0.038677685</Real>
+    <Real>0.023924842</Real>
+    <Real>0.085734844</Real>
+    <Real>0.14554502</Real>
+    <Real>0.21178007</Real>
+    <Real>0.26366264</Real>
+    <Real>0.31547186</Real>
+    <Real>0.36479235</Real>
+    <Real>0.41372058</Real>
+    <Real>0.45014268</Real>
+    <Real>0.48719069</Real>
+    <Real>0.51477271</Real>
+    <Real>0.54144377</Real>
+    <Real>0.55743951</Real>
+    <Real>0.56827539</Real>
+    <Real>0.57417756</Real>
+    <Real>0.57521474</Real>
+    <Real>0.57242984</Real>
+    <Real>0.56181103</Real>
+    <Real>0.54661202</Real>
+    <Real>0.5273785</Real>
+    <Real>0.49807823</Real>
+    <Real>0.46791199</Real>
+    <Real>0.43094185</Real>
+    <Real>0.39116937</Real>
+    <Real>0.34865311</Real>
+    <Real>0.30475527</Real>
+    <Real>0.26447845</Real>
+    <Real>0.20973703</Real>
+    <Real>0.16015707</Real>
+    <Real>0.10805874</Real>
+    <Real>0.059454329</Real>
+    <Real>0.0076480238</Real>
+    <Real>-0.045675594</Real>
+    <Real>-0.089126058</Real>
+    <Real>-0.14246953</Real>
+    <Real>-0.18825532</Real>
+    <Real>-0.22974341</Real>
+    <Real>-0.27582318</Real>
+    <Real>-0.30692092</Real>
+    <Real>-0.34222001</Real>
+    <Real>-0.37205994</Real>
+    <Real>-0.39867413</Real>
+    <Real>-0.42049485</Real>
+    <Real>-0.43268493</Real>
+    <Real>-0.446363</Real>
+    <Real>-0.45471677</Real>
+    <Real>-0.45743033</Real>
+    <Real>-0.45754004</Real>
+    <Real>-0.44663361</Real>
+    <Real>-0.43691492</Real>
+    <Real>-0.42143744</Real>
+    <Real>-0.39964595</Real>
+    <Real>-0.37948313</Real>
+    <Real>-0.35078076</Real>
+    <Real>-0.32291207</Real>
+    <Real>-0.28617722</Real>
+    <Real>-0.25431877</Real>
+    <Real>-0.21413048</Real>
+    <Real>-0.17472994</Real>
+    <Real>-0.13722105</Real>
+    <Real>-0.0940689</Real>
+    <Real>-0.050582096</Real>
+    <Real>-0.011372223</Real>
+    <Real>0.033095215</Real>
+    <Real>0.064681761</Real>
+    <Real>0.10605592</Real>
+    <Real>0.13676096</Real>
+    <Real>0.17619975</Real>
+    <Real>0.20634755</Real>
+    <Real>0.23424256</Real>
+    <Real>0.26192936</Real>
+    <Real>0.28315401</Real>
+    <Real>0.31159228</Real>
+    <Real>0.32296148</Real>
+    <Real>0.3337082</Real>
+    <Real>0.3472271</Real>
+    <Real>0.35520938</Real>
+    <Real>0.35884556</Real>
+    <Real>0.35598138</Real>
+    <Real>0.36070585</Real>
+    <Real>0.34978899</Real>
+    <Real>0.33616209</Real>
+    <Real>0.32133636</Real>
+    <Real>0.30463791</Real>
+    <Real>0.28434399</Real>
+    <Real>0.26060301</Real>
+    <Real>0.23513913</Real>
+    <Real>0.21211421</Real>
+    <Real>0.18200785</Real>
+    <Real>0.15506685</Real>
+    <Real>0.11292174</Real>
+    <Real>0.08485233</Real>
+    <Real>0.048554849</Real>
+    <Real>0.015430034</Real>
+    <Real>-0.0053237719</Real>
+    <Real>-0.043886948</Real>
+    <Real>-0.069251105</Real>
+    <Real>-0.099874027</Real>
+    <Real>-0.1318848</Real>
+    <Real>-0.15587749</Real>
+    <Real>-0.18213047</Real>
+    <Real>-0.19872877</Real>
+    <Real>-0.22116253</Real>
+    <Real>-0.23839074</Real>
+    <Real>-0.24964274</Real>
+    <Real>-0.25999296</Real>
+    <Real>-0.26915544</Real>
+    <Real>-0.28208914</Real>
+    <Real>-0.28375041</Real>
+    <Real>-0.2840305</Real>
+    <Real>-0.28654379</Real>
+    <Real>-0.27391881</Real>
+    <Real>-0.26717883</Real>
+    <Real>-0.25783545</Real>
+    <Real>-0.24391536</Real>
+    <Real>-0.23143035</Real>
+    <Real>-0.21355876</Real>
+    <Real>-0.19516303</Real>
+    <Real>-0.17305651</Real>
+    <Real>-0.14851433</Real>
+    <Real>-0.13391782</Real>
+    <Real>-0.10106573</Real>
+    <Real>-0.079669952</Real>
+    <Real>-0.054322001</Real>
+    <Real>-0.022567146</Real>
+    <Real>-0.0082916291</Real>
+    <Real>0.028239559</Real>
+    <Real>0.044842608</Real>
+    <Real>0.066723041</Real>
+    <Real>0.086818486</Real>
+    <Real>0.11206019</Real>
+    <Real>0.13034853</Real>
+    <Real>0.14292336</Real>
+    <Real>0.16384037</Real>
+    <Real>0.17437287</Real>
+    <Real>0.19422586</Real>
+    <Real>0.19642359</Real>
+    <Real>0.20773162</Real>
+    <Real>0.21621291</Real>
+    <Real>0.22017281</Real>
+    <Real>0.21870746</Real>
+    <Real>0.22144818</Real>
+    <Real>0.21968257</Real>
+    <Real>0.21284904</Real>
+    <Real>0.20909898</Real>
+    <Real>0.20217142</Real>
+    <Real>0.19360588</Real>
+    <Real>0.18018678</Real>
+    <Real>0.16507152</Real>
+    <Real>0.14102207</Real>
+    <Real>0.13159586</Real>
+    <Real>0.11218439</Real>
+    <Real>0.090035476</Real>
+    <Real>0.069503993</Real>
+    <Real>0.054288179</Real>
+    <Real>0.034861948</Real>
+    <Real>0.013234816</Real>
+    <Real>-0.0047988398</Real>
+    <Real>-0.024740862</Real>
+    <Real>-0.042112309</Real>
+    <Real>-0.057106286</Real>
+    <Real>-0.079133794</Real>
+    <Real>-0.08531253</Real>
+    <Real>-0.10183473</Real>
+    <Real>-0.11679</Real>
+    <Real>-0.13124378</Real>
+    <Real>-0.13978031</Real>
+    <Real>-0.15192363</Real>
+    <Real>-0.15962306</Real>
+    <Real>-0.16721499</Real>
+    <Real>-0.17583407</Real>
+    <Real>-0.17053062</Real>
+    <Real>-0.17783985</Real>
+    <Real>-0.17420124</Real>
+    <Real>-0.16439037</Real>
+    <Real>-0.16967009</Real>
+    <Real>-0.16545986</Real>
+    <Real>-0.15178227</Real>
+    <Real>-0.1513456</Real>
+    <Real>-0.13972749</Real>
+    <Real>-0.12844835</Real>
+    <Real>-0.11278458</Real>
+    <Real>-0.10008006</Real>
+    <Real>-0.084673822</Real>
+    <Real>-0.071988769</Real>
+    <Real>-0.055301242</Real>
+    <Real>-0.044846795</Real>
+    <Real>-0.024612129</Real>
+    <Real>-0.012670649</Real>
+    <Real>0.0064235702</Real>
+    <Real>0.017517105</Real>
+    <Real>0.032193232</Real>
+    <Real>0.05088919</Real>
+    <Real>0.059888519</Real>
+    <Real>0.073218867</Real>
+    <Real>0.084005043</Real>
+    <Real>0.097417012</Real>
+    <Real>0.11064502</Real>
+    <Real>0.11908618</Real>
+    <Real>0.12669091</Real>
+    <Real>0.12785465</Real>
+    <Real>0.13891017</Real>
+    <Real>0.14016822</Real>
+    <Real>0.15007298</Real>
+    <Real>4.4267403e-05</Real>
+    <Real>4.3514352e-05</Real>
+    <Real>4.3138727e-05</Real>
+    <Real>4.1891646e-05</Real>
+    <Real>4.0179297e-05</Real>
+    <Real>3.8032213e-05</Real>
+    <Real>3.7556416e-05</Real>
+    <Real>3.5218971e-05</Real>
+    <Real>3.1478037e-05</Real>
+    <Real>3.0895699e-05</Real>
+    <Real>2.615025e-05</Real>
+    <Real>2.0906495e-05</Real>
+    <Real>1.7488654e-05</Real>
+    <Real>1.3209424e-05</Real>
+    <Real>9.7491848e-06</Real>
+    <Real>6.3581501e-06</Real>
+    <Real>5.6303825e-06</Real>
+    <Real>-5.1143962e-07</Real>
+    <Real>-4.6430905e-06</Real>
+    <Real>-8.4661779e-06</Real>
+    <Real>-1.0448402e-05</Real>
+    <Real>-1.6193704e-05</Real>
+    <Real>-1.857411e-05</Real>
+    <Real>-2.250258e-05</Real>
+    <Real>-2.3523124e-05</Real>
+    <Real>-2.7104035e-05</Real>
+    <Real>-2.8832133e-05</Real>
+    <Real>-2.9649824e-05</Real>
+    <Real>-3.12257e-05</Real>
+    <Real>-3.2669741e-05</Real>
+    <Real>-3.3304954e-05</Real>
+    <Real>-3.3183347e-05</Real>
+    <Real>-3.4332639e-05</Real>
+    <Real>-3.3677767e-05</Real>
+    <Real>-3.4504159e-05</Real>
+    <Real>-3.454684e-05</Real>
+    <Real>-3.2467542e-05</Real>
+    <Real>-2.9868665e-05</Real>
+    <Real>-2.9505636e-05</Real>
+    <Real>-2.6500937e-05</Real>
+    <Real>-2.6333106e-05</Real>
+    <Real>-2.3109949e-05</Real>
+    <Real>-2.140675e-05</Real>
+    <Real>-1.6538143e-05</Real>
+    <Real>-1.4951454e-05</Real>
+    <Real>-1.0329346e-05</Real>
+    <Real>-8.6922209e-06</Real>
+    <Real>-6.4748251e-06</Real>
+    <Real>-2.4234089e-06</Real>
+    <Real>2.1927521e-07</Real>
+    <Real>2.7016404e-06</Real>
+    <Real>3.5660794e-06</Real>
+    <Real>6.7710325e-06</Real>
+    <Real>1.154716e-05</Real>
+    <Real>1.27539e-05</Real>
+    <Real>1.4957743e-05</Real>
+    <Real>1.8768704e-05</Real>
+    <Real>1.983804e-05</Real>
+    <Real>2.258397e-05</Real>
+    <Real>2.3245073e-05</Real>
+    <Real>2.5949555e-05</Real>
+    <Real>2.7714603e-05</Real>
+    <Real>2.4125953e-05</Real>
+    <Real>2.7313827e-05</Real>
+    <Real>2.6500267e-05</Real>
+    <Real>2.8872726e-05</Real>
+    <Real>2.8494722e-05</Real>
+    <Real>2.8652294e-05</Real>
+    <Real>2.6291838e-05</Real>
+    <Real>2.3836281e-05</Real>
+    <Real>2.2856551e-05</Real>
+    <Real>2.24215e-05</Real>
+    <Real>2.2928167e-05</Real>
+    <Real>2.0600462e-05</Real>
+    <Real>2.1569322e-05</Real>
+    <Real>1.8669114e-05</Real>
+    <Real>1.6274531e-05</Real>
+    <Real>1.3573073e-05</Real>
+    <Real>1.2755655e-05</Real>
+    <Real>9.1842421e-06</Real>
+    <Real>4.9424475e-06</Real>
+    <Real>1.9999163e-06</Real>
+    <Real>1.2401867e-06</Real>
+    <Real>-3.0244464e-06</Real>
+    <Real>-7.6198962e-06</Real>
+    <Real>-9.8329774e-06</Real>
+    <Real>-8.8280267e-06</Real>
+    <Real>-1.377236e-05</Real>
+    <Real>-1.6982995e-05</Real>
+    <Real>-1.9108473e-05</Real>
+    <Real>-2.0853575e-05</Real>
+    <Real>-2.3638708e-05</Real>
+    <Real>-2.4330864e-05</Real>
+    <Real>-2.3607576e-05</Real>
+    <Real>-2.3350785e-05</Real>
+    <Real>-2.4861311e-05</Real>
+    <Real>-2.4024377e-05</Real>
+    <Real>-2.7649214e-05</Real>
+    <Real>-3.0116586e-05</Real>
+    <Real>-2.7083521e-05</Real>
+    <Real>-2.6461454e-05</Real>
+    <Real>-2.5706378e-05</Real>
+    <Real>-2.3319637e-05</Real>
+    <Real>-2.2089596e-05</Real>
+    <Real>-1.7878658e-05</Real>
+    <Real>-1.7124203e-05</Real>
+    <Real>-1.5375375e-05</Real>
+    <Real>-1.5521959e-05</Real>
+    <Real>-1.172509e-05</Real>
+    <Real>-9.1009997e-06</Real>
+    <Real>-5.6435597e-06</Real>
+    <Real>-2.9174676e-06</Real>
+    <Real>-5.4268908e-06</Real>
+    <Real>-1.5508874e-06</Real>
+    <Real>-3.7975212e-07</Real>
+    <Real>3.1173399e-06</Real>
+    <Real>1.9381382e-06</Real>
+    <Real>5.5445184e-06</Real>
+    <Real>6.774098e-06</Real>
+    <Real>8.9054111e-06</Real>
+    <Real>1.0997211e-05</Real>
+    <Real>1.4307585e-05</Real>
+    <Real>1.3101091e-05</Real>
+    <Real>1.5396869e-05</Real>
+    <Real>1.3836742e-05</Real>
+    <Real>1.4298585e-05</Real>
+    <Real>1.65646e-05</Real>
+    <Real>1.5446933e-05</Real>
+    <Real>1.9028628e-05</Real>
+    <Real>2.0577343e-05</Real>
+    <Real>1.6241767e-05</Real>
+    <Real>1.6588914e-05</Real>
+    <Real>1.6793663e-05</Real>
+    <Real>1.5231977e-05</Real>
+    <Real>1.3574629e-05</Real>
+    <Real>1.3824551e-05</Real>
+    <Real>1.3580589e-05</Real>
+    <Real>8.8718243e-06</Real>
+    <Real>8.9766982e-06</Real>
+    <Real>4.874571e-06</Real>
+    <Real>6.1740734e-06</Real>
+    <Real>4.3778728e-06</Real>
+    <Real>3.0633016e-06</Real>
+    <Real>2.650128e-06</Real>
+    <Real>4.4499197e-06</Real>
+    <Real>5.2487553e-07</Real>
+    <Real>3.844505e-06</Real>
+    <Real>8.3970571e-07</Real>
+    <Real>-4.0378814e-06</Real>
+    <Real>-4.2863321e-06</Real>
+    <Real>-3.9477163e-06</Real>
+    <Real>-5.5808941e-06</Real>
+    <Real>-8.159157e-06</Real>
+    <Real>-1.07823e-05</Real>
+    <Real>-1.0445928e-05</Real>
+    <Real>-1.4758529e-05</Real>
+    <Real>-1.5891597e-05</Real>
+    <Real>-1.6962238e-05</Real>
+    <Real>-1.6818865e-05</Real>
+    <Real>-1.3153352e-05</Real>
+    <Real>-1.3562746e-05</Real>
+    <Real>-1.536158e-05</Real>
+    <Real>-1.6916658e-05</Real>
+    <Real>-1.5912401e-05</Real>
+    <Real>-1.9311357e-05</Real>
+    <Real>-1.3812277e-05</Real>
+    <Real>-1.7308477e-05</Real>
+    <Real>-1.1393254e-05</Real>
+    <Real>-6.9415369e-06</Real>
+    <Real>-8.5329793e-06</Real>
+    <Real>-7.3732735e-06</Real>
+    <Real>-8.2779943e-06</Real>
+    <Real>-4.1989624e-06</Real>
+    <Real>-4.0598088e-06</Real>
+    <Real>-6.2781332e-06</Real>
+    <Real>-6.1900923e-06</Real>
+    <Real>-9.3725657e-06</Real>
+    <Real>-9.9827339e-06</Real>
+    <Real>-9.6235508e-06</Real>
+    <Real>-4.7038488e-06</Real>
+    <Real>-3.4777854e-06</Real>
+    <Real>-2.7908015e-06</Real>
+    <Real>1.7161137e-06</Real>
+    <Real>2.1103369e-06</Real>
+    <Real>1.6298396e-06</Real>
+    <Real>5.1353272e-06</Real>
+    <Real>9.7297398e-06</Real>
+    <Real>7.9292831e-06</Real>
+    <Real>1.0491432e-05</Real>
+    <Real>8.7098369e-06</Real>
+    <Real>1.1306504e-05</Real>
+    <Real>1.2767204e-05</Real>
+    <Real>1.0523996e-05</Real>
+    <Real>1.5876185e-05</Real>
+    <Real>1.8240517e-05</Real>
+    <Real>1.7410239e-05</Real>
+    <Real>1.8709565e-05</Real>
+    <Real>2.0682788e-05</Real>
+    <Real>2.2414559e-05</Real>
+    <Real>2.3641453e-05</Real>
+    <Real>2.9956356e-05</Real>
+    <Real>3.1942258e-05</Real>
+    <Real>3.2165972e-05</Real>
+    <Real>2.3073231e-05</Real>
+    <Real>2.1864589e-05</Real>
+    <Real>2.3307522e-05</Real>
+    <Real>2.6105658e-05</Real>
+    <Real>3.0764437e-05</Real>
+    <Real>2.5258372e-05</Real>
+    <Real>2.4398061e-05</Real>
+    <Real>1.5440721e-05</Real>
+    <Real>7.2866023e-06</Real>
+    <Real>4.1072926e-06</Real>
+    <Real>1.3465999e-05</Real>
+    <Real>9.5875193e-06</Real>
+    <Real>3.303629e-06</Real>
+    <Real>-9.6435542e-06</Real>
+    <Real>-1.4834303e-05</Real>
+    <Real>-1.3345806e-05</Real>
+    <Real>-1.2496928e-05</Real>
+    <Real>-1.2373329e-05</Real>
+    <Real>-1.9174164e-05</Real>
+    <Real>-2.2750348e-05</Real>
+    <Real>-1.0412362e-05</Real>
+    <Real>-7.1453283e-06</Real>
+    <Real>-5.0996732e-06</Real>
+    <Real>-1.4278352e-06</Real>
+    <Real>1.091708e-05</Real>
+    <Real>6.6890452e-06</Real>
+    <Real>2.0174368e-05</Real>
+    <Real>1.0472003e-05</Real>
+    <Real>4.7418193e-06</Real>
+    <Real>9.2978889e-06</Real>
+    <Real>4.5979341e-06</Real>
+    <Real>1.164395e-05</Real>
+    <Real>-1.1824308e-05</Real>
+    <Real>-1.2670253e-05</Real>
+    <Real>-7.1008421e-06</Real>
+    <Real>4.0426371e-06</Real>
+    <Real>9.691882e-06</Real>
+    <Real>3.4888384e-05</Real>
+    <Real>2.3447481e-05</Real>
+    <Real>6.0634087e-05</Real>
+    <Real>4.6600537e-05</Real>
+    <Real>3.8806083e-05</Real>
+    <Real>4.0546623e-05</Real>
+    <Real>5.6960853e-05</Real>
+    <Real>1.7836719e-05</Real>
+    <Real>-8.4526189e-05</Real>
+    <Real>-0.00019142308</Real>
+  </Sequence>
+  <Real Name="Integral">0.54968381075777017</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP1.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP1.xml
new file mode 100644 (file)
index 0000000..f02426b
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.47994247</Real>
+    <Real>0.48478529</Real>
+    <Real>0.42015755</Real>
+    <Real>0.43633738</Real>
+    <Real>0.40917483</Real>
+    <Real>0.36798882</Real>
+    <Real>0.33975855</Real>
+    <Real>0.33914748</Real>
+    <Real>0.24553728</Real>
+    <Real>0.23165418</Real>
+    <Real>0.19017372</Real>
+    <Real>0.15800953</Real>
+    <Real>0.12168649</Real>
+    <Real>0.059838008</Real>
+    <Real>0.035983752</Real>
+    <Real>-0.0061296029</Real>
+    <Real>-0.027875844</Real>
+    <Real>-0.091517158</Real>
+    <Real>-0.13541557</Real>
+    <Real>-0.19742206</Real>
+    <Real>-0.22613534</Real>
+    <Real>-0.25163805</Real>
+    <Real>-0.28906253</Real>
+    <Real>-0.34219807</Real>
+    <Real>-0.39520577</Real>
+    <Real>-0.40806535</Real>
+    <Real>-0.38800871</Real>
+    <Real>-0.41812003</Real>
+    <Real>-0.39130437</Real>
+    <Real>-0.47249088</Real>
+    <Real>-0.50039351</Real>
+    <Real>-0.47069913</Real>
+    <Real>-0.44109708</Real>
+    <Real>-0.44801748</Real>
+    <Real>-0.44286934</Real>
+    <Real>-0.40633747</Real>
+    <Real>-0.38159758</Real>
+    <Real>-0.38471025</Real>
+    <Real>-0.28739071</Real>
+    <Real>-0.2954666</Real>
+    <Real>-0.22040513</Real>
+    <Real>-0.20538236</Real>
+    <Real>-0.17562716</Real>
+    <Real>-0.12331922</Real>
+    <Real>-0.10807745</Real>
+    <Real>-0.050659552</Real>
+    <Real>-0.016248262</Real>
+    <Real>0.025591634</Real>
+    <Real>0.048248891</Real>
+    <Real>0.14176746</Real>
+    <Real>0.1492541</Real>
+    <Real>0.19401339</Real>
+    <Real>0.2210024</Real>
+    <Real>0.27532429</Real>
+    <Real>0.30570927</Real>
+    <Real>0.3446942</Real>
+    <Real>0.39302194</Real>
+    <Real>0.42873836</Real>
+    <Real>0.42809039</Real>
+    <Real>0.43389183</Real>
+    <Real>0.45135197</Real>
+    <Real>0.46419406</Real>
+    <Real>0.4460637</Real>
+    <Real>0.45233327</Real>
+    <Real>0.42144969</Real>
+    <Real>0.45315924</Real>
+    <Real>0.39301997</Real>
+    <Real>0.40853813</Real>
+    <Real>0.34201711</Real>
+    <Real>0.3340483</Real>
+    <Real>0.28035039</Real>
+    <Real>0.23896335</Real>
+    <Real>0.28436226</Real>
+    <Real>0.17808978</Real>
+    <Real>0.14499563</Real>
+    <Real>0.06180751</Real>
+    <Real>0.092647187</Real>
+    <Real>0.027190113</Real>
+    <Real>-0.0080625331</Real>
+    <Real>-0.064187385</Real>
+    <Real>-0.10907344</Real>
+    <Real>-0.15446156</Real>
+    <Real>-0.16533569</Real>
+    <Real>-0.23526125</Real>
+    <Real>-0.2398034</Real>
+    <Real>-0.28330675</Real>
+    <Real>-0.30476564</Real>
+    <Real>-0.35689712</Real>
+    <Real>-0.38892877</Real>
+    <Real>-0.3612541</Real>
+    <Real>-0.39185265</Real>
+    <Real>-0.43028882</Real>
+    <Real>-0.45067519</Real>
+    <Real>-0.4342128</Real>
+    <Real>-0.41821808</Real>
+    <Real>-0.4186511</Real>
+    <Real>-0.40667656</Real>
+    <Real>-0.41434187</Real>
+    <Real>-0.40649354</Real>
+    <Real>-0.33379188</Real>
+    <Real>-0.33737326</Real>
+    <Real>-0.29176438</Real>
+    <Real>-0.26665944</Real>
+    <Real>-0.24745244</Real>
+    <Real>-0.20352092</Real>
+    <Real>-0.1578752</Real>
+    <Real>-0.086990885</Real>
+    <Real>-0.066635042</Real>
+    <Real>-0.042743091</Real>
+    <Real>0.00078681594</Real>
+    <Real>-0.0067911739</Real>
+    <Real>0.085896254</Real>
+    <Real>0.071024999</Real>
+    <Real>0.17950583</Real>
+    <Real>0.17651561</Real>
+    <Real>0.20058732</Real>
+    <Real>0.21677521</Real>
+    <Real>0.28812888</Real>
+    <Real>0.33220929</Real>
+    <Real>0.33306259</Real>
+    <Real>0.33927098</Real>
+    <Real>0.37198529</Real>
+    <Real>0.417128</Real>
+    <Real>0.4154191</Real>
+    <Real>0.39847392</Real>
+    <Real>0.44730949</Real>
+    <Real>0.4173483</Real>
+    <Real>0.37803513</Real>
+    <Real>0.37619099</Real>
+    <Real>0.3639302</Real>
+    <Real>0.33892557</Real>
+    <Real>0.32587534</Real>
+    <Real>0.28599876</Real>
+    <Real>0.27454555</Real>
+    <Real>0.24336377</Real>
+    <Real>0.198433</Real>
+    <Real>0.14513154</Real>
+    <Real>0.13489601</Real>
+    <Real>0.062797137</Real>
+    <Real>0.037670311</Real>
+    <Real>0.050498053</Real>
+    <Real>-0.033388019</Real>
+    <Real>-0.030411391</Real>
+    <Real>-0.084634274</Real>
+    <Real>-0.12620553</Real>
+    <Real>-0.15148365</Real>
+    <Real>-0.19281019</Real>
+    <Real>-0.18538459</Real>
+    <Real>-0.24954344</Real>
+    <Real>-0.26109678</Real>
+    <Real>-0.28819132</Real>
+    <Real>-0.29661107</Real>
+    <Real>-0.32724535</Real>
+    <Real>-0.35866067</Real>
+    <Real>-0.37147668</Real>
+    <Real>-0.38001916</Real>
+    <Real>-0.41183418</Real>
+    <Real>-0.39546514</Real>
+    <Real>-0.38687271</Real>
+    <Real>-0.34134433</Real>
+    <Real>-0.34561017</Real>
+    <Real>-0.34194723</Real>
+    <Real>-0.31308424</Real>
+    <Real>-0.27242407</Real>
+    <Real>-0.24386796</Real>
+    <Real>-0.20921478</Real>
+    <Real>-0.21119194</Real>
+    <Real>-0.17974477</Real>
+    <Real>-0.15848035</Real>
+    <Real>-0.12469824</Real>
+    <Real>-0.086453475</Real>
+    <Real>-0.080984168</Real>
+    <Real>0.005651589</Real>
+    <Real>0.003682811</Real>
+    <Real>0.018001949</Real>
+    <Real>0.05915371</Real>
+    <Real>0.12276107</Real>
+    <Real>0.13476479</Real>
+    <Real>0.16121536</Real>
+    <Real>0.2092976</Real>
+    <Real>0.22431286</Real>
+    <Real>0.27541709</Real>
+    <Real>0.24461982</Real>
+    <Real>0.29393646</Real>
+    <Real>0.3234759</Real>
+    <Real>0.31976876</Real>
+    <Real>0.31485754</Real>
+    <Real>0.32111084</Real>
+    <Real>0.35145399</Real>
+    <Real>0.32975963</Real>
+    <Real>0.30248013</Real>
+    <Real>0.33686966</Real>
+    <Real>0.31571227</Real>
+    <Real>0.31266999</Real>
+    <Real>0.25339827</Real>
+    <Real>0.25347894</Real>
+    <Real>0.23968148</Real>
+    <Real>0.18691608</Real>
+    <Real>0.17482249</Real>
+    <Real>0.14749897</Real>
+    <Real>0.12377977</Real>
+    <Real>0.1089068</Real>
+    <Real>0.063197732</Real>
+    <Real>0.026660295</Real>
+    <Real>-0.010755541</Real>
+    <Real>-0.037944749</Real>
+    <Real>-0.037892897</Real>
+    <Real>-0.10014877</Real>
+    <Real>-0.095640317</Real>
+    <Real>-0.13707285</Real>
+    <Real>-0.16875705</Real>
+    <Real>-0.18712473</Real>
+    <Real>-0.19054933</Real>
+    <Real>-0.20765278</Real>
+    <Real>-0.23237705</Real>
+    <Real>-0.25386557</Real>
+    <Real>-0.27768761</Real>
+    <Real>-0.25717878</Real>
+    <Real>-0.28340849</Real>
+    <Real>-0.27809283</Real>
+    <Real>-0.238038</Real>
+    <Real>-0.26776999</Real>
+    <Real>-0.27595633</Real>
+    <Real>-0.25788331</Real>
+    <Real>-0.2742697</Real>
+    <Real>-0.2293901</Real>
+    <Real>-0.25884274</Real>
+    <Real>-0.19792171</Real>
+    <Real>-0.17900355</Real>
+    <Real>-0.15930815</Real>
+    <Real>-0.17125751</Real>
+    <Real>-0.13059393</Real>
+    <Real>-0.10386769</Real>
+    <Real>-0.075353824</Real>
+    <Real>-0.065707266</Real>
+    <Real>-0.018131474</Real>
+    <Real>-0.014584285</Real>
+    <Real>0.0061852229</Real>
+    <Real>0.042538356</Real>
+    <Real>0.050294321</Real>
+    <Real>0.078784354</Real>
+    <Real>0.087153688</Real>
+    <Real>0.12855974</Real>
+    <Real>0.15673861</Real>
+    <Real>0.16491783</Real>
+    <Real>0.18010868</Real>
+    <Real>0.19055982</Real>
+    <Real>0.2284265</Real>
+    <Real>0.23438752</Real>
+    <Real>0.26127139</Real>
+    <Real>0.00051779405</Real>
+    <Real>0.00046002973</Real>
+    <Real>0.00049159979</Real>
+    <Real>0.00046070319</Real>
+    <Real>0.0005150768</Real>
+    <Real>0.00043054938</Real>
+    <Real>0.00045350095</Real>
+    <Real>0.00040957739</Real>
+    <Real>0.00034215208</Real>
+    <Real>0.00035906222</Real>
+    <Real>0.00033953731</Real>
+    <Real>0.00028457298</Real>
+    <Real>0.00030721581</Real>
+    <Real>0.00016524141</Real>
+    <Real>0.00017076859</Real>
+    <Real>0.00012973398</Real>
+    <Real>0.00016397034</Real>
+    <Real>4.7663285e-05</Real>
+    <Real>1.358061e-05</Real>
+    <Real>-2.7169301e-05</Real>
+    <Real>-2.7898577e-06</Real>
+    <Real>-0.00013654496</Real>
+    <Real>-9.7739423e-05</Real>
+    <Real>-0.0001642635</Real>
+    <Real>-0.00019529846</Real>
+    <Real>-0.00024131176</Real>
+    <Real>-0.00029883318</Real>
+    <Real>-0.0003162272</Real>
+    <Real>-0.00032828687</Real>
+    <Real>-0.00038343482</Real>
+    <Real>-0.00040526892</Real>
+    <Real>-0.00039040067</Real>
+    <Real>-0.0004144444</Real>
+    <Real>-0.00033617931</Real>
+    <Real>-0.00042994847</Real>
+    <Real>-0.00042565534</Real>
+    <Real>-0.0004040171</Real>
+    <Real>-0.00035610452</Real>
+    <Real>-0.00031678245</Real>
+    <Real>-0.00029163092</Real>
+    <Real>-0.00032491583</Real>
+    <Real>-0.00024466871</Real>
+    <Real>-0.00026350768</Real>
+    <Real>-0.00022657856</Real>
+    <Real>-0.00023745382</Real>
+    <Real>-0.00017040815</Real>
+    <Real>-0.00015178781</Real>
+    <Real>-0.00013567225</Real>
+    <Real>-0.00012801227</Real>
+    <Real>-5.3487096e-05</Real>
+    <Real>-3.4211818e-05</Real>
+    <Real>-6.9752728e-06</Real>
+    <Real>3.0836691e-05</Real>
+    <Real>5.3444957e-05</Real>
+    <Real>8.0782404e-05</Real>
+    <Real>0.00013846572</Real>
+    <Real>0.00016730832</Real>
+    <Real>0.00019705876</Real>
+    <Real>0.00022988698</Real>
+    <Real>0.00026496977</Real>
+    <Real>0.00027594061</Real>
+    <Real>0.00030931641</Real>
+    <Real>0.00025910389</Real>
+    <Real>0.0002923141</Real>
+    <Real>0.00027058041</Real>
+    <Real>0.00036504987</Real>
+    <Real>0.00032267233</Real>
+    <Real>0.00032371024</Real>
+    <Real>0.00030552977</Real>
+    <Real>0.00027583545</Real>
+    <Real>0.00025386945</Real>
+    <Real>0.00024303515</Real>
+    <Real>0.00026581573</Real>
+    <Real>0.0002071358</Real>
+    <Real>0.00023383345</Real>
+    <Real>0.00017728444</Real>
+    <Real>0.00017414079</Real>
+    <Real>0.00018484636</Real>
+    <Real>0.00018264132</Real>
+    <Real>0.00017436035</Real>
+    <Real>0.00010066917</Real>
+    <Real>6.8966023e-05</Real>
+    <Real>5.8083904e-05</Real>
+    <Real>1.8432511e-05</Real>
+    <Real>-5.5161676e-05</Real>
+    <Real>-7.3635965e-05</Real>
+    <Real>-5.5789766e-05</Real>
+    <Real>-9.8511002e-05</Real>
+    <Real>-0.00016468731</Real>
+    <Real>-0.00016649776</Real>
+    <Real>-0.0001994113</Real>
+    <Real>-0.00021746985</Real>
+    <Real>-0.00025234316</Real>
+    <Real>-0.00026447431</Real>
+    <Real>-0.00023566742</Real>
+    <Real>-0.0002863394</Real>
+    <Real>-0.00027145303</Real>
+    <Real>-0.00027926482</Real>
+    <Real>-0.00031412177</Real>
+    <Real>-0.00025063011</Real>
+    <Real>-0.00026088688</Real>
+    <Real>-0.00022227927</Real>
+    <Real>-0.00019989176</Real>
+    <Real>-0.00019884146</Real>
+    <Real>-0.00015387453</Real>
+    <Real>-0.00015428696</Real>
+    <Real>-0.00014001745</Real>
+    <Real>-0.00013479896</Real>
+    <Real>-0.00013827824</Real>
+    <Real>-0.00010479951</Real>
+    <Real>-9.2000962e-05</Real>
+    <Real>-6.305665e-05</Real>
+    <Real>-8.5287145e-05</Real>
+    <Real>-2.2435448e-05</Real>
+    <Real>-4.9504943e-05</Real>
+    <Real>7.0504911e-06</Real>
+    <Real>-3.8556545e-06</Real>
+    <Real>2.0939458e-05</Real>
+    <Real>4.0444185e-05</Real>
+    <Real>6.2464758e-05</Real>
+    <Real>8.4932581e-05</Real>
+    <Real>0.0001249061</Real>
+    <Real>0.00012059854</Real>
+    <Real>0.00016844175</Real>
+    <Real>0.00010705311</Real>
+    <Real>0.00012287036</Real>
+    <Real>0.00014456037</Real>
+    <Real>0.00010299935</Real>
+    <Real>0.00014447783</Real>
+    <Real>0.00016631189</Real>
+    <Real>0.00011951655</Real>
+    <Real>9.2054914e-05</Real>
+    <Real>7.7397526e-05</Real>
+    <Real>6.8027111e-05</Real>
+    <Real>4.7603451e-05</Real>
+    <Real>4.6011894e-05</Real>
+    <Real>8.9196699e-05</Real>
+    <Real>1.9264202e-05</Real>
+    <Real>5.8760601e-05</Real>
+    <Real>1.4962246e-05</Real>
+    <Real>5.5923185e-05</Real>
+    <Real>3.973005e-05</Real>
+    <Real>5.7783513e-05</Real>
+    <Real>7.4290845e-05</Real>
+    <Real>6.0946517e-05</Real>
+    <Real>3.0873391e-05</Real>
+    <Real>5.5158758e-05</Real>
+    <Real>3.5803965e-05</Real>
+    <Real>-2.1067415e-05</Real>
+    <Real>3.8682715e-06</Real>
+    <Real>-2.0667258e-06</Real>
+    <Real>-1.2632422e-05</Real>
+    <Real>-4.2208379e-05</Real>
+    <Real>-9.5042917e-05</Real>
+    <Real>-0.00010922949</Real>
+    <Real>-0.00013174933</Real>
+    <Real>-0.00014768293</Real>
+    <Real>-0.00012974846</Real>
+    <Real>-0.00013042323</Real>
+    <Real>-9.965428e-05</Real>
+    <Real>-8.2405808e-05</Real>
+    <Real>-9.2953065e-05</Real>
+    <Real>-7.6099925e-05</Real>
+    <Real>-6.2735577e-05</Real>
+    <Real>-7.770439e-05</Real>
+    <Real>-2.9663626e-05</Real>
+    <Real>-5.4733122e-05</Real>
+    <Real>-4.6981109e-05</Real>
+    <Real>1.8356723e-05</Real>
+    <Real>-4.4312477e-05</Real>
+    <Real>-2.5209471e-05</Real>
+    <Real>-6.2572442e-05</Real>
+    <Real>-2.3840879e-05</Real>
+    <Real>-6.1076091e-05</Real>
+    <Real>-9.3741124e-05</Real>
+    <Real>-7.945695e-05</Real>
+    <Real>-0.00011390245</Real>
+    <Real>-0.00013043737</Real>
+    <Real>-0.00012991235</Real>
+    <Real>-6.5812135e-05</Real>
+    <Real>-3.477887e-05</Real>
+    <Real>-2.9716135e-05</Real>
+    <Real>-7.4908535e-06</Real>
+    <Real>2.3869186e-05</Real>
+    <Real>4.6370671e-05</Real>
+    <Real>7.6261058e-05</Real>
+    <Real>7.8259094e-05</Real>
+    <Real>6.4048887e-05</Real>
+    <Real>7.6222859e-05</Real>
+    <Real>8.3034451e-05</Real>
+    <Real>6.315564e-05</Real>
+    <Real>6.9539514e-05</Real>
+    <Real>4.724467e-05</Real>
+    <Real>7.0027898e-05</Real>
+    <Real>7.6666351e-05</Real>
+    <Real>8.6733067e-05</Real>
+    <Real>8.0106831e-05</Real>
+    <Real>0.00010918936</Real>
+    <Real>0.00014464188</Real>
+    <Real>0.00017181516</Real>
+    <Real>0.0002254135</Real>
+    <Real>0.00024767048</Real>
+    <Real>0.00026707022</Real>
+    <Real>0.00019277025</Real>
+    <Real>0.00023908055</Real>
+    <Real>0.00024568432</Real>
+    <Real>0.00023091928</Real>
+    <Real>0.00029483382</Real>
+    <Real>0.00025279995</Real>
+    <Real>0.00024932221</Real>
+    <Real>0.00016185141</Real>
+    <Real>0.00012187717</Real>
+    <Real>8.6983739e-05</Real>
+    <Real>9.7002376e-05</Real>
+    <Real>1.2475208e-05</Real>
+    <Real>-6.0953054e-05</Real>
+    <Real>-0.00012379354</Real>
+    <Real>-0.00016237446</Real>
+    <Real>-0.00012646648</Real>
+    <Real>-0.00010655529</Real>
+    <Real>-6.7753019e-05</Real>
+    <Real>-7.6096891e-05</Real>
+    <Real>-6.1317194e-05</Real>
+    <Real>4.2310683e-05</Real>
+    <Real>7.8446574e-05</Real>
+    <Real>0.00011693679</Real>
+    <Real>0.00011118068</Real>
+    <Real>0.00019630734</Real>
+    <Real>0.00013006449</Real>
+    <Real>0.00020328228</Real>
+    <Real>9.4708485e-05</Real>
+    <Real>2.4244946e-05</Real>
+    <Real>2.0031335e-05</Real>
+    <Real>8.7780099e-06</Real>
+    <Real>8.5161257e-05</Real>
+    <Real>-3.2001142e-05</Real>
+    <Real>5.0963968e-06</Real>
+    <Real>5.9037811e-05</Real>
+    <Real>0.00016131309</Real>
+    <Real>0.00018575686</Real>
+    <Real>0.00038959685</Real>
+    <Real>0.00030655556</Real>
+    <Real>0.00055750855</Real>
+    <Real>0.00041609086</Real>
+    <Real>0.00041038837</Real>
+    <Real>0.00024904971</Real>
+    <Real>0.00032858923</Real>
+    <Real>-0.00012124365</Real>
+    <Real>-0.00067634159</Real>
+    <Real>-0.0014037765</Real>
+  </Sequence>
+  <Real Name="Integral">-0.13156737015469844</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP2.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP2.xml
new file mode 100644 (file)
index 0000000..e61b5e3
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>1.0026263</Real>
+    <Real>1.002813</Real>
+    <Real>1.0028353</Real>
+    <Real>1.00298</Real>
+    <Real>1.0031264</Real>
+    <Real>1.0033009</Real>
+    <Real>1.0034248</Real>
+    <Real>1.0034949</Real>
+    <Real>1.0036868</Real>
+    <Real>1.0038811</Real>
+    <Real>1.0039461</Real>
+    <Real>1.0039393</Real>
+    <Real>1.0039014</Real>
+    <Real>1.0041367</Real>
+    <Real>1.0040401</Real>
+    <Real>1.0039788</Real>
+    <Real>1.0041522</Real>
+    <Real>1.004038</Real>
+    <Real>1.00398</Real>
+    <Real>1.0038664</Real>
+    <Real>1.0038596</Real>
+    <Real>1.00374</Real>
+    <Real>1.0035481</Real>
+    <Real>1.0035183</Real>
+    <Real>1.003296</Real>
+    <Real>1.0031067</Real>
+    <Real>1.0031048</Real>
+    <Real>1.0029247</Real>
+    <Real>1.0029281</Real>
+    <Real>1.0027844</Real>
+    <Real>1.0024828</Real>
+    <Real>1.0026224</Real>
+    <Real>1.0028158</Real>
+    <Real>1.0028605</Real>
+    <Real>1.0029123</Real>
+    <Real>1.0031923</Real>
+    <Real>1.0032749</Real>
+    <Real>1.0033575</Real>
+    <Real>1.0034987</Real>
+    <Real>1.0035222</Real>
+    <Real>1.0038122</Real>
+    <Real>1.0038934</Real>
+    <Real>1.0038835</Real>
+    <Real>1.003985</Real>
+    <Real>1.0040591</Real>
+    <Real>1.0040226</Real>
+    <Real>1.004043</Real>
+    <Real>1.0039675</Real>
+    <Real>1.0040811</Real>
+    <Real>1.0039179</Real>
+    <Real>1.003891</Real>
+    <Real>1.0038245</Real>
+    <Real>1.0036744</Real>
+    <Real>1.0038064</Real>
+    <Real>1.0035872</Real>
+    <Real>1.003276</Real>
+    <Real>1.0033685</Real>
+    <Real>1.0032185</Real>
+    <Real>1.0030403</Real>
+    <Real>1.0028248</Real>
+    <Real>1.0028371</Real>
+    <Real>1.0028143</Real>
+    <Real>1.00263</Real>
+    <Real>1.002896</Real>
+    <Real>1.0029092</Real>
+    <Real>1.0029544</Real>
+    <Real>1.0030841</Real>
+    <Real>1.0033208</Real>
+    <Real>1.0033398</Real>
+    <Real>1.0034574</Real>
+    <Real>1.003602</Real>
+    <Real>1.0037988</Real>
+    <Real>1.0038297</Real>
+    <Real>1.0040625</Real>
+    <Real>1.0039389</Real>
+    <Real>1.0040179</Real>
+    <Real>1.0039594</Real>
+    <Real>1.0039961</Real>
+    <Real>1.0039948</Real>
+    <Real>1.0040424</Real>
+    <Real>1.0039783</Real>
+    <Real>1.0039077</Real>
+    <Real>1.003881</Real>
+    <Real>1.003885</Real>
+    <Real>1.0038402</Real>
+    <Real>1.0036588</Real>
+    <Real>1.0035746</Real>
+    <Real>1.0034667</Real>
+    <Real>1.0033582</Real>
+    <Real>1.0032606</Real>
+    <Real>1.0031298</Real>
+    <Real>1.0029531</Real>
+    <Real>1.0029762</Real>
+    <Real>1.0028747</Real>
+    <Real>1.0028256</Real>
+    <Real>1.0029508</Real>
+    <Real>1.0031258</Real>
+    <Real>1.0032694</Real>
+    <Real>1.0033274</Real>
+    <Real>1.0034236</Real>
+    <Real>1.0035467</Real>
+    <Real>1.0037386</Real>
+    <Real>1.0037678</Real>
+    <Real>1.0038179</Real>
+    <Real>1.003939</Real>
+    <Real>1.003979</Real>
+    <Real>1.00396</Real>
+    <Real>1.0039968</Real>
+    <Real>1.0040765</Real>
+    <Real>1.0039867</Real>
+    <Real>1.0040717</Real>
+    <Real>1.0039583</Real>
+    <Real>1.0038927</Real>
+    <Real>1.0039638</Real>
+    <Real>1.0038794</Real>
+    <Real>1.003749</Real>
+    <Real>1.0036877</Real>
+    <Real>1.0035897</Real>
+    <Real>1.0034268</Real>
+    <Real>1.0034192</Real>
+    <Real>1.0032343</Real>
+    <Real>1.0033185</Real>
+    <Real>1.0029762</Real>
+    <Real>1.0031357</Real>
+    <Real>1.003207</Real>
+    <Real>1.0029137</Real>
+    <Real>1.0030683</Real>
+    <Real>1.0031815</Real>
+    <Real>1.0033453</Real>
+    <Real>1.0033225</Real>
+    <Real>1.0034435</Real>
+    <Real>1.0035906</Real>
+    <Real>1.0036092</Real>
+    <Real>1.0037911</Real>
+    <Real>1.0038091</Real>
+    <Real>1.0039287</Real>
+    <Real>1.0040594</Real>
+    <Real>1.003963</Real>
+    <Real>1.0039438</Real>
+    <Real>1.004236</Real>
+    <Real>1.0041121</Real>
+    <Real>1.0039667</Real>
+    <Real>1.0039054</Real>
+    <Real>1.0039448</Real>
+    <Real>1.0038875</Real>
+    <Real>1.0039566</Real>
+    <Real>1.0037364</Real>
+    <Real>1.0038453</Real>
+    <Real>1.0036628</Real>
+    <Real>1.0036311</Real>
+    <Real>1.0035908</Real>
+    <Real>1.0035497</Real>
+    <Real>1.0035697</Real>
+    <Real>1.0033984</Real>
+    <Real>1.0034442</Real>
+    <Real>1.0033016</Real>
+    <Real>1.0032938</Real>
+    <Real>1.0032138</Real>
+    <Real>1.0033556</Real>
+    <Real>1.0033462</Real>
+    <Real>1.0034832</Real>
+    <Real>1.0035497</Real>
+    <Real>1.0036097</Real>
+    <Real>1.003722</Real>
+    <Real>1.003818</Real>
+    <Real>1.0037833</Real>
+    <Real>1.0038013</Real>
+    <Real>1.0039788</Real>
+    <Real>1.0039507</Real>
+    <Real>1.0040078</Real>
+    <Real>1.0040756</Real>
+    <Real>1.0040264</Real>
+    <Real>1.0038471</Real>
+    <Real>1.0039368</Real>
+    <Real>1.0040127</Real>
+    <Real>1.0038276</Real>
+    <Real>1.0038612</Real>
+    <Real>1.0038606</Real>
+    <Real>1.0038905</Real>
+    <Real>1.0039259</Real>
+    <Real>1.0036864</Real>
+    <Real>1.0036433</Real>
+    <Real>1.0036565</Real>
+    <Real>1.0036999</Real>
+    <Real>1.003649</Real>
+    <Real>1.0035149</Real>
+    <Real>1.0035567</Real>
+    <Real>1.0035112</Real>
+    <Real>1.003474</Real>
+    <Real>1.0034895</Real>
+    <Real>1.003518</Real>
+    <Real>1.0036062</Real>
+    <Real>1.0036708</Real>
+    <Real>1.0038066</Real>
+    <Real>1.0037796</Real>
+    <Real>1.0038444</Real>
+    <Real>1.0038437</Real>
+    <Real>1.0038533</Real>
+    <Real>1.0040073</Real>
+    <Real>1.0039427</Real>
+    <Real>1.0040594</Real>
+    <Real>1.0040133</Real>
+    <Real>1.0039896</Real>
+    <Real>1.0041509</Real>
+    <Real>1.0040509</Real>
+    <Real>1.0040835</Real>
+    <Real>1.0039433</Real>
+    <Real>1.0039626</Real>
+    <Real>1.0039417</Real>
+    <Real>1.0039464</Real>
+    <Real>1.0039327</Real>
+    <Real>1.0038795</Real>
+    <Real>1.0038284</Real>
+    <Real>1.0037864</Real>
+    <Real>1.0037988</Real>
+    <Real>1.0038092</Real>
+    <Real>1.0038675</Real>
+    <Real>1.0038058</Real>
+    <Real>1.0036768</Real>
+    <Real>1.0036308</Real>
+    <Real>1.0037299</Real>
+    <Real>1.003732</Real>
+    <Real>1.0038123</Real>
+    <Real>1.0038664</Real>
+    <Real>1.0037434</Real>
+    <Real>1.0037843</Real>
+    <Real>1.0037801</Real>
+    <Real>1.0039681</Real>
+    <Real>1.003965</Real>
+    <Real>1.0039586</Real>
+    <Real>1.0040132</Real>
+    <Real>1.0040785</Real>
+    <Real>1.004027</Real>
+    <Real>1.0039933</Real>
+    <Real>1.0040841</Real>
+    <Real>1.0040706</Real>
+    <Real>1.0040671</Real>
+    <Real>1.0040392</Real>
+    <Real>1.003906</Real>
+    <Real>1.0039387</Real>
+    <Real>1.0039802</Real>
+    <Real>1.0039933</Real>
+    <Real>1.0039399</Real>
+    <Real>1.0039351</Real>
+    <Real>1.0039452</Real>
+    <Real>1.0038861</Real>
+    <Real>1.0039293</Real>
+    <Real>1.0039737</Real>
+    <Real>1.0039887</Real>
+    <Real>1.0038258</Real>
+    <Real>-0.49893174</Real>
+    <Real>-0.49886957</Real>
+    <Real>-0.49892607</Real>
+    <Real>-0.49890354</Real>
+    <Real>-0.49890825</Real>
+    <Real>-0.49895376</Real>
+    <Real>-0.49898374</Real>
+    <Real>-0.4989509</Real>
+    <Real>-0.49897298</Real>
+    <Real>-0.49903247</Real>
+    <Real>-0.49904075</Real>
+    <Real>-0.49909836</Real>
+    <Real>-0.49908444</Real>
+    <Real>-0.49908859</Real>
+    <Real>-0.49905875</Real>
+    <Real>-0.49902666</Real>
+    <Real>-0.49906376</Real>
+    <Real>-0.49897763</Real>
+    <Real>-0.49900699</Real>
+    <Real>-0.49899176</Real>
+    <Real>-0.49896324</Real>
+    <Real>-0.4990257</Real>
+    <Real>-0.49898669</Real>
+    <Real>-0.49898905</Real>
+    <Real>-0.4989301</Real>
+    <Real>-0.49899307</Real>
+    <Real>-0.4989734</Real>
+    <Real>-0.49900821</Real>
+    <Real>-0.49903369</Real>
+    <Real>-0.49896592</Real>
+    <Real>-0.49899274</Real>
+    <Real>-0.49897274</Real>
+    <Real>-0.49891421</Real>
+    <Real>-0.49898604</Real>
+    <Real>-0.49893531</Real>
+    <Real>-0.49889025</Real>
+    <Real>-0.49898291</Real>
+    <Real>-0.49900803</Real>
+    <Real>-0.4990274</Real>
+    <Real>-0.49901819</Real>
+    <Real>-0.49902931</Real>
+    <Real>-0.49899384</Real>
+    <Real>-0.49903008</Real>
+    <Real>-0.49902987</Real>
+    <Real>-0.49906373</Real>
+    <Real>-0.49897286</Real>
+    <Real>-0.49903256</Real>
+    <Real>-0.4990426</Real>
+    <Real>-0.49899024</Real>
+    <Real>-0.49900568</Real>
+    <Real>-0.49897072</Real>
+    <Real>-0.49898463</Real>
+    <Real>-0.49899572</Real>
+    <Real>-0.49897897</Real>
+    <Real>-0.49897388</Real>
+    <Real>-0.498952</Real>
+    <Real>-0.49896869</Real>
+    <Real>-0.49902186</Real>
+    <Real>-0.49899849</Real>
+    <Real>-0.49902734</Real>
+    <Real>-0.49899837</Real>
+    <Real>-0.49893278</Real>
+    <Real>-0.49898127</Real>
+    <Real>-0.4989706</Real>
+    <Real>-0.49897298</Real>
+    <Real>-0.49895722</Real>
+    <Real>-0.49895576</Real>
+    <Real>-0.49900338</Real>
+    <Real>-0.49902055</Real>
+    <Real>-0.49900922</Real>
+    <Real>-0.49902984</Real>
+    <Real>-0.49903873</Real>
+    <Real>-0.49901998</Real>
+    <Real>-0.49906427</Real>
+    <Real>-0.49905005</Real>
+    <Real>-0.49904937</Real>
+    <Real>-0.49903309</Real>
+    <Real>-0.49906269</Real>
+    <Real>-0.49902761</Real>
+    <Real>-0.4989495</Real>
+    <Real>-0.49903408</Real>
+    <Real>-0.49898002</Real>
+    <Real>-0.49901122</Real>
+    <Real>-0.49896607</Real>
+    <Real>-0.49895996</Real>
+    <Real>-0.49893692</Real>
+    <Real>-0.49901545</Real>
+    <Real>-0.49897414</Real>
+    <Real>-0.49899518</Real>
+    <Real>-0.49900544</Real>
+    <Real>-0.49900562</Real>
+    <Real>-0.49902061</Real>
+    <Real>-0.49900696</Real>
+    <Real>-0.49901411</Real>
+    <Real>-0.49897903</Real>
+    <Real>-0.49896753</Real>
+    <Real>-0.49898955</Real>
+    <Real>-0.49894136</Real>
+    <Real>-0.49890041</Real>
+    <Real>-0.49896589</Real>
+    <Real>-0.49905798</Real>
+    <Real>-0.49901095</Real>
+    <Real>-0.49903458</Real>
+    <Real>-0.49901229</Real>
+    <Real>-0.49897078</Real>
+    <Real>-0.49899077</Real>
+    <Real>-0.49903148</Real>
+    <Real>-0.49900115</Real>
+    <Real>-0.49903333</Real>
+    <Real>-0.49893701</Real>
+    <Real>-0.49894023</Real>
+    <Real>-0.49889353</Real>
+    <Real>-0.49892846</Real>
+    <Real>-0.49893394</Real>
+    <Real>-0.49893048</Real>
+    <Real>-0.49895993</Real>
+    <Real>-0.49895453</Real>
+    <Real>-0.49897233</Real>
+    <Real>-0.49901488</Real>
+    <Real>-0.49897596</Real>
+    <Real>-0.49901453</Real>
+    <Real>-0.49898061</Real>
+    <Real>-0.49898961</Real>
+    <Real>-0.49896201</Real>
+    <Real>-0.49900386</Real>
+    <Real>-0.49896801</Real>
+    <Real>-0.49894783</Real>
+    <Real>-0.49898973</Real>
+    <Real>-0.49900243</Real>
+    <Real>-0.49898016</Real>
+    <Real>-0.4990072</Real>
+    <Real>-0.49901175</Real>
+    <Real>-0.49905095</Real>
+    <Real>-0.49902296</Real>
+    <Real>-0.49905404</Real>
+    <Real>-0.49907574</Real>
+    <Real>-0.49903113</Real>
+    <Real>-0.49899417</Real>
+    <Real>-0.49898854</Real>
+    <Real>-0.49898151</Real>
+    <Real>-0.49896878</Real>
+    <Real>-0.4989523</Real>
+    <Real>-0.49892372</Real>
+    <Real>-0.49893865</Real>
+    <Real>-0.49890816</Real>
+    <Real>-0.49890837</Real>
+    <Real>-0.49892312</Real>
+    <Real>-0.49893406</Real>
+    <Real>-0.49898854</Real>
+    <Real>-0.49900332</Real>
+    <Real>-0.49896649</Real>
+    <Real>-0.49897844</Real>
+    <Real>-0.49897742</Real>
+    <Real>-0.49898747</Real>
+    <Real>-0.49901125</Real>
+    <Real>-0.49901617</Real>
+    <Real>-0.49903822</Real>
+    <Real>-0.49900663</Real>
+    <Real>-0.49901626</Real>
+    <Real>-0.49898303</Real>
+    <Real>-0.49894875</Real>
+    <Real>-0.49897355</Real>
+    <Real>-0.49900821</Real>
+    <Real>-0.49900267</Real>
+    <Real>-0.49894786</Real>
+    <Real>-0.49896383</Real>
+    <Real>-0.49899969</Real>
+    <Real>-0.49897408</Real>
+    <Real>-0.49899754</Real>
+    <Real>-0.49899074</Real>
+    <Real>-0.4989655</Real>
+    <Real>-0.4989244</Real>
+    <Real>-0.49888101</Real>
+    <Real>-0.4989126</Real>
+    <Real>-0.49887562</Real>
+    <Real>-0.49887267</Real>
+    <Real>-0.4989208</Real>
+    <Real>-0.49892566</Real>
+    <Real>-0.49888468</Real>
+    <Real>-0.49895188</Real>
+    <Real>-0.49898317</Real>
+    <Real>-0.49898994</Real>
+    <Real>-0.499053</Real>
+    <Real>-0.49904776</Real>
+    <Real>-0.49901441</Real>
+    <Real>-0.49905989</Real>
+    <Real>-0.49906784</Real>
+    <Real>-0.49904436</Real>
+    <Real>-0.49905097</Real>
+    <Real>-0.49906713</Real>
+    <Real>-0.49905431</Real>
+    <Real>-0.49900526</Real>
+    <Real>-0.49893859</Real>
+    <Real>-0.49897069</Real>
+    <Real>-0.49897757</Real>
+    <Real>-0.49898547</Real>
+    <Real>-0.4989692</Real>
+    <Real>-0.49900842</Real>
+    <Real>-0.49897486</Real>
+    <Real>-0.49885672</Real>
+    <Real>-0.49891347</Real>
+    <Real>-0.49889705</Real>
+    <Real>-0.49882984</Real>
+    <Real>-0.49888229</Real>
+    <Real>-0.49882868</Real>
+    <Real>-0.49875924</Real>
+    <Real>-0.49873927</Real>
+    <Real>-0.49876097</Real>
+    <Real>-0.49878752</Real>
+    <Real>-0.4987694</Real>
+    <Real>-0.49884218</Real>
+    <Real>-0.49889925</Real>
+    <Real>-0.49895036</Real>
+    <Real>-0.4989852</Real>
+    <Real>-0.49903667</Real>
+    <Real>-0.49907553</Real>
+    <Real>-0.49912426</Real>
+    <Real>-0.49908084</Real>
+    <Real>-0.49905947</Real>
+    <Real>-0.49900791</Real>
+    <Real>-0.49891245</Real>
+    <Real>-0.49886835</Real>
+    <Real>-0.49882156</Real>
+    <Real>-0.49881804</Real>
+    <Real>-0.49885982</Real>
+    <Real>-0.4988803</Real>
+    <Real>-0.49897206</Real>
+    <Real>-0.49903926</Real>
+    <Real>-0.49898836</Real>
+    <Real>-0.49902949</Real>
+    <Real>-0.49892426</Real>
+    <Real>-0.49893805</Real>
+    <Real>-0.49871096</Real>
+    <Real>-0.49875355</Real>
+    <Real>-0.49870211</Real>
+    <Real>-0.49881226</Real>
+    <Real>-0.49883336</Real>
+    <Real>-0.49881047</Real>
+    <Real>-0.4987531</Real>
+    <Real>-0.49864075</Real>
+    <Real>-0.49877453</Real>
+    <Real>-0.49885714</Real>
+    <Real>-0.49892786</Real>
+    <Real>-0.49911681</Real>
+    <Real>-0.49893573</Real>
+    <Real>-0.49896306</Real>
+    <Real>-0.49876678</Real>
+    <Real>-0.4990873</Real>
+    <Real>-0.49923372</Real>
+    <Real>-0.49851903</Real>
+  </Sequence>
+  <Real Name="Integral">127.17098122835159</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP3.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP3.xml
new file mode 100644 (file)
index 0000000..ff8df50
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.24916932</Real>
+    <Real>0.26282433</Real>
+    <Real>0.21642341</Real>
+    <Real>0.15372278</Real>
+    <Real>0.11979742</Real>
+    <Real>0.092738658</Real>
+    <Real>0.050859306</Real>
+    <Real>0.074621499</Real>
+    <Real>0.037549708</Real>
+    <Real>0.022125257</Real>
+    <Real>0.01304414</Real>
+    <Real>0.0044885995</Real>
+    <Real>0.033661574</Real>
+    <Real>0.021974018</Real>
+    <Real>0.003042046</Real>
+    <Real>0.02771442</Real>
+    <Real>-0.024294494</Real>
+    <Real>-0.0089511611</Real>
+    <Real>-0.01425425</Real>
+    <Real>-0.018068291</Real>
+    <Real>-0.032646321</Real>
+    <Real>-0.020490842</Real>
+    <Real>-0.029507939</Real>
+    <Real>-0.053334761</Real>
+    <Real>-0.081523851</Real>
+    <Real>-0.11181895</Real>
+    <Real>-0.11998858</Real>
+    <Real>-0.19702718</Real>
+    <Real>-0.23862125</Real>
+    <Real>-0.23100108</Real>
+    <Real>-0.28396863</Real>
+    <Real>-0.25871417</Real>
+    <Real>-0.25871655</Real>
+    <Real>-0.23469536</Real>
+    <Real>-0.16978902</Real>
+    <Real>-0.11634055</Real>
+    <Real>-0.088878788</Real>
+    <Real>-0.090839922</Real>
+    <Real>-0.042584907</Real>
+    <Real>-0.049209379</Real>
+    <Real>-0.044580866</Real>
+    <Real>-0.061672501</Real>
+    <Real>-0.036852069</Real>
+    <Real>-0.060182665</Real>
+    <Real>-0.037425138</Real>
+    <Real>-0.023032969</Real>
+    <Real>-0.008587338</Real>
+    <Real>-0.0097123208</Real>
+    <Real>0.0093123093</Real>
+    <Real>0.0089723812</Real>
+    <Real>0.015222463</Real>
+    <Real>0.017061882</Real>
+    <Real>0.026156943</Real>
+    <Real>0.025765847</Real>
+    <Real>0.054910339</Real>
+    <Real>0.10248004</Real>
+    <Real>0.08782912</Real>
+    <Real>0.10213599</Real>
+    <Real>0.15908866</Real>
+    <Real>0.16958259</Real>
+    <Real>0.21099328</Real>
+    <Real>0.25954089</Real>
+    <Real>0.24664715</Real>
+    <Real>0.21735786</Real>
+    <Real>0.20271333</Real>
+    <Real>0.14929497</Real>
+    <Real>0.099971056</Real>
+    <Real>0.078323275</Real>
+    <Real>0.086109914</Real>
+    <Real>0.088238128</Real>
+    <Real>0.033936426</Real>
+    <Real>0.060482882</Real>
+    <Real>0.024708128</Real>
+    <Real>0.014221126</Real>
+    <Real>0.017057929</Real>
+    <Real>0.023793744</Real>
+    <Real>0.020157645</Real>
+    <Real>0.028095469</Real>
+    <Real>-0.0011269932</Real>
+    <Real>-0.0087106731</Real>
+    <Real>-0.015682038</Real>
+    <Real>-0.031383019</Real>
+    <Real>-0.040354021</Real>
+    <Real>-0.022688888</Real>
+    <Real>-0.029115962</Real>
+    <Real>-0.044007879</Real>
+    <Real>-0.047760032</Real>
+    <Real>-0.075893126</Real>
+    <Real>-0.081340298</Real>
+    <Real>-0.12698907</Real>
+    <Real>-0.12668371</Real>
+    <Real>-0.16949433</Real>
+    <Real>-0.17001522</Real>
+    <Real>-0.21445785</Real>
+    <Real>-0.19745404</Real>
+    <Real>-0.14944276</Real>
+    <Real>-0.15087374</Real>
+    <Real>-0.11744924</Real>
+    <Real>-0.095149398</Real>
+    <Real>-0.06332425</Real>
+    <Real>-0.036039084</Real>
+    <Real>-0.0081931204</Real>
+    <Real>-0.032258861</Real>
+    <Real>-0.051029101</Real>
+    <Real>-0.010478755</Real>
+    <Real>-0.046378605</Real>
+    <Real>-0.012759867</Real>
+    <Real>-0.045964837</Real>
+    <Real>-0.012755739</Real>
+    <Real>-0.0030502961</Real>
+    <Real>0.012351047</Real>
+    <Real>-0.0011214457</Real>
+    <Real>0.0090411613</Real>
+    <Real>0.032239337</Real>
+    <Real>0.03779193</Real>
+    <Real>0.023959428</Real>
+    <Real>0.024747973</Real>
+    <Real>0.024610961</Real>
+    <Real>0.061804209</Real>
+    <Real>0.062422201</Real>
+    <Real>0.073981203</Real>
+    <Real>0.11293139</Real>
+    <Real>0.13641046</Real>
+    <Real>0.14514221</Real>
+    <Real>0.1661052</Real>
+    <Real>0.16901226</Real>
+    <Real>0.13682093</Real>
+    <Real>0.14968935</Real>
+    <Real>0.096671052</Real>
+    <Real>0.091609098</Real>
+    <Real>0.038700294</Real>
+    <Real>0.050378289</Real>
+    <Real>0.0071525229</Real>
+    <Real>0.026320271</Real>
+    <Real>0.004891546</Real>
+    <Real>-0.0075392947</Real>
+    <Real>0.039158821</Real>
+    <Real>0.022921503</Real>
+    <Real>0.030754266</Real>
+    <Real>0.022782188</Real>
+    <Real>0.009197413</Real>
+    <Real>0.011712298</Real>
+    <Real>0.00042203636</Real>
+    <Real>0.0034940925</Real>
+    <Real>-0.034436598</Real>
+    <Real>-0.032315563</Real>
+    <Real>-0.016871653</Real>
+    <Real>-0.035277113</Real>
+    <Real>0.0017015081</Real>
+    <Real>0.0049509918</Real>
+    <Real>-0.057147924</Real>
+    <Real>-0.064407878</Real>
+    <Real>-0.045245171</Real>
+    <Real>-0.089002214</Real>
+    <Real>-0.071642399</Real>
+    <Real>-0.11470717</Real>
+    <Real>-0.11126412</Real>
+    <Real>-0.090277366</Real>
+    <Real>-0.094315536</Real>
+    <Real>-0.079579718</Real>
+    <Real>-0.047357906</Real>
+    <Real>-0.024927292</Real>
+    <Real>-0.034104288</Real>
+    <Real>-0.0096314782</Real>
+    <Real>-0.01172656</Real>
+    <Real>-0.0056364429</Real>
+    <Real>-0.040535823</Real>
+    <Real>-0.016774358</Real>
+    <Real>-0.014503113</Real>
+    <Real>-0.039290171</Real>
+    <Real>-0.014833414</Real>
+    <Real>-0.013736404</Real>
+    <Real>-0.012063603</Real>
+    <Real>-0.028713237</Real>
+    <Real>-0.015571943</Real>
+    <Real>0.0072697252</Real>
+    <Real>0.014094685</Real>
+    <Real>0.032336745</Real>
+    <Real>0.026830338</Real>
+    <Real>0.0048128823</Real>
+    <Real>-0.012038751</Real>
+    <Real>0.016595189</Real>
+    <Real>0.023860943</Real>
+    <Real>0.039478075</Real>
+    <Real>0.050808214</Real>
+    <Real>0.072448984</Real>
+    <Real>0.03044604</Real>
+    <Real>0.049967185</Real>
+    <Real>0.048776053</Real>
+    <Real>0.01749002</Real>
+    <Real>0.045520712</Real>
+    <Real>0.021682752</Real>
+    <Real>0.030495429</Real>
+    <Real>-0.009275022</Real>
+    <Real>0.0020285225</Real>
+    <Real>-0.0010389222</Real>
+    <Real>0.030749684</Real>
+    <Real>0.030424479</Real>
+    <Real>0.017310664</Real>
+    <Real>0.021767529</Real>
+    <Real>0.01571149</Real>
+    <Real>0.029586872</Real>
+    <Real>0.013801512</Real>
+    <Real>0.04165978</Real>
+    <Real>-0.0018744577</Real>
+    <Real>0.01699499</Real>
+    <Real>-0.0014720967</Real>
+    <Real>0.0059610172</Real>
+    <Real>-0.0066657215</Real>
+    <Real>-0.0048435708</Real>
+    <Real>-0.014292663</Real>
+    <Real>0.024748452</Real>
+    <Real>0.0096782139</Real>
+    <Real>0.0025369956</Real>
+    <Real>-0.020823359</Real>
+    <Real>0.017876782</Real>
+    <Real>-0.015183195</Real>
+    <Real>-0.015656698</Real>
+    <Real>-0.0028440207</Real>
+    <Real>0.014280689</Real>
+    <Real>-0.026562925</Real>
+    <Real>-0.014578264</Real>
+    <Real>-0.03152569</Real>
+    <Real>-0.0090835607</Real>
+    <Real>0.01867128</Real>
+    <Real>-0.024373746</Real>
+    <Real>0.02396073</Real>
+    <Real>0.023200441</Real>
+    <Real>0.017668812</Real>
+    <Real>-0.0162716</Real>
+    <Real>-0.0095616225</Real>
+    <Real>-0.0094661694</Real>
+    <Real>-0.006648181</Real>
+    <Real>0.009075908</Real>
+    <Real>0.0092385337</Real>
+    <Real>0.0098444149</Real>
+    <Real>-0.01935043</Real>
+    <Real>-0.0044980175</Real>
+    <Real>-0.024686264</Real>
+    <Real>0.00012611978</Real>
+    <Real>-0.0078650564</Real>
+    <Real>-0.025699897</Real>
+    <Real>-0.019722866</Real>
+    <Real>-0.003895215</Real>
+    <Real>-0.015588136</Real>
+    <Real>-0.014491427</Real>
+    <Real>-0.016194995</Real>
+    <Real>-0.0062554618</Real>
+    <Real>-0.010720518</Real>
+    <Real>0.0040345192</Real>
+    <Real>-0.294002</Real>
+    <Real>-0.177398</Real>
+    <Real>-0.39839</Real>
+    <Real>-0.48773</Real>
+    <Real>-0.172094</Real>
+    <Real>-0.41209301</Real>
+    <Real>-0.408075</Real>
+    <Real>-0.30323401</Real>
+    <Real>-0.31504101</Real>
+    <Real>-0.36764601</Real>
+    <Real>-0.22680099</Real>
+    <Real>-0.362151</Real>
+    <Real>-0.37852699</Real>
+    <Real>-0.41337499</Real>
+    <Real>-0.42870599</Real>
+    <Real>-0.370096</Real>
+    <Real>-0.39703399</Real>
+    <Real>-0.43473601</Real>
+    <Real>-0.35783899</Real>
+    <Real>-0.31582201</Real>
+    <Real>-0.398561</Real>
+    <Real>-0.209665</Real>
+    <Real>-0.403451</Real>
+    <Real>-0.45481399</Real>
+    <Real>-0.29749301</Real>
+    <Real>-0.32480201</Real>
+    <Real>-0.386527</Real>
+    <Real>-0.19479001</Real>
+    <Real>-0.36277401</Real>
+    <Real>-0.33375701</Real>
+    <Real>-0.28211099</Real>
+    <Real>-0.394546</Real>
+    <Real>-0.406385</Real>
+    <Real>-0.114484</Real>
+    <Real>-0.42001301</Real>
+    <Real>-0.403752</Real>
+    <Real>-0.20651101</Real>
+    <Real>-0.30948099</Real>
+    <Real>-0.34128401</Real>
+    <Real>-0.120096</Real>
+    <Real>-0.45341599</Real>
+    <Real>-0.31077701</Real>
+    <Real>-0.119248</Real>
+    <Real>-0.43382999</Real>
+    <Real>-0.175929</Real>
+    <Real>0.033982199</Real>
+    <Real>-0.33926401</Real>
+    <Real>-0.195425</Real>
+    <Real>-0.071849696</Real>
+    <Real>-0.37102601</Real>
+    <Real>-0.21621799</Real>
+    <Real>0.0139881</Real>
+    <Real>-0.35108399</Real>
+    <Real>-0.138989</Real>
+    <Real>0.052345399</Real>
+    <Real>-0.32499999</Real>
+    <Real>-0.14821599</Real>
+    <Real>0.042676602</Real>
+    <Real>-0.28181201</Real>
+    <Real>-0.126936</Real>
+    <Real>0.0222029</Real>
+    <Real>-0.287808</Real>
+    <Real>-0.071663201</Real>
+    <Real>0.13822199</Real>
+    <Real>-0.185139</Real>
+    <Real>-0.0152797</Real>
+    <Real>0.230471</Real>
+    <Real>-0.22155701</Real>
+    <Real>0.0130399</Real>
+    <Real>0.208427</Real>
+    <Real>-0.127197</Real>
+    <Real>0.0064887698</Real>
+    <Real>0.236035</Real>
+    <Real>-0.140938</Real>
+    <Real>0.192555</Real>
+    <Real>0.148371</Real>
+    <Real>-0.121454</Real>
+    <Real>0.073920898</Real>
+    <Real>0.32382101</Real>
+    <Real>-0.075303599</Real>
+    <Real>0.187121</Real>
+    <Real>0.197079</Real>
+    <Real>0.088469401</Real>
+    <Real>0.14371</Real>
+    <Real>0.346057</Real>
+    <Real>0.072195202</Real>
+    <Real>0.120678</Real>
+    <Real>0.37142599</Real>
+    <Real>0.134703</Real>
+    <Real>0.161566</Real>
+    <Real>0.34491301</Real>
+    <Real>0.110235</Real>
+    <Real>0.223032</Real>
+    <Real>0.215381</Real>
+    <Real>0.15115701</Real>
+    <Real>0.337161</Real>
+    <Real>0.34478301</Real>
+    <Real>0.154284</Real>
+    <Real>0.217981</Real>
+    <Real>0.31849399</Real>
+    <Real>0.27069601</Real>
+    <Real>0.32320201</Real>
+    <Real>0.201975</Real>
+    <Real>0.13255</Real>
+    <Real>0.19012199</Real>
+    <Real>0.22415</Real>
+    <Real>0.33738399</Real>
+    <Real>0.24033999</Real>
+    <Real>0.292528</Real>
+    <Real>0.231969</Real>
+    <Real>0.26378</Real>
+    <Real>0.30350101</Real>
+    <Real>0.23063</Real>
+    <Real>0.299878</Real>
+    <Real>0.15784501</Real>
+    <Real>0.276788</Real>
+    <Real>0.36825699</Real>
+    <Real>0.193731</Real>
+    <Real>0.21615</Real>
+    <Real>0.207757</Real>
+    <Real>0.136564</Real>
+    <Real>0.26222599</Real>
+    <Real>0.210265</Real>
+    <Real>0.13002799</Real>
+    <Real>0.20605899</Real>
+    <Real>0.152711</Real>
+    <Real>0.195077</Real>
+    <Real>0.29734299</Real>
+    <Real>0.237324</Real>
+    <Real>0.118121</Real>
+    <Real>0.29328901</Real>
+    <Real>0.22663499</Real>
+    <Real>0.075010903</Real>
+    <Real>0.26577801</Real>
+    <Real>0.119711</Real>
+    <Real>0.106759</Real>
+    <Real>0.27516001</Real>
+    <Real>0.105753</Real>
+    <Real>0.093085699</Real>
+    <Real>0.25944301</Real>
+    <Real>0.195959</Real>
+    <Real>0.0504844</Real>
+    <Real>0.237343</Real>
+    <Real>0.142589</Real>
+    <Real>-0.089643501</Real>
+    <Real>0.282426</Real>
+    <Real>0.148966</Real>
+    <Real>-0.0323091</Real>
+    <Real>0.160483</Real>
+    <Real>0.035948101</Real>
+    <Real>-0.078566097</Real>
+    <Real>0.21877199</Real>
+    <Real>0.129273</Real>
+    <Real>-0.15982699</Real>
+    <Real>0.0853457</Real>
+    <Real>0.116802</Real>
+    <Real>-0.041748598</Real>
+    <Real>0.20506001</Real>
+    <Real>0.082346298</Real>
+    <Real>-0.033599202</Real>
+    <Real>0.094616003</Real>
+    <Real>0.019920699</Real>
+    <Real>-0.046248399</Real>
+    <Real>0.024650799</Real>
+    <Real>-0.0416026</Real>
+    <Real>-0.098334201</Real>
+    <Real>0.063990101</Real>
+    <Real>-0.13928699</Real>
+    <Real>-0.242319</Real>
+    <Real>0.024995901</Real>
+    <Real>-0.18093801</Real>
+    <Real>-0.249294</Real>
+    <Real>0.032946199</Real>
+    <Real>-0.159826</Real>
+    <Real>-0.23584101</Real>
+    <Real>0.016282201</Real>
+    <Real>-0.196504</Real>
+    <Real>-0.23710801</Real>
+    <Real>-0.0406349</Real>
+    <Real>-0.11625</Real>
+    <Real>-0.115526</Real>
+    <Real>0.035594702</Real>
+    <Real>-0.100031</Real>
+    <Real>-0.131438</Real>
+    <Real>-0.148066</Real>
+    <Real>-0.246914</Real>
+    <Real>-0.228278</Real>
+    <Real>-0.128664</Real>
+    <Real>-0.151379</Real>
+    <Real>-0.120204</Real>
+    <Real>-0.20564</Real>
+    <Real>-0.19493499</Real>
+    <Real>-0.223316</Real>
+    <Real>-0.20992599</Real>
+    <Real>-0.293475</Real>
+    <Real>-0.181631</Real>
+    <Real>-0.15154199</Real>
+    <Real>-0.18523701</Real>
+    <Real>-0.277973</Real>
+    <Real>-0.212514</Real>
+    <Real>-0.25714999</Real>
+    <Real>-0.106606</Real>
+    <Real>-0.17149</Real>
+    <Real>-0.28705299</Real>
+    <Real>-0.17783999</Real>
+    <Real>-0.288715</Real>
+    <Real>-0.13793799</Real>
+    <Real>-0.15577</Real>
+    <Real>-0.101648</Real>
+    <Real>-0.29286501</Real>
+    <Real>-0.15349799</Real>
+    <Real>-0.196582</Real>
+    <Real>-0.151655</Real>
+    <Real>-0.105669</Real>
+    <Real>-0.233206</Real>
+    <Real>-0.205688</Real>
+    <Real>-0.120301</Real>
+    <Real>-0.30407101</Real>
+    <Real>-0.27380499</Real>
+    <Real>-0.0567232</Real>
+    <Real>-0.26257399</Real>
+    <Real>-0.213572</Real>
+    <Real>-0.188062</Real>
+    <Real>-0.234014</Real>
+    <Real>-0.147396</Real>
+    <Real>-0.130597</Real>
+    <Real>-0.127922</Real>
+    <Real>-0.16339099</Real>
+    <Real>-0.141241</Real>
+    <Real>-0.14472499</Real>
+    <Real>-0.10392</Real>
+    <Real>-0.0510807</Real>
+    <Real>-0.247492</Real>
+    <Real>-0.058272298</Real>
+    <Real>-0.0082769198</Real>
+    <Real>-0.25879499</Real>
+    <Real>-0.19123399</Real>
+    <Real>0.077861302</Real>
+    <Real>-0.074387997</Real>
+    <Real>-0.142011</Real>
+    <Real>0.081611998</Real>
+    <Real>-0.12735599</Real>
+    <Real>-0.153745</Real>
+    <Real>0.078688301</Real>
+    <Real>-0.12088</Real>
+    <Real>-0.122613</Real>
+    <Real>0.067525104</Real>
+    <Real>-0.13781101</Real>
+    <Real>0.023367999</Real>
+    <Real>0.057603098</Real>
+  </Sequence>
+  <Real Name="Integral">-13.63323055645742</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP4.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacP4.xml
new file mode 100644 (file)
index 0000000..d318d51
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.91440845</Real>
+    <Real>0.89127165</Real>
+    <Real>0.85387266</Real>
+    <Real>0.81370103</Real>
+    <Real>0.7681002</Real>
+    <Real>0.70884496</Real>
+    <Real>0.65127754</Real>
+    <Real>0.58396322</Real>
+    <Real>0.50845456</Real>
+    <Real>0.43051061</Real>
+    <Real>0.35105249</Real>
+    <Real>0.26587203</Real>
+    <Real>0.18143819</Real>
+    <Real>0.097567506</Real>
+    <Real>0.015512385</Real>
+    <Real>-0.068423927</Real>
+    <Real>-0.1456465</Real>
+    <Real>-0.22284648</Real>
+    <Real>-0.29907748</Real>
+    <Real>-0.37475094</Real>
+    <Real>-0.4380517</Real>
+    <Real>-0.49662268</Real>
+    <Real>-0.55154026</Real>
+    <Real>-0.60047692</Real>
+    <Real>-0.64397019</Real>
+    <Real>-0.67695993</Real>
+    <Real>-0.69747227</Real>
+    <Real>-0.71946371</Real>
+    <Real>-0.73064023</Real>
+    <Real>-0.73969084</Real>
+    <Real>-0.73910058</Real>
+    <Real>-0.72273451</Real>
+    <Real>-0.70480442</Real>
+    <Real>-0.68460542</Real>
+    <Real>-0.65121585</Real>
+    <Real>-0.61127657</Real>
+    <Real>-0.56959647</Real>
+    <Real>-0.53186774</Real>
+    <Real>-0.47233477</Real>
+    <Real>-0.42289308</Real>
+    <Real>-0.36013916</Real>
+    <Real>-0.30238953</Real>
+    <Real>-0.23851043</Real>
+    <Real>-0.17228492</Real>
+    <Real>-0.10760929</Real>
+    <Real>-0.038677685</Real>
+    <Real>0.023924842</Real>
+    <Real>0.085734844</Real>
+    <Real>0.14554502</Real>
+    <Real>0.21178007</Real>
+    <Real>0.26366264</Real>
+    <Real>0.31547186</Real>
+    <Real>0.36479235</Real>
+    <Real>0.41372058</Real>
+    <Real>0.45014268</Real>
+    <Real>0.48719069</Real>
+    <Real>0.51477271</Real>
+    <Real>0.54144377</Real>
+    <Real>0.55743951</Real>
+    <Real>0.56827539</Real>
+    <Real>0.57417756</Real>
+    <Real>0.57521474</Real>
+    <Real>0.57242984</Real>
+    <Real>0.56181103</Real>
+    <Real>0.54661202</Real>
+    <Real>0.5273785</Real>
+    <Real>0.49807823</Real>
+    <Real>0.46791199</Real>
+    <Real>0.43094185</Real>
+    <Real>0.39116937</Real>
+    <Real>0.34865311</Real>
+    <Real>0.30475527</Real>
+    <Real>0.26447845</Real>
+    <Real>0.20973703</Real>
+    <Real>0.16015707</Real>
+    <Real>0.10805874</Real>
+    <Real>0.059454329</Real>
+    <Real>0.0076480238</Real>
+    <Real>-0.045675594</Real>
+    <Real>-0.089126058</Real>
+    <Real>-0.14246953</Real>
+    <Real>-0.18825532</Real>
+    <Real>-0.22974341</Real>
+    <Real>-0.27582318</Real>
+    <Real>-0.30692092</Real>
+    <Real>-0.34222001</Real>
+    <Real>-0.37205994</Real>
+    <Real>-0.39867413</Real>
+    <Real>-0.42049485</Real>
+    <Real>-0.43268493</Real>
+    <Real>-0.446363</Real>
+    <Real>-0.45471677</Real>
+    <Real>-0.45743033</Real>
+    <Real>-0.45754004</Real>
+    <Real>-0.44663361</Real>
+    <Real>-0.43691492</Real>
+    <Real>-0.42143744</Real>
+    <Real>-0.39964595</Real>
+    <Real>-0.37948313</Real>
+    <Real>-0.35078076</Real>
+    <Real>-0.32291207</Real>
+    <Real>-0.28617722</Real>
+    <Real>-0.25431877</Real>
+    <Real>-0.21413048</Real>
+    <Real>-0.17472994</Real>
+    <Real>-0.13722105</Real>
+    <Real>-0.0940689</Real>
+    <Real>-0.050582096</Real>
+    <Real>-0.011372223</Real>
+    <Real>0.033095215</Real>
+    <Real>0.064681761</Real>
+    <Real>0.10605592</Real>
+    <Real>0.13676096</Real>
+    <Real>0.17619975</Real>
+    <Real>0.20634755</Real>
+    <Real>0.23424256</Real>
+    <Real>0.26192936</Real>
+    <Real>0.28315401</Real>
+    <Real>0.31159228</Real>
+    <Real>0.32296148</Real>
+    <Real>0.3337082</Real>
+    <Real>0.3472271</Real>
+    <Real>0.35520938</Real>
+    <Real>0.35884556</Real>
+    <Real>0.35598138</Real>
+    <Real>0.36070585</Real>
+    <Real>0.34978899</Real>
+    <Real>0.33616209</Real>
+    <Real>0.32133636</Real>
+    <Real>0.30463791</Real>
+    <Real>0.28434399</Real>
+    <Real>0.26060301</Real>
+    <Real>0.23513913</Real>
+    <Real>0.21211421</Real>
+    <Real>0.18200785</Real>
+    <Real>0.15506685</Real>
+    <Real>0.11292174</Real>
+    <Real>0.08485233</Real>
+    <Real>0.048554849</Real>
+    <Real>0.015430034</Real>
+    <Real>-0.0053237719</Real>
+    <Real>-0.043886948</Real>
+    <Real>-0.069251105</Real>
+    <Real>-0.099874027</Real>
+    <Real>-0.1318848</Real>
+    <Real>-0.15587749</Real>
+    <Real>-0.18213047</Real>
+    <Real>-0.19872877</Real>
+    <Real>-0.22116253</Real>
+    <Real>-0.23839074</Real>
+    <Real>-0.24964274</Real>
+    <Real>-0.25999296</Real>
+    <Real>-0.26915544</Real>
+    <Real>-0.28208914</Real>
+    <Real>-0.28375041</Real>
+    <Real>-0.2840305</Real>
+    <Real>-0.28654379</Real>
+    <Real>-0.27391881</Real>
+    <Real>-0.26717883</Real>
+    <Real>-0.25783545</Real>
+    <Real>-0.24391536</Real>
+    <Real>-0.23143035</Real>
+    <Real>-0.21355876</Real>
+    <Real>-0.19516303</Real>
+    <Real>-0.17305651</Real>
+    <Real>-0.14851433</Real>
+    <Real>-0.13391782</Real>
+    <Real>-0.10106573</Real>
+    <Real>-0.079669952</Real>
+    <Real>-0.054322001</Real>
+    <Real>-0.022567146</Real>
+    <Real>-0.0082916291</Real>
+    <Real>0.028239559</Real>
+    <Real>0.044842608</Real>
+    <Real>0.066723041</Real>
+    <Real>0.086818486</Real>
+    <Real>0.11206019</Real>
+    <Real>0.13034853</Real>
+    <Real>0.14292336</Real>
+    <Real>0.16384037</Real>
+    <Real>0.17437287</Real>
+    <Real>0.19422586</Real>
+    <Real>0.19642359</Real>
+    <Real>0.20773162</Real>
+    <Real>0.21621291</Real>
+    <Real>0.22017281</Real>
+    <Real>0.21870746</Real>
+    <Real>0.22144818</Real>
+    <Real>0.21968257</Real>
+    <Real>0.21284904</Real>
+    <Real>0.20909898</Real>
+    <Real>0.20217142</Real>
+    <Real>0.19360588</Real>
+    <Real>0.18018678</Real>
+    <Real>0.16507152</Real>
+    <Real>0.14102207</Real>
+    <Real>0.13159586</Real>
+    <Real>0.11218439</Real>
+    <Real>0.090035476</Real>
+    <Real>0.069503993</Real>
+    <Real>0.054288179</Real>
+    <Real>0.034861948</Real>
+    <Real>0.013234816</Real>
+    <Real>-0.0047988398</Real>
+    <Real>-0.024740862</Real>
+    <Real>-0.042112309</Real>
+    <Real>-0.057106286</Real>
+    <Real>-0.079133794</Real>
+    <Real>-0.08531253</Real>
+    <Real>-0.10183473</Real>
+    <Real>-0.11679</Real>
+    <Real>-0.13124378</Real>
+    <Real>-0.13978031</Real>
+    <Real>-0.15192363</Real>
+    <Real>-0.15962306</Real>
+    <Real>-0.16721499</Real>
+    <Real>-0.17583407</Real>
+    <Real>-0.17053062</Real>
+    <Real>-0.17783985</Real>
+    <Real>-0.17420124</Real>
+    <Real>-0.16439037</Real>
+    <Real>-0.16967009</Real>
+    <Real>-0.16545986</Real>
+    <Real>-0.15178227</Real>
+    <Real>-0.1513456</Real>
+    <Real>-0.13972749</Real>
+    <Real>-0.12844835</Real>
+    <Real>-0.11278458</Real>
+    <Real>-0.10008006</Real>
+    <Real>-0.084673822</Real>
+    <Real>-0.071988769</Real>
+    <Real>-0.055301242</Real>
+    <Real>-0.044846795</Real>
+    <Real>-0.024612129</Real>
+    <Real>-0.012670649</Real>
+    <Real>0.0064235702</Real>
+    <Real>0.017517105</Real>
+    <Real>0.032193232</Real>
+    <Real>0.05088919</Real>
+    <Real>0.059888519</Real>
+    <Real>0.073218867</Real>
+    <Real>0.084005043</Real>
+    <Real>0.097417012</Real>
+    <Real>0.11064502</Real>
+    <Real>0.11908618</Real>
+    <Real>0.12669091</Real>
+    <Real>0.12785465</Real>
+    <Real>0.13891017</Real>
+    <Real>0.14016822</Real>
+    <Real>0.15007298</Real>
+    <Real>4.4267403e-05</Real>
+    <Real>4.3514352e-05</Real>
+    <Real>4.3138727e-05</Real>
+    <Real>4.1891646e-05</Real>
+    <Real>4.0179297e-05</Real>
+    <Real>3.8032213e-05</Real>
+    <Real>3.7556416e-05</Real>
+    <Real>3.5218971e-05</Real>
+    <Real>3.1478037e-05</Real>
+    <Real>3.0895699e-05</Real>
+    <Real>2.615025e-05</Real>
+    <Real>2.0906495e-05</Real>
+    <Real>1.7488654e-05</Real>
+    <Real>1.3209424e-05</Real>
+    <Real>9.7491848e-06</Real>
+    <Real>6.3581501e-06</Real>
+    <Real>5.6303825e-06</Real>
+    <Real>-5.1143962e-07</Real>
+    <Real>-4.6430905e-06</Real>
+    <Real>-8.4661779e-06</Real>
+    <Real>-1.0448402e-05</Real>
+    <Real>-1.6193704e-05</Real>
+    <Real>-1.857411e-05</Real>
+    <Real>-2.250258e-05</Real>
+    <Real>-2.3523124e-05</Real>
+    <Real>-2.7104035e-05</Real>
+    <Real>-2.8832133e-05</Real>
+    <Real>-2.9649824e-05</Real>
+    <Real>-3.12257e-05</Real>
+    <Real>-3.2669741e-05</Real>
+    <Real>-3.3304954e-05</Real>
+    <Real>-3.3183347e-05</Real>
+    <Real>-3.4332639e-05</Real>
+    <Real>-3.3677767e-05</Real>
+    <Real>-3.4504159e-05</Real>
+    <Real>-3.454684e-05</Real>
+    <Real>-3.2467542e-05</Real>
+    <Real>-2.9868665e-05</Real>
+    <Real>-2.9505636e-05</Real>
+    <Real>-2.6500937e-05</Real>
+    <Real>-2.6333106e-05</Real>
+    <Real>-2.3109949e-05</Real>
+    <Real>-2.140675e-05</Real>
+    <Real>-1.6538143e-05</Real>
+    <Real>-1.4951454e-05</Real>
+    <Real>-1.0329346e-05</Real>
+    <Real>-8.6922209e-06</Real>
+    <Real>-6.4748251e-06</Real>
+    <Real>-2.4234089e-06</Real>
+    <Real>2.1927521e-07</Real>
+    <Real>2.7016404e-06</Real>
+    <Real>3.5660794e-06</Real>
+    <Real>6.7710325e-06</Real>
+    <Real>1.154716e-05</Real>
+    <Real>1.27539e-05</Real>
+    <Real>1.4957743e-05</Real>
+    <Real>1.8768704e-05</Real>
+    <Real>1.983804e-05</Real>
+    <Real>2.258397e-05</Real>
+    <Real>2.3245073e-05</Real>
+    <Real>2.5949555e-05</Real>
+    <Real>2.7714603e-05</Real>
+    <Real>2.4125953e-05</Real>
+    <Real>2.7313827e-05</Real>
+    <Real>2.6500267e-05</Real>
+    <Real>2.8872726e-05</Real>
+    <Real>2.8494722e-05</Real>
+    <Real>2.8652294e-05</Real>
+    <Real>2.6291838e-05</Real>
+    <Real>2.3836281e-05</Real>
+    <Real>2.2856551e-05</Real>
+    <Real>2.24215e-05</Real>
+    <Real>2.2928167e-05</Real>
+    <Real>2.0600462e-05</Real>
+    <Real>2.1569322e-05</Real>
+    <Real>1.8669114e-05</Real>
+    <Real>1.6274531e-05</Real>
+    <Real>1.3573073e-05</Real>
+    <Real>1.2755655e-05</Real>
+    <Real>9.1842421e-06</Real>
+    <Real>4.9424475e-06</Real>
+    <Real>1.9999163e-06</Real>
+    <Real>1.2401867e-06</Real>
+    <Real>-3.0244464e-06</Real>
+    <Real>-7.6198962e-06</Real>
+    <Real>-9.8329774e-06</Real>
+    <Real>-8.8280267e-06</Real>
+    <Real>-1.377236e-05</Real>
+    <Real>-1.6982995e-05</Real>
+    <Real>-1.9108473e-05</Real>
+    <Real>-2.0853575e-05</Real>
+    <Real>-2.3638708e-05</Real>
+    <Real>-2.4330864e-05</Real>
+    <Real>-2.3607576e-05</Real>
+    <Real>-2.3350785e-05</Real>
+    <Real>-2.4861311e-05</Real>
+    <Real>-2.4024377e-05</Real>
+    <Real>-2.7649214e-05</Real>
+    <Real>-3.0116586e-05</Real>
+    <Real>-2.7083521e-05</Real>
+    <Real>-2.6461454e-05</Real>
+    <Real>-2.5706378e-05</Real>
+    <Real>-2.3319637e-05</Real>
+    <Real>-2.2089596e-05</Real>
+    <Real>-1.7878658e-05</Real>
+    <Real>-1.7124203e-05</Real>
+    <Real>-1.5375375e-05</Real>
+    <Real>-1.5521959e-05</Real>
+    <Real>-1.172509e-05</Real>
+    <Real>-9.1009997e-06</Real>
+    <Real>-5.6435597e-06</Real>
+    <Real>-2.9174676e-06</Real>
+    <Real>-5.4268908e-06</Real>
+    <Real>-1.5508874e-06</Real>
+    <Real>-3.7975212e-07</Real>
+    <Real>3.1173399e-06</Real>
+    <Real>1.9381382e-06</Real>
+    <Real>5.5445184e-06</Real>
+    <Real>6.774098e-06</Real>
+    <Real>8.9054111e-06</Real>
+    <Real>1.0997211e-05</Real>
+    <Real>1.4307585e-05</Real>
+    <Real>1.3101091e-05</Real>
+    <Real>1.5396869e-05</Real>
+    <Real>1.3836742e-05</Real>
+    <Real>1.4298585e-05</Real>
+    <Real>1.65646e-05</Real>
+    <Real>1.5446933e-05</Real>
+    <Real>1.9028628e-05</Real>
+    <Real>2.0577343e-05</Real>
+    <Real>1.6241767e-05</Real>
+    <Real>1.6588914e-05</Real>
+    <Real>1.6793663e-05</Real>
+    <Real>1.5231977e-05</Real>
+    <Real>1.3574629e-05</Real>
+    <Real>1.3824551e-05</Real>
+    <Real>1.3580589e-05</Real>
+    <Real>8.8718243e-06</Real>
+    <Real>8.9766982e-06</Real>
+    <Real>4.874571e-06</Real>
+    <Real>6.1740734e-06</Real>
+    <Real>4.3778728e-06</Real>
+    <Real>3.0633016e-06</Real>
+    <Real>2.650128e-06</Real>
+    <Real>4.4499197e-06</Real>
+    <Real>5.2487553e-07</Real>
+    <Real>3.844505e-06</Real>
+    <Real>8.3970571e-07</Real>
+    <Real>-4.0378814e-06</Real>
+    <Real>-4.2863321e-06</Real>
+    <Real>-3.9477163e-06</Real>
+    <Real>-5.5808941e-06</Real>
+    <Real>-8.159157e-06</Real>
+    <Real>-1.07823e-05</Real>
+    <Real>-1.0445928e-05</Real>
+    <Real>-1.4758529e-05</Real>
+    <Real>-1.5891597e-05</Real>
+    <Real>-1.6962238e-05</Real>
+    <Real>-1.6818865e-05</Real>
+    <Real>-1.3153352e-05</Real>
+    <Real>-1.3562746e-05</Real>
+    <Real>-1.536158e-05</Real>
+    <Real>-1.6916658e-05</Real>
+    <Real>-1.5912401e-05</Real>
+    <Real>-1.9311357e-05</Real>
+    <Real>-1.3812277e-05</Real>
+    <Real>-1.7308477e-05</Real>
+    <Real>-1.1393254e-05</Real>
+    <Real>-6.9415369e-06</Real>
+    <Real>-8.5329793e-06</Real>
+    <Real>-7.3732735e-06</Real>
+    <Real>-8.2779943e-06</Real>
+    <Real>-4.1989624e-06</Real>
+    <Real>-4.0598088e-06</Real>
+    <Real>-6.2781332e-06</Real>
+    <Real>-6.1900923e-06</Real>
+    <Real>-9.3725657e-06</Real>
+    <Real>-9.9827339e-06</Real>
+    <Real>-9.6235508e-06</Real>
+    <Real>-4.7038488e-06</Real>
+    <Real>-3.4777854e-06</Real>
+    <Real>-2.7908015e-06</Real>
+    <Real>1.7161137e-06</Real>
+    <Real>2.1103369e-06</Real>
+    <Real>1.6298396e-06</Real>
+    <Real>5.1353272e-06</Real>
+    <Real>9.7297398e-06</Real>
+    <Real>7.9292831e-06</Real>
+    <Real>1.0491432e-05</Real>
+    <Real>8.7098369e-06</Real>
+    <Real>1.1306504e-05</Real>
+    <Real>1.2767204e-05</Real>
+    <Real>1.0523996e-05</Real>
+    <Real>1.5876185e-05</Real>
+    <Real>1.8240517e-05</Real>
+    <Real>1.7410239e-05</Real>
+    <Real>1.8709565e-05</Real>
+    <Real>2.0682788e-05</Real>
+    <Real>2.2414559e-05</Real>
+    <Real>2.3641453e-05</Real>
+    <Real>2.9956356e-05</Real>
+    <Real>3.1942258e-05</Real>
+    <Real>3.2165972e-05</Real>
+    <Real>2.3073231e-05</Real>
+    <Real>2.1864589e-05</Real>
+    <Real>2.3307522e-05</Real>
+    <Real>2.6105658e-05</Real>
+    <Real>3.0764437e-05</Real>
+    <Real>2.5258372e-05</Real>
+    <Real>2.4398061e-05</Real>
+    <Real>1.5440721e-05</Real>
+    <Real>7.2866023e-06</Real>
+    <Real>4.1072926e-06</Real>
+    <Real>1.3465999e-05</Real>
+    <Real>9.5875193e-06</Real>
+    <Real>3.303629e-06</Real>
+    <Real>-9.6435542e-06</Real>
+    <Real>-1.4834303e-05</Real>
+    <Real>-1.3345806e-05</Real>
+    <Real>-1.2496928e-05</Real>
+    <Real>-1.2373329e-05</Real>
+    <Real>-1.9174164e-05</Real>
+    <Real>-2.2750348e-05</Real>
+    <Real>-1.0412362e-05</Real>
+    <Real>-7.1453283e-06</Real>
+    <Real>-5.0996732e-06</Real>
+    <Real>-1.4278352e-06</Real>
+    <Real>1.091708e-05</Real>
+    <Real>6.6890452e-06</Real>
+    <Real>2.0174368e-05</Real>
+    <Real>1.0472003e-05</Real>
+    <Real>4.7418193e-06</Real>
+    <Real>9.2978889e-06</Real>
+    <Real>4.5979341e-06</Real>
+    <Real>1.164395e-05</Real>
+    <Real>-1.1824308e-05</Real>
+    <Real>-1.2670253e-05</Real>
+    <Real>-7.1008421e-06</Real>
+    <Real>4.0426371e-06</Real>
+    <Real>9.691882e-06</Real>
+    <Real>3.4888384e-05</Real>
+    <Real>2.3447481e-05</Real>
+    <Real>6.0634087e-05</Real>
+    <Real>4.6600537e-05</Real>
+    <Real>3.8806083e-05</Real>
+    <Real>4.0546623e-05</Real>
+    <Real>5.6960853e-05</Real>
+    <Real>1.7836719e-05</Real>
+    <Real>-8.4526189e-05</Real>
+    <Real>-0.00019142308</Real>
+  </Sequence>
+  <Real Name="Integral">0.54968381075777017</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacRcross.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacRcross.xml
new file mode 100644 (file)
index 0000000..a08bdab
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>0</Real>
+    <Real>0.0022387446</Real>
+    <Real>0.0035028025</Real>
+    <Real>0.0056085354</Real>
+    <Real>0.0086741624</Real>
+    <Real>0.011819702</Real>
+    <Real>0.015920334</Real>
+    <Real>0.020022845</Real>
+    <Real>0.024242017</Real>
+    <Real>0.028022908</Real>
+    <Real>0.032008588</Real>
+    <Real>0.034803107</Real>
+    <Real>0.037513334</Real>
+    <Real>0.039289925</Real>
+    <Real>0.039613295</Real>
+    <Real>0.040232945</Real>
+    <Real>0.039999284</Real>
+    <Real>0.038773619</Real>
+    <Real>0.037022036</Real>
+    <Real>0.03395154</Real>
+    <Real>0.030716933</Real>
+    <Real>0.027687127</Real>
+    <Real>0.024219509</Real>
+    <Real>0.020108201</Real>
+    <Real>0.01619355</Real>
+    <Real>0.013057033</Real>
+    <Real>0.0098494859</Real>
+    <Real>0.0073886877</Real>
+    <Real>0.0050956123</Real>
+    <Real>0.0031476091</Real>
+    <Real>0.0022303942</Real>
+    <Real>0.0014421673</Real>
+    <Real>0.0015605417</Real>
+    <Real>0.0023478915</Real>
+    <Real>0.0032595003</Real>
+    <Real>0.0048598177</Real>
+    <Real>0.0068661571</Real>
+    <Real>0.0093070166</Real>
+    <Real>0.01151516</Real>
+    <Real>0.014135026</Real>
+    <Real>0.015877407</Real>
+    <Real>0.017582361</Real>
+    <Real>0.020061353</Real>
+    <Real>0.021256194</Real>
+    <Real>0.022746835</Real>
+    <Real>0.023190113</Real>
+    <Real>0.023767922</Real>
+    <Real>0.023968713</Real>
+    <Real>0.023062855</Real>
+    <Real>0.022064622</Real>
+    <Real>0.020306958</Real>
+    <Real>0.019000532</Real>
+    <Real>0.017193301</Real>
+    <Real>0.014820882</Real>
+    <Real>0.012806546</Real>
+    <Real>0.01087003</Real>
+    <Real>0.0087013068</Real>
+    <Real>0.006995955</Real>
+    <Real>0.0053816945</Real>
+    <Real>0.0039921342</Real>
+    <Real>0.0027184775</Real>
+    <Real>0.0019667295</Real>
+    <Real>0.0015231621</Real>
+    <Real>0.0012839382</Real>
+    <Real>0.0015572251</Real>
+    <Real>0.0018984043</Real>
+    <Real>0.0027348096</Real>
+    <Real>0.0038960488</Real>
+    <Real>0.0049909945</Real>
+    <Real>0.0061516701</Real>
+    <Real>0.0075028935</Real>
+    <Real>0.0090615265</Real>
+    <Real>0.010369415</Real>
+    <Real>0.011767319</Real>
+    <Real>0.012683169</Real>
+    <Real>0.013795277</Real>
+    <Real>0.014282157</Real>
+    <Real>0.014870015</Real>
+    <Real>0.014935284</Real>
+    <Real>0.01447196</Real>
+    <Real>0.014191067</Real>
+    <Real>0.013750138</Real>
+    <Real>0.012850181</Real>
+    <Real>0.011913967</Real>
+    <Real>0.010623846</Real>
+    <Real>0.0090860547</Real>
+    <Real>0.0075213881</Real>
+    <Real>0.0063633667</Real>
+    <Real>0.0050101974</Real>
+    <Real>0.0040042601</Real>
+    <Real>0.0031182179</Real>
+    <Real>0.0022295942</Real>
+    <Real>0.0017177914</Real>
+    <Real>0.0013426655</Real>
+    <Real>0.0011556742</Real>
+    <Real>0.0012329743</Real>
+    <Real>0.0015336524</Real>
+    <Real>0.0020214748</Real>
+    <Real>0.002688495</Real>
+    <Real>0.003164774</Real>
+    <Real>0.0040248022</Real>
+    <Real>0.0049421801</Real>
+    <Real>0.0056449943</Real>
+    <Real>0.0064900178</Real>
+    <Real>0.0073318691</Real>
+    <Real>0.0079388851</Real>
+    <Real>0.008348099</Real>
+    <Real>0.0085937753</Real>
+    <Real>0.0088053253</Real>
+    <Real>0.0089643188</Real>
+    <Real>0.008462159</Real>
+    <Real>0.0081677679</Real>
+    <Real>0.0077010952</Real>
+    <Real>0.0069283829</Real>
+    <Real>0.006470554</Real>
+    <Real>0.005889717</Real>
+    <Real>0.0050404803</Real>
+    <Real>0.0043520979</Real>
+    <Real>0.0038374509</Real>
+    <Real>0.0031289412</Real>
+    <Real>0.0025550255</Real>
+    <Real>0.0020456621</Real>
+    <Real>0.001599103</Real>
+    <Real>0.0014034451</Real>
+    <Real>0.0012568776</Real>
+    <Real>0.0012050986</Real>
+    <Real>0.0012863051</Real>
+    <Real>0.0015274084</Real>
+    <Real>0.0017116911</Real>
+    <Real>0.0021996475</Real>
+    <Real>0.0025582563</Real>
+    <Real>0.0031697224</Real>
+    <Real>0.0036516772</Real>
+    <Real>0.0039112582</Real>
+    <Real>0.004503814</Real>
+    <Real>0.0045496449</Real>
+    <Real>0.0050086039</Real>
+    <Real>0.0053778985</Real>
+    <Real>0.0057354039</Real>
+    <Real>0.0060177911</Real>
+    <Real>0.0058440645</Real>
+    <Real>0.0055686114</Real>
+    <Real>0.0052352445</Real>
+    <Real>0.0049270913</Real>
+    <Real>0.0048669502</Real>
+    <Real>0.0044287615</Real>
+    <Real>0.0041116709</Real>
+    <Real>0.0037526242</Real>
+    <Real>0.0034778048</Real>
+    <Real>0.0031402872</Real>
+    <Real>0.0026885001</Real>
+    <Real>0.0022954869</Real>
+    <Real>0.0020505243</Real>
+    <Real>0.0017681995</Real>
+    <Real>0.001462435</Real>
+    <Real>0.0014559019</Real>
+    <Real>0.0014701682</Real>
+    <Real>0.0013319635</Real>
+    <Real>0.0015024599</Real>
+    <Real>0.0015520391</Real>
+    <Real>0.0018194491</Real>
+    <Real>0.0021310409</Real>
+    <Real>0.0023092343</Real>
+    <Real>0.0024470286</Real>
+    <Real>0.0026841904</Real>
+    <Real>0.0029517743</Real>
+    <Real>0.0030204616</Real>
+    <Real>0.0031903982</Real>
+    <Real>0.0035431373</Real>
+    <Real>0.0036453719</Real>
+    <Real>0.0038470726</Real>
+    <Real>0.003884491</Real>
+    <Real>0.003770831</Real>
+    <Real>0.0036215147</Real>
+    <Real>0.0034913709</Real>
+    <Real>0.0032639375</Real>
+    <Real>0.0030114818</Real>
+    <Real>0.0029031846</Real>
+    <Real>0.0027138728</Real>
+    <Real>0.0025935557</Real>
+    <Real>0.0024792887</Real>
+    <Real>0.0023132155</Real>
+    <Real>0.0020489933</Real>
+    <Real>0.0017954031</Real>
+    <Real>0.0016809653</Real>
+    <Real>0.0016296633</Real>
+    <Real>0.0015161918</Real>
+    <Real>0.0015554987</Real>
+    <Real>0.0015267093</Real>
+    <Real>0.0014726454</Real>
+    <Real>0.0015520853</Real>
+    <Real>0.0015158142</Real>
+    <Real>0.0017054193</Real>
+    <Real>0.0017699038</Real>
+    <Real>0.0020224431</Real>
+    <Real>0.0020263321</Real>
+    <Real>0.0022970943</Real>
+    <Real>0.0024474261</Real>
+    <Real>0.0025665488</Real>
+    <Real>0.002722204</Real>
+    <Real>0.0026923788</Real>
+    <Real>0.0027975827</Real>
+    <Real>0.0029700601</Real>
+    <Real>0.0029943788</Real>
+    <Real>0.0029474057</Real>
+    <Real>0.0027856492</Real>
+    <Real>0.002572892</Real>
+    <Real>0.0024962148</Real>
+    <Real>0.0024007454</Real>
+    <Real>0.0024167555</Real>
+    <Real>0.0022556121</Real>
+    <Real>0.0022061216</Real>
+    <Real>0.0021027932</Real>
+    <Real>0.0019645824</Real>
+    <Real>0.001897946</Real>
+    <Real>0.0017563587</Real>
+    <Real>0.0016798339</Real>
+    <Real>0.0016300865</Real>
+    <Real>0.0016609513</Real>
+    <Real>0.0016948835</Real>
+    <Real>0.0016175172</Real>
+    <Real>0.0016812063</Real>
+    <Real>0.0017271228</Real>
+    <Real>0.00175084</Real>
+    <Real>0.0019140517</Real>
+    <Real>0.0019397533</Real>
+    <Real>0.0018281466</Real>
+    <Real>0.0019714897</Real>
+    <Real>0.0020356507</Real>
+    <Real>0.0018801339</Real>
+    <Real>0.0020357326</Real>
+    <Real>0.0021443837</Real>
+    <Real>0.0021825135</Real>
+    <Real>0.0021718931</Real>
+    <Real>0.0022797454</Real>
+    <Real>0.0023199783</Real>
+    <Real>0.0023760132</Real>
+    <Real>0.002417963</Real>
+    <Real>0.0024605121</Real>
+    <Real>0.0024108223</Real>
+    <Real>0.0024090286</Real>
+    <Real>0.0024217165</Real>
+    <Real>0.0023988171</Real>
+    <Real>0.0022688324</Real>
+    <Real>0.0023057433</Real>
+    <Real>0.0022299876</Real>
+    <Real>0.0021526574</Real>
+    <Real>0.0022378063</Real>
+    <Real>0.0020277784</Real>
+    <Real>0.002016233</Real>
+    <Real>0.0020046735</Real>
+    <Real>-0.294002</Real>
+    <Real>-0.177398</Real>
+    <Real>-0.39839</Real>
+    <Real>-0.48773</Real>
+    <Real>-0.172094</Real>
+    <Real>-0.41209301</Real>
+    <Real>-0.408075</Real>
+    <Real>-0.30323401</Real>
+    <Real>-0.31504101</Real>
+    <Real>-0.36764601</Real>
+    <Real>-0.22680099</Real>
+    <Real>-0.362151</Real>
+    <Real>-0.37852699</Real>
+    <Real>-0.41337499</Real>
+    <Real>-0.42870599</Real>
+    <Real>-0.370096</Real>
+    <Real>-0.39703399</Real>
+    <Real>-0.43473601</Real>
+    <Real>-0.35783899</Real>
+    <Real>-0.31582201</Real>
+    <Real>-0.398561</Real>
+    <Real>-0.209665</Real>
+    <Real>-0.403451</Real>
+    <Real>-0.45481399</Real>
+    <Real>-0.29749301</Real>
+    <Real>-0.32480201</Real>
+    <Real>-0.386527</Real>
+    <Real>-0.19479001</Real>
+    <Real>-0.36277401</Real>
+    <Real>-0.33375701</Real>
+    <Real>-0.28211099</Real>
+    <Real>-0.394546</Real>
+    <Real>-0.406385</Real>
+    <Real>-0.114484</Real>
+    <Real>-0.42001301</Real>
+    <Real>-0.403752</Real>
+    <Real>-0.20651101</Real>
+    <Real>-0.30948099</Real>
+    <Real>-0.34128401</Real>
+    <Real>-0.120096</Real>
+    <Real>-0.45341599</Real>
+    <Real>-0.31077701</Real>
+    <Real>-0.119248</Real>
+    <Real>-0.43382999</Real>
+    <Real>-0.175929</Real>
+    <Real>0.033982199</Real>
+    <Real>-0.33926401</Real>
+    <Real>-0.195425</Real>
+    <Real>-0.071849696</Real>
+    <Real>-0.37102601</Real>
+    <Real>-0.21621799</Real>
+    <Real>0.0139881</Real>
+    <Real>-0.35108399</Real>
+    <Real>-0.138989</Real>
+    <Real>0.052345399</Real>
+    <Real>-0.32499999</Real>
+    <Real>-0.14821599</Real>
+    <Real>0.042676602</Real>
+    <Real>-0.28181201</Real>
+    <Real>-0.126936</Real>
+    <Real>0.0222029</Real>
+    <Real>-0.287808</Real>
+    <Real>-0.071663201</Real>
+    <Real>0.13822199</Real>
+    <Real>-0.185139</Real>
+    <Real>-0.0152797</Real>
+    <Real>0.230471</Real>
+    <Real>-0.22155701</Real>
+    <Real>0.0130399</Real>
+    <Real>0.208427</Real>
+    <Real>-0.127197</Real>
+    <Real>0.0064887698</Real>
+    <Real>0.236035</Real>
+    <Real>-0.140938</Real>
+    <Real>0.192555</Real>
+    <Real>0.148371</Real>
+    <Real>-0.121454</Real>
+    <Real>0.073920898</Real>
+    <Real>0.32382101</Real>
+    <Real>-0.075303599</Real>
+    <Real>0.187121</Real>
+    <Real>0.197079</Real>
+    <Real>0.088469401</Real>
+    <Real>0.14371</Real>
+    <Real>0.346057</Real>
+    <Real>0.072195202</Real>
+    <Real>0.120678</Real>
+    <Real>0.37142599</Real>
+    <Real>0.134703</Real>
+    <Real>0.161566</Real>
+    <Real>0.34491301</Real>
+    <Real>0.110235</Real>
+    <Real>0.223032</Real>
+    <Real>0.215381</Real>
+    <Real>0.15115701</Real>
+    <Real>0.337161</Real>
+    <Real>0.34478301</Real>
+    <Real>0.154284</Real>
+    <Real>0.217981</Real>
+    <Real>0.31849399</Real>
+    <Real>0.27069601</Real>
+    <Real>0.32320201</Real>
+    <Real>0.201975</Real>
+    <Real>0.13255</Real>
+    <Real>0.19012199</Real>
+    <Real>0.22415</Real>
+    <Real>0.33738399</Real>
+    <Real>0.24033999</Real>
+    <Real>0.292528</Real>
+    <Real>0.231969</Real>
+    <Real>0.26378</Real>
+    <Real>0.30350101</Real>
+    <Real>0.23063</Real>
+    <Real>0.299878</Real>
+    <Real>0.15784501</Real>
+    <Real>0.276788</Real>
+    <Real>0.36825699</Real>
+    <Real>0.193731</Real>
+    <Real>0.21615</Real>
+    <Real>0.207757</Real>
+    <Real>0.136564</Real>
+    <Real>0.26222599</Real>
+    <Real>0.210265</Real>
+    <Real>0.13002799</Real>
+    <Real>0.20605899</Real>
+    <Real>0.152711</Real>
+    <Real>0.195077</Real>
+    <Real>0.29734299</Real>
+    <Real>0.237324</Real>
+    <Real>0.118121</Real>
+    <Real>0.29328901</Real>
+    <Real>0.22663499</Real>
+    <Real>0.075010903</Real>
+    <Real>0.26577801</Real>
+    <Real>0.119711</Real>
+    <Real>0.106759</Real>
+    <Real>0.27516001</Real>
+    <Real>0.105753</Real>
+    <Real>0.093085699</Real>
+    <Real>0.25944301</Real>
+    <Real>0.195959</Real>
+    <Real>0.0504844</Real>
+    <Real>0.237343</Real>
+    <Real>0.142589</Real>
+    <Real>-0.089643501</Real>
+    <Real>0.282426</Real>
+    <Real>0.148966</Real>
+    <Real>-0.0323091</Real>
+    <Real>0.160483</Real>
+    <Real>0.035948101</Real>
+    <Real>-0.078566097</Real>
+    <Real>0.21877199</Real>
+    <Real>0.129273</Real>
+    <Real>-0.15982699</Real>
+    <Real>0.0853457</Real>
+    <Real>0.116802</Real>
+    <Real>-0.041748598</Real>
+    <Real>0.20506001</Real>
+    <Real>0.082346298</Real>
+    <Real>-0.033599202</Real>
+    <Real>0.094616003</Real>
+    <Real>0.019920699</Real>
+    <Real>-0.046248399</Real>
+    <Real>0.024650799</Real>
+    <Real>-0.0416026</Real>
+    <Real>-0.098334201</Real>
+    <Real>0.063990101</Real>
+    <Real>-0.13928699</Real>
+    <Real>-0.242319</Real>
+    <Real>0.024995901</Real>
+    <Real>-0.18093801</Real>
+    <Real>-0.249294</Real>
+    <Real>0.032946199</Real>
+    <Real>-0.159826</Real>
+    <Real>-0.23584101</Real>
+    <Real>0.016282201</Real>
+    <Real>-0.196504</Real>
+    <Real>-0.23710801</Real>
+    <Real>-0.0406349</Real>
+    <Real>-0.11625</Real>
+    <Real>-0.115526</Real>
+    <Real>0.035594702</Real>
+    <Real>-0.100031</Real>
+    <Real>-0.131438</Real>
+    <Real>-0.148066</Real>
+    <Real>-0.246914</Real>
+    <Real>-0.228278</Real>
+    <Real>-0.128664</Real>
+    <Real>-0.151379</Real>
+    <Real>-0.120204</Real>
+    <Real>-0.20564</Real>
+    <Real>-0.19493499</Real>
+    <Real>-0.223316</Real>
+    <Real>-0.20992599</Real>
+    <Real>-0.293475</Real>
+    <Real>-0.181631</Real>
+    <Real>-0.15154199</Real>
+    <Real>-0.18523701</Real>
+    <Real>-0.277973</Real>
+    <Real>-0.212514</Real>
+    <Real>-0.25714999</Real>
+    <Real>-0.106606</Real>
+    <Real>-0.17149</Real>
+    <Real>-0.28705299</Real>
+    <Real>-0.17783999</Real>
+    <Real>-0.288715</Real>
+    <Real>-0.13793799</Real>
+    <Real>-0.15577</Real>
+    <Real>-0.101648</Real>
+    <Real>-0.29286501</Real>
+    <Real>-0.15349799</Real>
+    <Real>-0.196582</Real>
+    <Real>-0.151655</Real>
+    <Real>-0.105669</Real>
+    <Real>-0.233206</Real>
+    <Real>-0.205688</Real>
+    <Real>-0.120301</Real>
+    <Real>-0.30407101</Real>
+    <Real>-0.27380499</Real>
+    <Real>-0.0567232</Real>
+    <Real>-0.26257399</Real>
+    <Real>-0.213572</Real>
+    <Real>-0.188062</Real>
+    <Real>-0.234014</Real>
+    <Real>-0.147396</Real>
+    <Real>-0.130597</Real>
+    <Real>-0.127922</Real>
+    <Real>-0.16339099</Real>
+    <Real>-0.141241</Real>
+    <Real>-0.14472499</Real>
+    <Real>-0.10392</Real>
+    <Real>-0.0510807</Real>
+    <Real>-0.247492</Real>
+    <Real>-0.058272298</Real>
+    <Real>-0.0082769198</Real>
+    <Real>-0.25879499</Real>
+    <Real>-0.19123399</Real>
+    <Real>0.077861302</Real>
+    <Real>-0.074387997</Real>
+    <Real>-0.142011</Real>
+    <Real>0.081611998</Real>
+    <Real>-0.12735599</Real>
+    <Real>-0.153745</Real>
+    <Real>0.078688301</Real>
+    <Real>-0.12088</Real>
+    <Real>-0.122613</Real>
+    <Real>0.067525104</Real>
+    <Real>-0.13781101</Real>
+    <Real>0.023367999</Real>
+    <Real>0.057603098</Real>
+  </Sequence>
+  <Real Name="Integral">-12.673485642531887</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacVector.xml b/src/gromacs/correlationfunctions/tests/refdata/AutocorrTest_EacVector.xml
new file mode 100644 (file)
index 0000000..d318d51
--- /dev/null
@@ -0,0 +1,509 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="AutocorrelationFunction">
+    <Int Name="Length">501</Int>
+    <Real>1</Real>
+    <Real>0.91440845</Real>
+    <Real>0.89127165</Real>
+    <Real>0.85387266</Real>
+    <Real>0.81370103</Real>
+    <Real>0.7681002</Real>
+    <Real>0.70884496</Real>
+    <Real>0.65127754</Real>
+    <Real>0.58396322</Real>
+    <Real>0.50845456</Real>
+    <Real>0.43051061</Real>
+    <Real>0.35105249</Real>
+    <Real>0.26587203</Real>
+    <Real>0.18143819</Real>
+    <Real>0.097567506</Real>
+    <Real>0.015512385</Real>
+    <Real>-0.068423927</Real>
+    <Real>-0.1456465</Real>
+    <Real>-0.22284648</Real>
+    <Real>-0.29907748</Real>
+    <Real>-0.37475094</Real>
+    <Real>-0.4380517</Real>
+    <Real>-0.49662268</Real>
+    <Real>-0.55154026</Real>
+    <Real>-0.60047692</Real>
+    <Real>-0.64397019</Real>
+    <Real>-0.67695993</Real>
+    <Real>-0.69747227</Real>
+    <Real>-0.71946371</Real>
+    <Real>-0.73064023</Real>
+    <Real>-0.73969084</Real>
+    <Real>-0.73910058</Real>
+    <Real>-0.72273451</Real>
+    <Real>-0.70480442</Real>
+    <Real>-0.68460542</Real>
+    <Real>-0.65121585</Real>
+    <Real>-0.61127657</Real>
+    <Real>-0.56959647</Real>
+    <Real>-0.53186774</Real>
+    <Real>-0.47233477</Real>
+    <Real>-0.42289308</Real>
+    <Real>-0.36013916</Real>
+    <Real>-0.30238953</Real>
+    <Real>-0.23851043</Real>
+    <Real>-0.17228492</Real>
+    <Real>-0.10760929</Real>
+    <Real>-0.038677685</Real>
+    <Real>0.023924842</Real>
+    <Real>0.085734844</Real>
+    <Real>0.14554502</Real>
+    <Real>0.21178007</Real>
+    <Real>0.26366264</Real>
+    <Real>0.31547186</Real>
+    <Real>0.36479235</Real>
+    <Real>0.41372058</Real>
+    <Real>0.45014268</Real>
+    <Real>0.48719069</Real>
+    <Real>0.51477271</Real>
+    <Real>0.54144377</Real>
+    <Real>0.55743951</Real>
+    <Real>0.56827539</Real>
+    <Real>0.57417756</Real>
+    <Real>0.57521474</Real>
+    <Real>0.57242984</Real>
+    <Real>0.56181103</Real>
+    <Real>0.54661202</Real>
+    <Real>0.5273785</Real>
+    <Real>0.49807823</Real>
+    <Real>0.46791199</Real>
+    <Real>0.43094185</Real>
+    <Real>0.39116937</Real>
+    <Real>0.34865311</Real>
+    <Real>0.30475527</Real>
+    <Real>0.26447845</Real>
+    <Real>0.20973703</Real>
+    <Real>0.16015707</Real>
+    <Real>0.10805874</Real>
+    <Real>0.059454329</Real>
+    <Real>0.0076480238</Real>
+    <Real>-0.045675594</Real>
+    <Real>-0.089126058</Real>
+    <Real>-0.14246953</Real>
+    <Real>-0.18825532</Real>
+    <Real>-0.22974341</Real>
+    <Real>-0.27582318</Real>
+    <Real>-0.30692092</Real>
+    <Real>-0.34222001</Real>
+    <Real>-0.37205994</Real>
+    <Real>-0.39867413</Real>
+    <Real>-0.42049485</Real>
+    <Real>-0.43268493</Real>
+    <Real>-0.446363</Real>
+    <Real>-0.45471677</Real>
+    <Real>-0.45743033</Real>
+    <Real>-0.45754004</Real>
+    <Real>-0.44663361</Real>
+    <Real>-0.43691492</Real>
+    <Real>-0.42143744</Real>
+    <Real>-0.39964595</Real>
+    <Real>-0.37948313</Real>
+    <Real>-0.35078076</Real>
+    <Real>-0.32291207</Real>
+    <Real>-0.28617722</Real>
+    <Real>-0.25431877</Real>
+    <Real>-0.21413048</Real>
+    <Real>-0.17472994</Real>
+    <Real>-0.13722105</Real>
+    <Real>-0.0940689</Real>
+    <Real>-0.050582096</Real>
+    <Real>-0.011372223</Real>
+    <Real>0.033095215</Real>
+    <Real>0.064681761</Real>
+    <Real>0.10605592</Real>
+    <Real>0.13676096</Real>
+    <Real>0.17619975</Real>
+    <Real>0.20634755</Real>
+    <Real>0.23424256</Real>
+    <Real>0.26192936</Real>
+    <Real>0.28315401</Real>
+    <Real>0.31159228</Real>
+    <Real>0.32296148</Real>
+    <Real>0.3337082</Real>
+    <Real>0.3472271</Real>
+    <Real>0.35520938</Real>
+    <Real>0.35884556</Real>
+    <Real>0.35598138</Real>
+    <Real>0.36070585</Real>
+    <Real>0.34978899</Real>
+    <Real>0.33616209</Real>
+    <Real>0.32133636</Real>
+    <Real>0.30463791</Real>
+    <Real>0.28434399</Real>
+    <Real>0.26060301</Real>
+    <Real>0.23513913</Real>
+    <Real>0.21211421</Real>
+    <Real>0.18200785</Real>
+    <Real>0.15506685</Real>
+    <Real>0.11292174</Real>
+    <Real>0.08485233</Real>
+    <Real>0.048554849</Real>
+    <Real>0.015430034</Real>
+    <Real>-0.0053237719</Real>
+    <Real>-0.043886948</Real>
+    <Real>-0.069251105</Real>
+    <Real>-0.099874027</Real>
+    <Real>-0.1318848</Real>
+    <Real>-0.15587749</Real>
+    <Real>-0.18213047</Real>
+    <Real>-0.19872877</Real>
+    <Real>-0.22116253</Real>
+    <Real>-0.23839074</Real>
+    <Real>-0.24964274</Real>
+    <Real>-0.25999296</Real>
+    <Real>-0.26915544</Real>
+    <Real>-0.28208914</Real>
+    <Real>-0.28375041</Real>
+    <Real>-0.2840305</Real>
+    <Real>-0.28654379</Real>
+    <Real>-0.27391881</Real>
+    <Real>-0.26717883</Real>
+    <Real>-0.25783545</Real>
+    <Real>-0.24391536</Real>
+    <Real>-0.23143035</Real>
+    <Real>-0.21355876</Real>
+    <Real>-0.19516303</Real>
+    <Real>-0.17305651</Real>
+    <Real>-0.14851433</Real>
+    <Real>-0.13391782</Real>
+    <Real>-0.10106573</Real>
+    <Real>-0.079669952</Real>
+    <Real>-0.054322001</Real>
+    <Real>-0.022567146</Real>
+    <Real>-0.0082916291</Real>
+    <Real>0.028239559</Real>
+    <Real>0.044842608</Real>
+    <Real>0.066723041</Real>
+    <Real>0.086818486</Real>
+    <Real>0.11206019</Real>
+    <Real>0.13034853</Real>
+    <Real>0.14292336</Real>
+    <Real>0.16384037</Real>
+    <Real>0.17437287</Real>
+    <Real>0.19422586</Real>
+    <Real>0.19642359</Real>
+    <Real>0.20773162</Real>
+    <Real>0.21621291</Real>
+    <Real>0.22017281</Real>
+    <Real>0.21870746</Real>
+    <Real>0.22144818</Real>
+    <Real>0.21968257</Real>
+    <Real>0.21284904</Real>
+    <Real>0.20909898</Real>
+    <Real>0.20217142</Real>
+    <Real>0.19360588</Real>
+    <Real>0.18018678</Real>
+    <Real>0.16507152</Real>
+    <Real>0.14102207</Real>
+    <Real>0.13159586</Real>
+    <Real>0.11218439</Real>
+    <Real>0.090035476</Real>
+    <Real>0.069503993</Real>
+    <Real>0.054288179</Real>
+    <Real>0.034861948</Real>
+    <Real>0.013234816</Real>
+    <Real>-0.0047988398</Real>
+    <Real>-0.024740862</Real>
+    <Real>-0.042112309</Real>
+    <Real>-0.057106286</Real>
+    <Real>-0.079133794</Real>
+    <Real>-0.08531253</Real>
+    <Real>-0.10183473</Real>
+    <Real>-0.11679</Real>
+    <Real>-0.13124378</Real>
+    <Real>-0.13978031</Real>
+    <Real>-0.15192363</Real>
+    <Real>-0.15962306</Real>
+    <Real>-0.16721499</Real>
+    <Real>-0.17583407</Real>
+    <Real>-0.17053062</Real>
+    <Real>-0.17783985</Real>
+    <Real>-0.17420124</Real>
+    <Real>-0.16439037</Real>
+    <Real>-0.16967009</Real>
+    <Real>-0.16545986</Real>
+    <Real>-0.15178227</Real>
+    <Real>-0.1513456</Real>
+    <Real>-0.13972749</Real>
+    <Real>-0.12844835</Real>
+    <Real>-0.11278458</Real>
+    <Real>-0.10008006</Real>
+    <Real>-0.084673822</Real>
+    <Real>-0.071988769</Real>
+    <Real>-0.055301242</Real>
+    <Real>-0.044846795</Real>
+    <Real>-0.024612129</Real>
+    <Real>-0.012670649</Real>
+    <Real>0.0064235702</Real>
+    <Real>0.017517105</Real>
+    <Real>0.032193232</Real>
+    <Real>0.05088919</Real>
+    <Real>0.059888519</Real>
+    <Real>0.073218867</Real>
+    <Real>0.084005043</Real>
+    <Real>0.097417012</Real>
+    <Real>0.11064502</Real>
+    <Real>0.11908618</Real>
+    <Real>0.12669091</Real>
+    <Real>0.12785465</Real>
+    <Real>0.13891017</Real>
+    <Real>0.14016822</Real>
+    <Real>0.15007298</Real>
+    <Real>4.4267403e-05</Real>
+    <Real>4.3514352e-05</Real>
+    <Real>4.3138727e-05</Real>
+    <Real>4.1891646e-05</Real>
+    <Real>4.0179297e-05</Real>
+    <Real>3.8032213e-05</Real>
+    <Real>3.7556416e-05</Real>
+    <Real>3.5218971e-05</Real>
+    <Real>3.1478037e-05</Real>
+    <Real>3.0895699e-05</Real>
+    <Real>2.615025e-05</Real>
+    <Real>2.0906495e-05</Real>
+    <Real>1.7488654e-05</Real>
+    <Real>1.3209424e-05</Real>
+    <Real>9.7491848e-06</Real>
+    <Real>6.3581501e-06</Real>
+    <Real>5.6303825e-06</Real>
+    <Real>-5.1143962e-07</Real>
+    <Real>-4.6430905e-06</Real>
+    <Real>-8.4661779e-06</Real>
+    <Real>-1.0448402e-05</Real>
+    <Real>-1.6193704e-05</Real>
+    <Real>-1.857411e-05</Real>
+    <Real>-2.250258e-05</Real>
+    <Real>-2.3523124e-05</Real>
+    <Real>-2.7104035e-05</Real>
+    <Real>-2.8832133e-05</Real>
+    <Real>-2.9649824e-05</Real>
+    <Real>-3.12257e-05</Real>
+    <Real>-3.2669741e-05</Real>
+    <Real>-3.3304954e-05</Real>
+    <Real>-3.3183347e-05</Real>
+    <Real>-3.4332639e-05</Real>
+    <Real>-3.3677767e-05</Real>
+    <Real>-3.4504159e-05</Real>
+    <Real>-3.454684e-05</Real>
+    <Real>-3.2467542e-05</Real>
+    <Real>-2.9868665e-05</Real>
+    <Real>-2.9505636e-05</Real>
+    <Real>-2.6500937e-05</Real>
+    <Real>-2.6333106e-05</Real>
+    <Real>-2.3109949e-05</Real>
+    <Real>-2.140675e-05</Real>
+    <Real>-1.6538143e-05</Real>
+    <Real>-1.4951454e-05</Real>
+    <Real>-1.0329346e-05</Real>
+    <Real>-8.6922209e-06</Real>
+    <Real>-6.4748251e-06</Real>
+    <Real>-2.4234089e-06</Real>
+    <Real>2.1927521e-07</Real>
+    <Real>2.7016404e-06</Real>
+    <Real>3.5660794e-06</Real>
+    <Real>6.7710325e-06</Real>
+    <Real>1.154716e-05</Real>
+    <Real>1.27539e-05</Real>
+    <Real>1.4957743e-05</Real>
+    <Real>1.8768704e-05</Real>
+    <Real>1.983804e-05</Real>
+    <Real>2.258397e-05</Real>
+    <Real>2.3245073e-05</Real>
+    <Real>2.5949555e-05</Real>
+    <Real>2.7714603e-05</Real>
+    <Real>2.4125953e-05</Real>
+    <Real>2.7313827e-05</Real>
+    <Real>2.6500267e-05</Real>
+    <Real>2.8872726e-05</Real>
+    <Real>2.8494722e-05</Real>
+    <Real>2.8652294e-05</Real>
+    <Real>2.6291838e-05</Real>
+    <Real>2.3836281e-05</Real>
+    <Real>2.2856551e-05</Real>
+    <Real>2.24215e-05</Real>
+    <Real>2.2928167e-05</Real>
+    <Real>2.0600462e-05</Real>
+    <Real>2.1569322e-05</Real>
+    <Real>1.8669114e-05</Real>
+    <Real>1.6274531e-05</Real>
+    <Real>1.3573073e-05</Real>
+    <Real>1.2755655e-05</Real>
+    <Real>9.1842421e-06</Real>
+    <Real>4.9424475e-06</Real>
+    <Real>1.9999163e-06</Real>
+    <Real>1.2401867e-06</Real>
+    <Real>-3.0244464e-06</Real>
+    <Real>-7.6198962e-06</Real>
+    <Real>-9.8329774e-06</Real>
+    <Real>-8.8280267e-06</Real>
+    <Real>-1.377236e-05</Real>
+    <Real>-1.6982995e-05</Real>
+    <Real>-1.9108473e-05</Real>
+    <Real>-2.0853575e-05</Real>
+    <Real>-2.3638708e-05</Real>
+    <Real>-2.4330864e-05</Real>
+    <Real>-2.3607576e-05</Real>
+    <Real>-2.3350785e-05</Real>
+    <Real>-2.4861311e-05</Real>
+    <Real>-2.4024377e-05</Real>
+    <Real>-2.7649214e-05</Real>
+    <Real>-3.0116586e-05</Real>
+    <Real>-2.7083521e-05</Real>
+    <Real>-2.6461454e-05</Real>
+    <Real>-2.5706378e-05</Real>
+    <Real>-2.3319637e-05</Real>
+    <Real>-2.2089596e-05</Real>
+    <Real>-1.7878658e-05</Real>
+    <Real>-1.7124203e-05</Real>
+    <Real>-1.5375375e-05</Real>
+    <Real>-1.5521959e-05</Real>
+    <Real>-1.172509e-05</Real>
+    <Real>-9.1009997e-06</Real>
+    <Real>-5.6435597e-06</Real>
+    <Real>-2.9174676e-06</Real>
+    <Real>-5.4268908e-06</Real>
+    <Real>-1.5508874e-06</Real>
+    <Real>-3.7975212e-07</Real>
+    <Real>3.1173399e-06</Real>
+    <Real>1.9381382e-06</Real>
+    <Real>5.5445184e-06</Real>
+    <Real>6.774098e-06</Real>
+    <Real>8.9054111e-06</Real>
+    <Real>1.0997211e-05</Real>
+    <Real>1.4307585e-05</Real>
+    <Real>1.3101091e-05</Real>
+    <Real>1.5396869e-05</Real>
+    <Real>1.3836742e-05</Real>
+    <Real>1.4298585e-05</Real>
+    <Real>1.65646e-05</Real>
+    <Real>1.5446933e-05</Real>
+    <Real>1.9028628e-05</Real>
+    <Real>2.0577343e-05</Real>
+    <Real>1.6241767e-05</Real>
+    <Real>1.6588914e-05</Real>
+    <Real>1.6793663e-05</Real>
+    <Real>1.5231977e-05</Real>
+    <Real>1.3574629e-05</Real>
+    <Real>1.3824551e-05</Real>
+    <Real>1.3580589e-05</Real>
+    <Real>8.8718243e-06</Real>
+    <Real>8.9766982e-06</Real>
+    <Real>4.874571e-06</Real>
+    <Real>6.1740734e-06</Real>
+    <Real>4.3778728e-06</Real>
+    <Real>3.0633016e-06</Real>
+    <Real>2.650128e-06</Real>
+    <Real>4.4499197e-06</Real>
+    <Real>5.2487553e-07</Real>
+    <Real>3.844505e-06</Real>
+    <Real>8.3970571e-07</Real>
+    <Real>-4.0378814e-06</Real>
+    <Real>-4.2863321e-06</Real>
+    <Real>-3.9477163e-06</Real>
+    <Real>-5.5808941e-06</Real>
+    <Real>-8.159157e-06</Real>
+    <Real>-1.07823e-05</Real>
+    <Real>-1.0445928e-05</Real>
+    <Real>-1.4758529e-05</Real>
+    <Real>-1.5891597e-05</Real>
+    <Real>-1.6962238e-05</Real>
+    <Real>-1.6818865e-05</Real>
+    <Real>-1.3153352e-05</Real>
+    <Real>-1.3562746e-05</Real>
+    <Real>-1.536158e-05</Real>
+    <Real>-1.6916658e-05</Real>
+    <Real>-1.5912401e-05</Real>
+    <Real>-1.9311357e-05</Real>
+    <Real>-1.3812277e-05</Real>
+    <Real>-1.7308477e-05</Real>
+    <Real>-1.1393254e-05</Real>
+    <Real>-6.9415369e-06</Real>
+    <Real>-8.5329793e-06</Real>
+    <Real>-7.3732735e-06</Real>
+    <Real>-8.2779943e-06</Real>
+    <Real>-4.1989624e-06</Real>
+    <Real>-4.0598088e-06</Real>
+    <Real>-6.2781332e-06</Real>
+    <Real>-6.1900923e-06</Real>
+    <Real>-9.3725657e-06</Real>
+    <Real>-9.9827339e-06</Real>
+    <Real>-9.6235508e-06</Real>
+    <Real>-4.7038488e-06</Real>
+    <Real>-3.4777854e-06</Real>
+    <Real>-2.7908015e-06</Real>
+    <Real>1.7161137e-06</Real>
+    <Real>2.1103369e-06</Real>
+    <Real>1.6298396e-06</Real>
+    <Real>5.1353272e-06</Real>
+    <Real>9.7297398e-06</Real>
+    <Real>7.9292831e-06</Real>
+    <Real>1.0491432e-05</Real>
+    <Real>8.7098369e-06</Real>
+    <Real>1.1306504e-05</Real>
+    <Real>1.2767204e-05</Real>
+    <Real>1.0523996e-05</Real>
+    <Real>1.5876185e-05</Real>
+    <Real>1.8240517e-05</Real>
+    <Real>1.7410239e-05</Real>
+    <Real>1.8709565e-05</Real>
+    <Real>2.0682788e-05</Real>
+    <Real>2.2414559e-05</Real>
+    <Real>2.3641453e-05</Real>
+    <Real>2.9956356e-05</Real>
+    <Real>3.1942258e-05</Real>
+    <Real>3.2165972e-05</Real>
+    <Real>2.3073231e-05</Real>
+    <Real>2.1864589e-05</Real>
+    <Real>2.3307522e-05</Real>
+    <Real>2.6105658e-05</Real>
+    <Real>3.0764437e-05</Real>
+    <Real>2.5258372e-05</Real>
+    <Real>2.4398061e-05</Real>
+    <Real>1.5440721e-05</Real>
+    <Real>7.2866023e-06</Real>
+    <Real>4.1072926e-06</Real>
+    <Real>1.3465999e-05</Real>
+    <Real>9.5875193e-06</Real>
+    <Real>3.303629e-06</Real>
+    <Real>-9.6435542e-06</Real>
+    <Real>-1.4834303e-05</Real>
+    <Real>-1.3345806e-05</Real>
+    <Real>-1.2496928e-05</Real>
+    <Real>-1.2373329e-05</Real>
+    <Real>-1.9174164e-05</Real>
+    <Real>-2.2750348e-05</Real>
+    <Real>-1.0412362e-05</Real>
+    <Real>-7.1453283e-06</Real>
+    <Real>-5.0996732e-06</Real>
+    <Real>-1.4278352e-06</Real>
+    <Real>1.091708e-05</Real>
+    <Real>6.6890452e-06</Real>
+    <Real>2.0174368e-05</Real>
+    <Real>1.0472003e-05</Real>
+    <Real>4.7418193e-06</Real>
+    <Real>9.2978889e-06</Real>
+    <Real>4.5979341e-06</Real>
+    <Real>1.164395e-05</Real>
+    <Real>-1.1824308e-05</Real>
+    <Real>-1.2670253e-05</Real>
+    <Real>-7.1008421e-06</Real>
+    <Real>4.0426371e-06</Real>
+    <Real>9.691882e-06</Real>
+    <Real>3.4888384e-05</Real>
+    <Real>2.3447481e-05</Real>
+    <Real>6.0634087e-05</Real>
+    <Real>4.6600537e-05</Real>
+    <Real>3.8806083e-05</Real>
+    <Real>4.0546623e-05</Real>
+    <Real>5.6960853e-05</Real>
+    <Real>1.7836719e-05</Real>
+    <Real>-8.4526189e-05</Real>
+    <Real>-0.00019142308</Real>
+  </Sequence>
+  <Real Name="Integral">0.54968381075777017</Real>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnERF.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnERF.xml
new file mode 100644 (file)
index 0000000..f968c0c
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">4</Int>
+    <Real>7.8450705641969325</Real>
+    <Real>2.6181457557146546</Real>
+    <Real>-124.26093946666471</Real>
+    <Real>10.991394787222672</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnERREST.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnERREST.xml
new file mode 100644 (file)
index 0000000..05f9939
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">3</Int>
+    <Real>3.7998256591705597</Real>
+    <Real>0.82432886141340755</Real>
+    <Real>1.5224332184919882</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP1.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP1.xml
new file mode 100644 (file)
index 0000000..b39c373
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">1</Int>
+    <Real>28.790295709638542</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP2.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP2.xml
new file mode 100644 (file)
index 0000000..e30564e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">2</Int>
+    <Real>38.159752015476776</Real>
+    <Real>0.7956683286568571</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP3.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP3.xml
new file mode 100644 (file)
index 0000000..74d4d3a
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">3</Int>
+    <Real>49.669368440495347</Real>
+    <Real>0.58492964998546348</Real>
+    <Real>6.4814246273214478</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP5.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP5.xml
new file mode 100644 (file)
index 0000000..9dd9a8b
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">5</Int>
+    <Real>0.4874505859136089</Real>
+    <Real>5.593512789216291</Real>
+    <Real>0.5859548866294173</Real>
+    <Real>50.639858390563305</Real>
+    <Real>-0.002429583757534859</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP7.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP7.xml
new file mode 100644 (file)
index 0000000..20c5871
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">7</Int>
+    <Real>0.5512395081799536</Real>
+    <Real>6.5183422896301373</Real>
+    <Real>-0.67296121974350642</Real>
+    <Real>31.927951035981206</Real>
+    <Real>1.186708933085455</Real>
+    <Real>42.008654192804514</Real>
+    <Real>-0.0015455112108527936</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP9.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnEXP9.xml
new file mode 100644 (file)
index 0000000..e9ecccc
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">9</Int>
+    <Real>15.957817686967116</Real>
+    <Real>221006.78653735726</Real>
+    <Real>114.88630569000553</Real>
+    <Real>-33734.142061366547</Real>
+    <Real>7.6914607460936715</Real>
+    <Real>1876.2303193471271</Real>
+    <Real>0.75265207702909753</Real>
+    <Real>24.572552704802391</Real>
+    <Real>-138.40801944191745</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnPRES.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnPRES.xml
new file mode 100644 (file)
index 0000000..fe3d48e
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">6</Int>
+    <Real>0.2214172263311579</Real>
+    <Real>10.066519430470473</Real>
+    <Real>3.7707829256907712</Real>
+    <Real>0.72109681793857272</Real>
+    <Real>0.49886880345093437</Real>
+    <Real>1.000154618776814</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnVAC.xml b/src/gromacs/correlationfunctions/tests/refdata/ExpfitTest_EffnVAC.xml
new file mode 100644 (file)
index 0000000..35f0f01
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Sequence Name="result">
+    <Int Name="Length">2</Int>
+    <Real>1.3759034165632673</Real>
+    <Real>0.20054113811854915</Real>
+  </Sequence>
+</ReferenceData>
diff --git a/src/gromacs/correlationfunctions/tests/testCOS3.xvg b/src/gromacs/correlationfunctions/tests/testCOS3.xvg
new file mode 100644 (file)
index 0000000..6f41600
--- /dev/null
@@ -0,0 +1,501 @@
+0 0.980215 0.84786 0.55111
+1 1.00563 0.766732 0.345733
+2 0.901045 0.646807 0.342314
+3 0.911231 0.637477 0.183936
+4 0.849712 0.50242 0.0810423
+5 0.77696 0.493325 0.0698848
+6 0.755667 0.444941 0.00746138
+7 0.724674 0.250751 -0.0151029
+8 0.663689 0.319373 -0.210542
+9 0.515147 0.109105 -0.192153
+10 0.579059 0.151557 -0.32202
+11 0.486462 0.0196987 -0.367642
+12 0.306271 -0.117139 -0.533263
+13 0.286981 -0.262968 -0.578647
+14 0.128506 -0.288335 -0.520779
+15 0.106801 -0.336168 -0.54033
+16 -0.0342238 -0.438876 -0.690429
+17 -0.189242 -0.517065 -0.733008
+18 -0.102822 -0.533843 -0.761297
+19 -0.286696 -0.492504 -0.764118
+20 -0.312994 -0.626441 -0.694044
+21 -0.433176 -0.582163 -0.738222
+22 -0.473521 -0.753763 -0.794075
+23 -0.514416 -0.784329 -0.710094
+24 -0.602884 -0.627913 -0.693283
+25 -0.701922 -0.788765 -0.697599
+26 -0.624715 -0.803903 -0.603359
+27 -0.633136 -0.62592 -0.542414
+28 -0.748294 -0.610642 -0.525884
+29 -0.681519 -0.726425 -0.554219
+30 -0.818801 -0.736255 -0.477194
+31 -0.779091 -0.683083 -0.439122
+32 -0.799431 -0.537976 -0.386361
+33 -0.74211 -0.458832 -0.25837
+34 -0.734999 -0.586292 -0.291565
+35 -0.752422 -0.409693 -0.224274
+36 -0.567355 -0.318048 -0.042563
+37 -0.48962 -0.259037 0.0429618
+38 -0.631321 -0.218146 -0.0215977
+39 -0.510246 -0.104216 0.203877
+40 -0.467046 -0.120795 0.271951
+41 -0.354142 -0.147802 0.153328
+42 -0.35987 0.0901972 0.278751
+43 -0.218068 0.0617962 0.315153
+44 -0.251885 0.0498296 0.449551
+45 -0.0739778 0.10528 0.330027
+46 -0.158898 0.306042 0.352122
+47 -0.0354126 0.365281 0.461546
+48 0.0111098 0.344993 0.553061
+49 0.0293386 0.465325 0.51471
+50 0.263435 0.412229 0.581141
+51 0.26077 0.489539 0.532995
+52 0.191436 0.406404 0.59817
+53 0.239305 0.500526 0.455499
+54 0.393089 0.560054 0.428476
+55 0.459268 0.625471 0.586418
+56 0.506983 0.521062 0.464051
+57 0.548327 0.567689 0.40065
+58 0.409701 0.619339 0.369207
+59 0.532969 0.56424 0.353377
+60 0.52379 0.565401 0.446169
+61 0.448233 0.514478 0.350512
+62 0.596133 0.396408 0.225304
+63 0.437427 0.400799 0.245919
+64 0.566243 0.388444 0.133041
+65 0.549138 0.427644 0.253539
+66 0.44934 0.344726 0.191529
+67 0.562821 0.276727 0.122273
+68 0.521943 0.253548 -0.0264084
+69 0.43181 0.298105 0.00961045
+70 0.319108 0.0887345 -0.123015
+71 0.366678 0.19142 -0.058703
+72 0.233041 0.111129 -0.126821
+73 0.29502 -0.0515529 -0.179635
+74 0.190305 0.0720675 -0.211369
+75 0.0935705 -0.146145 -0.316849
+76 0.0717608 -0.0630276 -0.268758
+77 0.0181038 -0.0806319 -0.393499
+78 0.0992837 -0.160283 -0.363726
+79 -0.075659 -0.169269 -0.390363
+80 -0.0234965 -0.246341 -0.275014
+81 -0.110975 -0.346189 -0.364672
+82 -0.0849593 -0.408301 -0.351602
+83 -0.0912708 -0.434549 -0.294002
+84 -0.177398 -0.39839 -0.48773
+85 -0.172094 -0.412093 -0.408075
+86 -0.303234 -0.315041 -0.367646
+87 -0.226801 -0.362151 -0.378527
+88 -0.413375 -0.428706 -0.370096
+89 -0.397034 -0.434736 -0.357839
+90 -0.315822 -0.398561 -0.209665
+91 -0.403451 -0.454814 -0.297493
+92 -0.324802 -0.386527 -0.19479
+93 -0.362774 -0.333757 -0.282111
+94 -0.394546 -0.406385 -0.114484
+95 -0.420013 -0.403752 -0.206511
+96 -0.309481 -0.341284 -0.120096
+97 -0.453416 -0.310777 -0.119248
+98 -0.43383 -0.175929 0.0339822
+99 -0.339264 -0.195425 -0.0718497
+100 -0.371026 -0.216218 0.0139881
+101 -0.351084 -0.138989 0.0523454
+102 -0.325 -0.148216 0.0426766
+103 -0.281812 -0.126936 0.0222029
+104 -0.287808 -0.0716632 0.138222
+105 -0.185139 -0.0152797 0.230471
+106 -0.221557 0.0130399 0.208427
+107 -0.127197 0.00648877 0.236035
+108 -0.140938 0.192555 0.148371
+109 -0.121454 0.0739209 0.323821
+110 -0.0753036 0.187121 0.197079
+111 0.0884694 0.14371 0.346057
+112 0.0721952 0.120678 0.371426
+113 0.134703 0.161566 0.344913
+114 0.110235 0.223032 0.215381
+115 0.151157 0.337161 0.344783
+116 0.154284 0.217981 0.318494
+117 0.270696 0.323202 0.201975
+118 0.13255 0.190122 0.22415
+119 0.337384 0.24034 0.292528
+120 0.231969 0.26378 0.303501
+121 0.23063 0.299878 0.157845
+122 0.276788 0.368257 0.193731
+123 0.21615 0.207757 0.136564
+124 0.262226 0.210265 0.130028
+125 0.206059 0.152711 0.195077
+126 0.297343 0.237324 0.118121
+127 0.293289 0.226635 0.0750109
+128 0.265778 0.119711 0.106759
+129 0.27516 0.105753 0.0930857
+130 0.259443 0.195959 0.0504844
+131 0.237343 0.142589 -0.0896435
+132 0.282426 0.148966 -0.0323091
+133 0.160483 0.0359481 -0.0785661
+134 0.218772 0.129273 -0.159827
+135 0.0853457 0.116802 -0.0417486
+136 0.20506 0.0823463 -0.0335992
+137 0.094616 0.0199207 -0.0462484
+138 0.0246508 -0.0416026 -0.0983342
+139 0.0639901 -0.139287 -0.242319
+140 0.0249959 -0.180938 -0.249294
+141 0.0329462 -0.159826 -0.235841
+142 0.0162822 -0.196504 -0.237108
+143 -0.0406349 -0.11625 -0.115526
+144 0.0355947 -0.100031 -0.131438
+145 -0.148066 -0.246914 -0.228278
+146 -0.128664 -0.151379 -0.120204
+147 -0.20564 -0.194935 -0.223316
+148 -0.209926 -0.293475 -0.181631
+149 -0.151542 -0.185237 -0.277973
+150 -0.212514 -0.25715 -0.106606
+151 -0.17149 -0.287053 -0.17784
+152 -0.288715 -0.137938 -0.15577
+153 -0.101648 -0.292865 -0.153498
+154 -0.196582 -0.151655 -0.105669
+155 -0.233206 -0.205688 -0.120301
+156 -0.304071 -0.273805 -0.0567232
+157 -0.262574 -0.213572 -0.188062
+158 -0.234014 -0.147396 -0.130597
+159 -0.127922 -0.163391 -0.141241
+160 -0.144725 -0.10392 -0.0510807
+161 -0.247492 -0.0582723 -0.00827692
+162 -0.258795 -0.191234 0.0778613
+163 -0.074388 -0.142011 0.081612
+164 -0.127356 -0.153745 0.0786883
+165 -0.12088 -0.122613 0.0675251
+166 -0.137811 0.023368 0.0576031
+167 -0.189745 -0.0722396 0.018102
+168 -0.0595371 -0.0306057 0.0829234
+169 -0.078322 0.0656503 0.0512902
+170 -0.132692 -0.0462057 0.0294912
+171 -0.0740977 0.073898 0.19823
+172 -0.0558499 0.0752766 0.142552
+173 0.0759637 0.123402 0.232148
+174 -0.0360002 0.145455 0.160842
+175 0.0436169 0.160745 0.162525
+176 0.0858365 0.100668 0.179054
+177 0.13627 0.0892889 0.0655269
+178 0.161949 0.17863 0.197206
+179 0.106877 0.177517 0.0546804
+180 0.0593105 0.149241 0.142748
+181 0.214126 0.0766684 0.0810017
+182 0.0547008 0.21327 0.177475
+183 0.0717283 0.0736023 0.154865
+184 0.191727 0.172906 0.119034
+185 0.14478 0.087557 0.0742026
+186 0.23908 0.132729 0.0355024
+187 0.203703 0.073267 0.0143013
+188 0.122586 0.213276 0.0651469
+189 0.0835698 0.0487019 0.133766
+190 0.0917354 0.169554 -0.041977
+191 0.113556 0.110627 0.110535
+192 0.183147 0.0180818 -0.0115564
+193 0.128454 0.100595 0.0386712
+194 0.163301 0.132653 -0.0680352
+195 0.196114 0.152816 0.0859278
+196 0.0286079 0.0400758 -0.0260642
+197 0.0880536 0.0830662 -0.0696107
+198 0.0915375 0.0893299 -0.0358353
+199 0.0509963 -0.0207323 -0.143666
+200 0.0416355 -0.092149 -0.0664544
+201 0.0468225 0.0383251 -0.0613309
+202 0.0107274 0.0410744 -0.0949562
+203 0.00933228 -0.0911049 -0.160811
+204 0.0217787 -0.144363 -0.101096
+205 0.0698741 -0.16287 -0.175699
+206 -0.0222541 -0.0185677 -0.0613003
+207 -0.10017 -0.0874568 -0.183911
+208 -0.124739 -0.176242 -0.0730185
+209 0.00860095 -0.158835 -0.0638301
+210 -0.0753048 -0.0403158 -0.0791765
+211 -0.121974 -0.0898573 -0.160381
+212 -0.0300112 -0.161479 -0.106232
+213 -0.0072594 -0.118346 -0.013073
+214 -0.140189 -0.123004 -0.1696
+215 -0.0339676 -0.0278884 -0.147712
+216 -0.110571 -0.120261 -0.0271705
+217 -0.137256 -0.0305097 -0.0102887
+218 -0.104694 -0.0970638 -0.0492807
+219 -0.15725 -0.0387797 -0.0991524
+220 -0.0535873 -0.189848 -0.0629756
+221 -0.0447722 -0.113558 0.00994687
+222 -0.0972935 -0.0299721 -0.118869
+223 -0.143216 -0.150272 -0.0945565
+224 -0.0342238 0.0223487 0.0838931
+225 -0.189588 0.0427961 0.0480686
+226 -0.150381 -0.0581302 -0.00364323
+227 -0.138787 0.0093412 -0.0574481
+228 -0.153102 -0.0615975 0.116143
+229 -0.060412 -0.0513939 -0.0577417
+230 0.0202902 -0.0246957 0.0801256
+231 -0.0200033 0.0275668 -0.0043169
+232 0.0293085 0.0427626 0.15295
+233 -0.0519639 -0.0702145 -0.0396086
+234 0.0761017 0.0374428 0.051298
+235 -0.0159578 0.0792842 0.0497498
+236 0.034143 0.0416644 -0.00292247
+237 0.0390065 0.144795 0.0173019
+238 0.0785221 -0.0182246 0.0322779
+239 0.08855 0.049747 0.094665
+240 0.0907667 0.00867691 0.0256048
+241 0.0713141 0.0126793 0.121408
+242 0.130155 0.131182 0.162077
+243 -0.0251589 0.0344113 0.061318
+244 0.00263686 0.116403 0.0435752
+245 0.0601417 0.0605919 0.122334
+246 0.140309 0.115836 0.0823734
+247 0.016011 0.0486162 0.148154
+248 0.00262091 0.0737306 0.072526
+249 0.0104423 0.122525 0.0314302
+250 -0.0121604 0.0365901 -0.00125785
+251 0.057694 0.0796572 0.0780739
+252 0.0105251 0.0256032 0.0185461
+253 0.176984 -0.0236614 0.0373487
+254 0.130621 0.0946323 0.0871696
+255 0.0184087 -0.0344569 -0.0683991
+256 -0.0285362 0.0517099 -0.0466689
+257 0.0359978 -0.0290421 -0.00906326
+258 0.139413 0.0805375 0.0462067
+259 -0.0417211 0.0459312 0.0709178
+260 0.131659 0.0797177 0.069449
+261 0.12139 -0.0308921 0.0236481
+262 -0.0473358 0.0443106 -0.072358
+263 0.084628 -0.0945129 0.0475128
+264 -0.071014 -0.0498558 0.0574321
+265 0.0737743 -0.0154591 -0.137914
+266 -0.0568069 -0.124133 -0.124654
+267 0.0666604 0.0191854 -0.119743
+268 0.041571 -0.0896298 -0.136019
+269 0.0326789 0.0194811 -0.137027
+270 -0.0600132 -0.0246257 -0.103282
+271 0.0021657 -0.0392893 0.0165702
+272 -0.0265276 0.0358137 -0.109032
+273 -0.00980905 -0.126957 0.0070903
+274 -0.112373 -0.142977 -0.0603599
+275 -0.0156997 -0.0061422 -0.0778784
+276 -0.141867 -0.0276022 -0.10555
+277 -0.0537075 -0.118422 -0.0688021
+278 -0.021912 0.0395811 -0.122468
+279 -0.142235 0.0242776 -0.131142
+280 -0.153856 -0.0539371 0.0487173
+281 -0.150066 0.0260706 -0.0484171
+282 0.0276874 -0.126691 -0.034534
+283 -0.0827422 -0.0664515 0.0509452
+284 -0.0961105 0.00643995 -0.0932914
+285 -0.0274402 -0.0195262 -0.0658101
+286 -0.134431 -0.0642967 -0.0574195
+287 0.00743148 -0.0152639 -0.0931265
+288 -0.00423643 0.0615726 -0.0341869
+289 -0.00121529 -0.0691136 0.0208955
+290 -0.0341773 0.00765812 0.0634719
+291 -0.0623566 -0.0894382 0.0760852
+292 -0.0612666 0.0517529 -0.0649392
+293 -0.101927 -0.0570001 -0.059353
+294 -0.0932661 -0.0140564 0.0587881
+295 -0.0342204 0.05115 -0.0077483
+296 0.00962707 0.0205178 -0.00930554
+297 0.086751 0.0407356 -0.0366705
+298 -0.0619837 0.0756976 -0.0100863
+299 0.0570416 0.0740328 -0.00593619
+300 0.0302965 0.121386 0.0437065
+301 0.0361282 -0.0495037 0.123276
+302 -0.062523 0.075657 -0.0168684
+303 -0.0562189 0.00751898 0.00902153
+304 0.0530975 0.0861497 0.0635998
+305 0.123772 0.103072 0.0125279
+306 0.046479 -0.0338678 0.135673
+307 -0.0563367 0.0694053 0.0863605
+308 -0.00974361 0.0449466 -0.00726647
+309 0.0645008 0.130862 -0.0300805
+310 -0.0102122 0.0417346 -0.0178576
+311 0.112372 -0.0570851 0.0815094
+312 0.0688116 0.0848637 0.0273649
+313 -0.0419733 0.085479 -0.0461803
+314 0.0577574 0.113394 0.0193587
+315 -0.0251148 0.00416879 0.0452759
+316 0.0129669 0.0516217 0.063999
+317 0.12351 0.0856708 0.0512581
+318 0.00205911 0.0124627 0.106923
+319 0.0915276 0.050777 0.0746293
+320 0.0447759 0.0116996 -0.061127
+321 -0.0109667 -0.0846675 -0.0540089
+322 0.0618661 -0.0517726 -0.0919522
+323 -0.0485281 -0.0735097 0.0261627
+324 0.0108828 0.00799162 -0.00281248
+325 0.00692862 -0.0243732 -0.07108
+326 -0.0159341 0.0429378 0.000305988
+327 0.0612861 0.0363946 0.0751722
+328 0.0682336 -0.0468204 -0.113224
+329 0.074241 0.0751501 -0.0933165
+330 0.0640157 -0.0512504 -0.119017
+331 0.00823924 0.0518188 -0.0208047
+332 -0.0522299 0.0381819 -0.00512094
+333 0.0609206 -0.0391507 0.0530922
+334 0.0448167 -0.0484483 0.000356115
+335 0.0603005 -0.0881785 -0.059333
+336 -0.0634416 -0.100544 -0.0499614
+337 0.0555596 0.0650417 -0.00739016
+338 0.0521511 -0.0904961 -0.015789
+339 0.0345315 0.0335526 -0.0157579
+340 0.0218467 -0.0659198 0.0542071
+341 0.00794727 0.00734579 -0.071046
+342 -0.115605 -0.059259 0.0317368
+343 -0.125382 -0.111452 0.00489641
+344 -0.00661221 -0.0946826 0.0502072
+345 -0.0828954 0.0533706 -0.106901
+346 0.0468269 0.0559098 -0.103946
+347 0.0627571 0.0246041 -0.00290758
+348 0.0430174 -0.0919724 0.0707788
+349 -0.0701459 -0.0746821 0.0259014
+350 -0.0659695 -0.0228015 0.0433118
+351 0.021503 -0.101376 0.0464046
+352 -0.00511543 -0.0885198 -0.0413994
+353 -0.115176 0.08576 -0.0920088
+354 -0.107332 0.0558678 -0.0642828
+355 -0.00758383 -0.0829995 0.0157428
+356 -0.0203309 0.0498391 0.0397182
+357 0.0759063 -0.000820063 0.0646244
+358 -0.0988938 0.0139485 -0.040957
+359 -0.100375 -0.0142476 0.0607591
+360 -0.0127385 -0.0447691 0.0204786
+361 -0.00720208 0.012704 0.101364
+362 0.0933342 0.0210504 0.103063
+363 0.0914453 -0.0212247 -0.00537845
+364 0.0222687 -0.0733793 0.0519698
+365 0.00887453 0.105965 0.0476493
+366 0.0393766 -0.0381711 0.0627169
+367 0.00992684 0.0120678 0.0319012
+368 -0.00524682 0.0858477 0.0545543
+369 -0.0276856 0.030261 0.0137738
+370 0.027146 0.0506496 -0.0606836
+371 -0.0409651 -0.0656822 0.0750463
+372 0.0261079 0.110611 0.0537327
+373 0.0683191 0.00103924 0.101136
+374 0.0223146 0.0638174 0.0372899
+375 0.0538864 0.026447 -0.0256291
+376 -0.0199266 0.0578314 -0.0205107
+377 -0.0287525 0.00897231 0.0789033
+378 0.011206 -0.0477837 -0.0527743
+379 0.0471543 -0.0419562 0.0626134
+380 0.0566571 0.0389111 0.10356
+381 0.0175098 0.0792653 0.0697493
+382 0.0516203 -0.00647098 -0.0733728
+383 0.0899533 0.0374349 0.0162332
+384 0.0490273 0.00456911 0.00870165
+385 -0.0153788 0.0137572 0.0249342
+386 0.109505 0.0779426 -0.0960305
+387 0.0230987 0.0716719 -0.034583
+388 -0.0308869 0.0992023 -0.076132
+389 0.049703 -0.00463838 0.0507225
+390 -0.0160384 -0.0116619 0.0794113
+391 -0.0251558 0.0270421 0.0103171
+392 0.0273061 -0.00456061 -0.0610323
+393 -0.0278667 -0.00932626 -0.0554114
+394 -0.0954355 -0.0612679 0.038761
+395 0.0116837 0.0508276 0.00879948
+396 -0.0921252 -0.00449076 -0.100855
+397 0.0595651 0.0473238 0.0656456
+398 0.00559781 0.0358737 0.0698283
+399 0.0325561 0.0287903 -0.103249
+400 -0.0611306 0.0483602 -0.0651726
+401 0.0530863 -0.0870683 -0.0114436
+402 0.0706962 0.000487238 -0.0722344
+403 0.0812003 -0.0450292 0.0609868
+404 -0.0902842 0.0756444 -0.0795868
+405 0.0342166 -0.0107851 0.0474598
+406 -0.0755312 -0.0418849 0.06597
+407 0.0782342 -0.0275304 -0.00841178
+408 -0.0404713 0.00561785 0.0787162
+409 -0.0985844 -0.0632749 -0.0258086
+410 -0.102143 0.0257031 0.0809771
+411 0.0299029 -0.00559649 0.0390066
+412 0.034459 -0.00404783 0.014188
+413 -0.016108 -0.0565063 0.0656708
+414 0.0809532 -0.0208452 -0.0651575
+415 -0.0251259 -0.0314543 -0.0551357
+416 -0.0949532 0.0830507 0.016536
+417 -0.0878092 -0.0828968 0.0055337
+418 -0.0826239 -0.101344 -0.0400788
+419 -0.0111641 0.0395108 0.016706
+420 0.028367 0.0597103 -0.0745472
+421 0.0141354 -0.0712234 0.0260366
+422 0.00158414 0.0215662 -0.0662277
+423 0.0182286 -0.032185 0.0981183
+424 0.0403989 0.0722646 0.0815234
+425 0.0763858 -0.0237108 0.0734619
+426 0.0749794 0.0654159 -0.0269555
+427 -0.01714 0.0617229 0.028065
+428 0.0490571 -0.0055667 -0.0504239
+429 -0.0592585 0.00800895 -0.0364137
+430 0.0356458 -0.0462567 -0.0565739
+431 0.0304146 0.0883306 -0.0221918
+432 -0.032884 -0.0858759 -0.0727408
+433 -0.0157107 0.103217 -0.0525016
+434 0.0840815 -0.0678038 0.0487336
+435 -0.0136451 -0.0254523 -0.0494127
+436 0.0481152 0.0318921 -0.0711827
+437 0.0669082 -0.00405252 0.1008
+438 -0.0756365 0.107987 0.0485059
+439 0.0971897 -0.0468521 0.0878878
+440 -0.0395712 0.0705408 -0.0558674
+441 -0.0188154 -0.00529399 0.0839984
+442 0.0746482 -0.00178176 0.0844743
+443 -0.0253263 -0.0826901 -0.0344131
+444 0.0200462 -0.0762975 0.045179
+445 -0.0194727 0.0442604 0.066079
+446 -0.0425051 0.00700625 0.0682874
+447 0.00871708 -0.0705593 0.0118328
+448 -0.0118458 0.000796106 -0.027898
+449 0.0226526 -0.0742575 -0.041394
+450 0.0307982 -0.0477487 -0.0859615
+451 0.00750597 -0.00622766 -0.076102
+452 0.0841357 -0.0354635 0.0520188
+453 0.0884507 0.0470198 0.0603375
+454 0.0726154 -0.0256462 -0.0204797
+455 0.0588101 0.00135376 -0.0994888
+456 -0.0512545 -0.102458 0.0550721
+457 0.0207424 -0.0420637 -0.0171892
+458 -0.0167934 0.0343817 0.0216211
+459 0.0853327 0.0416083 -0.104239
+460 0.0685533 0.00330597 0.0908588
+461 0.0831542 0.0777739 -0.0795082
+462 -0.0525808 -0.0390724 0.057681
+463 -0.0777708 -0.0555692 -0.0935927
+464 0.0156546 0.055027 0.00757796
+465 0.0352357 0.0601726 -0.0158123
+466 0.0892271 0.0551928 0.0615953
+467 -0.00601811 -0.034404 0.051511
+468 -0.0875655 -0.00102833 0.0364426
+469 0.0343225 -0.0193016 -0.0429046
+470 0.0237604 -0.105861 -0.0114598
+471 0.0624156 -0.102361 0.0263063
+472 -0.032 0.0271664 -0.0176814
+473 -0.0547783 -0.0769611 -0.0828618
+474 -0.00660219 -0.0272973 -0.0851916
+475 -0.00607989 -0.0831763 0.00508346
+476 -0.00919653 -0.0785865 0.0022782
+477 -0.0873774 -0.00788886 -0.0605173
+478 0.0831451 -0.0517538 -0.029326
+479 -0.0775978 -0.0502973 -0.0660945
+480 0.022881 0.0856377 0.0377766
+481 0.0346714 -0.00127431 0.0261189
+482 0.0132186 0.0532034 -0.0723848
+483 0.0200223 -0.0577082 0.0559004
+484 -0.00117771 -0.0906531 0.0213202
+485 0.085207 0.0652701 0.0662271
+486 0.0669462 -0.0557815 -0.0583366
+487 0.0196271 -0.0298252 -0.0782588
+488 -0.0372764 0.00892936 -0.0904771
+489 0.041935 -0.00854382 -0.0927152
+490 -0.0598391 -0.0137204 -0.0609897
+491 0.034607 0.0648553 -0.0128075
+492 -0.0934921 -0.0226216 -0.00705076
+493 0.0728948 0.0116726 -0.00765632
+494 0.101406 0.0161229 -0.0828996
+495 0.00169226 0.0232688 0.0290798
+496 0.072528 -0.0770499 -0.0124139
+497 0.0578824 0.0609395 0.00790179
+498 -0.0153936 0.0875941 0.104917
+499 -0.0776594 0.0832574 0.0209262
+500 -0.0864071 0.0137418 -0.0414727
diff --git a/src/gromacs/correlationfunctions/tests/testEXP.xvg b/src/gromacs/correlationfunctions/tests/testEXP.xvg
new file mode 100644 (file)
index 0000000..a192c51
--- /dev/null
@@ -0,0 +1,501 @@
+0 0
+1 0.933793
+2 1.64413
+3 2.26881
+4 2.69732
+5 3.18609
+6 3.5633
+7 3.77591
+8 4.083
+9 4.27165
+10 4.50143
+11 4.68664
+12 4.84612
+13 4.93256
+14 5.0487
+15 5.21257
+16 5.29916
+17 5.32257
+18 5.43037
+19 5.50601
+20 5.60239
+21 5.62398
+22 5.72622
+23 5.77308
+24 5.7562
+25 5.84888
+26 5.81699
+27 5.86178
+28 5.94235
+29 5.95981
+30 5.98369
+31 5.95674
+32 6.06792
+33 6.07991
+34 6.11024
+35 6.12377
+36 6.06567
+37 6.16848
+38 6.15328
+39 6.16295
+40 6.16469
+41 6.22697
+42 6.1776
+43 6.27148
+44 6.23865
+45 6.2744
+46 6.27211
+47 6.29498
+48 6.31175
+49 6.28439
+50 6.34758
+51 6.26659
+52 6.29551
+53 6.31016
+54 6.31924
+55 6.32594
+56 6.39353
+57 6.37555
+58 6.4125
+59 6.34882
+60 6.34253
+61 6.37401
+62 6.42251
+63 6.44891
+64 6.41029
+65 6.36925
+66 6.45488
+67 6.47461
+68 6.39323
+69 6.41703
+70 6.47664
+71 6.47864
+72 6.40653
+73 6.4444
+74 6.4901
+75 6.49016
+76 6.43924
+77 6.50607
+78 6.48499
+79 6.4465
+80 6.51673
+81 6.44586
+82 6.53225
+83 6.51432
+84 6.52803
+85 6.49069
+86 6.51123
+87 6.54134
+88 6.50065
+89 6.49403
+90 6.54445
+91 6.56578
+92 6.54692
+93 6.58151
+94 6.5848
+95 6.5796
+96 6.53327
+97 6.57402
+98 6.51995
+99 6.59609
+100 6.59545
+101 6.51956
+102 6.54083
+103 6.53558
+104 6.51182
+105 6.5347
+106 6.55378
+107 6.58284
+108 6.56471
+109 6.57831
+110 6.59092
+111 6.62654
+112 6.54307
+113 6.57412
+114 6.60729
+115 6.59664
+116 6.63216
+117 6.59422
+118 6.61469
+119 6.62636
+120 6.57808
+121 6.57356
+122 6.63797
+123 6.58006
+124 6.62347
+125 6.56521
+126 6.63422
+127 6.57666
+128 6.56846
+129 6.57003
+130 6.56552
+131 6.56682
+132 6.58905
+133 6.59197
+134 6.58329
+135 6.57486
+136 6.6287
+137 6.62418
+138 6.57194
+139 6.62585
+140 6.59216
+141 6.66186
+142 6.61182
+143 6.64493
+144 6.60235
+145 6.64946
+146 6.58789
+147 6.636
+148 6.60824
+149 6.59174
+150 6.67204
+151 6.63844
+152 6.64634
+153 6.61669
+154 6.60086
+155 6.68471
+156 6.6902
+157 6.65257
+158 6.61755
+159 6.67101
+160 6.6674
+161 6.63823
+162 6.63133
+163 6.6367
+164 6.66352
+165 6.696
+166 6.60881
+167 6.67253
+168 6.66735
+169 6.66583
+170 6.66259
+171 6.63691
+172 6.6766
+173 6.6913
+174 6.65969
+175 6.61821
+176 6.6796
+177 6.70715
+178 6.67694
+179 6.69653
+180 6.64676
+181 6.65935
+182 6.6781
+183 6.71181
+184 6.70878
+185 6.67739
+186 6.64651
+187 6.66021
+188 6.71047
+189 6.65987
+190 6.6511
+191 6.71258
+192 6.71689
+193 6.65441
+194 6.65054
+195 6.66806
+196 6.70738
+197 6.64787
+198 6.69967
+199 6.6331
+200 6.63513
+201 6.69851
+202 6.64237
+203 6.70702
+204 6.70229
+205 6.66568
+206 6.6818
+207 6.68629
+208 6.71863
+209 6.73129
+210 6.66952
+211 6.69274
+212 6.67642
+213 6.6782
+214 6.65372
+215 6.7269
+216 6.70297
+217 6.64193
+218 6.65786
+219 6.73524
+220 6.70002
+221 6.6906
+222 6.70867
+223 6.7153
+224 6.66604
+225 6.70376
+226 6.70701
+227 6.71955
+228 6.73206
+229 6.71019
+230 6.70016
+231 6.72956
+232 6.64624
+233 6.73931
+234 6.70839
+235 6.67605
+236 6.67944
+237 6.7271
+238 6.72234
+239 6.66538
+240 6.71936
+241 6.66755
+242 6.68937
+243 6.724
+244 6.68827
+245 6.69197
+246 6.66415
+247 6.69317
+248 6.69017
+249 6.70377
+250 6.70761
+251 6.74691
+252 6.7327
+253 6.66325
+254 6.67565
+255 6.68625
+256 6.71185
+257 6.65938
+258 6.66814
+259 6.69835
+260 6.71306
+261 6.68137
+262 6.68514
+263 6.69503
+264 6.70687
+265 6.70667
+266 6.71226
+267 6.74293
+268 6.6743
+269 6.70273
+270 6.68393
+271 6.71818
+272 6.72623
+273 6.73187
+274 6.73242
+275 6.70873
+276 6.70823
+277 6.69239
+278 6.75188
+279 6.71371
+280 6.7502
+281 6.69877
+282 6.6998
+283 6.66478
+284 6.70866
+285 6.73126
+286 6.73144
+287 6.70046
+288 6.70388
+289 6.6847
+290 6.75264
+291 6.73971
+292 6.70705
+293 6.7407
+294 6.67035
+295 6.72357
+296 6.73306
+297 6.73084
+298 6.68237
+299 6.76651
+300 6.72838
+301 6.76579
+302 6.744
+303 6.6963
+304 6.76216
+305 6.66966
+306 6.67184
+307 6.67226
+308 6.67163
+309 6.68679
+310 6.73726
+311 6.68492
+312 6.73491
+313 6.75372
+314 6.68562
+315 6.73127
+316 6.73742
+317 6.74772
+318 6.71254
+319 6.67357
+320 6.72034
+321 6.71205
+322 6.68542
+323 6.76568
+324 6.69664
+325 6.7009
+326 6.71605
+327 6.73142
+328 6.7524
+329 6.70307
+330 6.7459
+331 6.70831
+332 6.71814
+333 6.76659
+334 6.67721
+335 6.70581
+336 6.75936
+337 6.71626
+338 6.77537
+339 6.73916
+340 6.75086
+341 6.69825
+342 6.73784
+343 6.68206
+344 6.73098
+345 6.69878
+346 6.70428
+347 6.76935
+348 6.68665
+349 6.72539
+350 6.70694
+351 6.683
+352 6.76606
+353 6.74774
+354 6.69002
+355 6.77377
+356 6.71343
+357 6.71858
+358 6.77459
+359 6.72939
+360 6.74046
+361 6.71403
+362 6.70104
+363 6.7676
+364 6.70533
+365 6.68404
+366 6.73426
+367 6.74651
+368 6.73703
+369 6.7093
+370 6.68535
+371 6.78054
+372 6.68628
+373 6.74885
+374 6.75663
+375 6.78102
+376 6.78231
+377 6.69437
+378 6.69903
+379 6.70758
+380 6.74678
+381 6.7422
+382 6.72993
+383 6.68776
+384 6.74261
+385 6.75407
+386 6.76879
+387 6.70534
+388 6.6894
+389 6.71274
+390 6.73197
+391 6.75648
+392 6.74171
+393 6.73153
+394 6.68943
+395 6.75898
+396 6.72838
+397 6.74778
+398 6.72736
+399 6.77489
+400 6.77639
+401 6.70282
+402 6.71161
+403 6.76628
+404 6.77065
+405 6.77603
+406 6.68948
+407 6.76621
+408 6.72207
+409 6.72234
+410 6.75854
+411 6.77273
+412 6.76151
+413 6.74252
+414 6.73153
+415 6.69708
+416 6.74061
+417 6.75818
+418 6.72091
+419 6.74424
+420 6.78673
+421 6.74145
+422 6.69344
+423 6.72471
+424 6.72518
+425 6.76767
+426 6.71893
+427 6.78251
+428 6.78466
+429 6.78094
+430 6.77212
+431 6.74085
+432 6.74283
+433 6.73333
+434 6.78714
+435 6.77238
+436 6.73692
+437 6.73205
+438 6.70148
+439 6.77486
+440 6.76451
+441 6.79155
+442 6.73363
+443 6.69988
+444 6.77442
+445 6.78397
+446 6.7856
+447 6.73778
+448 6.70429
+449 6.7378
+450 6.74829
+451 6.69527
+452 6.75622
+453 6.7867
+454 6.76332
+455 6.72525
+456 6.72494
+457 6.78544
+458 6.7868
+459 6.73629
+460 6.75375
+461 6.71361
+462 6.73621
+463 6.74825
+464 6.70532
+465 6.78782
+466 6.73666
+467 6.79325
+468 6.69962
+469 6.71673
+470 6.72258
+471 6.72758
+472 6.70651
+473 6.70794
+474 6.77938
+475 6.71007
+476 6.7414
+477 6.77997
+478 6.71039
+479 6.77047
+480 6.71826
+481 6.73399
+482 6.69929
+483 6.7929
+484 6.77405
+485 6.79742
+486 6.76882
+487 6.74596
+488 6.71524
+489 6.7947
+490 6.75326
+491 6.72172
+492 6.71176
+493 6.71697
+494 6.74455
+495 6.78932
+496 6.70312
+497 6.72368
+498 6.70806
+499 6.70917
+500 6.79967
diff --git a/src/gromacs/correlationfunctions/tests/testINVEXP.xvg b/src/gromacs/correlationfunctions/tests/testINVEXP.xvg
new file mode 100755 (executable)
index 0000000..a36eac5
--- /dev/null
@@ -0,0 +1,501 @@
+0  1.0681\r
+1  0.943394\r
+2  0.940582\r
+3  0.876908\r
+4  0.772058\r
+5  0.717467\r
+6  0.62021\r
+7  0.637288\r
+8  0.612462\r
+9  0.660404\r
+10  0.587782\r
+11  0.604724\r
+12  0.414682\r
+13  0.485151\r
+14  0.437477\r
+15  0.400413\r
+16  0.492272\r
+17  0.485068\r
+18  0.524471\r
+19  0.331468\r
+20  0.466912\r
+21  0.478988\r
+22  0.409751\r
+23  0.290041\r
+24  0.278663\r
+25  0.327049\r
+26  0.342437\r
+27  0.303842\r
+28  0.439109\r
+29  0.296164\r
+30  0.343069\r
+31  0.248582\r
+32  0.307399\r
+33  0.2247\r
+34  0.210569\r
+35  0.36623\r
+36  0.311727\r
+37  0.281739\r
+38  0.297556\r
+39  0.322846\r
+40  0.323614\r
+41  0.238788\r
+42  0.208327\r
+43  0.34916\r
+44  0.303368\r
+45  0.258602\r
+46  0.304515\r
+47  0.190447\r
+48  0.308091\r
+49  0.160807\r
+50  0.181371\r
+51  0.192209\r
+52  0.181283\r
+53  0.201928\r
+54  0.105623\r
+55  0.246128\r
+56  0.128467\r
+57  0.186709\r
+58  0.195287\r
+59  0.131209\r
+60  0.123502\r
+61  0.21343\r
+62  0.265214\r
+63  0.198079\r
+64  0.0875281\r
+65  0.148709\r
+66  0.162407\r
+67  0.165434\r
+68  0.235861\r
+69  0.225641\r
+70  0.0716764\r
+71  0.224192\r
+72  0.0976416\r
+73  0.164153\r
+74  0.0848313\r
+75  0.0779902\r
+76  0.0789197\r
+77  0.123511\r
+78  0.095581\r
+79  0.187898\r
+80  0.0618937\r
+81  0.214364\r
+82  0.207497\r
+83  0.134731\r
+84  0.211358\r
+85  0.0212662\r
+86  0.123847\r
+87  0.0641108\r
+88  0.09398\r
+89  0.0165856\r
+90  0.0257984\r
+91  0.0374152\r
+92  0.00685148\r
+93  0.0827592\r
+94  0.0394362\r
+95  0.176037\r
+96  0.0588189\r
+97  0.00230256\r
+98  0.14224\r
+99  0.15686\r
+100  0.0514332\r
+101  0.123575\r
+102  0.0661031\r
+103  0.0936242\r
+104  0.165916\r
+105  0.065199\r
+106  0.0166701\r
+107  0.121875\r
+108  0.0783671\r
+109  0.0831681\r
+110  0.0477346\r
+111  0.0944206\r
+112  -0.00249231\r
+113  -0.00795285\r
+114  0.104603\r
+115  0.0897528\r
+116  0.0475694\r
+117  0.105319\r
+118  0.0818006\r
+119  0.137639\r
+120  0.00351689\r
+121  0.139798\r
+122  0.128182\r
+123  0.0740928\r
+124  0.0266052\r
+125  0.01518\r
+126  0.0764528\r
+127  -0.0478048\r
+128  0.145348\r
+129  -0.0278405\r
+130  0.0743014\r
+131  -0.0442497\r
+132  -0.019708\r
+133  0.0312048\r
+134  0.0508013\r
+135  0.0895047\r
+136  0.0205578\r
+137  0.11894\r
+138  -0.0355846\r
+139  0.0526809\r
+140  0.0259417\r
+141  0.000229281\r
+142  0.0478984\r
+143  0.0418232\r
+144  0.0504251\r
+145  0.0714415\r
+146  0.0905807\r
+147  -0.0255317\r
+148  -0.0387278\r
+149  0.0939955\r
+150  -0.020037\r
+151  -0.0230931\r
+152  -0.0375384\r
+153  0.0771837\r
+154  0.0622474\r
+155  -0.0626867\r
+156  0.122018\r
+157  -0.0446062\r
+158  -0.0246245\r
+159  0.0897752\r
+160  0.0498833\r
+161  0.0472345\r
+162  0.0583388\r
+163  -0.0347339\r
+164  0.0762762\r
+165  -0.0672939\r
+166  0.046974\r
+167  0.0223582\r
+168  -0.0599178\r
+169  -0.0605643\r
+170  -0.0708522\r
+171  0.0534838\r
+172  0.112608\r
+173  0.0901323\r
+174  -0.0488154\r
+175  0.0518089\r
+176  0.0541252\r
+177  -0.0691998\r
+178  0.0425829\r
+179  0.0192925\r
+180  -0.0710574\r
+181  -0.0671212\r
+182  -0.0424854\r
+183  -0.00173892\r
+184  -0.0106879\r
+185  -0.0576365\r
+186  0.0192927\r
+187  0.016837\r
+188  -0.0206993\r
+189  0.0350927\r
+190  0.0979423\r
+191  0.0528159\r
+192  0.106826\r
+193  -0.0702302\r
+194  -0.0487975\r
+195  -0.0589017\r
+196  -0.0146245\r
+197  0.0089213\r
+198  -0.0842674\r
+199  -0.0234645\r
+200  0.0565023\r
+201  0.00287557\r
+202  -0.0520075\r
+203  -0.00293986\r
+204  -0.0299982\r
+205  0.102979\r
+206  -0.0167894\r
+207  -0.0287721\r
+208  0.0207559\r
+209  0.0876499\r
+210  0.106049\r
+211  -0.0401939\r
+212  0.0195434\r
+213  -0.0314981\r
+214  0.108024\r
+215  -0.0271984\r
+216  -0.090313\r
+217  0.0936537\r
+218  0.0444229\r
+219  0.101328\r
+220  0.0322305\r
+221  -0.018528\r
+222  -0.00257325\r
+223  -0.0320265\r
+224  -0.0105935\r
+225  0.000379694\r
+226  0.00231763\r
+227  0.00982889\r
+228  -0.040522\r
+229  -0.0410073\r
+230  0.000112217\r
+231  -0.0148902\r
+232  0.0756062\r
+233  -0.0742674\r
+234  -0.0573473\r
+235  -0.0227042\r
+236  0.0972166\r
+237  -0.0418052\r
+238  -0.00486911\r
+239  0.0599813\r
+240  0.074408\r
+241  0.0899329\r
+242  -0.0437813\r
+243  0.0811337\r
+244  0.0342668\r
+245  0.0959573\r
+246  -0.0525791\r
+247  -0.0727846\r
+248  0.102521\r
+249  0.0381233\r
+250  -0.089035\r
+251  -0.0643688\r
+252  -0.0852113\r
+253  -0.0222789\r
+254  0.099484\r
+255  0.0382242\r
+256  0.0687417\r
+257  -0.0650391\r
+258  -0.0590526\r
+259  -0.0609537\r
+260  -0.0781632\r
+261  -0.0263208\r
+262  0.0187378\r
+263  -0.0436076\r
+264  0.048821\r
+265  -0.00552439\r
+266  0.0194677\r
+267  0.0920907\r
+268  -0.0609475\r
+269  0.0306231\r
+270  -0.0299242\r
+271  0.0303031\r
+272  0.0357398\r
+273  -0.041525\r
+274  -0.0890632\r
+275  -0.086406\r
+276  -0.00247411\r
+277  -0.0422722\r
+278  -0.0668341\r
+279  0.0957862\r
+280  0.0974149\r
+281  -0.0132207\r
+282  0.0459918\r
+283  0.0291298\r
+284  -0.0351444\r
+285  -0.0254443\r
+286  0.0340195\r
+287  0.00756723\r
+288  0.0238715\r
+289  -0.0274353\r
+290  -0.0856008\r
+291  0.0583847\r
+292  -0.0165585\r
+293  -0.0404389\r
+294  0.0103612\r
+295  0.0513012\r
+296  -0.00408748\r
+297  -0.0539004\r
+298  0.0202747\r
+299  0.0770502\r
+300  0.0150383\r
+301  0.0873767\r
+302  -0.0196684\r
+303  -0.0632305\r
+304  0.0573153\r
+305  0.0801514\r
+306  0.0941519\r
+307  -0.0209786\r
+308  0.0986031\r
+309  -0.00683724\r
+310  0.0340542\r
+311  -0.0769762\r
+312  0.0225878\r
+313  0.0603486\r
+314  -0.093571\r
+315  -0.0853193\r
+316  -0.0215317\r
+317  0.0523009\r
+318  0.0175962\r
+319  0.0762564\r
+320  -0.0976852\r
+321  0.0337763\r
+322  0.0767278\r
+323  0.0310502\r
+324  0.00986905\r
+325  0.0137131\r
+326  -0.0711432\r
+327  -0.0888209\r
+328  -0.0218738\r
+329  -0.000910774\r
+330  -0.0763064\r
+331  -0.0104076\r
+332  0.0988596\r
+333  0.0750879\r
+334  -0.00508757\r
+335  -0.0833086\r
+336  -0.0906822\r
+337  -0.0485789\r
+338  0.0497686\r
+339  -0.0125583\r
+340  0.0836466\r
+341  -0.0617063\r
+342  -0.0496492\r
+343  -0.08338\r
+344  -0.0968441\r
+345  -0.054627\r
+346  0.00546937\r
+347  0.0578465\r
+348  0.0143735\r
+349  0.0332627\r
+350  0.0861252\r
+351  0.0663102\r
+352  0.0308983\r
+353  0.0893619\r
+354  0.0277007\r
+355  0.075605\r
+356  0.0383847\r
+357  -0.0513761\r
+358  0.0884597\r
+359  -0.0641501\r
+360  0.0215607\r
+361  -0.0653902\r
+362  0.0966357\r
+363  -0.0567258\r
+364  0.0480028\r
+365  -0.0426312\r
+366  -0.0626624\r
+367  -0.0192904\r
+368  -0.0845387\r
+369  -0.0279446\r
+370  0.00569403\r
+371  0.0839343\r
+372  0.0978487\r
+373  -0.02417\r
+374  -0.0158972\r
+375  -0.0494234\r
+376  0.00957538\r
+377  0.000469922\r
+378  -0.0108498\r
+379  0.0162894\r
+380  0.0487372\r
+381  -0.0557467\r
+382  -0.0222935\r
+383  0.0371676\r
+384  -0.0232714\r
+385  -0.0209432\r
+386  -0.0980981\r
+387  0.0378866\r
+388  -0.0548227\r
+389  0.0672464\r
+390  0.0591308\r
+391  0.0117988\r
+392  0.0906635\r
+393  0.0278184\r
+394  -0.00406985\r
+395  0.0922327\r
+396  0.0835114\r
+397  0.00238354\r
+398  -0.00648136\r
+399  0.0534958\r
+400  -0.0609925\r
+401  0.0889696\r
+402  -0.0120165\r
+403  -0.0544075\r
+404  -0.0222787\r
+405  -0.0647516\r
+406  -0.0404564\r
+407  0.0184243\r
+408  0.056176\r
+409  0.0126803\r
+410  -0.0369847\r
+411  0.0492475\r
+412  0.0799349\r
+413  -0.0708037\r
+414  0.0655493\r
+415  -0.048577\r
+416  -0.0417596\r
+417  0.0804274\r
+418  -0.0920922\r
+419  -0.0870022\r
+420  -0.0373363\r
+421  -0.0118833\r
+422  0.0119897\r
+423  0.0904194\r
+424  -0.0882078\r
+425  0.0292385\r
+426  -0.0799874\r
+427  0.0656876\r
+428  -0.0801976\r
+429  -0.0795223\r
+430  -0.0302974\r
+431  0.0645107\r
+432  0.0188364\r
+433  0.0901072\r
+434  -0.014961\r
+435  -0.0714636\r
+436  -0.00657822\r
+437  -0.0570667\r
+438  -0.00645351\r
+439  0.03649\r
+440  0.0497419\r
+441  0.00386253\r
+442  0.0688225\r
+443  -0.022944\r
+444  0.0833869\r
+445  0.011775\r
+446  -0.0590674\r
+447  -0.00939986\r
+448  -0.0937156\r
+449  0.0277734\r
+450  -0.0824969\r
+451  0.0173356\r
+452  0.0468303\r
+453  -0.0794911\r
+454  -0.085217\r
+455  0.0162948\r
+456  0.046809\r
+457  -0.00383156\r
+458  0.0106462\r
+459  0.0524757\r
+460  -0.0554865\r
+461  0.0518396\r
+462  -0.0995535\r
+463  0.0887906\r
+464  0.0555471\r
+465  -0.0516458\r
+466  -0.0381637\r
+467  0.0649521\r
+468  0.0411061\r
+469  -0.077658\r
+470  -0.0838968\r
+471  0.0971887\r
+472  -0.0118835\r
+473  0.087111\r
+474  -0.088725\r
+475  0.0906914\r
+476  0.016415\r
+477  -0.091898\r
+478  0.0461889\r
+479  -0.079051\r
+480  -0.0247629\r
+481  0.0810491\r
+482  -0.095085\r
+483  0.0106392\r
+484  0.0945944\r
+485  -0.0103912\r
+486  -0.0226289\r
+487  0.00549821\r
+488  0.0166932\r
+489  -0.0258937\r
+490  -0.0953396\r
+491  -0.0643975\r
+492  0.0483682\r
+493  0.0041773\r
+494  -0.0933927\r
+495  -0.062249\r
+496  -0.0524264\r
+497  0.0154673\r
+498  -0.0758339\r
+499  -0.0898537\r
+500  0.0852957\r
diff --git a/src/gromacs/correlationfunctions/tests/testPRES.xvg b/src/gromacs/correlationfunctions/tests/testPRES.xvg
new file mode 100644 (file)
index 0000000..1a7c439
--- /dev/null
@@ -0,0 +1,501 @@
+0 1\r
+1 -0.36916866\r
+2 0.014760643\r
+3 0.13679177\r
+4 -0.30409385\r
+5 0.29211639\r
+6 -0.091300702\r
+7 -0.039725083\r
+8 0.11034297\r
+9 -0.14710173\r
+10 0.10112144\r
+11 -0.010410828\r
+12 -0.032484227\r
+13 0.061104037\r
+14 -0.062734083\r
+15 0.025088122\r
+16 0.0090911273\r
+17 -0.017547903\r
+18 0.028334545\r
+19 -0.019187307\r
+20 0.0034395636\r
+21 0.0048080537\r
+22 -0.011152624\r
+23 0.01468337\r
+24 -0.0030113453\r
+25 -0.001243929\r
+26 0.0026129168\r
+27 -0.0026818807\r
+28 0.00064227781\r
+29 0.0074954932\r
+30 -0.0080780674\r
+31 0.00097865747\r
+32 -0.005031499\r
+33 -0.0052062969\r
+34 0.015055237\r
+35 -0.0095560328\r
+36 -0.0012146344\r
+37 0.010541719\r
+38 -0.012150134\r
+39 0.010456563\r
+40 0.0036188245\r
+41 -0.010936702\r
+42 0.010207533\r
+43 -0.012300312\r
+44 0.0095503834\r
+45 0.006544511\r
+46 -0.0066008741\r
+47 0.010029187\r
+48 -0.0071012281\r
+49 0.0031570678\r
+50 0.0012269821\r
+51 -0.0035287761\r
+52 0.0092208671\r
+53 -0.0050034278\r
+54 -0.0028083487\r
+55 0.0099907991\r
+56 -0.011213547\r
+57 0.0090618645\r
+58 0.00031212197\r
+59 -0.0078672003\r
+60 0.010691127\r
+61 -0.0142263\r
+62 0.0058443876\r
+63 0.009818197\r
+64 -0.015058958\r
+65 0.010990055\r
+66 -0.0046160689\r
+67 -0.00587247\r
+68 0.0080246324\r
+69 -0.013475108\r
+70 0.009457794\r
+71 0.0047824004\r
+72 -0.007228957\r
+73 0.0056784217\r
+74 -0.0053565642\r
+75 -0.0023129048\r
+76 0.0029403305\r
+77 0.0033938085\r
+78 -0.0027952122\r
+79 0.0049366451\r
+80 -0.0028004289\r
+81 -0.0050486784\r
+82 0.010090499\r
+83 -0.0066157412\r
+84 0.002647089\r
+85 0.004144073\r
+86 -0.0087895271\r
+87 0.0071204964\r
+88 -0.00012740103\r
+89 -0.0050871728\r
+90 0.0071564119\r
+91 -0.0033754525\r
+92 1.2455157e-05\r
+93 0.0030776314\r
+94 0.0017022748\r
+95 -0.001404079\r
+96 -0.00045972626\r
+97 0.002904963\r
+98 -0.00059061365\r
+99 0.0034982589\r
+100 -0.0040645105\r
+101 0.001922386\r
+102 -0.0048760292\r
+103 0.0036464155\r
+104 -0.0036342766\r
+105 -0.0017862264\r
+106 0.0059070168\r
+107 -0.0091214493\r
+108 0.0045011193\r
+109 -0.0060048408\r
+110 0.0060602812\r
+111 -0.0060052815\r
+112 -0.00020469623\r
+113 0.0065917101\r
+114 -0.0099221852\r
+115 0.014778086\r
+116 -0.0070540206\r
+117 -0.00076770342\r
+118 0.0079772927\r
+119 -0.0085905236\r
+120 -0.00062513836\r
+121 0.0039284039\r
+122 -0.0039490427\r
+123 0.0094788591\r
+124 -0.0089938099\r
+125 -0.00032447391\r
+126 0.012605208\r
+127 -0.012399453\r
+128 0.013065264\r
+129 -0.0065310037\r
+130 -0.0039457333\r
+131 0.0067739115\r
+132 -0.0068084074\r
+133 0.0013759999\r
+134 -0.00063317348\r
+135 -0.0021762489\r
+136 0.0030220418\r
+137 0.0015570751\r
+138 -0.0025386858\r
+139 -0.0014269051\r
+140 0.002304196\r
+141 0.0017299628\r
+142 0.0027960096\r
+143 0.0076820985\r
+144 -0.0079212418\r
+145 -0.0017760952\r
+146 0.00056810081\r
+147 -0.002893933\r
+148 0.0090171461\r
+149 -0.0048042782\r
+150 0.00058932377\r
+151 0.00017170853\r
+152 -0.0035441974\r
+153 0.0043755975\r
+154 0.0084104895\r
+155 -0.005701828\r
+156 0.0018862645\r
+157 -0.0037968043\r
+158 -0.0049495224\r
+159 0.010596751\r
+160 -0.0089947785\r
+161 0.0012556332\r
+162 0.0055142779\r
+163 -0.0062561089\r
+164 0.0038259902\r
+165 -0.0011985974\r
+166 -0.0049824898\r
+167 0.011615239\r
+168 -0.0088481353\r
+169 0.0067664258\r
+170 -0.0021850029\r
+171 -0.0020955691\r
+172 0.0065267348\r
+173 -0.0093968866\r
+174 0.010932961\r
+175 -0.0053299546\r
+176 0.00051623668\r
+177 0.010631414\r
+178 -0.0061742852\r
+179 0.0047321249\r
+180 -0.0041945108\r
+181 0.00041651391\r
+182 0.0059446844\r
+183 -0.0073002656\r
+184 0.0056609192\r
+185 -0.0031166474\r
+186 0.0030953688\r
+187 0.001780965\r
+188 -0.0028736768\r
+189 0.0018569937\r
+190 -0.013309515\r
+191 0.0091007007\r
+192 -0.0032373501\r
+193 -0.0039707857\r
+194 0.011440142\r
+195 -0.0057663289\r
+196 0.004801657\r
+197 -0.0013462481\r
+198 -0.010549285\r
+199 0.010122314\r
+200 -0.0035914536\r
+201 -0.00088911725\r
+202 0.0033173624\r
+203 -0.0043540954\r
+204 0.0030779559\r
+205 -0.0025979372\r
+206 0.0016403824\r
+207 -0.0024759414\r
+208 0.0032173406\r
+209 -0.0030610313\r
+210 -0.0016666896\r
+211 0.0015944701\r
+212 -0.0023360152\r
+213 0.0048610048\r
+214 -0.0032376247\r
+215 -4.3995002e-05\r
+216 6.6794023e-05\r
+217 0.0027313477\r
+218 0.0012655508\r
+219 -0.0017807253\r
+220 -0.0016059832\r
+221 -0.0032230254\r
+222 0.0025585309\r
+223 -0.0011469088\r
+224 -0.0003959904\r
+225 0.0053054824\r
+226 -0.0083941959\r
+227 0.0015681321\r
+228 0.0041374876\r
+229 -0.0057795873\r
+230 0.012391208\r
+231 -0.0089103375\r
+232 -0.0057140203\r
+233 0.010399712\r
+234 -0.0084861502\r
+235 0.0069274989\r
+236 -0.0035049527\r
+237 -0.0032573957\r
+238 0.006458053\r
+239 -0.0073720368\r
+240 0.004089722\r
+241 -0.0039903411\r
+242 0.0042265311\r
+243 0.0033469261\r
+244 -0.0019453617\r
+245 -0.002372851\r
+246 -0.0048265504\r
+247 0.0021513391\r
+248 0.0093348207\r
+249 -0.0069923934\r
+250 -0.0025467685\r
+251 0.0029155541\r
+252 -0.0025788452\r
+253 0.001574745\r
+254 0.0045629202\r
+255 -0.0040519536\r
+256 0.0076833817\r
+257 -0.0074180399\r
+258 -0.00063383685\r
+259 0.0068584823\r
+260 -0.0096914403\r
+261 0.0059967688\r
+262 0.00045410173\r
+263 -0.001403505\r
+264 0.0081904238\r
+265 -0.0071767739\r
+266 0.0059756132\r
+267 0.0017534261\r
+268 -0.004887574\r
+269 0.0048234918\r
+270 -0.0068738558\r
+271 0.0038855002\r
+272 0.0022543436\r
+273 -6.9437609e-05\r
+274 -0.0022807576\r
+275 0.0013418244\r
+276 0.0011818884\r
+277 0.00076014954\r
+278 0.0049090373\r
+279 -0.0070762441\r
+280 -0.0035987494\r
+281 -0.00042682359\r
+282 0.0075464111\r
+283 -0.0014126097\r
+284 -0.00064224669\r
+285 0.0043936991\r
+286 -0.0010854328\r
+287 0.0026627405\r
+288 -0.0056961166\r
+289 -0.0022827355\r
+290 0.00798009\r
+291 -0.0076570431\r
+292 0.0063197703\r
+293 -0.0046694987\r
+294 -0.0024289403\r
+295 0.014527988\r
+296 -0.004486569\r
+297 -0.0080975585\r
+298 0.0095232942\r
+299 -0.010183442\r
+300 0.01195895\r
+301 -0.004018328\r
+302 -0.011547823\r
+303 0.010954626\r
+304 -0.0091701818\r
+305 0.0042623717\r
+306 0.0034892822\r
+307 -0.010150087\r
+308 0.0037818881\r
+309 0.0026481578\r
+310 -0.0088027283\r
+311 0.0074229712\r
+312 -0.002371628\r
+313 -0.0019573871\r
+314 0.0067617097\r
+315 -0.0072601173\r
+316 0.001730287\r
+317 0.0016428277\r
+318 -0.0014072933\r
+319 0.0055637106\r
+320 -0.0082579367\r
+321 -0.00076510199\r
+322 0.0030415574\r
+323 -0.0036437184\r
+324 0.004035587\r
+325 0.00082805112\r
+326 -0.0026851012\r
+327 0.0072246657\r
+328 -0.005339296\r
+329 -0.0043448825\r
+330 0.010643155\r
+331 -0.0081609374\r
+332 0.0066917325\r
+333 0.0012791562\r
+334 -0.01113791\r
+335 0.0090475954\r
+336 -0.010853231\r
+337 0.0032409009\r
+338 0.0040980312\r
+339 -0.0049287883\r
+340 0.0016793288\r
+341 -0.00061239968\r
+342 -0.0017427787\r
+343 0.0036588193\r
+344 -0.0067342253\r
+345 0.0067958251\r
+346 0.00043325857\r
+347 -0.0062904337\r
+348 0.0073918666\r
+349 -0.0066576978\r
+350 0.0026485433\r
+351 -0.0023968324\r
+352 -0.00020262248\r
+353 0.0055669462\r
+354 0.0031921639\r
+355 0.0029113674\r
+356 -0.0020937975\r
+357 -0.0015773086\r
+358 -0.0011931629\r
+359 0.0019845672\r
+360 0.0010049488\r
+361 -0.0043402076\r
+362 0.0069653274\r
+363 -0.0066296993\r
+364 0.0040835956\r
+365 -0.0022719748\r
+366 0.0031787892\r
+367 0.0018863936\r
+368 -0.0043240145\r
+369 0.0031209756\r
+370 0.0032751251\r
+371 -0.0043714253\r
+372 0.0010235949\r
+373 0.005830025\r
+374 -0.0087525349\r
+375 0.011878699\r
+376 -0.0092464787\r
+377 0.0051095452\r
+378 0.00049215492\r
+379 -0.0097728624\r
+380 0.0087838903\r
+381 -0.0098013112\r
+382 0.0068713438\r
+383 0.0049554926\r
+384 -0.0043905163\r
+385 -0.0015883465\r
+386 0.0021411048\r
+387 -0.00053965888\r
+388 0.0036745358\r
+389 0.0014808036\r
+390 -0.004536402\r
+391 0.0015192218\r
+392 0.0027196502\r
+393 -0.0025810566\r
+394 0.0031082096\r
+395 -4.7723387e-06\r
+396 0.0020796938\r
+397 -0.0022570854\r
+398 -0.003936731\r
+399 0.0084666388\r
+400 -0.0057506351\r
+401 0.0016458976\r
+402 0.0094691866\r
+403 -0.008839108\r
+404 0.0050982854\r
+405 -0.0010481337\r
+406 -0.0069512806\r
+407 0.010890251\r
+408 -0.0057060768\r
+409 0.0014311795\r
+410 0.011839364\r
+411 -0.009251874\r
+412 0.0021195342\r
+413 -0.0023409846\r
+414 -0.0063670687\r
+415 0.015033781\r
+416 -0.0088340168\r
+417 0.0079325639\r
+418 -0.0024966017\r
+419 -0.0032571545\r
+420 0.0071797801\r
+421 -0.0057685757\r
+422 0.0065634168\r
+423 -0.0010758619\r
+424 0.0016557167\r
+425 -0.0047244662\r
+426 0.0030926208\r
+427 0.0010412274\r
+428 -0.0091296123\r
+429 0.0059321171\r
+430 -0.004148807\r
+431 -0.00095115911\r
+432 0.0094210884\r
+433 -0.0078277968\r
+434 -0.0012672641\r
+435 0.0050365588\r
+436 -0.0071693578\r
+437 0.0058395732\r
+438 -0.0051660217\r
+439 -0.0013598015\r
+440 0.011156443\r
+441 -0.014047785\r
+442 0.015500496\r
+443 -0.00036496224\r
+444 -0.0050689753\r
+445 0.0055969248\r
+446 -0.0040965089\r
+447 0.00058886366\r
+448 0.0076116355\r
+449 -0.01027737\r
+450 0.00046901907\r
+451 0.001038831\r
+452 -0.0013155834\r
+453 0.0050353034\r
+454 -5.9224741e-05\r
+455 -0.0065878485\r
+456 0.0062157693\r
+457 -0.0041094506\r
+458 -0.0028793431\r
+459 0.0037869066\r
+460 -0.0023136901\r
+461 0.001233849\r
+462 0.00063285754\r
+463 -0.001011581\r
+464 0.004749887\r
+465 -0.01004642\r
+466 0.0079936783\r
+467 0.00078925829\r
+468 -0.005341806\r
+469 0.0060564244\r
+470 -0.0098092403\r
+471 -0.0029105401\r
+472 0.0059783383\r
+473 -0.0072104572\r
+474 0.0051409769\r
+475 0.0018890171\r
+476 -0.0014278876\r
+477 0.0010991714\r
+478 -0.0031653206\r
+479 0.0064217826\r
+480 0.0050600168\r
+481 -0.0037536295\r
+482 0.0016811847\r
+483 -0.00051376806\r
+484 0.00042566853\r
+485 0.0034279566\r
+486 0.0048093524\r
+487 -0.0063048747\r
+488 0.0075198538\r
+489 -0.00304979\r
+490 0.0021628828\r
+491 0.0049535774\r
+492 -0.0073786608\r
+493 0.0066929183\r
+494 -0.010125056\r
+495 0.0034794835\r
+496 0.00019589747\r
+497 -0.0036975265\r
+498 0.0083901558\r
+499 -0.0051172093\r
+500 -0.00025500495\r
diff --git a/src/gromacs/domdec/CMakeLists.txt b/src/gromacs/domdec/CMakeLists.txt
new file mode 100644 (file)
index 0000000..592be68
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+file(GLOB DOMDEC_SOURCES *.cpp)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${DOMDEC_SOURCES} PARENT_SCOPE)
+
+if (BUILD_TESTING)
+#    add_subdirectory(tests)
+endif()
similarity index 96%
rename from src/gromacs/mdlib/domdec.c
rename to src/gromacs/domdec/domdec.cpp
index 2ebc52e545d9c54ad41c3fbf86bf78c76d1e40fb..c9bfb95cf985f28f58cc5a0f6acf58df747ebc78 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2011,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <stdio.h>
-#include <time.h>
+#include "domdec.h"
+
+#include "config.h"
+
+#include <assert.h>
+#include <limits.h>
 #include <math.h>
-#include <string.h>
+#include <stdio.h>
 #include <stdlib.h>
-#include <assert.h>
+#include <string.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "gmx_fatal_collective.h"
-#include "vec.h"
-#include "domdec.h"
-#include "domdec_network.h"
-#include "nrnb.h"
-#include "pbc.h"
-#include "chargegroup.h"
-#include "constr.h"
-#include "mdatoms.h"
-#include "names.h"
-#include "force.h"
-#include "pme.h"
-#include "mdrun.h"
-#include "nsgrid.h"
-#include "shellfc.h"
-#include "mtop_util.h"
-#include "gmx_ga2la.h"
-#include "macros.h"
-#include "nbnxn_search.h"
-#include "bondf.h"
-#include "gmx_omp_nthreads.h"
-#include "gpu_utils.h"
-
-#include "gromacs/fileio/futil.h"
+#include <algorithm>
+
+#include "gromacs/domdec/domdec_network.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
+#include "gromacs/imd/imd.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/nsgrid.h"
+#include "gromacs/legacyheaders/shellfc.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/ns.h"
+#include "gromacs/legacyheaders/types/nsgrid.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/listed-forces/manage-threading.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/pulling/pull_rotation.h"
+#include "gromacs/swap/swapcoords.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
-#include "gromacs/swap/swapcoords.h"
 #include "gromacs/utility/qsort_threadsafe.h"
-#include "gromacs/pulling/pull.h"
-#include "gromacs/pulling/pull_rotation.h"
-#include "gromacs/imd/imd.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "domdec_constraints.h"
+#include "domdec_internal.h"
+#include "domdec_vsite.h"
 
 #define DDRANK(dd, rank)    (rank)
 #define DDMASTERRANK(dd)   (dd->masterrank)
@@ -768,7 +798,7 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
     rvec                  *buf, *sbuf;
     ivec                   vis;
     int                    is;
-    gmx_bool               bPBC, bScrew;
+    gmx_bool               bShiftForcesNeedPbc, bScrew;
 
     comm = dd->comm;
 
@@ -776,16 +806,17 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
 
     buf = comm->vbuf.v;
 
-    n       = 0;
     nzone   = comm->zones.n/2;
     nat_tot = dd->nat_tot;
     for (d = dd->ndim-1; d >= 0; d--)
     {
-        bPBC   = (dd->ci[dd->dim[d]] == 0);
-        bScrew = (bPBC && dd->bScrewPBC && dd->dim[d] == XX);
+        /* Only forces in domains near the PBC boundaries need to
+           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)
         {
-            bPBC = FALSE;
+            bShiftForcesNeedPbc = FALSE;
         }
         /* Determine which shift vector we need */
         clear_ivec(vis);
@@ -821,7 +852,7 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
             index = ind->index;
             /* Add the received forces */
             n = 0;
-            if (!bPBC)
+            if (!bShiftForcesNeedPbc)
             {
                 for (i = 0; i < ind->nsend[nzone]; i++)
                 {
@@ -836,6 +867,9 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
             }
             else if (!bScrew)
             {
+                /* fshift should always be defined if this function is
+                 * called when bShiftForcesNeedPbc is true */
+                assert(NULL != fshift);
                 for (i = 0; i < ind->nsend[nzone]; i++)
                 {
                     at0 = cgindex[index[i]];
@@ -956,7 +990,6 @@ void dd_atom_sum_real(gmx_domdec_t *dd, real v[])
 
     buf = &comm->vbuf.v[0][0];
 
-    n       = 0;
     nzone   = comm->zones.n/2;
     nat_tot = dd->nat_tot;
     for (d = dd->ndim-1; d >= 0; d--)
@@ -1062,7 +1095,7 @@ static void dd_sendrecv_ddzone(const gmx_domdec_t *dd,
 static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
                           rvec cell_ns_x0, rvec cell_ns_x1)
 {
-    int                d, d1, dim, dim1, pos, buf_size, i, j, k, p, npulse, npulse_min;
+    int                d, d1, dim, pos, buf_size, i, j, p, npulse, npulse_min;
     gmx_ddzone_t      *zp;
     gmx_ddzone_t       buf_s[DDZONECOMM_MAXZONE];
     gmx_ddzone_t       buf_r[DDZONECOMM_MAXZONE];
@@ -1134,7 +1167,7 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
         if (bPBC)
         {
             /* Take the minimum to avoid double communication */
-            npulse_min = min(npulse, dd->nc[dim]-1-npulse);
+            npulse_min = std::min(npulse, dd->nc[dim]-1-npulse);
         }
         else
         {
@@ -1158,9 +1191,9 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
             {
                 for (d1 = d; d1 < dd->ndim-1; d1++)
                 {
-                    extr_s[d1][0] = max(extr_s[d1][0], extr_r[d1][0]);
-                    extr_s[d1][1] = min(extr_s[d1][1], extr_r[d1][1]);
-                    extr_s[d1][2] = min(extr_s[d1][2], extr_r[d1][2]);
+                    extr_s[d1][0] = std::max(extr_s[d1][0], extr_r[d1][0]);
+                    extr_s[d1][1] = std::min(extr_s[d1][1], extr_r[d1][1]);
+                    extr_s[d1][2] = std::min(extr_s[d1][2], extr_r[d1][2]);
                 }
             }
         }
@@ -1221,9 +1254,9 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
                 {
                     if (bUse)
                     {
-                        buf_e[i].min0 = min(buf_e[i].min0, buf_r[i].min0);
-                        buf_e[i].max1 = max(buf_e[i].max1, buf_r[i].max1);
-                        buf_e[i].min1 = min(buf_e[i].min1, buf_r[i].min1);
+                        buf_e[i].min0 = std::min(buf_e[i].min0, buf_r[i].min0);
+                        buf_e[i].max1 = std::max(buf_e[i].max1, buf_r[i].max1);
+                        buf_e[i].min1 = std::min(buf_e[i].min1, buf_r[i].min1);
                     }
 
                     if (dd->ndim == 3 && d == 0 && i == buf_size - 1)
@@ -1236,8 +1269,8 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
                     }
                     if (bUse && dh[d1] >= 0)
                     {
-                        buf_e[i].mch0 = max(buf_e[i].mch0, buf_r[i].mch0-dh[d1]);
-                        buf_e[i].mch1 = max(buf_e[i].mch1, buf_r[i].mch1-dh[d1]);
+                        buf_e[i].mch0 = std::max(buf_e[i].mch0, buf_r[i].mch0-dh[d1]);
+                        buf_e[i].mch1 = std::max(buf_e[i].mch1, buf_r[i].mch1-dh[d1]);
                     }
                 }
                 /* Copy the received buffer to the send buffer,
@@ -1253,9 +1286,9 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
 
                 for (d1 = d; d1 < dd->ndim-1; d1++)
                 {
-                    extr_s[d1][1] = min(extr_s[d1][1], buf_e[pos].min0);
-                    extr_s[d1][0] = max(extr_s[d1][0], buf_e[pos].max1);
-                    extr_s[d1][2] = min(extr_s[d1][2], buf_e[pos].min1);
+                    extr_s[d1][1] = std::min(extr_s[d1][1], buf_e[pos].min0);
+                    extr_s[d1][0] = std::max(extr_s[d1][0], buf_e[pos].max1);
+                    extr_s[d1][2] = std::min(extr_s[d1][2], buf_e[pos].min1);
                     pos++;
                 }
 
@@ -1285,8 +1318,8 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
             {
                 print_ddzone(debug, 1, i, 0, &comm->zone_d1[i]);
             }
-            cell_ns_x0[dim] = min(cell_ns_x0[dim], comm->zone_d1[i].min0);
-            cell_ns_x1[dim] = max(cell_ns_x1[dim], comm->zone_d1[i].max1);
+            cell_ns_x0[dim] = std::min(cell_ns_x0[dim], comm->zone_d1[i].min0);
+            cell_ns_x1[dim] = std::max(cell_ns_x1[dim], comm->zone_d1[i].max1);
         }
     }
     if (dd->ndim >= 3)
@@ -1300,8 +1333,8 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
                 {
                     print_ddzone(debug, 2, i, j, &comm->zone_d2[i][j]);
                 }
-                cell_ns_x0[dim] = min(cell_ns_x0[dim], comm->zone_d2[i][j].min0);
-                cell_ns_x1[dim] = max(cell_ns_x1[dim], comm->zone_d2[i][j].max1);
+                cell_ns_x0[dim] = std::min(cell_ns_x0[dim], comm->zone_d2[i][j].min0);
+                cell_ns_x1[dim] = std::max(cell_ns_x1[dim], comm->zone_d2[i][j].max1);
             }
         }
     }
@@ -1527,10 +1560,6 @@ 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)
 {
-    gmx_domdec_master_t *ma;
-    int                  n, i, c, a, nalloc = 0;
-    rvec                *buf = NULL;
-
     dd_collect_cg(dd, state_local);
 
     if (dd->nnodes <= GMX_DD_NNODES_SENDRECV)
@@ -1752,7 +1781,7 @@ static void dd_distribute_vec_scatterv(gmx_domdec_t *dd, t_block *cgs,
 {
     gmx_domdec_master_t *ma;
     int                 *scounts = NULL, *disps = NULL;
-    int                  n, i, c, a, nalloc = 0;
+    int                  n, i, c, a;
     rvec                *buf = NULL;
 
     if (DDMASTER(dd))
@@ -1946,7 +1975,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[0], DDMASTER(dd) ? grid_r[0] : NULL);
+    dd_gather(dd, 2*sizeof(rvec), grid_s, DDMASTER(dd) ? grid_r : NULL);
 
     if (DDMASTER(dd))
     {
@@ -2068,7 +2097,7 @@ void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title,
     gmx_fio_fclose(out);
 }
 
-real dd_cutoff_mbody(gmx_domdec_t *dd)
+real dd_cutoff_multibody(const gmx_domdec_t *dd)
 {
     gmx_domdec_comm_t *comm;
     int                di;
@@ -2089,15 +2118,15 @@ real dd_cutoff_mbody(gmx_domdec_t *dd)
             r = comm->cellsize_min[dd->dim[0]];
             for (di = 1; di < dd->ndim; di++)
             {
-                r = min(r, comm->cellsize_min[dd->dim[di]]);
+                r = std::min(r, comm->cellsize_min[dd->dim[di]]);
             }
             if (comm->bBondComm)
             {
-                r = max(r, comm->cutoff_mbody);
+                r = std::max(r, comm->cutoff_mbody);
             }
             else
             {
-                r = min(r, comm->cutoff);
+                r = std::min(r, comm->cutoff);
             }
         }
     }
@@ -2105,13 +2134,13 @@ real dd_cutoff_mbody(gmx_domdec_t *dd)
     return r;
 }
 
-real dd_cutoff_twobody(gmx_domdec_t *dd)
+real dd_cutoff_twobody(const gmx_domdec_t *dd)
 {
     real r_mb;
 
-    r_mb = dd_cutoff_mbody(dd);
+    r_mb = dd_cutoff_multibody(dd);
 
-    return max(dd->comm->cutoff, r_mb);
+    return std::max(dd->comm->cutoff, r_mb);
 }
 
 
@@ -2173,7 +2202,7 @@ static int *dd_pmenodes(t_commrec *cr)
 static int gmx_ddcoord2pmeindex(t_commrec *cr, int x, int y, int z)
 {
     gmx_domdec_t *dd;
-    ivec          coords, coords_pme, nc;
+    ivec          coords;
     int           slab;
 
     dd = cr->dd;
@@ -2242,7 +2271,6 @@ static int dd_simnode2pmenode(t_commrec *cr, int sim_nodeid)
 {
     gmx_domdec_t      *dd;
     gmx_domdec_comm_t *comm;
-    ivec               coord, coord_pme;
     int                i;
     int                pmenode = -1;
 
@@ -2253,6 +2281,7 @@ static int dd_simnode2pmenode(t_commrec *cr, int sim_nodeid)
     if (comm->bCartesianPP_PME)
     {
 #ifdef GMX_MPI
+        ivec coord, coord_pme;
         MPI_Cart_coords(cr->mpi_comm_mysim, sim_nodeid, DIM, coord);
         if (coord[comm->cartpmedim] < dd->nc[comm->cartpmedim])
         {
@@ -2314,22 +2343,6 @@ void get_pme_nnodes(const gmx_domdec_t *dd,
     }
 }
 
-gmx_bool gmx_pmeonlynode(t_commrec *cr, int sim_nodeid)
-{
-    gmx_bool bPMEOnlyNode;
-
-    if (DOMAINDECOMP(cr))
-    {
-        bPMEOnlyNode = (dd_simnode2pmenode(cr, sim_nodeid) == -1);
-    }
-    else
-    {
-        bPMEOnlyNode = FALSE;
-    }
-
-    return bPMEOnlyNode;
-}
-
 void get_pme_ddnodes(t_commrec *cr, int pmenodeid,
                      int *nmy_ddnodes, int **my_ddnodes, int *node_peer)
 {
@@ -2390,7 +2403,7 @@ void get_pme_ddnodes(t_commrec *cr, int pmenodeid,
 static gmx_bool receive_vir_ener(t_commrec *cr)
 {
     gmx_domdec_comm_t *comm;
-    int                pmenode, coords[DIM], rank;
+    int                pmenode;
     gmx_bool           bReceive;
 
     bReceive = TRUE;
@@ -2401,10 +2414,12 @@ static gmx_bool receive_vir_ener(t_commrec *cr)
         {
             pmenode = dd_simnode2pmenode(cr, cr->sim_nodeid);
 #ifdef GMX_MPI
+            ivec coords;
             MPI_Cart_coords(cr->mpi_comm_mysim, cr->sim_nodeid, DIM, coords);
             coords[comm->cartpmedim]++;
             if (coords[comm->cartpmedim] < cr->dd->nc[comm->cartpmedim])
             {
+                int rank;
                 MPI_Cart_rank(cr->mpi_comm_mysim, coords, &rank);
                 if (dd_simnode2pmenode(cr, rank) == pmenode)
                 {
@@ -2512,12 +2527,8 @@ static void make_dd_indices(gmx_domdec_t *dd,
 {
     int          nzone, zone, zone1, cg0, cg1, cg1_p1, cg, cg_gl, a, a_gl;
     int         *zone2cg, *zone_ncg1, *index_gl, *gatindex;
-    gmx_ga2la_t *ga2la;
-    char        *bLocalCG;
     gmx_bool     bCGs;
 
-    bLocalCG = dd->comm->bLocalCG;
-
     if (dd->nat_tot > dd->gatindex_nalloc)
     {
         dd->gatindex_nalloc = over_alloc_dd(dd->nat_tot);
@@ -2582,7 +2593,7 @@ static void make_dd_indices(gmx_domdec_t *dd,
 static int check_bLocalCG(gmx_domdec_t *dd, int ncg_sys, const char *bLocalCG,
                           const char *where)
 {
-    int ncg, i, ngl, nerr;
+    int i, ngl, nerr;
 
     nerr = 0;
     if (bLocalCG == NULL)
@@ -2742,12 +2753,12 @@ static real cellsize_min_dlb(gmx_domdec_comm_t *comm, int dim_ind, int dim)
         /* The cut-off might have changed, e.g. by PME load balacning,
          * from the value used to set comm->cellsize_min, so check it.
          */
-        cellsize_min = max(cellsize_min, comm->cutoff/comm->cd[dim_ind].np_dlb);
+        cellsize_min = std::max(cellsize_min, comm->cutoff/comm->cd[dim_ind].np_dlb);
 
         if (comm->bPMELoadBalDLBLimits)
         {
             /* Check for the cut-off limit set by the PME load balancing */
-            cellsize_min = max(cellsize_min, comm->PMELoadBal_max_cutoff/comm->cd[dim_ind].np_dlb);
+            cellsize_min = std::max(cellsize_min, comm->PMELoadBal_max_cutoff/comm->cd[dim_ind].np_dlb);
         }
     }
 
@@ -2770,10 +2781,10 @@ static real grid_jump_limit(gmx_domdec_comm_t *comm, real cutoff,
     {
         if (comm->bPMELoadBalDLBLimits)
         {
-            cutoff = max(cutoff, comm->PMELoadBal_max_cutoff);
+            cutoff = std::max(cutoff, comm->PMELoadBal_max_cutoff);
         }
-        grid_jump_limit = max(grid_jump_limit,
-                              cutoff/comm->cd[dim_ind].np);
+        grid_jump_limit = std::max(grid_jump_limit,
+                                   cutoff/comm->cd[dim_ind].np);
     }
 
     return grid_jump_limit;
@@ -2960,8 +2971,8 @@ static void init_ddpme(gmx_domdec_t *dd, gmx_ddpme_t *ddpme, int dimind)
             {
                 slab = pmeindex % ddpme->nslab;
             }
-            ddpme->pp_min[slab] = min(ddpme->pp_min[slab], xyz[dimind]);
-            ddpme->pp_max[slab] = max(ddpme->pp_max[slab], xyz[dimind]);
+            ddpme->pp_min[slab] = std::min(ddpme->pp_min[slab], xyz[dimind]);
+            ddpme->pp_max[slab] = std::max(ddpme->pp_max[slab], xyz[dimind]);
         }
     }
 
@@ -3162,7 +3173,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
                 {
                     npulse[d]++;
                 }
-                cellsize_min[d] = min(cellsize_min[d], cellsize);
+                cellsize_min[d] = std::min(cellsize_min[d], cellsize);
             }
             if (setmode == setcellsizeslbLOCAL)
             {
@@ -3432,7 +3443,7 @@ static void set_dd_cell_sizes_dlb_root(gmx_domdec_t *dd,
                                        gmx_bool bUniform, gmx_int64_t step)
 {
     gmx_domdec_comm_t *comm;
-    int                ncd, d1, i, j, pos;
+    int                ncd, d1, i, pos;
     real              *cell_size;
     real               load_aver, load_i, imbalance, change, change_max, sc;
     real               cellsize_limit_f, dist_min_f, dist_min_f_hard, space;
@@ -3475,7 +3486,7 @@ static void set_dd_cell_sizes_dlb_root(gmx_domdec_t *dd,
             imbalance = (load_i - load_aver)/(load_aver > 0 ? load_aver : 1);
             /* Determine the change of the cell size using underrelaxation */
             change     = -relax*imbalance;
-            change_max = max(change_max, max(change, -change));
+            change_max = std::max(change_max, std::max(change, -change));
         }
         /* Limit the amount of scaling.
          * We need to use the same rescaling for all cells in one row,
@@ -3618,7 +3629,7 @@ static void distribute_dd_cell_sizes_dlb(gmx_domdec_t *dd,
                                          gmx_ddbox_t *ddbox)
 {
     gmx_domdec_comm_t *comm;
-    int                d1, dim1, pos;
+    int                d1, pos;
 
     comm = dd->comm;
 
@@ -3906,13 +3917,13 @@ static void distribute_cg(FILE *fplog, gmx_int64_t step,
 {
     gmx_domdec_master_t *ma;
     int                **tmp_ind = NULL, *tmp_nalloc = NULL;
-    int                  i, icg, j, k, k0, k1, d, npbcdim;
+    int                  i, icg, j, k, k0, k1, d;
     matrix               tcm;
-    rvec                 box_size, cg_cm;
+    rvec                 cg_cm;
     ivec                 ind;
     real                 nrcg, inv_ncg, pos_d;
     atom_id             *cgindex;
-    gmx_bool             bUnbounded, bScrew;
+    gmx_bool             bScrew;
 
     ma = dd->ma;
 
@@ -4120,9 +4131,9 @@ static void get_cg_distribution(FILE *fplog, gmx_int64_t step, gmx_domdec_t *dd,
     }
 
     dd_scatterv(dd,
-                DDMASTER(dd) ? ma->ibuf : NULL,
-                DDMASTER(dd) ? ma->ibuf+dd->nnodes : NULL,
-                DDMASTER(dd) ? ma->cg : NULL,
+                bMaster ? ma->ibuf : NULL,
+                bMaster ? ma->ibuf+dd->nnodes : NULL,
+                bMaster ? ma->cg : NULL,
                 dd->ncg_home*sizeof(int), dd->index_gl);
 
     /* Determine the home charge group sizes */
@@ -4457,8 +4468,8 @@ static void calc_cg_move(FILE *fplog, gmx_int64_t step,
                          int *move)
 {
     int      npbcdim;
-    int      c, i, cg, k, k0, k1, d, dim, dim2, dir, d2, d3, d4, cell_d;
-    int      mc, cdd, nrcg, ncg_recv, nat_recv, nvs, nvr, nvec, vec;
+    int      cg, k, k0, k1, d, dim, d2;
+    int      mc, nrcg;
     int      flag;
     gmx_bool bScrew;
     ivec     dev;
@@ -4634,17 +4645,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, k0, k1, d, dim, dim2, dir, d2, d3, d4, cell_d;
-    int                mc, cdd, nrcg, ncg_recv, nat_recv, nvs, nvr, nvec, vec;
+    int                c, 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, bSDX = FALSE, bCGP = FALSE;
-    gmx_bool           bScrew;
-    ivec               dev;
-    real               inv_ncg, pos_d;
+    real               pos_d;
     matrix             tcm;
-    rvec              *cg_cm = NULL, cell_x0, cell_x1, limitd, limit0, limit1, cm_new;
+    rvec              *cg_cm = NULL, cell_x0, cell_x1, limitd, limit0, limit1;
     atom_id           *cgindex;
     cginfo_mb_t       *cginfo_mb;
     gmx_domdec_comm_t *comm;
@@ -4901,7 +4910,6 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
     {
         dim      = dd->dim[d];
         ncg_recv = 0;
-        nat_recv = 0;
         nvr      = 0;
         for (dir = 0; dir < (dd->nc[dim] == 2 ? 1 : 2); dir++)
         {
@@ -4936,7 +4944,6 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
                              comm->cgcm_state[cdd], nvs,
                              comm->vbuf.v+nvr, i);
             ncg_recv += rbuf[0];
-            nat_recv += rbuf[1];
             nvr      += i;
         }
 
@@ -5240,7 +5247,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
     gmx_domdec_comm_t *comm;
     gmx_domdec_load_t *load;
     gmx_domdec_root_t *root = NULL;
-    int                d, dim, cid, i, pos;
+    int                d, dim, i, pos;
     float              cell_frac = 0, sbuf[DD_NLOAD_MAX];
     gmx_bool           bSepPME;
 
@@ -5336,7 +5343,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
                 for (i = 0; i < dd->nc[dim]; i++)
                 {
                     load->sum += load->load[pos++];
-                    load->max  = max(load->max, load->load[pos]);
+                    load->max  = std::max(load->max, load->load[pos]);
                     pos++;
                     if (dd->bGridJump)
                     {
@@ -5345,14 +5352,14 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
                             /* This direction could not be load balanced properly,
                              * therefore we need to use the maximum iso the average load.
                              */
-                            load->sum_m = max(load->sum_m, load->load[pos]);
+                            load->sum_m = std::max(load->sum_m, load->load[pos]);
                         }
                         else
                         {
                             load->sum_m += load->load[pos];
                         }
                         pos++;
-                        load->cvol_min = min(load->cvol_min, load->load[pos]);
+                        load->cvol_min = std::min(load->cvol_min, load->load[pos]);
                         pos++;
                         if (d < dd->ndim-1)
                         {
@@ -5366,9 +5373,9 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
                     }
                     if (bSepPME)
                     {
-                        load->mdf = max(load->mdf, load->load[pos]);
+                        load->mdf = std::max(load->mdf, load->load[pos]);
                         pos++;
-                        load->pme = max(load->pme, load->load[pos]);
+                        load->pme = std::max(load->pme, load->load[pos]);
                         pos++;
                     }
                 }
@@ -5762,7 +5769,6 @@ static void make_load_communicators(gmx_domdec_t gmx_unused *dd)
 
 void setup_dd_grid(FILE *fplog, gmx_domdec_t *dd)
 {
-    gmx_bool                bZYX;
     int                     d, dim, i, j, m;
     ivec                    tmp, s;
     int                     nzone, nzonep;
@@ -5921,17 +5927,16 @@ void setup_dd_grid(FILE *fplog, gmx_domdec_t *dd)
 static void make_pp_communicator(FILE *fplog, t_commrec *cr, int gmx_unused reorder)
 {
     gmx_domdec_t      *dd;
+    dd   = cr->dd;
+
+#ifdef GMX_MPI
     gmx_domdec_comm_t *comm;
-    int                i, rank, *buf;
+    int                rank, *buf;
     ivec               periods;
-#ifdef GMX_MPI
     MPI_Comm           comm_cart;
-#endif
 
-    dd   = cr->dd;
     comm = dd->comm;
 
-#ifdef GMX_MPI
     if (comm->bCartesianPP)
     {
         /* Set up cartesian communication for the particle-particle part */
@@ -5941,7 +5946,7 @@ static void make_pp_communicator(FILE *fplog, t_commrec *cr, int gmx_unused reor
                     dd->nc[XX], dd->nc[YY], dd->nc[ZZ]);
         }
 
-        for (i = 0; i < DIM; i++)
+        for (int i = 0; i < DIM; i++)
         {
             periods[i] = TRUE;
         }
@@ -6005,7 +6010,7 @@ static void make_pp_communicator(FILE *fplog, t_commrec *cr, int gmx_unused reor
         /* Determine the master coordinates and rank.
          * The DD master should be the same node as the master of this sim.
          */
-        for (i = 0; i < dd->nnodes; i++)
+        for (int i = 0; i < dd->nnodes; i++)
         {
             if (comm->ddindex2simnodeid[i] == 0)
             {
@@ -6043,30 +6048,27 @@ static void make_pp_communicator(FILE *fplog, t_commrec *cr, int gmx_unused reor
     }
 }
 
-static void receive_ddindex2simnodeid(t_commrec *cr)
+static void receive_ddindex2simnodeid(t_commrec gmx_unused *cr)
 {
+#ifdef GMX_MPI
     gmx_domdec_t      *dd;
-
     gmx_domdec_comm_t *comm;
-    int               *buf;
 
     dd   = cr->dd;
     comm = dd->comm;
 
-#ifdef GMX_MPI
     if (!comm->bCartesianPP_PME && comm->bCartesianPP)
     {
+        int *buf;
         snew(comm->ddindex2simnodeid, dd->nnodes);
         snew(buf, dd->nnodes);
         if (cr->duty & DUTY_PP)
         {
             buf[dd_index(dd->nc, dd->ci)] = cr->sim_nodeid;
         }
-#ifdef GMX_MPI
         /* Communicate the ddindex to simulation nodeid index */
         MPI_Allreduce(buf, comm->ddindex2simnodeid, dd->nnodes, MPI_INT, MPI_SUM,
                       cr->mpi_comm_mysim);
-#endif
         sfree(buf);
     }
 #endif
@@ -6108,9 +6110,8 @@ static void split_communicator(FILE *fplog, t_commrec *cr, int gmx_unused dd_nod
 {
     gmx_domdec_t      *dd;
     gmx_domdec_comm_t *comm;
-    int                i, rank;
+    int                i;
     gmx_bool           bDiv[DIM];
-    ivec               periods;
 #ifdef GMX_MPI
     MPI_Comm           comm_cart;
 #endif
@@ -6158,6 +6159,9 @@ static void split_communicator(FILE *fplog, t_commrec *cr, int gmx_unused dd_nod
 #ifdef GMX_MPI
     if (comm->bCartesianPP_PME)
     {
+        int  rank;
+        ivec periods;
+
         if (fplog)
         {
             fprintf(fplog, "Will use a Cartesian communicator for PP <-> PME: %d x %d x %d\n", comm->ntot[XX], comm->ntot[YY], comm->ntot[ZZ]);
@@ -6169,7 +6173,6 @@ static void split_communicator(FILE *fplog, t_commrec *cr, int gmx_unused dd_nod
         }
         MPI_Cart_create(cr->mpi_comm_mysim, DIM, comm->ntot, periods, reorder,
                         &comm_cart);
-
         MPI_Comm_rank(comm_cart, &rank);
         if (MASTERNODE(cr) && rank != 0)
         {
@@ -6353,7 +6356,7 @@ static real *get_slb_frac(FILE *fplog, const char *dir, int nc, const char *size
         for (i = 0; i < nc; i++)
         {
             dbl = 0;
-            sscanf(size_string, "%lf%n", &dbl, &n);
+            sscanf(size_string, "%20lf%n", &dbl, &n);
             if (dbl == 0)
             {
                 gmx_fatal(FARGS, "Incorrect or not enough DD cell size entries for direction %s: '%s'", dir, size_string);
@@ -6416,7 +6419,7 @@ static int dd_getenv(FILE *fplog, const char *env_var, int def)
     val = getenv(env_var);
     if (val)
     {
-        if (sscanf(val, "%d", &nst) <= 0)
+        if (sscanf(val, "%20d", &nst) <= 0)
         {
             nst = 1;
         }
@@ -6477,7 +6480,7 @@ static real average_cellsize_min(gmx_domdec_t *dd, gmx_ddbox_t *ddbox)
     {
         d = dd->dim[di];
         /* Check using the initial average cell size */
-        r = min(r, ddbox->box_size[d]*ddbox->skew_fac[d]/dd->nc[d]);
+        r = std::min(r, ddbox->box_size[d]*ddbox->skew_fac[d]/dd->nc[d]);
     }
 
     return r;
@@ -6487,7 +6490,6 @@ static int check_dlb_support(FILE *fplog, t_commrec *cr,
                              const char *dlb_opt, gmx_bool bRecordLoad,
                              unsigned long Flags, t_inputrec *ir)
 {
-    gmx_domdec_t *dd;
     int           eDLB = -1;
     char          buf[STRLEN];
 
@@ -6629,10 +6631,10 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
     gmx_domdec_t      *dd;
     gmx_domdec_comm_t *comm;
     int                recload;
-    int                d, i, j;
     real               r_2b, r_mb, r_bonded = -1, r_bonded_limit = -1, limit, acs;
     gmx_bool           bC;
     char               buf[STRLEN];
+    const real         tenPercentMargin = 1.1;
 
     if (fplog)
     {
@@ -6758,8 +6760,8 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
      * within nstlist steps. Since boundaries are allowed to displace by half
      * a cell size, DD cells should be at least the size of the list buffer.
      */
-    comm->cellsize_limit = max(comm->cellsize_limit,
-                               ir->rlistlong - max(ir->rvdw, ir->rcoulomb));
+    comm->cellsize_limit = std::max(comm->cellsize_limit,
+                                    ir->rlistlong - std::max(ir->rvdw, ir->rcoulomb));
 
     if (comm->bInterCGBondeds)
     {
@@ -6772,7 +6774,7 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
             }
             else
             {
-                comm->cutoff = max(comm->cutoff, comm->cutoff_mbody);
+                comm->cutoff = std::max(comm->cutoff, comm->cutoff_mbody);
             }
             r_bonded_limit = comm->cutoff_mbody;
         }
@@ -6798,16 +6800,16 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
              */
             if (Flags & MD_DDBONDCOMM)
             {
-                if (max(r_2b, r_mb) > comm->cutoff)
+                if (std::max(r_2b, r_mb) > comm->cutoff)
                 {
-                    r_bonded        = max(r_2b, r_mb);
-                    r_bonded_limit  = 1.1*r_bonded;
+                    r_bonded        = std::max(r_2b, r_mb);
+                    r_bonded_limit  = tenPercentMargin*r_bonded;
                     comm->bBondComm = TRUE;
                 }
                 else
                 {
                     r_bonded       = r_mb;
-                    r_bonded_limit = min(1.1*r_bonded, comm->cutoff);
+                    r_bonded_limit = std::min(tenPercentMargin*r_bonded, comm->cutoff);
                 }
                 /* We determine cutoff_mbody later */
             }
@@ -6816,9 +6818,9 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
                 /* No special bonded communication,
                  * simply increase the DD cut-off.
                  */
-                r_bonded_limit     = 1.1*max(r_2b, r_mb);
+                r_bonded_limit     = tenPercentMargin*std::max(r_2b, r_mb);
                 comm->cutoff_mbody = r_bonded_limit;
-                comm->cutoff       = max(comm->cutoff, comm->cutoff_mbody);
+                comm->cutoff       = std::max(comm->cutoff, comm->cutoff_mbody);
             }
         }
         if (fplog)
@@ -6827,7 +6829,7 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
                     "Minimum cell size due to bonded interactions: %.3f nm\n",
                     r_bonded_limit);
         }
-        comm->cellsize_limit = max(comm->cellsize_limit, r_bonded_limit);
+        comm->cellsize_limit = std::max(comm->cellsize_limit, r_bonded_limit);
     }
 
     if (dd->bInterCGcons && rconstr <= 0)
@@ -6855,7 +6857,7 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
                 "User supplied maximum distance required for P-LINCS: %.3f nm\n",
                 rconstr);
     }
-    comm->cellsize_limit = max(comm->cellsize_limit, rconstr);
+    comm->cellsize_limit = std::max(comm->cellsize_limit, rconstr);
 
     comm->cgs_gl = gmx_mtop_global_cgs(mtop);
 
@@ -7011,12 +7013,12 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
             if (comm->eDLB != edlbNO)
             {
                 /* Check if this does not limit the scaling */
-                comm->cutoff_mbody = min(comm->cutoff_mbody, dlb_scale*acs);
+                comm->cutoff_mbody = std::min(comm->cutoff_mbody, dlb_scale*acs);
             }
             if (!comm->bBondComm)
             {
                 /* Without bBondComm do not go beyond the n.b. cut-off */
-                comm->cutoff_mbody = min(comm->cutoff_mbody, comm->cutoff);
+                comm->cutoff_mbody = std::min(comm->cutoff_mbody, comm->cutoff);
                 if (comm->cellsize_limit >= comm->cutoff)
                 {
                     /* We don't loose a lot of efficieny
@@ -7028,7 +7030,7 @@ gmx_domdec_t *init_domain_decomposition(FILE *fplog, t_commrec *cr,
                 }
             }
             /* Check if we did not end up below our original limit */
-            comm->cutoff_mbody = max(comm->cutoff_mbody, r_bonded_limit);
+            comm->cutoff_mbody = std::max(comm->cutoff_mbody, r_bonded_limit);
 
             if (comm->cutoff_mbody > comm->cellsize_limit)
             {
@@ -7091,7 +7093,7 @@ static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step)
     cellsize_min = comm->cellsize_min[dd->dim[0]];
     for (d = 1; d < dd->ndim; d++)
     {
-        cellsize_min = min(cellsize_min, comm->cellsize_min[dd->dim[d]]);
+        cellsize_min = std::min(cellsize_min, comm->cellsize_min[dd->dim[d]]);
     }
 
     if (cellsize_min < comm->cellsize_limit*1.05)
@@ -7156,8 +7158,6 @@ void dd_init_bondeds(FILE *fplog,
                      t_inputrec *ir, gmx_bool bBCheck, cginfo_mb_t *cginfo_mb)
 {
     gmx_domdec_comm_t *comm;
-    gmx_bool           bBondComm;
-    int                d;
 
     dd_make_reverse_top(fplog, dd, mtop, vsite, ir, bBCheck);
 
@@ -7268,7 +7268,7 @@ static void print_dd_settings(FILE *fplog, gmx_domdec_t *dd,
             limit = dd->comm->cellsize_min[XX];
             for (d = 1; d < DIM; d++)
             {
-                limit = min(limit, dd->comm->cellsize_min[d]);
+                limit = std::min(limit, dd->comm->cellsize_min[d]);
             }
         }
 
@@ -7276,10 +7276,10 @@ static void print_dd_settings(FILE *fplog, gmx_domdec_t *dd,
         {
             fprintf(fplog, "%40s  %-7s %6.3f nm\n",
                     "two-body bonded interactions", "(-rdd)",
-                    max(comm->cutoff, comm->cutoff_mbody));
+                    std::max(comm->cutoff, comm->cutoff_mbody));
             fprintf(fplog, "%40s  %-7s %6.3f nm\n",
                     "multi-body bonded interactions", "(-rdd)",
-                    (comm->bBondComm || dd->bGridJump) ? comm->cutoff_mbody : min(comm->cutoff, limit));
+                    (comm->bBondComm || dd->bGridJump) ? comm->cutoff_mbody : std::min(comm->cutoff, limit));
         }
         if (dd->vsite_comm)
         {
@@ -7314,7 +7314,7 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
 
     /* Determine the maximum number of comm. pulses in one dimension */
 
-    comm->cellsize_limit = max(comm->cellsize_limit, comm->cutoff_mbody);
+    comm->cellsize_limit = std::max(comm->cellsize_limit, comm->cutoff_mbody);
 
     /* Determine the maximum required number of grid pulses */
     if (comm->cellsize_limit >= comm->cutoff)
@@ -7335,7 +7335,7 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
     else
     {
         /* There is no cell size limit */
-        npulse = max(dd->nc[XX]-1, max(dd->nc[YY]-1, dd->nc[ZZ]-1));
+        npulse = std::max(dd->nc[XX]-1, std::max(dd->nc[YY]-1, dd->nc[ZZ]-1));
     }
 
     if (!bNoCutOff && npulse > 1)
@@ -7347,9 +7347,9 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
             dim      = dd->dim[d];
             npulse_d = (int)(1 + dd->nc[dim]*comm->cutoff
                              /(ddbox->box_size[dim]*ddbox->skew_fac[dim]*dlb_scale));
-            npulse_d_max = max(npulse_d_max, npulse_d);
+            npulse_d_max = std::max(npulse_d_max, npulse_d);
         }
-        npulse = min(npulse, npulse_d_max);
+        npulse = std::min(npulse, npulse_d_max);
     }
 
     /* This env var can override npulse */
@@ -7363,10 +7363,10 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
     comm->bVacDLBNoLimit = (ir->ePBC == epbcNONE);
     for (d = 0; d < dd->ndim; d++)
     {
-        comm->cd[d].np_dlb    = min(npulse, dd->nc[dd->dim[d]]-1);
+        comm->cd[d].np_dlb    = std::min(npulse, dd->nc[dd->dim[d]]-1);
         comm->cd[d].np_nalloc = comm->cd[d].np_dlb;
         snew(comm->cd[d].ind, comm->cd[d].np_nalloc);
-        comm->maxpulse = max(comm->maxpulse, comm->cd[d].np_dlb);
+        comm->maxpulse = std::max(comm->maxpulse, comm->cd[d].np_dlb);
         if (comm->cd[d].np_dlb < dd->nc[dd->dim[d]]-1)
         {
             comm->bVacDLBNoLimit = FALSE;
@@ -7376,10 +7376,10 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
     /* cellsize_limit is set for LINCS in init_domain_decomposition */
     if (!comm->bVacDLBNoLimit)
     {
-        comm->cellsize_limit = max(comm->cellsize_limit,
-                                   comm->cutoff/comm->maxpulse);
+        comm->cellsize_limit = std::max(comm->cellsize_limit,
+                                        comm->cutoff/comm->maxpulse);
     }
-    comm->cellsize_limit = max(comm->cellsize_limit, comm->cutoff_mbody);
+    comm->cellsize_limit = std::max(comm->cellsize_limit, comm->cutoff_mbody);
     /* Set the minimum cell size for each DD dimension */
     for (d = 0; d < dd->ndim; d++)
     {
@@ -7396,7 +7396,7 @@ static void set_cell_limits_dlb(gmx_domdec_t      *dd,
     }
     if (comm->cutoff_mbody <= 0)
     {
-        comm->cutoff_mbody = min(comm->cutoff, comm->cellsize_limit);
+        comm->cutoff_mbody = std::min(comm->cutoff, comm->cellsize_limit);
     }
     if (comm->bDynLoadBal)
     {
@@ -7487,7 +7487,7 @@ void set_dd_parameters(FILE *fplog, gmx_domdec_t *dd, real dlb_scale,
     }
     natoms_tot = comm->cgs_gl.index[comm->cgs_gl.nr];
 
-    dd->ga2la = ga2la_init(natoms_tot, vol_frac*natoms_tot);
+    dd->ga2la = ga2la_init(natoms_tot, static_cast<int>(vol_frac*natoms_tot));
 }
 
 static gmx_bool test_dd_cutoff(t_commrec *cr,
@@ -7765,11 +7765,11 @@ set_dd_corners(const gmx_domdec_t *dd,
         c->c[1][1] = comm->cell_x0[dim1];
         if (dd->bGridJump)
         {
-            c->c[1][1] = max(comm->cell_x0[dim1], comm->zone_d1[1].mch0);
+            c->c[1][1] = std::max(comm->cell_x0[dim1], comm->zone_d1[1].mch0);
             if (bDistMB)
             {
                 /* For the multi-body distance we need the maximum */
-                c->bc[1] = max(comm->cell_x0[dim1], comm->zone_d1[1].p1_0);
+                c->bc[1] = std::max(comm->cell_x0[dim1], comm->zone_d1[1].p1_0);
             }
         }
         /* Set the upper-right corner for rounding */
@@ -7792,8 +7792,8 @@ set_dd_corners(const gmx_domdec_t *dd,
                         if (j >= 4)
                         {
                             c->c[2][j-4] =
-                                max(c->c[2][j-4],
-                                    comm->zone_d2[zones->shift[i][dim0]][zones->shift[i][dim1]].mch0);
+                                std::max(c->c[2][j-4],
+                                         comm->zone_d2[zones->shift[i][dim0]][zones->shift[i][dim1]].mch0);
                         }
                     }
                 }
@@ -7805,7 +7805,7 @@ set_dd_corners(const gmx_domdec_t *dd,
                     {
                         for (j = 0; j < 2; j++)
                         {
-                            c->bc[2] = max(c->bc[2], comm->zone_d2[i][j].p1_0);
+                            c->bc[2] = std::max(c->bc[2], comm->zone_d2[i][j].p1_0);
                         }
                     }
                 }
@@ -7819,11 +7819,11 @@ set_dd_corners(const gmx_domdec_t *dd,
             c->cr1[3] = comm->cell_x1[dim1];
             if (dd->bGridJump)
             {
-                c->cr1[0] = max(comm->cell_x1[dim1], comm->zone_d1[1].mch1);
+                c->cr1[0] = std::max(comm->cell_x1[dim1], comm->zone_d1[1].mch1);
                 if (bDistMB)
                 {
                     /* For the multi-body distance we need the maximum */
-                    c->bcr1 = max(comm->cell_x1[dim1], comm->zone_d1[1].p1_1);
+                    c->bcr1 = std::max(comm->cell_x1[dim1], comm->zone_d1[1].p1_1);
                 }
             }
         }
@@ -8103,7 +8103,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
 {
     int                    dim_ind, dim, dim0, dim1, dim2, dimd, p, nat_tot;
     int                    nzone, nzone_send, zone, zonei, cg0, cg1;
-    int                    c, i, j, cg, cg_gl, nrcg;
+    int                    c, i, cg, cg_gl, nrcg;
     int                   *zone_cg_range, pos_cg, *index_gl, *cgindex, *recv_i;
     gmx_domdec_comm_t     *comm;
     gmx_domdec_zones_t    *zones;
@@ -8111,7 +8111,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
     gmx_domdec_ind_t      *ind;
     cginfo_mb_t           *cginfo_mb;
     gmx_bool               bBondComm, bDist2B, bDistMB, bDistBonded;
-    real                   r_mb, r_comm2, r_scomm2, r_bcomm2, r_0, r_1, r2inc, inv_ncg;
+    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;
@@ -8142,8 +8142,6 @@ static void setup_dd_communication(gmx_domdec_t *dd,
 
     for (dim_ind = 0; dim_ind < dd->ndim; dim_ind++)
     {
-        dim = dd->dim[dim_ind];
-
         /* Check if we need to use triclinic distances */
         tric_dist[dim_ind] = 0;
         for (i = 0; i <= dim_ind; i++)
@@ -8435,7 +8433,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
                     /* The rvec buffer is also required for atom buffers
                      * of size nrecv in dd_move_x and dd_move_f.
                      */
-                    i = max(cd->ind[0].nrecv[nzone+1], ind->nrecv[nzone+1]);
+                    i = std::max(cd->ind[0].nrecv[nzone+1], ind->nrecv[nzone+1]);
                     vec_rvec_check_alloc(&comm->vbuf2, i);
                 }
             }
@@ -8580,10 +8578,9 @@ static void set_zones_size(gmx_domdec_t *dd,
     gmx_domdec_comm_t  *comm;
     gmx_domdec_zones_t *zones;
     gmx_bool            bDistMB;
-    int                 z, zi, zj0, zj1, d, dim;
+    int                 z, zi, d, dim;
     real                rcs, rcmbs;
     int                 i, j;
-    real                size_j, add_tric;
     real                vol;
 
     comm = dd->comm;
@@ -8681,8 +8678,8 @@ static void set_zones_size(gmx_domdec_t *dd,
                                  * With multiple pulses this will lead
                                  * to a larger zone then strictly necessary.
                                  */
-                                zones->size[z].x1[dim] = max(zones->size[z].x1[dim],
-                                                             zones->size[zi].x1[dim]+rcmbs);
+                                zones->size[z].x1[dim] = std::max(zones->size[z].x1[dim],
+                                                                  zones->size[zi].x1[dim]+rcmbs);
                             }
                         }
                     }
@@ -8701,8 +8698,8 @@ static void set_zones_size(gmx_domdec_t *dd,
                 {
                     if (zones->shift[z][dim] > 0)
                     {
-                        zones->size[z].x1[dim] = max(zones->size[z].x1[dim],
-                                                     zones->size[zi].x1[dim]+rcs);
+                        zones->size[z].x1[dim] = std::max(zones->size[z].x1[dim],
+                                                          zones->size[zi].x1[dim]+rcs);
                     }
                 }
             }
@@ -8772,8 +8769,8 @@ static void set_zones_size(gmx_domdec_t *dd,
             {
                 for (i = 0; i < DIM; i++)
                 {
-                    corner_min[i] = min(corner_min[i], corner[i]);
-                    corner_max[i] = max(corner_max[i], corner[i]);
+                    corner_min[i] = std::min(corner_min[i], corner[i]);
+                    corner_max[i] = std::max(corner_max[i], corner[i]);
                 }
             }
         }
@@ -8943,8 +8940,7 @@ static int dd_sort_order(gmx_domdec_t *dd, t_forcerec *fr, int ncg_home_old)
 {
     gmx_domdec_sort_t *sort;
     gmx_cgsort_t      *cgsort, *sort_i;
-    int                ncg_new, nsort2, nsort_new, i, *a, moved, *ibuf;
-    int                sort_last, sort_skip;
+    int                ncg_new, nsort2, nsort_new, i, *a, moved;
 
     sort = dd->comm->sort;
 
@@ -9055,7 +9051,7 @@ static void dd_sort_state(gmx_domdec_t *dd, rvec *cgcm, t_forcerec *fr, t_state
                           int ncg_home_old)
 {
     gmx_domdec_sort_t *sort;
-    gmx_cgsort_t      *cgsort, *sort_i;
+    gmx_cgsort_t      *cgsort;
     int               *cgindex;
     int                ncg_new, i, *ibuf, cgsize;
     rvec              *vbuf;
@@ -9312,7 +9308,7 @@ void dd_partition_system(FILE                *fplog,
     t_block           *cgs_gl;
     gmx_int64_t        step_pcoupl;
     rvec               cell_ns_x0, cell_ns_x1;
-    int                i, j, n, ncgindex_set, ncg_home_old = -1, ncg_moved, nat_f_novirsum;
+    int                i, n, ncgindex_set, ncg_home_old = -1, ncg_moved, nat_f_novirsum;
     gmx_bool           bBoxChanged, bNStGlobalComm, bDoDLB, bCheckDLB, bTurnOnDLB, bLogLoad;
     gmx_bool           bRedist, bSortCG, bResortAll;
     ivec               ncells_old = {0, 0, 0}, ncells_new = {0, 0, 0}, np;
@@ -9381,7 +9377,6 @@ void dd_partition_system(FILE                *fplog,
              * so the extra communication cost is negligible.
              */
             const int nddp_chk_dlb = 100;
-
             bCheckDLB = (comm->n_load_collect == 0 ||
                          comm->n_load_have % nddp_chk_dlb == nddp_chk_dlb - 1);
         }
similarity index 63%
rename from src/gromacs/legacyheaders/domdec.h
rename to src/gromacs/domdec/domdec.h
index 240a7901ccd0592922e98459d37437374285905a..645dbcc951e42a61247ea01596f85829281f5f37 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.
  */
+/*! \defgroup module_domdec Spatial domain decomposition (for parallelization over MPI)
+ * \ingroup group_mdrun
+ *
+ * \brief Manages the decomposition of the simulation volume over MPI
+ * ranks to try to distribute work evenly with minimal communication
+ * overheads.
+ *
+ * \todo Get domdec stuff out of legacyheaders/types/commrec.h
+ *
+ * \author Berk Hess <hess@kth.se>
+ *
+ */
 
-#ifndef _domdec_h
-#define _domdec_h
+/*! \libinternal \file
+ *
+ * \brief This file declares functions for mdrun to call to manage the
+ * details of its domain decomposition.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \inlibraryapi
+ * \ingroup module_domdec
+ */
 
-#include "typedefs.h"
-#include "vsite.h"
-#include "genborn.h"
+#ifndef GMX_DOMDEC_DOMDEC_H
+#define GMX_DOMDEC_DOMDEC_H
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int ddglatnr(gmx_domdec_t *dd, int i);
-/* Returns the global topology atom number belonging to local atom index i.
- * This function is intended for writing ascii output
+/*! \brief Returns the global topology atom number belonging to local atom index i.
+ *
+ * This function is intended for writing ASCII output
  * and returns atom numbers starting at 1.
  * When dd=NULL returns i+1.
  */
+int ddglatnr(gmx_domdec_t *dd, int i);
 
+/*! \brief Return a block struct for the charge groups of the whole system */
 t_block *dd_charge_groups_global(gmx_domdec_t *dd);
-/* Return a block struct for the charge groups of the whole system */
-
-gmx_bool dd_filled_nsgrid_home(gmx_domdec_t *dd);
-/* Is the ns grid already filled with the home particles? */
 
-void dd_store_state(gmx_domdec_t *dd, t_state *state);
-/* Store the global cg indices of the home cgs in state,
- * so it can be reset, even after a new DD partitioning.
+/*! \brief Store the global cg indices of the home cgs in state,
+ *
+ * This means it can be reset, even after a new DD partitioning.
  */
+void dd_store_state(gmx_domdec_t *dd, t_state *state);
 
+/*! \brief Returns a pointer to the gmx_domdec_zones_t struct */
 gmx_domdec_zones_t *domdec_zones(gmx_domdec_t *dd);
 
+/*! \brief Sets the j-charge-group range for i-charge-group \p icg */
 void dd_get_ns_ranges(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 involved in virtual sites */
 int dd_natoms_vsite(gmx_domdec_t *dd);
 
+/*! \brief Sets the atom range for atom in the local state for atoms received in constraints communication */
 void dd_get_constraint_range(gmx_domdec_t *dd,
                              int *at_start, int *at_end);
 
-real dd_cutoff_mbody(gmx_domdec_t *dd);
-
-real dd_cutoff_twobody(gmx_domdec_t *dd);
-
+/*! \brief Get the number of PME nodes along x and y, can be called with dd=NULL */
 void get_pme_nnodes(const gmx_domdec_t *dd,
                     int *npmenodes_x, int *npmenodes_y);
-/* Get the number of PME nodes along x and y, can be called with dd=NULL */
-
-gmx_bool gmx_pmeonlynode(t_commrec *cr, int nodeid);
-/* Return if nodeid in cr->mpi_comm_mysim is a PME-only node */
 
+/*! \brief Returns the set of DD nodes that communicate with pme node cr->nodeid */
 void get_pme_ddnodes(t_commrec *cr, int pmenodeid,
                      int *nmy_ddnodes, int **my_ddnodes, int *node_peer);
-/* Returns the set of DD nodes that communicate with pme node cr->nodeid */
 
+/*! \brief Returns the maximum shift for coordinate communication in PME, dim x */
 int dd_pme_maxshift_x(gmx_domdec_t *dd);
-/* Returns the maximum shift for coordinate communication in PME, dim x */
 
+/*! \brief Returns the maximum shift for coordinate communication in PME, dim y */
 int dd_pme_maxshift_y(gmx_domdec_t *dd);
-/* Returns the maximum shift for coordinate communication in PME, dim y */
 
+/*! \brief Generates the MPI communicators for domain decomposition */
 void make_dd_communicators(FILE *fplog, t_commrec *cr, int dd_node_order);
 
+/*! \brief Initialized the domain decomposition, chooses the DD grid and PME ranks */
 gmx_domdec_t *
 init_domain_decomposition(FILE *fplog,
                           t_commrec *cr,
@@ -108,92 +144,111 @@ init_domain_decomposition(FILE *fplog,
                           gmx_ddbox_t *ddbox,
                           int *npme_x, int *npme_y);
 
+/*! \brief Initialize data structures for bonded interactions */
 void dd_init_bondeds(FILE *fplog,
                      gmx_domdec_t *dd, gmx_mtop_t *mtop,
                      gmx_vsite_t *vsite,
                      t_inputrec *ir, gmx_bool bBCheck, cginfo_mb_t *cginfo_mb);
-/* Initialize data structures for bonded interactions */
 
+/*! \brief Returns if we need to do pbc for calculating bonded interactions */
 gmx_bool dd_bonded_molpbc(gmx_domdec_t *dd, int ePBC);
-/* Returns if we need to do pbc for calculating bonded interactions */
 
+/*! \brief Set DD grid dimensions and limits
+ *
+ * Should be called after calling dd_init_bondeds.
+ */
 void set_dd_parameters(FILE *fplog, gmx_domdec_t *dd, real dlb_scale,
                        t_inputrec *ir,
                        gmx_ddbox_t *ddbox);
-/* Set DD grid dimensions and limits,
- * should be called after calling dd_init_bondeds.
- */
 
-gmx_bool change_dd_cutoff(t_commrec *cr, t_state *state, t_inputrec *ir,
-                          real cutoff_req );
-/* Change the DD non-bonded communication cut-off.
+/*! \brief Change the DD non-bonded communication cut-off.
+ *
  * This could fail when trying to increase the cut-off,
  * then FALSE will be returned and the cut-off is not modified.
  */
+gmx_bool change_dd_cutoff(t_commrec *cr, t_state *state, t_inputrec *ir,
+                          real cutoff_req );
 
-void change_dd_dlb_cutoff_limit(t_commrec *cr);
-/* Domain boundary changes due to the DD dynamic load balancing can limit
+/*! \brief Limit DLB to preserve the option of returning to the current cut-off.
+ *
+ * Domain boundary changes due to the DD dynamic load balancing can limit
  * the cut-off distance that can be set in change_dd_cutoff. This function
  * limits the DLB such that using the currently set cut-off should still be
  * possible after subsequently setting a shorter cut-off with change_dd_cutoff.
  */
+void change_dd_dlb_cutoff_limit(t_commrec *cr);
 
+/*! \brief Return if the DLB lock is set */
 gmx_bool dd_dlb_is_locked(const gmx_domdec_t *dd);
-/* Return if the DLB lock is set */
 
+/*! \brief Set a lock such that with DLB=auto DLB can (not) get turned on */
 void dd_dlb_set_lock(gmx_domdec_t *dd, gmx_bool bValue);
-/* Set a lock such that with DLB=auto DLB can (not) get turned on */
 
-void dd_setup_dlb_resource_sharing(t_commrec           *cr,
-                                   const gmx_hw_info_t *hwinfo,
-                                   const gmx_hw_opt_t  *hw_opt);
-/* When domains (PP MPI ranks) share a GPU, the individual GPU wait times
+/*! \brief Set up communication for averaging GPU wait times over ranks
+ *
+ * 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(t_commrec           *cr,
+                                   const gmx_hw_info_t *hwinfo,
+                                   const gmx_hw_opt_t  *hw_opt);
 
+/*! \brief Sets up the DD communication setup */
 void setup_dd_grid(FILE *fplog, gmx_domdec_t *dd);
 
+/*! \brief Collects local rvec arrays \p lv to \p v on the master rank */
 void dd_collect_vec(gmx_domdec_t *dd,
                     t_state *state_local, rvec *lv, rvec *v);
 
+/*! \brief Collects the local state \p state_local to \p state on the master rank */
 void dd_collect_state(gmx_domdec_t *dd,
                       t_state *state_local, t_state *state);
 
+/*! \brief Cycle counter indices used internally in the domain decomposition */
 enum {
     ddCyclStep, ddCyclPPduringPME, ddCyclF, ddCyclWaitGPU, ddCyclPME, ddCyclNr
 };
 
+/*! \brief Add the wallcycle count to the DD counter */
 void dd_cycles_add(gmx_domdec_t *dd, float cycles, int ddCycl);
-/* Add the wallcycle count to the DD counter */
 
+/*! \brief Start the force flop count */
 void dd_force_flop_start(gmx_domdec_t *dd, t_nrnb *nrnb);
-/* Start the force flop count */
 
+/*! \brief Stop the force flop count */
 void dd_force_flop_stop(gmx_domdec_t *dd, t_nrnb *nrnb);
-/* Stop the force flop count */
 
-float dd_pme_f_ratio(gmx_domdec_t *dd);
-/* Return the PME/PP force load ratio, or -1 if nothing was measured.
+/*! \brief Return the PME/PP force load ratio, or -1 if nothing was measured.
+ *
  * Should only be called on the DD master node.
  */
+float dd_pme_f_ratio(gmx_domdec_t *dd);
 
+/*! \brief Communicate the coordinates to the neighboring cells and do pbc. */
 void dd_move_x(gmx_domdec_t *dd, matrix box, rvec x[]);
-/* Communicate the coordinates to the neighboring cells and do pbc. */
 
-void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift);
-/* Sum the forces over the neighboring cells.
+/*! \brief Sum the forces over the neighboring cells.
+ *
  * When fshift!=NULL the shift forces are updated to obtain
  * the correct virial from the single sum including f.
  */
+void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift);
 
+/*! \brief Communicate a real for each atom to the neighboring cells. */
 void dd_atom_spread_real(gmx_domdec_t *dd, real v[]);
-/* Communicate a real for each atom to the neighboring cells. */
 
+/*! \brief Sum the contributions to a real for each atom over the neighboring cells. */
 void dd_atom_sum_real(gmx_domdec_t *dd, real v[]);
-/* Sum the contributions to a real for each atom over the neighboring cells. */
 
+/*! \brief Partition the system over the nodes.
+ *
+ * step is only used for printing error messages.
+ * If bMasterState==TRUE then state_global from the master node is used,
+ * else state_local is redistributed between the nodes.
+ * When f!=NULL, *f will be reallocated to the size of state_local.
+ */
 void dd_partition_system(FILE                *fplog,
                          gmx_int64_t          step,
                          t_commrec           *cr,
@@ -213,62 +268,52 @@ void dd_partition_system(FILE                *fplog,
                          t_nrnb              *nrnb,
                          gmx_wallcycle_t      wcycle,
                          gmx_bool             bVerbose);
-/* Partition the system over the nodes.
- * step is only used for printing error messages.
- * If bMasterState==TRUE then state_global from the master node is used,
- * else state_local is redistributed between the nodes.
- * When f!=NULL, *f will be reallocated to the size of state_local.
- */
 
+/*! \brief Reset all the statistics and counters for total run counting */
 void reset_dd_statistics_counters(gmx_domdec_t *dd);
-/* Reset all the statistics and counters for total run counting */
 
+/*! \brief Print statistics for domain decomposition communication */
 void print_dd_statistics(t_commrec *cr, t_inputrec *ir, FILE *fplog);
 
 /* In domdec_con.c */
 
+/*! \brief Communicates the virtual site forces, reduces the shift forces when \p fshift != NULL */
 void dd_move_f_vsites(gmx_domdec_t *dd, rvec *f, rvec *fshift);
 
+/*! \brief Clears the forces for virtual sites */
 void dd_clear_f_vsites(gmx_domdec_t *dd, rvec *f);
 
+/*! \brief Move x0 and also x1 if x1!=NULL. bX1IsCoord tells if to do PBC on x1 */
 void dd_move_x_constraints(gmx_domdec_t *dd, matrix box,
                            rvec *x0, rvec *x1, gmx_bool bX1IsCoord);
-/* Move x0 and also x1 if x1!=NULL. bX1IsCoord tells if to do PBC on x1 */
 
+/*! \brief Communicates the coordinates involved in virtual sites */
 void dd_move_x_vsites(gmx_domdec_t *dd, matrix box, rvec *x);
 
+/*! \brief Returns the local atom count array for all constraints
+ *
+ * The local atom count for a constraint, possible values 2/1/0, is needed
+ * to avoid not/double-counting contributions linked to the Lagrange
+ * multiplier, such as the virial and free-energy derivatives.
+ */
 int *dd_constraints_nlocalatoms(gmx_domdec_t *dd);
 
-void dd_clear_local_constraint_indices(gmx_domdec_t *dd);
-
-void dd_clear_local_vsite_indices(gmx_domdec_t *dd);
-
-int dd_make_local_vsites(gmx_domdec_t *dd, int at_start, t_ilist *lil);
-
-int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
-                              const gmx_mtop_t *mtop,
-                              const int *cginfo,
-                              gmx_constr_t constr, int nrec,
-                              t_ilist *il_local);
-
-void init_domdec_constraints(gmx_domdec_t *dd,
-                             gmx_mtop_t   *mtop);
-
-void init_domdec_vsites(gmx_domdec_t *dd, int n_intercg_vsite);
-
-
 /* In domdec_top.c */
 
+/*! \brief Print error output when interactions are missing */
 void dd_print_missing_interactions(FILE *fplog, t_commrec *cr,
                                    int local_count,  gmx_mtop_t *top_global, t_state *state_local);
 
+/*! \brief Generate and store the reverse topology */
 void dd_make_reverse_top(FILE *fplog,
                          gmx_domdec_t *dd, gmx_mtop_t *mtop,
                          gmx_vsite_t *vsite,
                          t_inputrec *ir, gmx_bool bBCheck);
 
+/*! \brief Store the local charge group index in \p lcgs */
 void dd_make_local_cgs(gmx_domdec_t *dd, t_block *lcgs);
 
+/*! \brief Generate the local topology and virtual site data */
 void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                        int npbcdim, matrix box,
                        rvec cellsize_min, ivec npulse,
@@ -277,56 +322,64 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                        gmx_vsite_t *vsite,
                        gmx_mtop_t *top, gmx_localtop_t *ltop);
 
+/*! \brief Sort ltop->ilist when we are doing free energy. */
 void dd_sort_local_top(gmx_domdec_t *dd, t_mdatoms *mdatoms,
                        gmx_localtop_t *ltop);
-/* Sort ltop->ilist when we are doing free energy. */
 
+/*! \brief Construct local topology */
 gmx_localtop_t *dd_init_local_top(gmx_mtop_t *top_global);
 
+/*! \brief Construct local state */
 void dd_init_local_state(gmx_domdec_t *dd,
                          t_state *state_global, t_state *local_state);
 
+/*! \brief Generate a list of links between charge groups that are linked by bonded interactions */
 t_blocka *make_charge_group_links(gmx_mtop_t *mtop, gmx_domdec_t *dd,
                                   cginfo_mb_t *cginfo_mb);
 
+/*! \brief Calculate the maximum distance involved in 2-body and multi-body bonded interactions */
 void dd_bonded_cg_distance(FILE *fplog, gmx_mtop_t *mtop,
                            t_inputrec *ir, rvec *x, matrix box,
                            gmx_bool bBCheck,
                            real *r_2b, real *r_mb);
 
+/*! \brief Dump a pdb file with the current DD home + communicated atoms.
+ *
+ * When natoms=-1, dump all known atoms.
+ */
 void write_dd_pdb(const char *fn, gmx_int64_t step, const char *title,
                   gmx_mtop_t *mtop,
                   t_commrec *cr,
                   int natoms, rvec x[], matrix box);
-/* Dump a pdb file with the current DD home + communicated atoms.
- * When natoms=-1, dump all known atoms.
- */
 
 
 /* In domdec_setup.c */
 
+/*! \brief Returns the volume fraction of the system that is communicated */
 real comm_box_frac(ivec dd_nc, real cutoff, gmx_ddbox_t *ddbox);
-/* Returns the volume fraction of the system that is communicated */
 
+/*! \brief Determines the optimal DD cell setup dd->nc and possibly npmenodes
+ * for the system.
+ *
+ * On the master node returns the actual cellsize limit used.
+ */
 real dd_choose_grid(FILE *fplog,
                     t_commrec *cr, gmx_domdec_t *dd, t_inputrec *ir,
                     gmx_mtop_t *mtop, matrix box, gmx_ddbox_t *ddbox,
                     gmx_bool bDynLoadBal, real dlb_scale,
                     real cellsize_limit, real cutoff_dd,
                     gmx_bool bInterCGBondeds);
-/* Determines the optimal DD cell setup dd->nc and possibly npmenodes
- * for the system.
- * On the master node returns the actual cellsize limit used.
- */
 
 
 /* In domdec_box.c */
 
+/*! \brief Set the box and PBC data in \p ddbox */
 void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, t_commrec *cr_sum,
                t_inputrec *ir, matrix box,
                gmx_bool bCalcUnboundedSize, t_block *cgs, rvec *x,
                gmx_ddbox_t *ddbox);
 
+/*! \brief Set the box and PBC data in \p ddbox */
 void set_ddbox_cr(t_commrec *cr, ivec *dd_nc,
                   t_inputrec *ir, matrix box, t_block *cgs, rvec *x,
                   gmx_ddbox_t *ddbox);
@@ -335,4 +388,4 @@ void set_ddbox_cr(t_commrec *cr, ivec *dd_nc,
 }
 #endif
 
-#endif  /* _domdec_h */
+#endif
similarity index 91%
rename from src/gromacs/mdlib/domdec_box.c
rename to src/gromacs/domdec/domdec_box.cpp
index b38900e581347fb603755be8d3da9be6bac19b86..170e36b97621577895ef910d82cb3c966474102d 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ *
+ * \brief This file defines functions used by the domdec module
+ * for (bounding) box and pbc information generation.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
 
-#include "typedefs.h"
-#include "vec.h"
-#include "pbc.h"
-#include "types/commrec.h"
-#include "domdec.h"
-#include "domdec_network.h"
-#include "nsgrid.h"
-#include "network.h"
+#include "gmxpre.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/domdec/domdec_network.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nsgrid.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 
+/*! \brief Calculates the average and standard deviation in 3D of n charge groups */
 static void calc_cgcm_av_stddev(t_block *cgs, int n, rvec *x, rvec av, rvec stddev,
                                 t_commrec *cr_sum)
 {
@@ -119,6 +126,7 @@ static void calc_cgcm_av_stddev(t_block *cgs, int n, rvec *x, rvec av, rvec stdd
     }
 }
 
+/*! \brief Determines if dimensions require triclinic treatment and stores this info in ddbox */
 static void set_tric_dir(ivec *dd_nc, gmx_ddbox_t *ddbox, matrix box)
 {
     int   npbcdim, d, i, j;
@@ -228,6 +236,7 @@ static void set_tric_dir(ivec *dd_nc, gmx_ddbox_t *ddbox, matrix box)
     }
 }
 
+/*! \brief This function calculates and bounding box and pbc infor and populates ddbox */
 static void low_set_ddbox(t_inputrec *ir, ivec *dd_nc, matrix box,
                           gmx_bool bCalcUnboundedSize, int ncg, t_block *cgs, rvec *x,
                           t_commrec *cr_sum,
diff --git a/src/gromacs/domdec/domdec_constraints.cpp b/src/gromacs/domdec/domdec_constraints.cpp
new file mode 100644 (file)
index 0000000..84141fc
--- /dev/null
@@ -0,0 +1,709 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+/*! \internal \file
+ *
+ * \brief This file implements functions for domdec to use
+ * while managing inter-atomic constraints.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#include "gmxpre.h"
+
+#include "domdec_constraints.h"
+
+#include <assert.h>
+
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/gmx_hash.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "domdec_specatomcomm.h"
+
+/*! \brief Struct used during constraint setup with domain decomposition */
+typedef struct gmx_domdec_constraints {
+    //! @cond Doxygen_Suppress
+    int       *molb_con_offset; /**< Offset in the constraint array for each molblock */
+    int       *molb_ncon_mol;   /**< The number of constraints per molecule for each molblock */
+
+    int        ncon;            /**< The fully local and conneced constraints */
+    /* The global constraint number, only required for clearing gc_req */
+    int       *con_gl;          /**< Global constraint indices for local constraints */
+    int       *con_nlocat;      /**< Number of local atoms (2/1/0) for each constraint */
+    int        con_nalloc;      /**< Allocation size for \p con_gl and \p con_nlocat */
+
+    char      *gc_req;          /**< Boolean that tells if a global constraint index has been requested; note: size global #constraints */
+    gmx_hash_t ga2la;           /**< Global to local communicated constraint atom only index */
+
+    /* Multi-threading stuff */
+    int      nthread;           /**< Number of threads used for DD constraint setup */
+    t_ilist *ils;               /**< Constraint ilist working arrays, size \p nthread */
+    //! @endcond
+} gmx_domdec_constraints_t;
+
+void dd_move_x_constraints(gmx_domdec_t *dd, matrix box,
+                           rvec *x0, rvec *x1, gmx_bool bX1IsCoord)
+{
+    if (dd->constraint_comm)
+    {
+        dd_move_x_specat(dd, dd->constraint_comm, box, x0, x1, bX1IsCoord);
+    }
+}
+
+int *dd_constraints_nlocalatoms(gmx_domdec_t *dd)
+{
+    if (dd->constraints)
+    {
+        return dd->constraints->con_nlocat;
+    }
+    else
+    {
+        return NULL;
+    }
+}
+
+void dd_clear_local_constraint_indices(gmx_domdec_t *dd)
+{
+    gmx_domdec_constraints_t *dc;
+    int i;
+
+    dc = dd->constraints;
+
+    for (i = 0; i < dc->ncon; i++)
+    {
+        dc->gc_req[dc->con_gl[i]] = 0;
+    }
+
+    if (dd->constraint_comm)
+    {
+        gmx_hash_clear_and_optimize(dc->ga2la);
+    }
+}
+
+void dd_clear_local_vsite_indices(gmx_domdec_t *dd)
+{
+    if (dd->vsite_comm)
+    {
+        gmx_hash_clear_and_optimize(dd->ga2la_vsite);
+    }
+}
+
+/*! \brief Walks over the constraints out from the local atoms into the non-local atoms and adds them to a list */
+static void walk_out(int con, int con_offset, int a, int offset, int nrec,
+                     int ncon1, const t_iatom *ia1, const t_iatom *ia2,
+                     const t_blocka *at2con,
+                     const gmx_ga2la_t ga2la, gmx_bool bHomeConnect,
+                     gmx_domdec_constraints_t *dc,
+                     gmx_domdec_specat_comm_t *dcc,
+                     t_ilist *il_local,
+                     ind_req_t *ireq)
+{
+    int            a1_gl, a2_gl, a_loc, i, coni, b;
+    const t_iatom *iap;
+
+    if (dc->gc_req[con_offset+con] == 0)
+    {
+        /* Add this non-home constraint to the list */
+        if (dc->ncon+1 > dc->con_nalloc)
+        {
+            dc->con_nalloc = over_alloc_large(dc->ncon+1);
+            srenew(dc->con_gl, dc->con_nalloc);
+            srenew(dc->con_nlocat, dc->con_nalloc);
+        }
+        dc->con_gl[dc->ncon]       = con_offset + con;
+        dc->con_nlocat[dc->ncon]   = (bHomeConnect ? 1 : 0);
+        dc->gc_req[con_offset+con] = 1;
+        if (il_local->nr + 3 > il_local->nalloc)
+        {
+            il_local->nalloc = over_alloc_dd(il_local->nr+3);
+            srenew(il_local->iatoms, il_local->nalloc);
+        }
+        iap = constr_iatomptr(ncon1, ia1, ia2, con);
+        il_local->iatoms[il_local->nr++] = iap[0];
+        a1_gl = offset + iap[1];
+        a2_gl = offset + iap[2];
+        /* The following indexing code can probably be optizimed */
+        if (ga2la_get_home(ga2la, a1_gl, &a_loc))
+        {
+            il_local->iatoms[il_local->nr++] = a_loc;
+        }
+        else
+        {
+            /* We set this index later */
+            il_local->iatoms[il_local->nr++] = -a1_gl - 1;
+        }
+        if (ga2la_get_home(ga2la, a2_gl, &a_loc))
+        {
+            il_local->iatoms[il_local->nr++] = a_loc;
+        }
+        else
+        {
+            /* We set this index later */
+            il_local->iatoms[il_local->nr++] = -a2_gl - 1;
+        }
+        dc->ncon++;
+    }
+    /* Check to not ask for the same atom more than once */
+    if (gmx_hash_get_minone(dc->ga2la, offset+a) == -1)
+    {
+        assert(dcc);
+        /* Add this non-home atom to the list */
+        if (ireq->n+1 > ireq->nalloc)
+        {
+            ireq->nalloc = over_alloc_large(ireq->n+1);
+            srenew(ireq->ind, ireq->nalloc);
+        }
+        ireq->ind[ireq->n++] = offset + a;
+        /* Temporarily mark with -2, we get the index later */
+        gmx_hash_set(dc->ga2la, offset+a, -2);
+    }
+
+    if (nrec > 0)
+    {
+        for (i = at2con->index[a]; i < at2con->index[a+1]; i++)
+        {
+            coni = at2con->a[i];
+            if (coni != con)
+            {
+                /* Walk further */
+                iap = constr_iatomptr(ncon1, ia1, ia2, coni);
+                if (a == iap[1])
+                {
+                    b = iap[2];
+                }
+                else
+                {
+                    b = iap[1];
+                }
+                if (!ga2la_get_home(ga2la, offset+b, &a_loc))
+                {
+                    walk_out(coni, con_offset, b, offset, nrec-1,
+                             ncon1, ia1, ia2, at2con,
+                             ga2la, FALSE, dc, dcc, il_local, ireq);
+                }
+            }
+        }
+    }
+}
+
+/*! \brief Looks up SETTLE constraints for a range of charge-groups */
+static void atoms_to_settles(gmx_domdec_t *dd,
+                             const gmx_mtop_t *mtop,
+                             const int *cginfo,
+                             const int **at2settle_mt,
+                             int cg_start, int cg_end,
+                             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);
+
+    nral = NRAL(F_SETTLE);
+
+    for (cg = cg_start; cg < cg_end; cg++)
+    {
+        if (GET_CGINFO_SETTLE(cginfo[cg]))
+        {
+            for (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];
+
+                settle = at2settle_mt[molb->type][a_mol];
+
+                if (settle >= 0)
+                {
+                    offset = a_gl - a_mol;
+
+                    ia1 = mtop->moltype[molb->type].ilist[F_SETTLE].iatoms;
+
+                    bAssign = FALSE;
+                    nlocal  = 0;
+                    for (sa = 0; sa < nral; sa++)
+                    {
+                        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 (nlocal == 0 && a_gl == a_glsa)
+                            {
+                                bAssign = TRUE;
+                            }
+                            nlocal++;
+                        }
+                    }
+
+                    if (bAssign)
+                    {
+                        if (ils_local->nr+1+nral > ils_local->nalloc)
+                        {
+                            ils_local->nalloc = over_alloc_dd(ils_local->nr+1+nral);
+                            srenew(ils_local->iatoms, ils_local->nalloc);
+                        }
+
+                        ils_local->iatoms[ils_local->nr++] = ia1[settle*4];
+
+                        for (sa = 0; sa < nral; sa++)
+                        {
+                            if (ga2la_get_home(ga2la, a_gls[sa], &a_locs[sa]))
+                            {
+                                ils_local->iatoms[ils_local->nr++] = a_locs[sa];
+                            }
+                            else
+                            {
+                                ils_local->iatoms[ils_local->nr++] = -a_gls[sa] - 1;
+                                /* Add this non-home atom to the list */
+                                if (ireq->n+1 > ireq->nalloc)
+                                {
+                                    ireq->nalloc = over_alloc_large(ireq->n+1);
+                                    srenew(ireq->ind, ireq->nalloc);
+                                }
+                                ireq->ind[ireq->n++] = a_gls[sa];
+                                /* A check on double atom requests is
+                                 * not required for settle.
+                                 */
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    gmx_mtop_atomlookup_destroy(alook);
+}
+
+/*! \brief Looks up constraint for the local atoms */
+static void atoms_to_constraints(gmx_domdec_t *dd,
+                                 const gmx_mtop_t *mtop,
+                                 const int *cginfo,
+                                 const t_blocka *at2con_mt, int nrec,
+                                 t_ilist *ilc_local,
+                                 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;
+
+    dc  = dd->constraints;
+    dcc = dd->constraint_comm;
+
+    ga2la  = dd->ga2la;
+
+    alook = gmx_mtop_atomlookup_init(mtop);
+
+    nhome = 0;
+    for (cg = 0; cg < dd->ncg_home; cg++)
+    {
+        if (GET_CGINFO_CONSTR(cginfo[cg]))
+        {
+            for (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];
+
+                ncon1 = mtop->moltype[molb->type].ilist[F_CONSTR].nr/NRAL(F_SETTLE);
+
+                ia1 = mtop->moltype[molb->type].ilist[F_CONSTR].iatoms;
+                ia2 = mtop->moltype[molb->type].ilist[F_CONSTRNC].iatoms;
+
+                /* Calculate the global constraint number offset for the molecule.
+                 * This is only required for the global index to make sure
+                 * that we use each constraint only once.
+                 */
+                con_offset =
+                    dc->molb_con_offset[mb] + molnr*dc->molb_ncon_mol[mb];
+
+                /* The global atom number offset for this molecule */
+                offset = a_gl - a_mol;
+                at2con = &at2con_mt[molb->type];
+                for (i = at2con->index[a_mol]; i < at2con->index[a_mol+1]; i++)
+                {
+                    con = at2con->a[i];
+                    iap = constr_iatomptr(ncon1, ia1, ia2, con);
+                    if (a_mol == iap[1])
+                    {
+                        b_mol = iap[2];
+                    }
+                    else
+                    {
+                        b_mol = iap[1];
+                    }
+                    if (ga2la_get_home(ga2la, offset+b_mol, &a_loc))
+                    {
+                        /* Add this fully home constraint at the first atom */
+                        if (a_mol < b_mol)
+                        {
+                            if (dc->ncon+1 > dc->con_nalloc)
+                            {
+                                dc->con_nalloc = over_alloc_large(dc->ncon+1);
+                                srenew(dc->con_gl, dc->con_nalloc);
+                                srenew(dc->con_nlocat, dc->con_nalloc);
+                            }
+                            dc->con_gl[dc->ncon]     = con_offset + con;
+                            dc->con_nlocat[dc->ncon] = 2;
+                            if (ilc_local->nr + 3 > ilc_local->nalloc)
+                            {
+                                ilc_local->nalloc = over_alloc_dd(ilc_local->nr + 3);
+                                srenew(ilc_local->iatoms, ilc_local->nalloc);
+                            }
+                            b_lo = a_loc;
+                            ilc_local->iatoms[ilc_local->nr++] = iap[0];
+                            ilc_local->iatoms[ilc_local->nr++] = (a_gl == iap[1] ? a    : b_lo);
+                            ilc_local->iatoms[ilc_local->nr++] = (a_gl == iap[1] ? b_lo : a   );
+                            dc->ncon++;
+                            nhome++;
+                        }
+                    }
+                    else
+                    {
+                        /* We need the nrec constraints coupled to this constraint,
+                         * so we need to walk out of the home cell by nrec+1 atoms,
+                         * since already atom bg is not locally present.
+                         * Therefore we call walk_out with nrec recursions to go
+                         * after this first call.
+                         */
+                        walk_out(con, con_offset, b_mol, offset, nrec,
+                                 ncon1, ia1, ia2, at2con,
+                                 dd->ga2la, TRUE, dc, dcc, ilc_local, ireq);
+                    }
+                }
+            }
+        }
+    }
+
+    gmx_mtop_atomlookup_destroy(alook);
+
+    if (debug)
+    {
+        fprintf(debug,
+                "Constraints: home %3d border %3d atoms: %3d\n",
+                nhome, dc->ncon-nhome,
+                dd->constraint_comm ? ireq->n : 0);
+    }
+}
+
+int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
+                              const gmx_mtop_t *mtop,
+                              const int *cginfo,
+                              gmx_constr_t constr, int nrec,
+                              t_ilist *il_local)
+{
+    gmx_domdec_constraints_t *dc;
+    t_ilist                  *ilc_local, *ils_local;
+    ind_req_t                *ireq;
+    const t_blocka           *at2con_mt;
+    const int               **at2settle_mt;
+    gmx_hash_t                ga2la_specat;
+    int at_end, i, j;
+    t_iatom                  *iap;
+
+    // This code should not be called unless this condition is true,
+    // because that's the only time init_domdec_constraints is
+    // called...
+    GMX_RELEASE_ASSERT(dd->bInterCGcons || dd->bInterCGsettles, "dd_make_local_constraints called when there are no local constraints");
+    // ... and init_domdec_constraints always sets
+    // dd->constraint_comm...
+    GMX_RELEASE_ASSERT(dd->constraint_comm, "Invalid use of dd_make_local_constraints before construction of constraint_comm");
+    // ... which static analysis needs to be reassured about, because
+    // otherwise, when dd->bInterCGsettles is
+    // true. dd->constraint_comm is unilaterally dereferenced before
+    // the call to atoms_to_settles.
+
+    dc = dd->constraints;
+
+    ilc_local = &il_local[F_CONSTR];
+    ils_local = &il_local[F_SETTLE];
+
+    dc->ncon      = 0;
+    ilc_local->nr = 0;
+    if (dd->constraint_comm)
+    {
+        at2con_mt = atom2constraints_moltype(constr);
+        ireq      = &dd->constraint_comm->ireq[0];
+        ireq->n   = 0;
+    }
+    else
+    {
+        // Currently unreachable
+        at2con_mt = NULL;
+        ireq      = NULL;
+    }
+
+    if (dd->bInterCGsettles)
+    {
+        at2settle_mt  = atom2settle_moltype(constr);
+        ils_local->nr = 0;
+    }
+    else
+    {
+        /* Settle works inside charge groups, we assigned them already */
+        at2settle_mt = NULL;
+    }
+
+    if (at2settle_mt == NULL)
+    {
+        atoms_to_constraints(dd, mtop, cginfo, at2con_mt, nrec,
+                             ilc_local, ireq);
+    }
+    else
+    {
+        int t0_set;
+        int thread;
+
+        /* 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);
+
+#pragma omp parallel for num_threads(dc->nthread) schedule(static)
+        for (thread = 0; thread < dc->nthread; thread++)
+        {
+            if (at2con_mt && thread == 0)
+            {
+                atoms_to_constraints(dd, mtop, cginfo, at2con_mt, nrec,
+                                     ilc_local, ireq);
+            }
+
+            if (thread >= t0_set)
+            {
+                int        cg0, cg1;
+                t_ilist   *ilst;
+                ind_req_t *ireqt;
+
+                /* Distribute the settle check+assignments over
+                 * dc->nthread or dc->nthread-1 threads.
+                 */
+                cg0 = (dd->ncg_home*(thread-t0_set  ))/(dc->nthread-t0_set);
+                cg1 = (dd->ncg_home*(thread-t0_set+1))/(dc->nthread-t0_set);
+
+                if (thread == t0_set)
+                {
+                    ilst = ils_local;
+                }
+                else
+                {
+                    ilst = &dc->ils[thread];
+                }
+                ilst->nr = 0;
+
+                ireqt = &dd->constraint_comm->ireq[thread];
+                if (thread > 0)
+                {
+                    ireqt->n = 0;
+                }
+
+                atoms_to_settles(dd, mtop, cginfo, at2settle_mt,
+                                 cg0, cg1,
+                                 ilst, ireqt);
+            }
+        }
+
+        /* Combine the generate settles and requested indices */
+        for (thread = 1; thread < dc->nthread; thread++)
+        {
+            t_ilist   *ilst;
+            ind_req_t *ireqt;
+            int        ia;
+
+            if (thread > t0_set)
+            {
+                ilst = &dc->ils[thread];
+                if (ils_local->nr + ilst->nr > ils_local->nalloc)
+                {
+                    ils_local->nalloc = over_alloc_large(ils_local->nr + ilst->nr);
+                    srenew(ils_local->iatoms, ils_local->nalloc);
+                }
+                for (ia = 0; ia < ilst->nr; ia++)
+                {
+                    ils_local->iatoms[ils_local->nr+ia] = ilst->iatoms[ia];
+                }
+                ils_local->nr += ilst->nr;
+            }
+
+            ireqt = &dd->constraint_comm->ireq[thread];
+            if (ireq->n+ireqt->n > ireq->nalloc)
+            {
+                ireq->nalloc = over_alloc_large(ireq->n+ireqt->n);
+                srenew(ireq->ind, ireq->nalloc);
+            }
+            for (ia = 0; ia < ireqt->n; ia++)
+            {
+                ireq->ind[ireq->n+ia] = ireqt->ind[ia];
+            }
+            ireq->n += ireqt->n;
+        }
+
+        if (debug)
+        {
+            fprintf(debug, "Settles: total %3d\n", ils_local->nr/4);
+        }
+    }
+
+    if (dd->constraint_comm)
+    {
+        int nral1;
+
+        at_end =
+            setup_specat_communication(dd, ireq, dd->constraint_comm,
+                                       dd->constraints->ga2la,
+                                       at_start, 2,
+                                       "constraint", " or lincs-order");
+
+        /* Fill in the missing indices */
+        ga2la_specat = dd->constraints->ga2la;
+
+        nral1 = 1 + NRAL(F_CONSTR);
+        for (i = 0; i < ilc_local->nr; i += nral1)
+        {
+            iap = ilc_local->iatoms + i;
+            for (j = 1; j < nral1; j++)
+            {
+                if (iap[j] < 0)
+                {
+                    iap[j] = gmx_hash_get_minone(ga2la_specat, -iap[j]-1);
+                }
+            }
+        }
+
+        nral1 = 1 + NRAL(F_SETTLE);
+        for (i = 0; i < ils_local->nr; i += nral1)
+        {
+            iap = ils_local->iatoms + i;
+            for (j = 1; j < nral1; j++)
+            {
+                if (iap[j] < 0)
+                {
+                    iap[j] = gmx_hash_get_minone(ga2la_specat, -iap[j]-1);
+                }
+            }
+        }
+    }
+    else
+    {
+        // Currently unreachable
+        at_end = at_start;
+    }
+
+    return at_end;
+}
+
+void init_domdec_constraints(gmx_domdec_t *dd,
+                             gmx_mtop_t   *mtop)
+{
+    gmx_domdec_constraints_t *dc;
+    gmx_molblock_t           *molb;
+    int mb, ncon, c;
+
+    if (debug)
+    {
+        fprintf(debug, "Begin init_domdec_constraints\n");
+    }
+
+    snew(dd->constraints, 1);
+    dc = dd->constraints;
+
+    snew(dc->molb_con_offset, mtop->nmolblock);
+    snew(dc->molb_ncon_mol, mtop->nmolblock);
+
+    ncon = 0;
+    for (mb = 0; mb < mtop->nmolblock; mb++)
+    {
+        molb                    = &mtop->molblock[mb];
+        dc->molb_con_offset[mb] = ncon;
+        dc->molb_ncon_mol[mb]   =
+            mtop->moltype[molb->type].ilist[F_CONSTR].nr/3 +
+            mtop->moltype[molb->type].ilist[F_CONSTRNC].nr/3;
+        ncon += molb->nmol*dc->molb_ncon_mol[mb];
+    }
+
+    if (ncon > 0)
+    {
+        snew(dc->gc_req, ncon);
+        for (c = 0; c < ncon; c++)
+        {
+            dc->gc_req[c] = 0;
+        }
+    }
+
+    /* Use a hash table for the global to local index.
+     * The number of keys is a rough estimate, it will be optimized later.
+     */
+    dc->ga2la = gmx_hash_init(std::min(mtop->natoms/20,
+                                       mtop->natoms/(2*dd->nnodes)));
+
+    dc->nthread = gmx_omp_nthreads_get(emntDomdec);
+    snew(dc->ils, dc->nthread);
+
+    dd->constraint_comm = specat_comm_init(dc->nthread);
+}
diff --git a/src/gromacs/domdec/domdec_constraints.h b/src/gromacs/domdec/domdec_constraints.h
new file mode 100644 (file)
index 0000000..d59e2ce
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file declares functions for domdec to use
+ * while managing inter-atomic constraints.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#ifndef GMX_DOMDEC_DOMDEC_CONSTRAINTS_H
+#define GMX_DOMDEC_DOMDEC_CONSTRAINTS_H
+
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/topology.h"
+
+/*! \brief Clears the local indices for the constraint communication setup */
+void dd_clear_local_constraint_indices(gmx_domdec_t *dd);
+
+/*! \brief Sets up communication and atom indices for all local+connected constraints */
+int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
+                              const gmx_mtop_t *mtop,
+                              const int *cginfo,
+                              gmx_constr_t constr, int nrec,
+                              t_ilist *il_local);
+
+/*! \brief Initializes the data structures for constraint communication */
+void init_domdec_constraints(gmx_domdec_t *dd,
+                             gmx_mtop_t   *mtop);
+
+#endif
similarity index 69%
rename from src/gromacs/gmxlib/minvert.h
rename to src/gromacs/domdec/domdec_internal.h
index ae466aa44829d468052e99e9d3c2eebb71238122..fb560877c8b6c6c59292ad0e1b03c94ca7897fbb 100644 (file)
@@ -1,9 +1,8 @@
 /*
  * 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _minvert_h
-#define _minvert_h
-
-#include "typedefs.h"
-
-/* A bunch of routines that works on matrices that run from 1 thru n
- * although they are allocated from 0 thru n
+/*! \internal \file
+ *
+ * \brief Declares implementation functions and types for the domain
+ * decomposition module.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
  */
+#ifndef GMX_DOMDEC_DOMDEC_INTERNAL_H
+#define GMX_DOMDEC_DOMDEC_INTERNAL_H
 
-extern void mat_mult(int n, real **A, real **B, real **C);
-
-extern real **mk_mat(int n);
-
-extern real **mk_mat2(int nrow, int ncol);
-
-extern void cp_mat(int n, real **src, real **dest);
+#include "gromacs/legacyheaders/types/commrec.h"
 
-extern void print_mat(FILE *fp, char *title, int n, real **a, int *indx);
-/* index may be NULL */
+/*! \brief Returns the DD cut-off distance for multi-body interactions */
+real dd_cutoff_multibody(const gmx_domdec_t *dd);
 
-extern void invert_mat(int n, real **A, real **Ainv);
+/*! \brief Returns the DD cut-off distance for two-body interactions */
+real dd_cutoff_twobody(const gmx_domdec_t *dd);
 
 #endif
similarity index 96%
rename from src/gromacs/mdlib/domdec_network.c
rename to src/gromacs/domdec/domdec_network.cpp
index 9142d54ae7b51040f371e4afa427b6e42282b591..3710f598b645b794cb01717a77c4245bf761c480 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ *
+ * \brief This file defines functions for (mostly) the domdec module
+ * to use MPI functionality
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#include "gmxpre.h"
 
-#include <string.h>
-#include "types/commrec.h"
 #include "domdec_network.h"
 
+#include "config.h"
+
+#include <string.h>
+
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/utility/gmxmpi.h"
 
 
+/*! \brief Returns the MPI rank of the domain decomposition master rank */
 #define DDMASTERRANK(dd)   (dd->masterrank)
 
 
similarity index 59%
rename from src/gromacs/legacyheaders/domdec_network.h
rename to src/gromacs/domdec/domdec_network.h
index 84e6b2e556db3be939517f67bc7daa1f1a2fca65..efadf4327f7586108293867fd52244485b606562 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _domdec_network_h
-#define _domdec_network_h
-
-#include "typedefs.h"
+/*! \libinternal \file
+ *
+ * \brief This file declares functions for (mostly) the domdec module
+ * to use MPI functionality
+ *
+ * \todo Wrap the raw dd_bcast in md.cpp into a higher-level function
+ * in the domdec module, then this file can be module-internal.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \inlibraryapi
+ * \ingroup module_domdec
+ */
+#ifndef GMX_DOMDEC_DOMDEC_NETWORK_H
+#define GMX_DOMDEC_DOMDEC_NETWORK_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "gromacs/legacyheaders/typedefs.h"
 
+/* \brief */
 enum {
     dddirForward, dddirBackward
 };
 
-/* Move integers in the comm. region one cell along the domain decomposition
- * in the dimension indexed by ddimind
- * forward (direction=dddirFoward) or backward (direction=dddirBackward).
+/*! \brief Move integers in the communication region one cell along
+ * the domain decomposition
+ *
+ * Moves in the dimension indexed by ddimind, either forward
+ * (direction=dddirFoward) or backward (direction=dddirBackward).
  */
 void
 dd_sendrecv_int(const gmx_domdec_t *dd,
@@ -56,9 +67,10 @@ dd_sendrecv_int(const gmx_domdec_t *dd,
                 int *buf_s, int n_s,
                 int *buf_r, int n_r);
 
-/* Move reals in the comm. region one cell along the domain decomposition
- * in the dimension indexed by ddimind
- * forward (direction=dddirFoward) or backward (direction=dddirBackward).
+/*! \brief Move reals in the comm. region one cell along the domain decomposition
+ *
+ * Moves in the dimension indexed by ddimind, either forward
+ * (direction=dddirFoward) or backward (direction=dddirBackward).
  */
 void
 dd_sendrecv_real(const gmx_domdec_t *dd,
@@ -66,9 +78,10 @@ dd_sendrecv_real(const gmx_domdec_t *dd,
                  real *buf_s, int n_s,
                  real *buf_r, int n_r);
 
-/* Move revc's in the comm. region one cell along the domain decomposition
- * in dimension indexed by ddimind
- * forward (direction=dddirFoward) or backward (direction=dddirBackward).
+/*! \brief Move revc's in the comm. region one cell along the domain decomposition
+ *
+ * Moves in dimension indexed by ddimind, either forward
+ * (direction=dddirFoward) or backward (direction=dddirBackward).
  */
 void
 dd_sendrecv_rvec(const gmx_domdec_t *dd,
@@ -77,9 +90,10 @@ dd_sendrecv_rvec(const gmx_domdec_t *dd,
                  rvec *buf_r, int n_r);
 
 
-/* Move revc's in the comm. region one cell along the domain decomposition
- * in dimension indexed by ddimind
- * simultaneously in the forward and backward directions.
+/*! \brief Move revc's in the comm. region one cell along the domain decomposition
+ *
+ * Moves in dimension indexed by ddimind, simultaneously in the forward
+ * and backward directions.
  */
 void
 dd_sendrecv2_rvec(const gmx_domdec_t *dd,
@@ -96,33 +110,40 @@ dd_sendrecv2_rvec(const gmx_domdec_t *dd,
  * The DD master node is the master for these operations.
  */
 
+/*! \brief Broadcasts \p nbytes from \p data on \p DDMASTERRANK to all PP ranks */
 void
 dd_bcast(gmx_domdec_t *dd, int nbytes, void *data);
 
-/* Copies src to dest on the master node and then broadcasts */
+/*! \brief Copies \p nbytes from \p src to \p dest on \p DDMASTERRANK
+ * and then broadcasts to \p dest on all PP ranks */
 void
 dd_bcastc(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(gmx_domdec_t *dd, int nbytes, 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(gmx_domdec_t *dd, int nbytes, void *src, void *dest);
 
-/* If rcount==0, rbuf is allowed to be NULL */
+/*! \brief Scatters \p scounts bytes from \p src on \p DDMASTERRANK to all PP ranks, receiving \p rcount bytes in \p dest.
+ *
+ * See man MPI_Scatterv for details of how to construct scounts and disps.
+ * If rcount==0, rbuf is allowed to be NULL */
 void
 dd_scatterv(gmx_domdec_t *dd,
             int *scounts, int *disps, void *sbuf,
             int rcount, void *rbuf);
 
-/* If scount==0, sbuf is allowed to be NULL */
+/*! \brief Gathers \p rcount bytes from \p src on all PP ranks, received in \p scounts bytes in \p dest on \p DDMASTERRANK.
+ *
+ * See man MPI_Gatherv for details of how to construct scounts and disps.
+ *
+ * If scount==0, sbuf is allowed to be NULL */
 void
 dd_gatherv(gmx_domdec_t *dd,
            int scount, void *sbuf,
            int *rcounts, int *disps, void *rbuf);
 
-#ifdef __cplusplus
-}
 #endif
-
-#endif  /* _domdec_network_h */
similarity index 84%
rename from src/gromacs/mdlib/domdec_setup.c
rename to src/gromacs/domdec/domdec_setup.cpp
index 9c56f78727c0165866cb178098caa118b215c688..8d0bf79b7b2e6e1d753728f442876b0b3f42c8b4 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ *
+ * \brief This file defines functions used by the domdec module
+ * in its initial setup phase.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#include "gmxpre.h"
 
-#include <stdio.h>
 #include <assert.h>
-#include "domdec.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "perf_est.h"
-#include "physics.h"
+#include <stdio.h>
+
+#include <cmath>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/perf_est.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "names.h"
 
-/* Margin for setting up the DD grid */
+/*! \brief Margin for setting up the DD grid */
 #define DD_GRID_MARGIN_PRES_SCALE 1.05
 
+/*! \brief Factorize \p n.
+ *
+ * \param[in]    n     Value to factorize
+ * \param[out]   fac   Pointer to array of factors (to be allocated in this function)
+ * \param[out]   mfac  Pointer to array of the number of times each factor repeats in the factorization (to be allocated in this function)
+ * \return             The number of unique factors
+ */
 static int factorize(int n, int **fac, int **mfac)
 {
     int d, ndiv;
@@ -84,6 +100,7 @@ static int factorize(int n, int **fac, int **mfac)
     return ndiv;
 }
 
+/*! \brief Find largest divisor of \p n smaller than \p n*/
 static gmx_bool largest_divisor(int n)
 {
     int ndiv, *div, *mdiv, ldiv;
@@ -96,6 +113,7 @@ static gmx_bool largest_divisor(int n)
     return ldiv;
 }
 
+/*! \brief Compute largest common divisor of \p n1 and \b n2 */
 static int lcd(int n1, int n2)
 {
     int d, i;
@@ -112,54 +130,56 @@ static int lcd(int n1, int n2)
     return d;
 }
 
-static gmx_bool fits_pme_ratio(int nnodes, int npme, float ratio)
+/*! \brief Returns TRUE when there are enough PME ranks for the ratio */
+static gmx_bool fits_pme_ratio(int nrank_tot, int nrank_pme, float ratio)
 {
-    return ((double)npme/(double)nnodes > 0.95*ratio);
+    return ((double)nrank_pme/(double)nrank_tot > 0.95*ratio);
 }
 
-static gmx_bool fits_pp_pme_perf(int nnodes, int npme, float ratio)
+/*! \brief Returns TRUE when npme out of ntot ranks doing PME is expected to give reasonable performance */
+static gmx_bool fits_pp_pme_perf(int ntot, int npme, float ratio)
 {
     int ndiv, *div, *mdiv, ldiv;
     int npp_root3, npme_root2;
 
-    ndiv = factorize(nnodes-npme, &div, &mdiv);
+    ndiv = factorize(ntot - npme, &div, &mdiv);
     ldiv = div[ndiv-1];
     sfree(div);
     sfree(mdiv);
 
-    npp_root3  = (int)(pow(nnodes-npme, 1.0/3.0) + 0.5);
-    npme_root2 = (int)(sqrt(npme) + 0.5);
+    npp_root3  = static_cast<int>(std::pow(ntot - npme, 1.0/3.0) + 0.5);
+    npme_root2 = static_cast<int>(std::sqrt(static_cast<double>(npme)) + 0.5);
 
     /* The check below gives a reasonable division:
-     * factor 5 allowed at 5 or more PP nodes,
-     * factor 7 allowed at 49 or more PP nodes.
+     * factor 5 allowed at 5 or more PP ranks,
+     * factor 7 allowed at 49 or more PP ranks.
      */
     if (ldiv > 3 + npp_root3)
     {
         return FALSE;
     }
 
-    /* Check if the number of PP and PME nodes have a reasonable sized
+    /* Check if the number of PP and PME ranks have a reasonable sized
      * denominator in common, such that we can use 2D PME decomposition
      * when required (which requires nx_pp == nx_pme).
      * The factor of 2 allows for a maximum ratio of 2^2=4
      * between nx_pme and ny_pme.
      */
-    if (lcd(nnodes-npme, npme)*2 < npme_root2)
+    if (lcd(ntot - npme, npme)*2 < npme_root2)
     {
         return FALSE;
     }
 
     /* Does this division gives a reasonable PME load? */
-    return fits_pme_ratio(nnodes, npme, ratio);
+    return fits_pme_ratio(ntot, npme, ratio);
 }
 
+/*! \brief Make a guess for the number of PME ranks to use. */
 static int guess_npme(FILE *fplog, gmx_mtop_t *mtop, t_inputrec *ir, matrix box,
-                      int nnodes)
+                      int nrank_tot)
 {
     float      ratio;
-    int        npme, nkx, nky;
-    t_inputrec ir_try;
+    int        npme;
 
     ratio = pme_load_estimate(mtop, ir, box);
 
@@ -168,59 +188,59 @@ static int guess_npme(FILE *fplog, gmx_mtop_t *mtop, t_inputrec *ir, matrix box,
         fprintf(fplog, "Guess for relative PME load: %.2f\n", ratio);
     }
 
-    /* We assume the optimal node ratio is close to the load ratio.
+    /* We assume the optimal rank ratio is close to the load ratio.
      * The communication load is neglected,
      * but (hopefully) this will balance out between PP and PME.
      */
 
-    if (!fits_pme_ratio(nnodes, nnodes/2, ratio))
+    if (!fits_pme_ratio(nrank_tot, nrank_tot/2, ratio))
     {
-        /* We would need more than nnodes/2 PME only nodes,
+        /* We would need more than nrank_tot/2 PME only nodes,
          * which is not possible. Since the PME load is very high,
-         * we will not loose much performance when all nodes do PME.
+         * we will not loose much performance when all ranks do PME.
          */
 
         return 0;
     }
 
-    /* First try to find npme as a factor of nnodes up to nnodes/3.
+    /* First try to find npme as a factor of nrank_tot up to nrank_tot/3.
      * We start with a minimum PME node fraction of 1/16
      * and avoid ratios which lead to large prime factors in nnodes-npme.
      */
-    npme = (nnodes + 15)/16;
-    while (npme <= nnodes/3)
+    npme = (nrank_tot + 15)/16;
+    while (npme <= nrank_tot/3)
     {
-        if (nnodes % npme == 0)
+        if (nrank_tot % npme == 0)
         {
             /* Note that fits_perf might change the PME grid,
              * in the current implementation it does not.
              */
-            if (fits_pp_pme_perf(nnodes, npme, ratio))
+            if (fits_pp_pme_perf(nrank_tot, npme, ratio))
             {
                 break;
             }
         }
         npme++;
     }
-    if (npme > nnodes/3)
+    if (npme > nrank_tot/3)
     {
         /* Try any possible number for npme */
         npme = 1;
-        while (npme <= nnodes/2)
+        while (npme <= nrank_tot/2)
         {
             /* Note that fits_perf may change the PME grid */
-            if (fits_pp_pme_perf(nnodes, npme, ratio))
+            if (fits_pp_pme_perf(nrank_tot, npme, ratio))
             {
                 break;
             }
             npme++;
         }
     }
-    if (npme > nnodes/2)
+    if (npme > nrank_tot/2)
     {
         gmx_fatal(FARGS, "Could not find an appropriate number of separate PME ranks. i.e. >= %5f*#ranks (%d) and <= #ranks/2 (%d) and reasonable performance wise (grid_x=%d, grid_y=%d).\n"
                   "Use the -npme option of mdrun or change the number of ranks or the PME grid dimensions, see the manual for details.",
-                  ratio, (int)(0.95*ratio*nnodes+0.5), nnodes/2, ir->nkx, ir->nky);
+                  ratio, (int)(0.95*ratio*nrank_tot + 0.5), nrank_tot/2, ir->nkx, ir->nky);
         /* Keep the compiler happy */
         npme = 0;
     }
@@ -231,17 +251,18 @@ static int guess_npme(FILE *fplog, gmx_mtop_t *mtop, t_inputrec *ir, matrix box,
             fprintf(fplog,
                     "Will use %d particle-particle and %d PME only ranks\n"
                     "This is a guess, check the performance at the end of the log file\n",
-                    nnodes-npme, npme);
+                    nrank_tot - npme, npme);
         }
         fprintf(stderr, "\n"
                 "Will use %d particle-particle and %d PME only ranks\n"
                 "This is a guess, check the performance at the end of the log file\n",
-                nnodes-npme, npme);
+                nrank_tot - npme, npme);
     }
 
     return npme;
 }
 
+/*! \brief Return \p n divided by \p f rounded up to the next integer. */
 static int div_up(int n, int f)
 {
     return (n + f - 1)/f;
@@ -249,23 +270,21 @@ static int div_up(int n, int f)
 
 real comm_box_frac(ivec dd_nc, real cutoff, gmx_ddbox_t *ddbox)
 {
-    int  i, j, k, npp;
-    rvec bt, nw;
+    int  i, j, k;
+    rvec nw;
     real comm_vol;
 
     for (i = 0; i < DIM; i++)
     {
-        bt[i] = ddbox->box_size[i]*ddbox->skew_fac[i];
-        nw[i] = dd_nc[i]*cutoff/bt[i];
+        real bt = ddbox->box_size[i]*ddbox->skew_fac[i];
+        nw[i] = dd_nc[i]*cutoff/bt;
     }
 
-    npp      = 1;
     comm_vol = 0;
     for (i = 0; i < DIM; i++)
     {
         if (dd_nc[i] > 1)
         {
-            npp      *= dd_nc[i];
             comm_vol += nw[i];
             for (j = i+1; j < DIM; j++)
             {
@@ -287,15 +306,23 @@ real comm_box_frac(ivec dd_nc, real cutoff, gmx_ddbox_t *ddbox)
     return comm_vol;
 }
 
+/*! \brief Return whether the DD inhomogeneous in the z direction */
 static gmx_bool inhomogeneous_z(const t_inputrec *ir)
 {
     return ((EEL_PME(ir->coulombtype) || ir->coulombtype == eelEWALD) &&
             ir->ePBC == epbcXYZ && ir->ewald_geometry == eewg3DC);
 }
 
-/* Avoid integer overflows */
+/*! \brief Estimate cost of PME FFT communication
+ *
+ * This only takes the communication into account and not imbalance
+ * in the calculation. But the imbalance in communication and calculation
+ * are similar and therefore these formulas also prefer load balance
+ * in the FFT and pme_solve calculation.
+ */
 static float comm_pme_cost_vol(int npme, int a, int b, int c)
 {
+    /* We use a float here, since an integer might overflow */
     float comm_vol;
 
     comm_vol  = npme - 1;
@@ -303,9 +330,11 @@ static float comm_pme_cost_vol(int npme, int a, int b, int c)
     comm_vol *= div_up(a, npme);
     comm_vol *= div_up(b, npme);
     comm_vol *= c;
+
     return comm_vol;
 }
 
+/*! \brief Estimate cost of communication for a possible domain decomposition. */
 static float comm_cost_est(real limit, real cutoff,
                            matrix box, gmx_ddbox_t *ddbox,
                            int natoms, t_inputrec *ir,
@@ -313,7 +342,7 @@ static float comm_cost_est(real limit, real cutoff,
                            int npme_tot, ivec nc)
 {
     ivec  npme = {1, 1, 1};
-    int   i, j, k, nk, overlap;
+    int   i, j, nk, overlap;
     rvec  bt;
     float comm_vol, comm_vol_xf, comm_pme, cost_pbcdx;
     /* This is the cost of a pbc_dx call relative to the cost
@@ -465,12 +494,6 @@ static float comm_cost_est(real limit, real cutoff,
         }
     }
 
-    /* PME FFT communication volume.
-     * This only takes the communication into account and not imbalance
-     * in the calculation. But the imbalance in communication and calculation
-     * are similar and therefore these formulas also prefer load balance
-     * in the FFT and pme_solve calculation.
-     */
     comm_pme += comm_pme_cost_vol(npme[YY], ir->nky, ir->nkz, ir->nkx);
     comm_pme += comm_pme_cost_vol(npme[XX], ir->nkx, ir->nky, ir->nkz);
 
@@ -501,6 +524,7 @@ static float comm_cost_est(real limit, real cutoff,
     return 3*natoms*(comm_vol + cost_pbcdx) + comm_pme;
 }
 
+/*! \brief Assign penalty factors to possible domain decompositions, based on the estimated communication costs. */
 static void assign_factors(gmx_domdec_t *dd,
                            real limit, real cutoff,
                            matrix box, gmx_ddbox_t *ddbox,
@@ -508,7 +532,7 @@ static void assign_factors(gmx_domdec_t *dd,
                            float pbcdxr, int npme,
                            int ndiv, int *div, int *mdiv, ivec ir_try, ivec opt)
 {
-    int   x, y, z, i;
+    int   x, y, i;
     float ce;
 
     if (ndiv == 0)
@@ -563,6 +587,7 @@ static void assign_factors(gmx_domdec_t *dd,
     }
 }
 
+/*! \brief Determine the optimal distribution of DD cells for the simulation system and number of MPI ranks */
 static real optimize_ncells(FILE *fplog,
                             int nnodes_tot, int npme_only,
                             gmx_bool bDynLoadBal, real dlb_scale,
diff --git a/src/gromacs/domdec/domdec_specatomcomm.cpp b/src/gromacs/domdec/domdec_specatomcomm.cpp
new file mode 100644 (file)
index 0000000..abc52ba
--- /dev/null
@@ -0,0 +1,629 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+/*! \internal \file
+ *
+ * \brief This file implements functions for domdec to use
+ * while managing inter-atomic constraints.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#include "gmxpre.h"
+
+#include "domdec_specatomcomm.h"
+
+#include <assert.h>
+
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/domdec/domdec_network.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/gmx_hash.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+
+void dd_move_f_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
+                      rvec *f, rvec *fshift)
+{
+    gmx_specatsend_t *spas;
+    rvec             *vbuf;
+    int               n, n0, n1, d, dim, dir, i;
+    ivec              vis;
+    int               is;
+    gmx_bool          bPBC, bScrew;
+
+    n = spac->at_end;
+    for (d = dd->ndim-1; d >= 0; d--)
+    {
+        dim = dd->dim[d];
+        if (dd->nc[dim] > 2)
+        {
+            /* Pulse the grid forward and backward */
+            spas = spac->spas[d];
+            n0   = spas[0].nrecv;
+            n1   = spas[1].nrecv;
+            n   -= n1 + n0;
+            vbuf = spac->vbuf;
+            /* Send and receive the coordinates */
+            dd_sendrecv2_rvec(dd, d,
+                              f+n+n1, n0, vbuf, spas[0].nsend,
+                              f+n, n1, vbuf+spas[0].nsend, spas[1].nsend);
+            for (dir = 0; dir < 2; dir++)
+            {
+                bPBC   = ((dir == 0 && dd->ci[dim] == 0) ||
+                          (dir == 1 && dd->ci[dim] == dd->nc[dim]-1));
+                bScrew = (bPBC && dd->bScrewPBC && dim == XX);
+
+                spas = &spac->spas[d][dir];
+                /* Sum the buffer into the required forces */
+                if (!bPBC || (!bScrew && fshift == NULL))
+                {
+                    for (i = 0; i < spas->nsend; i++)
+                    {
+                        rvec_inc(f[spas->a[i]], *vbuf);
+                        vbuf++;
+                    }
+                }
+                else
+                {
+                    clear_ivec(vis);
+                    vis[dim] = (dir == 0 ? 1 : -1);
+                    is       = IVEC2IS(vis);
+                    if (!bScrew)
+                    {
+                        /* Sum and add to shift forces */
+                        for (i = 0; i < spas->nsend; i++)
+                        {
+                            rvec_inc(f[spas->a[i]], *vbuf);
+                            rvec_inc(fshift[is], *vbuf);
+                            vbuf++;
+                        }
+                    }
+                    else
+                    {
+                        /* Rotate the forces */
+                        for (i = 0; i < spas->nsend; i++)
+                        {
+                            f[spas->a[i]][XX] += (*vbuf)[XX];
+                            f[spas->a[i]][YY] -= (*vbuf)[YY];
+                            f[spas->a[i]][ZZ] -= (*vbuf)[ZZ];
+                            if (fshift)
+                            {
+                                rvec_inc(fshift[is], *vbuf);
+                            }
+                            vbuf++;
+                        }
+                    }
+                }
+            }
+        }
+        else
+        {
+            /* Two cells, so we only need to communicate one way */
+            spas = &spac->spas[d][0];
+            n   -= spas->nrecv;
+            /* Send and receive the coordinates */
+            dd_sendrecv_rvec(dd, d, dddirForward,
+                             f+n, spas->nrecv, spac->vbuf, spas->nsend);
+            /* Sum the buffer into the required forces */
+            if (dd->bScrewPBC && dim == XX &&
+                (dd->ci[dim] == 0 ||
+                 dd->ci[dim] == dd->nc[dim]-1))
+            {
+                for (i = 0; i < spas->nsend; i++)
+                {
+                    /* Rotate the force */
+                    f[spas->a[i]][XX] += spac->vbuf[i][XX];
+                    f[spas->a[i]][YY] -= spac->vbuf[i][YY];
+                    f[spas->a[i]][ZZ] -= spac->vbuf[i][ZZ];
+                }
+            }
+            else
+            {
+                for (i = 0; i < spas->nsend; i++)
+                {
+                    rvec_inc(f[spas->a[i]], spac->vbuf[i]);
+                }
+            }
+        }
+    }
+}
+
+void dd_move_x_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
+                      matrix box,
+                      rvec *x0,
+                      rvec *x1, gmx_bool bX1IsCoord)
+{
+    gmx_specatsend_t *spas;
+    rvec             *x, *vbuf, *rbuf;
+    int               nvec, v, n, nn, ns0, ns1, nr0, nr1, nr, d, dim, dir, i;
+    gmx_bool          bPBC, bScrew = FALSE;
+    rvec              shift = {0, 0, 0};
+
+    nvec = 1;
+    if (x1 != NULL)
+    {
+        nvec++;
+    }
+
+    n = spac->at_start;
+    for (d = 0; d < dd->ndim; d++)
+    {
+        dim = dd->dim[d];
+        if (dd->nc[dim] > 2)
+        {
+            /* Pulse the grid forward and backward */
+            vbuf = spac->vbuf;
+            for (dir = 0; dir < 2; dir++)
+            {
+                if (dir == 0 && dd->ci[dim] == 0)
+                {
+                    bPBC   = TRUE;
+                    bScrew = (dd->bScrewPBC && dim == XX);
+                    copy_rvec(box[dim], shift);
+                }
+                else if (dir == 1 && dd->ci[dim] == dd->nc[dim]-1)
+                {
+                    bPBC   = TRUE;
+                    bScrew = (dd->bScrewPBC && dim == XX);
+                    for (i = 0; i < DIM; i++)
+                    {
+                        shift[i] = -box[dim][i];
+                    }
+                }
+                else
+                {
+                    bPBC   = FALSE;
+                    bScrew = FALSE;
+                }
+                spas = &spac->spas[d][dir];
+                for (v = 0; v < nvec; v++)
+                {
+                    x = (v == 0 ? x0 : x1);
+                    /* Copy the required coordinates to the send buffer */
+                    if (!bPBC || (v == 1 && !bX1IsCoord))
+                    {
+                        /* Only copy */
+                        for (i = 0; i < spas->nsend; i++)
+                        {
+                            copy_rvec(x[spas->a[i]], *vbuf);
+                            vbuf++;
+                        }
+                    }
+                    else if (!bScrew)
+                    {
+                        /* Shift coordinates */
+                        for (i = 0; i < spas->nsend; i++)
+                        {
+                            rvec_add(x[spas->a[i]], shift, *vbuf);
+                            vbuf++;
+                        }
+                    }
+                    else
+                    {
+                        /* Shift and rotate coordinates */
+                        for (i = 0; i < spas->nsend; i++)
+                        {
+                            (*vbuf)[XX] =               x[spas->a[i]][XX] + shift[XX];
+                            (*vbuf)[YY] = box[YY][YY] - x[spas->a[i]][YY] + shift[YY];
+                            (*vbuf)[ZZ] = box[ZZ][ZZ] - x[spas->a[i]][ZZ] + shift[ZZ];
+                            vbuf++;
+                        }
+                    }
+                }
+            }
+            /* Send and receive the coordinates */
+            spas = spac->spas[d];
+            ns0  = spas[0].nsend;
+            nr0  = spas[0].nrecv;
+            ns1  = spas[1].nsend;
+            nr1  = spas[1].nrecv;
+            if (nvec == 1)
+            {
+                dd_sendrecv2_rvec(dd, d,
+                                  spac->vbuf+ns0, ns1, x0+n, nr1,
+                                  spac->vbuf, ns0, x0+n+nr1, nr0);
+            }
+            else
+            {
+                /* Communicate both vectors in one buffer */
+                rbuf = spac->vbuf2;
+                dd_sendrecv2_rvec(dd, d,
+                                  spac->vbuf+2*ns0, 2*ns1, rbuf, 2*nr1,
+                                  spac->vbuf, 2*ns0, rbuf+2*nr1, 2*nr0);
+                /* Split the buffer into the two vectors */
+                nn = n;
+                for (dir = 1; dir >= 0; dir--)
+                {
+                    nr = spas[dir].nrecv;
+                    for (v = 0; v < 2; v++)
+                    {
+                        x = (v == 0 ? x0 : x1);
+                        for (i = 0; i < nr; i++)
+                        {
+                            copy_rvec(*rbuf, x[nn+i]);
+                            rbuf++;
+                        }
+                    }
+                    nn += nr;
+                }
+            }
+            n += nr0 + nr1;
+        }
+        else
+        {
+            spas = &spac->spas[d][0];
+            /* Copy the required coordinates to the send buffer */
+            vbuf = spac->vbuf;
+            for (v = 0; v < nvec; v++)
+            {
+                x = (v == 0 ? x0 : x1);
+                if (dd->bScrewPBC && dim == XX &&
+                    (dd->ci[XX] == 0 || dd->ci[XX] == dd->nc[XX]-1))
+                {
+                    /* Here we only perform the rotation, the rest of the pbc
+                     * is handled in the constraint or viste routines.
+                     */
+                    for (i = 0; i < spas->nsend; i++)
+                    {
+                        (*vbuf)[XX] =               x[spas->a[i]][XX];
+                        (*vbuf)[YY] = box[YY][YY] - x[spas->a[i]][YY];
+                        (*vbuf)[ZZ] = box[ZZ][ZZ] - x[spas->a[i]][ZZ];
+                        vbuf++;
+                    }
+                }
+                else
+                {
+                    for (i = 0; i < spas->nsend; i++)
+                    {
+                        copy_rvec(x[spas->a[i]], *vbuf);
+                        vbuf++;
+                    }
+                }
+            }
+            /* Send and receive the coordinates */
+            if (nvec == 1)
+            {
+                dd_sendrecv_rvec(dd, d, dddirBackward,
+                                 spac->vbuf, spas->nsend, x0+n, spas->nrecv);
+            }
+            else
+            {
+                /* Communicate both vectors in one buffer */
+                rbuf = spac->vbuf2;
+                dd_sendrecv_rvec(dd, d, dddirBackward,
+                                 spac->vbuf, 2*spas->nsend, rbuf, 2*spas->nrecv);
+                /* Split the buffer into the two vectors */
+                nr = spas[0].nrecv;
+                for (v = 0; v < 2; v++)
+                {
+                    x = (v == 0 ? x0 : x1);
+                    for (i = 0; i < nr; i++)
+                    {
+                        copy_rvec(*rbuf, x[n+i]);
+                        rbuf++;
+                    }
+                }
+            }
+            n += spas->nrecv;
+        }
+    }
+}
+
+int setup_specat_communication(gmx_domdec_t             *dd,
+                               ind_req_t                *ireq,
+                               gmx_domdec_specat_comm_t *spac,
+                               gmx_hash_t                ga2la_specat,
+                               int                       at_start,
+                               int                       vbuf_fac,
+                               const char               *specat_type,
+                               const char               *add_err)
+{
+    int               nsend[2], nlast, nsend_zero[2] = {0, 0}, *nsend_ptr;
+    int               d, dim, ndir, dir, nr, ns, i, nrecv_local, n0, start, indr, ind, buf[2];
+    int               nat_tot_specat, nat_tot_prev, nalloc_old;
+    gmx_bool          bPBC;
+    gmx_specatsend_t *spas;
+
+    if (debug)
+    {
+        fprintf(debug, "Begin setup_specat_communication for %s\n", specat_type);
+    }
+
+    /* nsend[0]: the number of atoms requested by this node only,
+     *           we communicate this for more efficients checks
+     * nsend[1]: the total number of requested atoms
+     */
+    nsend[0] = ireq->n;
+    nsend[1] = nsend[0];
+    nlast    = nsend[1];
+    for (d = dd->ndim-1; d >= 0; d--)
+    {
+        /* Pulse the grid forward and backward */
+        dim  = dd->dim[d];
+        bPBC = (dim < dd->npbcdim);
+        if (dd->nc[dim] == 2)
+        {
+            /* Only 2 cells, so we only need to communicate once */
+            ndir = 1;
+        }
+        else
+        {
+            ndir = 2;
+        }
+        for (dir = 0; dir < ndir; dir++)
+        {
+            if (!bPBC &&
+                dd->nc[dim] > 2 &&
+                ((dir == 0 && dd->ci[dim] == dd->nc[dim] - 1) ||
+                 (dir == 1 && dd->ci[dim] == 0)))
+            {
+                /* No pbc: the fist/last cell should not request atoms */
+                nsend_ptr = nsend_zero;
+            }
+            else
+            {
+                nsend_ptr = nsend;
+            }
+            /* Communicate the number of indices */
+            dd_sendrecv_int(dd, d, dir == 0 ? dddirForward : dddirBackward,
+                            nsend_ptr, 2, spac->nreq[d][dir], 2);
+            nr = spac->nreq[d][dir][1];
+            if (nlast+nr > ireq->nalloc)
+            {
+                ireq->nalloc = over_alloc_dd(nlast+nr);
+                srenew(ireq->ind, ireq->nalloc);
+            }
+            /* Communicate the indices */
+            dd_sendrecv_int(dd, d, dir == 0 ? dddirForward : dddirBackward,
+                            ireq->ind, nsend_ptr[1], ireq->ind+nlast, nr);
+            nlast += nr;
+        }
+        nsend[1] = nlast;
+    }
+    if (debug)
+    {
+        fprintf(debug, "Communicated the counts\n");
+    }
+
+    /* Search for the requested atoms and communicate the indices we have */
+    nat_tot_specat = at_start;
+    nrecv_local    = 0;
+    for (d = 0; d < dd->ndim; d++)
+    {
+        /* Pulse the grid forward and backward */
+        if (dd->dim[d] >= dd->npbcdim || dd->nc[dd->dim[d]] > 2)
+        {
+            ndir = 2;
+        }
+        else
+        {
+            ndir = 1;
+        }
+        nat_tot_prev = nat_tot_specat;
+        for (dir = ndir-1; dir >= 0; dir--)
+        {
+            if (nat_tot_specat > spac->bSendAtom_nalloc)
+            {
+                nalloc_old             = spac->bSendAtom_nalloc;
+                spac->bSendAtom_nalloc = over_alloc_dd(nat_tot_specat);
+                srenew(spac->bSendAtom, spac->bSendAtom_nalloc);
+                for (i = nalloc_old; i < spac->bSendAtom_nalloc; i++)
+                {
+                    spac->bSendAtom[i] = FALSE;
+                }
+            }
+            spas = &spac->spas[d][dir];
+            n0   = spac->nreq[d][dir][0];
+            nr   = spac->nreq[d][dir][1];
+            if (debug)
+            {
+                fprintf(debug, "dim=%d, dir=%d, searching for %d atoms\n",
+                        d, dir, nr);
+            }
+            start       = nlast - nr;
+            spas->nsend = 0;
+            nsend[0]    = 0;
+            for (i = 0; i < nr; i++)
+            {
+                indr = ireq->ind[start+i];
+                ind  = -1;
+                /* Check if this is a home atom and if so ind will be set */
+                if (!ga2la_get_home(dd->ga2la, indr, &ind))
+                {
+                    /* Search in the communicated atoms */
+                    ind = gmx_hash_get_minone(ga2la_specat, indr);
+                }
+                if (ind >= 0)
+                {
+                    if (i < n0 || !spac->bSendAtom[ind])
+                    {
+                        if (spas->nsend+1 > spas->a_nalloc)
+                        {
+                            spas->a_nalloc = over_alloc_large(spas->nsend+1);
+                            srenew(spas->a, spas->a_nalloc);
+                        }
+                        /* Store the local index so we know which coordinates
+                         * to send out later.
+                         */
+                        spas->a[spas->nsend] = ind;
+                        spac->bSendAtom[ind] = TRUE;
+                        if (spas->nsend+1 > spac->ibuf_nalloc)
+                        {
+                            spac->ibuf_nalloc = over_alloc_large(spas->nsend+1);
+                            srenew(spac->ibuf, spac->ibuf_nalloc);
+                        }
+                        /* Store the global index so we can send it now */
+                        spac->ibuf[spas->nsend] = indr;
+                        if (i < n0)
+                        {
+                            nsend[0]++;
+                        }
+                        spas->nsend++;
+                    }
+                }
+            }
+            nlast = start;
+            /* Clear the local flags */
+            for (i = 0; i < spas->nsend; i++)
+            {
+                spac->bSendAtom[spas->a[i]] = FALSE;
+            }
+            /* Send and receive the number of indices to communicate */
+            nsend[1] = spas->nsend;
+            dd_sendrecv_int(dd, d, dir == 0 ? dddirBackward : dddirForward,
+                            nsend, 2, buf, 2);
+            if (debug)
+            {
+                fprintf(debug, "Send to rank %d, %d (%d) indices, "
+                        "receive from rank %d, %d (%d) indices\n",
+                        dd->neighbor[d][1-dir], nsend[1], nsend[0],
+                        dd->neighbor[d][dir], buf[1], buf[0]);
+                if (gmx_debug_at)
+                {
+                    for (i = 0; i < spas->nsend; i++)
+                    {
+                        fprintf(debug, " %d", spac->ibuf[i]+1);
+                    }
+                    fprintf(debug, "\n");
+                }
+            }
+            nrecv_local += buf[0];
+            spas->nrecv  = buf[1];
+            if (nat_tot_specat + spas->nrecv > dd->gatindex_nalloc)
+            {
+                dd->gatindex_nalloc =
+                    over_alloc_dd(nat_tot_specat + spas->nrecv);
+                srenew(dd->gatindex, dd->gatindex_nalloc);
+            }
+            /* Send and receive the indices */
+            dd_sendrecv_int(dd, d, dir == 0 ? dddirBackward : dddirForward,
+                            spac->ibuf, spas->nsend,
+                            dd->gatindex+nat_tot_specat, spas->nrecv);
+            nat_tot_specat += spas->nrecv;
+        }
+
+        /* Allocate the x/f communication buffers */
+        ns = spac->spas[d][0].nsend;
+        nr = spac->spas[d][0].nrecv;
+        if (ndir == 2)
+        {
+            ns += spac->spas[d][1].nsend;
+            nr += spac->spas[d][1].nrecv;
+        }
+        if (vbuf_fac*ns > spac->vbuf_nalloc)
+        {
+            spac->vbuf_nalloc = over_alloc_dd(vbuf_fac*ns);
+            srenew(spac->vbuf, spac->vbuf_nalloc);
+        }
+        if (vbuf_fac == 2 && vbuf_fac*nr > spac->vbuf2_nalloc)
+        {
+            spac->vbuf2_nalloc = over_alloc_dd(vbuf_fac*nr);
+            srenew(spac->vbuf2, spac->vbuf2_nalloc);
+        }
+
+        /* Make a global to local index for the communication atoms */
+        for (i = nat_tot_prev; i < nat_tot_specat; i++)
+        {
+            gmx_hash_change_or_set(ga2la_specat, dd->gatindex[i], i);
+        }
+    }
+
+    /* Check that in the end we got the number of atoms we asked for */
+    if (nrecv_local != ireq->n)
+    {
+        if (debug)
+        {
+            fprintf(debug, "Requested %d, received %d (tot recv %d)\n",
+                    ireq->n, nrecv_local, nat_tot_specat-at_start);
+            if (gmx_debug_at)
+            {
+                for (i = 0; i < ireq->n; i++)
+                {
+                    ind = gmx_hash_get_minone(ga2la_specat, ireq->ind[i]);
+                    fprintf(debug, " %s%d",
+                            (ind >= 0) ? "" : "!",
+                            ireq->ind[i]+1);
+                }
+                fprintf(debug, "\n");
+            }
+        }
+        fprintf(stderr, "\nDD cell %d %d %d: Neighboring cells do not have atoms:",
+                dd->ci[XX], dd->ci[YY], dd->ci[ZZ]);
+        for (i = 0; i < ireq->n; i++)
+        {
+            if (gmx_hash_get_minone(ga2la_specat, ireq->ind[i]) < 0)
+            {
+                fprintf(stderr, " %d", ireq->ind[i]+1);
+            }
+        }
+        fprintf(stderr, "\n");
+        gmx_fatal(FARGS, "DD cell %d %d %d could only obtain %d of the %d atoms that are connected via %ss from the neighboring cells. This probably means your %s lengths are too long compared to the domain decomposition cell size. Decrease the number of domain decomposition grid cells%s%s.",
+                  dd->ci[XX], dd->ci[YY], dd->ci[ZZ],
+                  nrecv_local, ireq->n, specat_type,
+                  specat_type, add_err,
+                  dd->bGridJump ? " or use the -rcon option of mdrun" : "");
+    }
+
+    spac->at_start = at_start;
+    spac->at_end   = nat_tot_specat;
+
+    if (debug)
+    {
+        fprintf(debug, "Done setup_specat_communication\n");
+    }
+
+    return nat_tot_specat;
+}
+
+gmx_domdec_specat_comm_t *specat_comm_init(int nthread)
+{
+    gmx_domdec_specat_comm_t *spac;
+
+    snew(spac, 1);
+    spac->nthread = nthread;
+    snew(spac->ireq, spac->nthread);
+
+    return spac;
+}
diff --git a/src/gromacs/domdec/domdec_specatomcomm.h b/src/gromacs/domdec/domdec_specatomcomm.h
new file mode 100644 (file)
index 0000000..d60a98f
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file declares functions for domdec to use
+ * while managing communication of atoms required for special purposes
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#ifndef GMX_DOMDEC_DOMDEC_SPECATOMCOMM_H
+#define GMX_DOMDEC_DOMDEC_SPECATOMCOMM_H
+
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+
+typedef struct {
+    int  nsend;
+    int *a;
+    int  a_nalloc;
+    int  nrecv;
+} gmx_specatsend_t;
+
+typedef struct {
+    int *ind;
+    int  nalloc;
+    int  n;
+} ind_req_t;
+
+/*! \internal \brief Struct with setup and buffers for special atom communication */
+typedef struct gmx_domdec_specat_comm {
+    /* The number of indices to receive during the setup */
+    int              nreq[DIM][2][2];  /**< The nr. of atoms requested, per DIM, direction and direct/indirect */
+    /* The atoms to send */
+    gmx_specatsend_t spas[DIM][2];     /**< The communication setup per DIM, direction */
+    gmx_bool        *bSendAtom;        /**< Work buffer that tells if spec.atoms should be sent */
+    int              bSendAtom_nalloc; /**< Allocation size of \p bSendAtom */
+    /* Send buffers */
+    int             *ibuf;             /**< Integer send buffer */
+    int              ibuf_nalloc;      /**< Allocation size of \p ibuf */
+    rvec            *vbuf;             /**< rvec send buffer */
+    int              vbuf_nalloc;      /**< Allocation size of \p vbuf */
+    rvec            *vbuf2;            /**< rvec send buffer */
+    int              vbuf2_nalloc;     /**< Allocation size of \p vbuf2 */
+    /* The range in the local buffer(s) for received atoms */
+    int              at_start;         /**< Start index of received atoms */
+    int              at_end;           /**< End index of received atoms */
+
+    /* The atom indices we need from the surrounding cells.
+     * We can gather the indices over nthread threads.
+     */
+    int        nthread;                /**< Number of threads used for spec.atom communication */
+    ind_req_t *ireq;                   /**< Index request buffer per thread, allocation size \p nthread */
+} gmx_domdec_specat_comm_t;
+
+/*! \brief Communicates the force for special atoms, the shift forces are reduced with \p fshift != NULL */
+void dd_move_f_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
+                      rvec *f, rvec *fshift);
+
+/*! \brief Communicates the coordinates for special atoms
+ *
+ * \param[in]     dd         Domain decomposition struct
+ * \param[in]     spac       Special atom communication struct
+ * \param[in]     box        Box, used for pbc
+ * \param[in,out] x0         Vector to communicate
+ * \param[in,out] x1         Vector to communicate, when != NULL
+ * \param[in]     bX1IsCoord Tells is \p x1 is a coordinate vector (needs pbc)
+ */
+void dd_move_x_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
+                      matrix box,
+                      rvec *x0,
+                      rvec *x1, gmx_bool bX1IsCoord);
+
+/*! \brief Sets up the communication for special atoms
+ *
+ * \param[in]     dd         Domain decomposition struct
+ * \param[in]     ireq List of requested atom indices
+ * \param[in,out] spac   Special atom communication struct
+ * \param[out]    ga2la_specat Global to local special atom index
+ * \param[in]     at_start     Index in local state where to start storing communicated atoms
+ * \param[in]     vbuf_fac     Buffer factor, 1 or 2 for communicating 1 or 2 vectors
+ * \param[in]     specat_type  Name of the special atom, used for error message
+ * \param[in]     add_err      Text to add at the end of error message when atoms can't be found
+ */
+int setup_specat_communication(gmx_domdec_t             *dd,
+                               ind_req_t                *ireq,
+                               gmx_domdec_specat_comm_t *spac,
+                               gmx_hash_t                ga2la_specat,
+                               int                       at_start,
+                               int                       vbuf_fac,
+                               const char               *specat_type,
+                               const char               *add_err);
+
+/*! \brief Initialize a special communication struct */
+gmx_domdec_specat_comm_t *specat_comm_init(int nthread);
+
+#endif
similarity index 87%
rename from src/gromacs/mdlib/domdec_top.c
rename to src/gromacs/domdec/domdec_topology.cpp
index 8aa77bfb6aa21c3c14d196339775c7979a486509..39e40f66fe873f1dc6fecaac4fa1dac477a4dfc4 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ *
+ * \brief This file defines functions used by the domdec module
+ * while managing the construction, use and error checking for
+ * topologies local to a DD rank.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#include "gmxpre.h"
 
 #include <string.h>
-#include "typedefs.h"
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/domdec/domdec_network.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topsort.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "domdec.h"
-#include "domdec_network.h"
-#include "names.h"
-#include "network.h"
-#include "vec.h"
-#include "pbc.h"
-#include "chargegroup.h"
-#include "gromacs/gmxlib/topsort.h"
-#include "mtop_util.h"
-#include "mshift.h"
-#include "vsite.h"
-#include "gmx_ga2la.h"
-#include "force.h"
-#include "gmx_omp_nthreads.h"
-
-#include "gmx_fatal.h"
-
-/* for dd_init_local_state */
+
+#include "domdec_constraints.h"
+#include "domdec_internal.h"
+#include "domdec_vsite.h"
+
+/*! \brief The number of integer item in the local state, used for broadcasting of the state */
 #define NITEM_DD_INIT_LOCAL_STATE 5
 
 typedef struct {
     int  *index;  /* Index for each atom into il                  */
     int  *il;     /* ftype|type|a0|...|an|ftype|...               */
-} gmx_reverse_ilist_t;
+} reverse_ilist_t;
 
 typedef struct {
     int  a_start;
     int  a_end;
     int  natoms_mol;
     int  type;
-} gmx_molblock_ind_t;
+} molblock_ind_t;
 
+/*! \brief Struct for thread local work data for local topology generation */
+typedef struct {
+    t_idef     idef;             /**< Partial local topology */
+    int      **vsite_pbc;        /**< vsite PBC structure */
+    int       *vsite_pbc_nalloc; /**< Allocation sizes for vsite_pbc */
+    int        nbonded;          /**< The number of bondeds in this struct */
+    t_blocka   excl;             /**< List of exclusions */
+    int        excl_count;       /**< The total exclusion count for \p excl */
+} thread_work_t;
+
+/*! \brief Struct for the reverse topology: links bonded interactions to atomsx */
 typedef struct gmx_reverse_top {
-    gmx_bool             bExclRequired; /* Do we require all exclusions to be assigned? */
-    gmx_bool             bConstr;       /* Are there constraints in this revserse top?  */
-    gmx_bool             bSettle;       /* Are there settles in this revserse top?  */
-    gmx_bool             bBCheck;       /* All bonded interactions have to be assigned? */
-    gmx_bool             bMultiCGmols;  /* Are the multi charge-group molecules?        */
-    gmx_reverse_ilist_t *ril_mt;        /* Reverse ilist for all moltypes      */
-    int                  ril_mt_tot_size;
-    int                  ilsort;        /* The sorting state of bondeds for free energy */
-    gmx_molblock_ind_t  *mbi;
-    int                  nmolblock;
+    //! @cond Doxygen_Suppress
+    gmx_bool         bExclRequired;   /**< Do we require all exclusions to be assigned? */
+    gmx_bool         bConstr;         /**< Are there constraints in this revserse top?  */
+    gmx_bool         bSettle;         /**< Are there settles in this revserse top?  */
+    gmx_bool         bBCheck;         /**< All bonded interactions have to be assigned? */
+    gmx_bool         bMultiCGmols;    /**< Are the multi charge-group molecules?        */
+    reverse_ilist_t *ril_mt;          /**< Reverse ilist for all moltypes      */
+    int              ril_mt_tot_size; /**< The size of ril_mt[?].index summed over all entries */
+    int              ilsort;          /**< The sorting state of bondeds for free energy */
+    molblock_ind_t  *mbi;             /**< molblock to global atom index for quick lookup of molblocks on atom index */
+    int              nmolblock;       /**< The number of molblocks, size of \p mbi */
 
     /* Work data structures for multi-threading */
-    int         nthread;
-    t_idef     *idef_thread;
-    int      ***vsite_pbc;
-    int       **vsite_pbc_nalloc;
-    int        *nbonded_thread;
-    t_blocka   *excl_thread;
-    int        *excl_count_thread;
+    int            nthread;           /**< The number of threads to be used */
+    thread_work_t *th_work;           /**< Thread work array for local topology generation */
 
     /* Pointers only used for an error message */
-    gmx_mtop_t     *err_top_global;
-    gmx_localtop_t *err_top_local;
+    gmx_mtop_t     *err_top_global; /**< Pointer to the global top, only used for error reporting */
+    gmx_localtop_t *err_top_local;  /**< Pointer to the local top, only used for error reporting */
+    //! @endcond
 } gmx_reverse_top_t;
 
+/*! \brief Returns the number of atom entries for il in gmx_reverse_top_t */
 static int nral_rt(int ftype)
 {
-    /* Returns the number of atom entries for il in gmx_reverse_top_t */
     int nral;
 
     nral = NRAL(ftype);
@@ -116,7 +138,7 @@ static int nral_rt(int ftype)
     return nral;
 }
 
-/* This function tells which interactions need to be assigned exactly once */
+/*! \brief Return whether interactions of type \p ftype need to be assigned exactly once */
 static gmx_bool dd_check_ftype(int ftype, gmx_bool bBCheck,
                                gmx_bool bConstr, gmx_bool bSettle)
 {
@@ -127,6 +149,7 @@ static gmx_bool dd_check_ftype(int ftype, gmx_bool bBCheck,
             (bSettle && ftype == F_SETTLE));
 }
 
+/*! \brief Print a header on error messages */
 static void print_error_header(FILE *fplog, char *moltypename, int nprint)
 {
     fprintf(fplog, "\nMolecule type '%s'\n", moltypename);
@@ -139,16 +162,17 @@ static void print_error_header(FILE *fplog, char *moltypename, int nprint)
             nprint);
 }
 
+/*! \brief Help print error output when interactions are missing */
 static void print_missing_interactions_mb(FILE *fplog, t_commrec *cr,
                                           gmx_reverse_top_t *rt,
                                           char *moltypename,
-                                          gmx_reverse_ilist_t *ril,
+                                          reverse_ilist_t *ril,
                                           int a_start, int a_end,
                                           int nat_mol, int nmol,
                                           t_idef *idef)
 {
     int      nril_mol, *assigned, *gatindex;
-    int      ftype, ftype_j, nral, i, j_mol, j, k, a0, a0_mol, mol, a, a_gl;
+    int      ftype, ftype_j, nral, i, j_mol, j, a0, a0_mol, mol, a;
     int      nprint;
     t_ilist *il;
     t_iatom *ia;
@@ -276,6 +300,7 @@ static void print_missing_interactions_mb(FILE *fplog, t_commrec *cr,
     sfree(assigned);
 }
 
+/*! \brief Help print error output when interactions are missing */
 static void print_missing_interactions_atoms(FILE *fplog, t_commrec *cr,
                                              gmx_mtop_t *mtop, t_idef *idef)
 {
@@ -334,7 +359,10 @@ void dd_print_missing_interactions(FILE *fplog, t_commrec *cr, int local_count,
 
     if (DDMASTER(dd))
     {
-        fprintf(fplog, "\nA list of missing interactions:\n");
+        if (fplog)
+        {
+            fprintf(fplog, "\nA list of missing interactions:\n");
+        }
         fprintf(stderr, "\nA list of missing interactions:\n");
         rest_global = dd->nbonded_global;
         rest_local  = local_count;
@@ -350,7 +378,6 @@ void dd_print_missing_interactions(FILE *fplog, t_commrec *cr, int local_count,
                 || (dd->reverse_top->bConstr && ftype == F_CONSTR)
                 || (dd->reverse_top->bSettle && ftype == F_SETTLE))
             {
-                nral = NRAL(ftype);
                 n    = gmx_mtop_ftype_count(err_top_global, ftype);
                 if (ftype == F_CONSTR)
                 {
@@ -361,7 +388,10 @@ void dd_print_missing_interactions(FILE *fplog, t_commrec *cr, int local_count,
                 {
                     sprintf(buf, "%20s of %6d missing %6d",
                             interaction_function[ftype].longname, n, -ndiff);
-                    fprintf(fplog, "%s\n", buf);
+                    if (fplog)
+                    {
+                        fprintf(fplog, "%s\n", buf);
+                    }
                     fprintf(stderr, "%s\n", buf);
                 }
                 rest_global -= n;
@@ -374,7 +404,10 @@ void dd_print_missing_interactions(FILE *fplog, t_commrec *cr, int local_count,
         {
             sprintf(buf, "%20s of %6d missing %6d", "exclusions",
                     rest_global, -ndiff);
-            fprintf(fplog, "%s\n", buf);
+            if (fplog)
+            {
+                fprintf(fplog, "%s\n", buf);
+            }
             fprintf(stderr, "%s\n", buf);
         }
     }
@@ -391,21 +424,19 @@ void dd_print_missing_interactions(FILE *fplog, t_commrec *cr, int local_count,
         }
         else
         {
-            gmx_fatal(FARGS, "%d of the %d bonded interactions could not be calculated because some atoms involved moved further apart than the multi-body cut-off distance (%g nm) or the two-body cut-off distance (%g nm), see option -rdd, for pairs and tabulated bonds also see option -ddcheck", -ndiff_tot, cr->dd->nbonded_global, dd_cutoff_mbody(cr->dd), dd_cutoff_twobody(cr->dd));
+            gmx_fatal(FARGS, "%d of the %d bonded interactions could not be calculated because some atoms involved moved further apart than the multi-body cut-off distance (%g nm) or the two-body cut-off distance (%g nm), see option -rdd, for pairs and tabulated bonds also see option -ddcheck", -ndiff_tot, cr->dd->nbonded_global, dd_cutoff_multibody(cr->dd), dd_cutoff_twobody(cr->dd));
         }
     }
 }
 
+/*! \brief Return global topology molecule information for global atom index \p i_gl */
 static void global_atomnr_to_moltype_ind(gmx_reverse_top_t *rt, int i_gl,
                                          int *mb, int *mt, int *mol, int *i_mol)
 {
-    int molb;
-
-
-    gmx_molblock_ind_t *mbi   = rt->mbi;
-    int                 start = 0;
-    int                 end   =  rt->nmolblock; /* exclusive */
-    int                 mid;
+    molblock_ind_t *mbi   = rt->mbi;
+    int             start = 0;
+    int             end   = rt->nmolblock; /* exclusive */
+    int             mid;
 
     /* binary search for molblock_ind */
     while (TRUE)
@@ -433,9 +464,11 @@ static void global_atomnr_to_moltype_ind(gmx_reverse_top_t *rt, int i_gl,
     *i_mol = (i_gl - mbi->a_start) - (*mol)*mbi->natoms_mol;
 }
 
-static int count_excls(t_block *cgs, t_blocka *excls, int *n_intercg_excl)
+/*! \brief Count the exclusions for all atoms in \p cgs */
+static int count_excls(const t_block *cgs, const t_blocka *excls,
+                       int *n_intercg_excl)
 {
-    int n, n_inter, cg, at0, at1, at, excl, atj;
+    int n, cg, at0, at1, at, excl, atj;
 
     n               = 0;
     *n_intercg_excl = 0;
@@ -463,6 +496,7 @@ static int count_excls(t_block *cgs, t_blocka *excls, int *n_intercg_excl)
     return n;
 }
 
+/*! \brief Run the reverse ilist generation and store it when \p bAssign = TRUE */
 static int low_make_reverse_ilist(t_ilist *il_mt, t_atom *atom,
                                   int **vsite_pbc,
                                   int *count,
@@ -489,7 +523,6 @@ static int low_make_reverse_ilist(t_ilist *il_mt, t_atom *atom,
             bVSite = (interaction_function[ftype].flags & IF_VSITE);
             nral   = NRAL(ftype);
             il     = &il_mt[ftype];
-            ia     = il->iatoms;
             for (i = 0; i < il->nr; i += 1+nral)
             {
                 ia = il->iatoms + i;
@@ -566,12 +599,13 @@ static int low_make_reverse_ilist(t_ilist *il_mt, t_atom *atom,
     return nint;
 }
 
+/*! \brief Make the reverse ilist: a list of bonded interactions linked to atoms */
 static int make_reverse_ilist(gmx_moltype_t *molt,
                               int **vsite_pbc,
                               gmx_bool bConstr, gmx_bool bSettle,
                               gmx_bool bBCheck,
                               gmx_bool bLinkToAllAtoms,
-                              gmx_reverse_ilist_t *ril_mt)
+                              reverse_ilist_t *ril_mt)
 {
     int nat_mt, *count, i, nint_mt;
 
@@ -605,12 +639,14 @@ static int make_reverse_ilist(gmx_moltype_t *molt,
     return nint_mt;
 }
 
-static void destroy_reverse_ilist(gmx_reverse_ilist_t *ril)
+/*! \brief Destroys a reverse_ilist_t struct */
+static void destroy_reverse_ilist(reverse_ilist_t *ril)
 {
     sfree(ril->index);
     sfree(ril->il);
 }
 
+/*! \brief Generate the reverse topology */
 static gmx_reverse_top_t *make_reverse_top(gmx_mtop_t *mtop, gmx_bool bFE,
                                            int ***vsite_pbc_molt,
                                            gmx_bool bConstr, gmx_bool bSettle,
@@ -684,20 +720,15 @@ static gmx_reverse_top_t *make_reverse_top(gmx_mtop_t *mtop, gmx_bool bFE,
     }
 
     rt->nthread = gmx_omp_nthreads_get(emntDomdec);
-    snew(rt->idef_thread, rt->nthread);
+    snew(rt->th_work, rt->nthread);
     if (vsite_pbc_molt != NULL)
     {
-        snew(rt->vsite_pbc, rt->nthread);
-        snew(rt->vsite_pbc_nalloc, rt->nthread);
         for (thread = 0; thread < rt->nthread; thread++)
         {
-            snew(rt->vsite_pbc[thread], F_VSITEN-F_VSITE2+1);
-            snew(rt->vsite_pbc_nalloc[thread], F_VSITEN-F_VSITE2+1);
+            snew(rt->th_work[thread].vsite_pbc, F_VSITEN-F_VSITE2+1);
+            snew(rt->th_work[thread].vsite_pbc_nalloc, F_VSITEN-F_VSITE2+1);
         }
     }
-    snew(rt->nbonded_thread, rt->nthread);
-    snew(rt->excl_thread, rt->nthread);
-    snew(rt->excl_count_thread, rt->nthread);
 
     return rt;
 }
@@ -707,7 +738,7 @@ void dd_make_reverse_top(FILE *fplog,
                          gmx_vsite_t *vsite,
                          t_inputrec *ir, gmx_bool bBCheck)
 {
-    int             mb, n_recursive_vsite, nexcl, nexcl_icg, a;
+    int             mb, nexcl, nexcl_icg;
     gmx_molblock_t *molb;
     gmx_moltype_t  *molt;
 
@@ -786,6 +817,63 @@ void dd_make_reverse_top(FILE *fplog,
     }
 }
 
+/*! \brief Store a vsite interaction at the end of \p il
+ *
+ * This routine is very similar to add_ifunc, but vsites interactions
+ * have more work to do than other kinds of interactions, and the
+ * complex way nral (and thus vector contents) depends on ftype
+ * confuses static analysis tools unless we fuse the vsite
+ * atom-indexing organization code with the ifunc-adding code, so that
+ * they can see that nral is the same value. */
+static gmx_inline void
+add_ifunc_for_vsites(t_iatom *tiatoms, gmx_ga2la_t ga2la,
+                     int nral, gmx_bool bHomeA,
+                     int a, int a_gl, int a_mol,
+                     const t_iatom *iatoms,
+                     t_ilist *il)
+{
+    t_iatom *liatoms;
+
+    if (il->nr+1+nral > il->nalloc)
+    {
+        il->nalloc = over_alloc_large(il->nr+1+nral);
+        srenew(il->iatoms, il->nalloc);
+    }
+    liatoms = il->iatoms + il->nr;
+    il->nr += 1 + nral;
+
+    /* Copy the type */
+    tiatoms[0] = iatoms[0];
+
+    if (bHomeA)
+    {
+        /* We know the local index of the first atom */
+        tiatoms[1] = a;
+    }
+    else
+    {
+        /* Convert later in make_local_vsites */
+        tiatoms[1] = -a_gl - 1;
+    }
+
+    for (int k = 2; k < 1+nral; k++)
+    {
+        int ak_gl = a_gl + iatoms[k] - a_mol;
+        if (!ga2la_get_home(ga2la, ak_gl, &tiatoms[k]))
+        {
+            /* Copy the global index, convert later in make_local_vsites */
+            tiatoms[k] = -(ak_gl + 1);
+        }
+        // Note that ga2la_get_home always sets the third parameter if
+        // it returns TRUE
+    }
+    for (int k = 0; k < 1+nral; k++)
+    {
+        liatoms[k] = tiatoms[k];
+    }
+}
+
+/*! \brief Store a bonded interaction at the end of \p il */
 static gmx_inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
 {
     t_iatom *liatoms;
@@ -804,6 +892,7 @@ static gmx_inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
     il->nr += 1 + nral;
 }
 
+/*! \brief Store a position restraint in idef and iatoms, complex because the parameters are different for each entry */
 static void add_posres(int mol, int a_mol, const gmx_molblock_t *molb,
                        t_iatom *iatoms, const t_iparams *ip_in,
                        t_idef *idef)
@@ -849,6 +938,7 @@ static void add_posres(int mol, int a_mol, const gmx_molblock_t *molb,
     iatoms[0] = n;
 }
 
+/*! \brief Store a flat-bottomed position restraint in idef and iatoms, complex because the parameters are different for each entry */
 static void add_fbposres(int mol, int a_mol, const gmx_molblock_t *molb,
                          t_iatom *iatoms, const t_iparams *ip_in,
                          t_idef *idef)
@@ -886,42 +976,20 @@ static void add_fbposres(int mol, int a_mol, const gmx_molblock_t *molb,
     iatoms[0] = n;
 }
 
+/*! \brief Store a virtual site interaction, complex because of PBC and recursion */
 static void add_vsite(gmx_ga2la_t ga2la, int *index, int *rtil,
                       int ftype, int nral,
                       gmx_bool bHomeA, int a, int a_gl, int a_mol,
                       t_iatom *iatoms,
                       t_idef *idef, int **vsite_pbc, int *vsite_pbc_nalloc)
 {
-    int     k, ak_gl, vsi, pbc_a_mol;
-    t_iatom tiatoms[1+MAXATOMLIST], *iatoms_r;
+    int     k, vsi, pbc_a_mol;
+    t_iatom tiatoms[1+MAXATOMLIST];
     int     j, ftype_r, nral_r;
 
-    /* Copy the type */
-    tiatoms[0] = iatoms[0];
-
-    if (bHomeA)
-    {
-        /* We know the local index of the first atom */
-        tiatoms[1] = a;
-    }
-    else
-    {
-        /* Convert later in make_local_vsites */
-        tiatoms[1] = -a_gl - 1;
-    }
-
-    for (k = 2; k < 1+nral; k++)
-    {
-        ak_gl = a_gl + iatoms[k] - a_mol;
-        if (!ga2la_get_home(ga2la, ak_gl, &tiatoms[k]))
-        {
-            /* Copy the global index, convert later in make_local_vsites */
-            tiatoms[k] = -(ak_gl + 1);
-        }
-    }
-
     /* Add this interaction to the local topology */
-    add_ifunc(nral, tiatoms, &idef->il[ftype]);
+    add_ifunc_for_vsites(tiatoms, ga2la, nral, bHomeA, a, a_gl, a_mol, iatoms, &idef->il[ftype]);
+
     if (vsite_pbc)
     {
         vsi = idef->il[ftype].nr/(1+nral) - 1;
@@ -1000,6 +1068,7 @@ static void add_vsite(gmx_ga2la_t ga2la, int *index, int *rtil,
     }
 }
 
+/*! \brief Update the local atom to local charge group index */
 static void make_la2lc(gmx_domdec_t *dd)
 {
     int *cgindex, *la2lc, cg, a;
@@ -1023,6 +1092,7 @@ static void make_la2lc(gmx_domdec_t *dd)
     }
 }
 
+/*! \brief Returns the squared distance between charge groups \p i and \p j */
 static real dd_dist2(t_pbc *pbc_null, rvec *cg_cm, const int *la2lc, int i, int j)
 {
     rvec dx;
@@ -1039,16 +1109,16 @@ static real dd_dist2(t_pbc *pbc_null, rvec *cg_cm, const int *la2lc, int i, int
     return norm2(dx);
 }
 
-/* Append the nsrc t_blocka block structures in src to *dest */
-static void combine_blocka(t_blocka *dest, const t_blocka *src, int nsrc)
+/*! \brief Append t_blocka block structures 1 to nsrc in src to *dest */
+static void combine_blocka(t_blocka *dest, const thread_work_t *src, int nsrc)
 {
     int ni, na, s, i;
 
-    ni = src[nsrc-1].nr;
+    ni = src[nsrc-1].excl.nr;
     na = 0;
     for (s = 0; s < nsrc; s++)
     {
-        na += src[s].nra;
+        na += src[s].excl.nra;
     }
     if (ni + 1 > dest->nalloc_index)
     {
@@ -1060,42 +1130,42 @@ static void combine_blocka(t_blocka *dest, const t_blocka *src, int nsrc)
         dest->nalloc_a = over_alloc_large(dest->nra+na);
         srenew(dest->a, dest->nalloc_a);
     }
-    for (s = 0; s < nsrc; s++)
+    for (s = 1; s < nsrc; s++)
     {
-        for (i = dest->nr+1; i < src[s].nr+1; i++)
+        for (i = dest->nr+1; i < src[s].excl.nr+1; i++)
         {
-            dest->index[i] = dest->nra + src[s].index[i];
+            dest->index[i] = dest->nra + src[s].excl.index[i];
         }
-        for (i = 0; i < src[s].nra; i++)
+        for (i = 0; i < src[s].excl.nra; i++)
         {
-            dest->a[dest->nra+i] = src[s].a[i];
+            dest->a[dest->nra+i] = src[s].excl.a[i];
         }
-        dest->nr   = src[s].nr;
-        dest->nra += src[s].nra;
+        dest->nr   = src[s].excl.nr;
+        dest->nra += src[s].excl.nra;
     }
 }
 
-/* Append the nsrc t_idef structures in src to *dest,
+/*! \brief Append t_idef structures 1 to nsrc in src to *dest,
  * virtual sites need special attention, as pbc info differs per vsite.
  */
-static void combine_idef(t_idef *dest, const t_idef *src, int nsrc,
-                         gmx_vsite_t *vsite, int ***vsite_pbc_t)
+static void combine_idef(t_idef *dest, const thread_work_t *src, int nsrc,
+                         gmx_vsite_t *vsite)
 {
-    int            ftype, n, s, i;
-    t_ilist       *ild;
-    const t_ilist *ils;
-    gmx_bool       vpbc;
-    int            nral1 = 0, ftv = 0;
+    int ftype;
 
     for (ftype = 0; ftype < F_NRE; ftype++)
     {
+        int n, s;
+
         n = 0;
-        for (s = 0; s < nsrc; s++)
+        for (s = 1; s < nsrc; s++)
         {
-            n += src[s].il[ftype].nr;
+            n += src[s].idef.il[ftype].nr;
         }
         if (n > 0)
         {
+            t_ilist *ild;
+
             ild = &dest->il[ftype];
 
             if (ild->nr + n > ild->nalloc)
@@ -1104,6 +1174,9 @@ static void combine_idef(t_idef *dest, const t_idef *src, int nsrc,
                 srenew(ild->iatoms, ild->nalloc);
             }
 
+            gmx_bool vpbc;
+            int      nral1 = 0, ftv = 0;
+
             vpbc = ((interaction_function[ftype].flags & IF_VSITE) &&
                     vsite->vsite_pbc_loc != NULL);
             if (vpbc)
@@ -1119,9 +1192,12 @@ static void combine_idef(t_idef *dest, const t_idef *src, int nsrc,
                 }
             }
 
-            for (s = 0; s < nsrc; s++)
+            for (s = 1; s < nsrc; s++)
             {
-                ils = &src[s].il[ftype];
+                const t_ilist *ils;
+                int            i;
+
+                ils = &src[s].idef.il[ftype];
                 for (i = 0; i < ils->nr; i++)
                 {
                     ild->iatoms[ild->nr+i] = ils->iatoms[i];
@@ -1131,7 +1207,7 @@ static void combine_idef(t_idef *dest, const t_idef *src, int nsrc,
                     for (i = 0; i < ils->nr; i += nral1)
                     {
                         vsite->vsite_pbc_loc[ftv][(ild->nr+i)/nral1] =
-                            vsite_pbc_t[s][ftv][i/nral1];
+                            src[s].vsite_pbc[ftv][i/nral1];
                     }
                 }
 
@@ -1143,6 +1219,8 @@ static void combine_idef(t_idef *dest, const t_idef *src, int nsrc,
     /* Position restraints need an additional treatment */
     if (dest->il[F_POSRES].nr > 0)
     {
+        int n, s, i;
+
         n = dest->il[F_POSRES].nr/2;
         if (n > dest->iparams_posres_nalloc)
         {
@@ -1150,25 +1228,26 @@ static void combine_idef(t_idef *dest, const t_idef *src, int nsrc,
             srenew(dest->iparams_posres, dest->iparams_posres_nalloc);
         }
         /* Set n to the number of original position restraints in dest */
-        for (s = 0; s < nsrc; s++)
+        for (s = 1; s < nsrc; s++)
         {
-            n -= src[s].il[F_POSRES].nr/2;
+            n -= src[s].idef.il[F_POSRES].nr/2;
         }
-        for (s = 0; s < nsrc; s++)
+        for (s = 1; s < nsrc; s++)
         {
-            for (i = 0; i < src[s].il[F_POSRES].nr/2; i++)
+            for (i = 0; i < src[s].idef.il[F_POSRES].nr/2; i++)
             {
                 /* Correct the index into iparams_posres */
                 dest->il[F_POSRES].iatoms[n*2] = n;
                 /* Copy the position restraint force parameters */
-                dest->iparams_posres[n] = src[s].iparams_posres[i];
+                dest->iparams_posres[n] = src[s].idef.iparams_posres[i];
                 n++;
             }
         }
     }
 }
 
-/* This function looks up and assigns bonded interactions for zone iz.
+/*! \brief This function looks up and assigns bonded interactions for zone iz.
+ *
  * With thread parallelizing each thread acts on a different atom range:
  * at_start to at_end.
  */
@@ -1395,6 +1474,7 @@ static int make_bondeds_zone(gmx_domdec_t *dd,
     return nbonded_local;
 }
 
+/*! \brief Set the exclusion data for i-zone \p iz for the case of no exclusions */
 static void set_no_exclusions_zone(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                                    int iz, t_blocka *lexcls)
 {
@@ -1409,6 +1489,7 @@ static void set_no_exclusions_zone(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
     }
 }
 
+/*! \brief Set the exclusion data for i-zone \p iz */
 static int make_exclusions_zone(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                                 const gmx_moltype_t *moltype,
                                 gmx_bool bRCheck, real rc2,
@@ -1418,11 +1499,10 @@ static int make_exclusions_zone(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                                 int iz,
                                 int cg_start, int cg_end)
 {
-    int             nizone, n, count, jla0, jla1, jla;
+    int             n, count, jla0, jla1, jla;
     int             cg, la0, la1, la, a_gl, mb, mt, mol, a_mol, j, aj_mol;
     const t_blocka *excls;
     gmx_ga2la_t     ga2la;
-    int             a_loc;
     int             cell;
 
     ga2la = dd->ga2la;
@@ -1548,6 +1628,7 @@ static int make_exclusions_zone(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
     return count;
 }
 
+/*! \brief Ensure we have enough space in \p ba for \p nindex_max indices */
 static void check_alloc_index(t_blocka *ba, int nindex_max)
 {
     if (nindex_max+1 > ba->nalloc_index)
@@ -1557,6 +1638,7 @@ static void check_alloc_index(t_blocka *ba, int nindex_max)
     }
 }
 
+/*! \brief Ensure that we have enough space for exclusion storate in \p lexcls */
 static void check_exclusions_alloc(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                                    t_blocka *lexcls)
 {
@@ -1569,10 +1651,11 @@ static void check_exclusions_alloc(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
 
     for (thread = 1; thread < dd->reverse_top->nthread; thread++)
     {
-        check_alloc_index(&dd->reverse_top->excl_thread[thread], nr);
+        check_alloc_index(&dd->reverse_top->th_work[thread].excl, nr);
     }
 }
 
+/*! \brief Set the total count indexes for the local exclusions, needed by several functions */
 static void finish_local_exclusions(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                                     t_blocka *lexcls)
 {
@@ -1598,6 +1681,7 @@ static void finish_local_exclusions(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
     }
 }
 
+/*! \brief Clear a t_idef struct */
 static void clear_idef(t_idef *idef)
 {
     int  ftype;
@@ -1609,6 +1693,7 @@ static void clear_idef(t_idef *idef)
     }
 }
 
+/*! \brief Generate and store all required local bonded interactions in \p idef and local exclusions in \p lexcls */
 static int make_local_bondeds_excls(gmx_domdec_t *dd,
                                     gmx_domdec_zones_t *zones,
                                     const gmx_mtop_t *mtop,
@@ -1673,7 +1758,6 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
         {
             int       cg0t, cg1t;
             t_idef   *idef_t;
-            int       ftype;
             int     **vsite_pbc;
             int      *vsite_pbc_nalloc;
             t_blocka *excl_t;
@@ -1687,7 +1771,7 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
             }
             else
             {
-                idef_t = &rt->idef_thread[thread];
+                idef_t = &rt->th_work[thread].idef;
                 clear_idef(idef_t);
             }
 
@@ -1700,8 +1784,8 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
                 }
                 else
                 {
-                    vsite_pbc        = rt->vsite_pbc[thread];
-                    vsite_pbc_nalloc = rt->vsite_pbc_nalloc[thread];
+                    vsite_pbc        = rt->th_work[thread].vsite_pbc;
+                    vsite_pbc_nalloc = rt->th_work[thread].vsite_pbc_nalloc;
                 }
             }
             else
@@ -1710,7 +1794,7 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
                 vsite_pbc_nalloc = NULL;
             }
 
-            rt->nbonded_thread[thread] =
+            rt->th_work[thread].nbonded =
                 make_bondeds_zone(dd, zones,
                                   mtop->molblock,
                                   bRCheckMB, rcheck, bRCheck2B, rc2,
@@ -1728,12 +1812,12 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
                 }
                 else
                 {
-                    excl_t      = &rt->excl_thread[thread];
+                    excl_t      = &rt->th_work[thread].excl;
                     excl_t->nr  = 0;
                     excl_t->nra = 0;
                 }
 
-                rt->excl_count_thread[thread] =
+                rt->th_work[thread].excl_count =
                     make_exclusions_zone(dd, zones,
                                          mtop->moltype, bRCheck2B, rc2,
                                          la2lc, pbc_null, cg_cm, cginfo,
@@ -1745,25 +1829,24 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
 
         if (rt->nthread > 1)
         {
-            combine_idef(idef, rt->idef_thread+1, rt->nthread-1,
-                         vsite, rt->vsite_pbc+1);
+            combine_idef(idef, rt->th_work, rt->nthread, vsite);
         }
 
         for (thread = 0; thread < rt->nthread; thread++)
         {
-            nbonded_local += rt->nbonded_thread[thread];
+            nbonded_local += rt->th_work[thread].nbonded;
         }
 
         if (iz < nzone_excl)
         {
             if (rt->nthread > 1)
             {
-                combine_blocka(lexcls, rt->excl_thread+1, rt->nthread-1);
+                combine_blocka(lexcls, rt->th_work, rt->nthread);
             }
 
             for (thread = 0; thread < rt->nthread; thread++)
             {
-                *excl_count += rt->excl_count_thread[thread];
+                *excl_count += rt->th_work[thread].excl_count;
             }
         }
     }
@@ -1800,7 +1883,7 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                        gmx_vsite_t *vsite,
                        gmx_mtop_t *mtop, gmx_localtop_t *ltop)
 {
-    gmx_bool bUniqueExcl, bRCheckMB, bRCheck2B, bRCheckExcl;
+    gmx_bool bRCheckMB, bRCheck2B;
     real     rc = -1;
     ivec     rcheck;
     int      d, nexcl;
@@ -1815,7 +1898,6 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
 
     bRCheckMB   = FALSE;
     bRCheck2B   = FALSE;
-    bRCheckExcl = FALSE;
 
     if (dd->reverse_top->bMultiCGmols)
     {
@@ -1854,17 +1936,6 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
                         d, cellsize_min[d], d, rcheck[d], bRCheck2B);
             }
         }
-        if (dd->reverse_top->bExclRequired)
-        {
-            bRCheckExcl = bRCheck2B;
-        }
-        else
-        {
-            /* If we don't have forces on exclusions,
-             * we don't care about exclusions being assigned mulitple times.
-             */
-            bRCheckExcl = FALSE;
-        }
         if (bRCheckMB || bRCheck2B)
         {
             make_la2lc(dd);
@@ -1963,14 +2034,16 @@ void dd_init_local_state(gmx_domdec_t *dd,
     state_local->flags = buf[0];
 }
 
+/*! \brief Check if a link is stored in \p link between charge groups \p cg_gl and \p cg_gl_j and if not so, store a link */
 static void check_link(t_blocka *link, int cg_gl, int cg_gl_j)
 {
-    int      k, aj;
+    int      k;
     gmx_bool bFound;
 
     bFound = FALSE;
     for (k = link->index[cg_gl]; k < link->index[cg_gl+1]; k++)
     {
+        GMX_RELEASE_ASSERT(link->a, "Inconsistent NULL pointer while making charge-group links");
         if (link->a[k] == cg_gl_j)
         {
             bFound = TRUE;
@@ -1978,6 +2051,8 @@ static void check_link(t_blocka *link, int cg_gl, int cg_gl_j)
     }
     if (!bFound)
     {
+        GMX_RELEASE_ASSERT(link->a || link->index[cg_gl+1]+1 > link->nalloc_a,
+                           "Inconsistent allocation of link");
         /* Add this charge group link */
         if (link->index[cg_gl+1]+1 > link->nalloc_a)
         {
@@ -1989,6 +2064,7 @@ static void check_link(t_blocka *link, int cg_gl, int cg_gl_j)
     }
 }
 
+/*! \brief Allocate and return an array of the charge group index for all atoms */
 static int *make_at2cg(t_block *cgs)
 {
     int *at2cg, cg, a;
@@ -2015,7 +2091,7 @@ t_blocka *make_charge_group_links(gmx_mtop_t *mtop, gmx_domdec_t *dd,
     t_block            *cgs;
     t_blocka           *excls;
     int                *a2c;
-    gmx_reverse_ilist_t ril;
+    reverse_ilist_t     ril;
     t_blocka           *link;
     cginfo_mb_t        *cgi_mb;
 
@@ -2143,6 +2219,7 @@ t_blocka *make_charge_group_links(gmx_mtop_t *mtop, gmx_domdec_t *dd,
     return link;
 }
 
+/*! \brief Set the distance, function type and atom indices for the longest distance between molecules of molecule type \p molt for two-body and multi-body bonded interactions */
 static void bonded_cg_distance_mol(gmx_moltype_t *molt, int *at2cg,
                                    gmx_bool bBCheck, gmx_bool bExcl, rvec *cg_cm,
                                    real *r_2b, int *ft2b, int *a2_1, int *a2_2,
@@ -2220,6 +2297,7 @@ static void bonded_cg_distance_mol(gmx_moltype_t *molt, int *at2cg,
     *r_mb = sqrt(r2_mb);
 }
 
+//! Compute charge group centers of mass for molecule \p molt
 static void get_cgcm_mol(gmx_moltype_t *molt, gmx_ffparams_t *ffparams,
                          int ePBC, t_graph *graph, matrix box,
                          gmx_vsite_t *vsite,
@@ -2262,6 +2340,7 @@ static void get_cgcm_mol(gmx_moltype_t *molt, gmx_ffparams_t *ffparams,
     calc_cgcm(NULL, 0, molt->cgs.nr, &molt->cgs, xs, cg_cm);
 }
 
+//! Returns whether \p molt has a virtual site
 static int have_vsite_molt(gmx_moltype_t *molt)
 {
     int      i;
@@ -2287,7 +2366,7 @@ void dd_bonded_cg_distance(FILE *fplog,
                            real *r_2b, real *r_mb)
 {
     gmx_bool        bExclRequired;
-    int             mb, cg_offset, at_offset, *at2cg, mol;
+    int             mb, at_offset, *at2cg, mol;
     t_graph         graph;
     gmx_vsite_t    *vsite;
     gmx_molblock_t *molb;
@@ -2303,7 +2382,6 @@ void dd_bonded_cg_distance(FILE *fplog,
 
     *r_2b     = 0;
     *r_mb     = 0;
-    cg_offset = 0;
     at_offset = 0;
     for (mb = 0; mb < mtop->nmolblock; mb++)
     {
@@ -2311,7 +2389,6 @@ void dd_bonded_cg_distance(FILE *fplog,
         molt = &mtop->moltype[molb->type];
         if (molt->cgs.nr == 1 || molb->nmol == 0)
         {
-            cg_offset += molb->nmol*molt->cgs.nr;
             at_offset += molb->nmol*molt->atoms.nr;
         }
         else
@@ -2349,7 +2426,6 @@ void dd_bonded_cg_distance(FILE *fplog,
                     a_mb_2 = at_offset + amol_mb_2;
                 }
 
-                cg_offset += molt->cgs.nr;
                 at_offset += molt->atoms.nr;
             }
             sfree(cg_cm);
diff --git a/src/gromacs/domdec/domdec_vsite.cpp b/src/gromacs/domdec/domdec_vsite.cpp
new file mode 100644 (file)
index 0000000..e9d063f
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+/*! \internal \file
+ *
+ * \brief This file implements functions for domdec to use
+ * while managing inter-atomic constraints.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
+ */
+
+#include "gmxpre.h"
+
+#include "domdec_vsite.h"
+
+#include <assert.h>
+
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/gmx_hash.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "domdec_specatomcomm.h"
+
+void dd_move_f_vsites(gmx_domdec_t *dd, rvec *f, rvec *fshift)
+{
+    if (dd->vsite_comm)
+    {
+        dd_move_f_specat(dd, dd->vsite_comm, f, fshift);
+    }
+}
+
+void dd_clear_f_vsites(gmx_domdec_t *dd, rvec *f)
+{
+    int i;
+
+    if (dd->vsite_comm)
+    {
+        for (i = dd->vsite_comm->at_start; i < dd->vsite_comm->at_end; i++)
+        {
+            clear_rvec(f[i]);
+        }
+    }
+}
+
+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);
+    }
+}
+
+int dd_make_local_vsites(gmx_domdec_t *dd, int at_start, t_ilist *lil)
+{
+    gmx_domdec_specat_comm_t *spac;
+    ind_req_t                *ireq;
+    gmx_hash_t                ga2la_specat;
+    int  ftype, nral, i, j, a;
+    t_ilist                  *lilf;
+    t_iatom                  *iatoms;
+    int  at_end;
+
+    spac         = dd->vsite_comm;
+    ireq         = &spac->ireq[0];
+    ga2la_specat = dd->ga2la_vsite;
+
+    ireq->n = 0;
+    /* Loop over all the home vsites */
+    for (ftype = 0; ftype < F_NRE; ftype++)
+    {
+        if (interaction_function[ftype].flags & IF_VSITE)
+        {
+            nral = NRAL(ftype);
+            lilf = &lil[ftype];
+            for (i = 0; i < lilf->nr; i += 1+nral)
+            {
+                iatoms = lilf->iatoms + i;
+                /* Check if we have the other atoms */
+                for (j = 1; j < 1+nral; j++)
+                {
+                    if (iatoms[j] < 0)
+                    {
+                        /* This is not a home atom,
+                         * we need to ask our neighbors.
+                         */
+                        a = -iatoms[j] - 1;
+                        /* Check to not ask for the same atom more than once */
+                        if (gmx_hash_get_minone(dd->ga2la_vsite, a) == -1)
+                        {
+                            /* Add this non-home atom to the list */
+                            if (ireq->n+1 > ireq->nalloc)
+                            {
+                                ireq->nalloc = over_alloc_large(ireq->n+1);
+                                srenew(ireq->ind, ireq->nalloc);
+                            }
+                            ireq->ind[ireq->n++] = a;
+                            /* Temporarily mark with -2,
+                             * we get the index later.
+                             */
+                            gmx_hash_set(ga2la_specat, a, -2);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    at_end = setup_specat_communication(dd, ireq, dd->vsite_comm, ga2la_specat,
+                                        at_start, 1, "vsite", "");
+
+    /* Fill in the missing indices */
+    for (ftype = 0; ftype < F_NRE; ftype++)
+    {
+        if (interaction_function[ftype].flags & IF_VSITE)
+        {
+            nral = NRAL(ftype);
+            lilf = &lil[ftype];
+            for (i = 0; i < lilf->nr; i += 1+nral)
+            {
+                iatoms = lilf->iatoms + i;
+                for (j = 1; j < 1+nral; j++)
+                {
+                    if (iatoms[j] < 0)
+                    {
+                        iatoms[j] = gmx_hash_get_minone(ga2la_specat, -iatoms[j]-1);
+                    }
+                }
+            }
+        }
+    }
+
+    return at_end;
+}
+
+void init_domdec_vsites(gmx_domdec_t *dd, int n_intercg_vsite)
+{
+    if (debug)
+    {
+        fprintf(debug, "Begin init_domdec_vsites\n");
+    }
+
+    /* Use a hash table for the global to local index.
+     * The number of keys is a rough estimate, it will be optimized later.
+     */
+    dd->ga2la_vsite = gmx_hash_init(std::min(n_intercg_vsite/20,
+                                             n_intercg_vsite/(2*dd->nnodes)));
+
+    dd->vsite_comm = specat_comm_init(1);
+}
similarity index 64%
rename from src/gromacs/utility/gmx_header_config_gen.h.cmakein
rename to src/gromacs/domdec/domdec_vsite.h
index f9d6835ca8af6fa99c63971e1d11f31ab605c3cb..7c42b391f3c5322bbfe5bbeaf132e51b4ba8e5e2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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
- * Generated include file for configuration macros that affect installed
- * headers.
+/*! \internal \file
  *
- * This include file will configured by CMake and installed with GROMACS
- * header files so that they can refer to a central location for \#defines that
- * will be available for builds of projects that depend on GROMACS.
+ * \brief This file declares functions for domdec to use
+ * while managing virtual sites.
  *
- * gmx_header_config.h should be included instead of this file to allow usage
- * of relative install paths.
- *
- * \inlibraryapi
- * \ingroup module_utility
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_domdec
  */
 
-#ifdef __CYGWIN__
-#define GMX_CYGWIN
-#endif
+#ifndef GMX_DOMDEC_DOMDEC_VSITE_H
+#define GMX_DOMDEC_DOMDEC_VSITE_H
 
-#if defined( _WIN32 ) || defined( _WIN64 )
-#define GMX_NATIVE_WINDOWS
-#endif
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/topology.h"
+
+/*! \brief Clears the local indices for the virtual site communication setup */
+void dd_clear_local_vsite_indices(gmx_domdec_t *dd);
 
-/** Define if we have sufficient C++11 support */
-#cmakedefine GMX_CXX11
+/*! \brief Sets up communication and atom indices for all local vsites */
+int dd_make_local_vsites(gmx_domdec_t *dd, int at_start, t_ilist *lil);
+
+/*! \brief Initializes the data structures for virtual site communication */
+void init_domdec_vsites(gmx_domdec_t *dd, int n_intercg_vsite);
+
+#endif
index 99b81af603daa16e23520d0f8c223c35e5172fa8..35855ffde15a2b9103dd24f1f297baa750d112b1 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "edsam.h"
 
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "names.h"
 #include "gromacs/fileio/confio.h"
-#include "txtdump.h"
-#include "vec.h"
-#include "nrnb.h"
-#include "mshift.h"
-#include "mdrun.h"
-#include "update.h"
-#include "physics.h"
-#include "mtop_util.h"
-#include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "xvgr.h"
-#include "gromacs/mdlib/groupcoord.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
 #include "gromacs/linearalgebra/nrjac.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
-/* We use the same defines as in mvdata.c here */
+/* 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)); }}
@@ -1141,7 +1138,7 @@ static void get_flood_enx_names(t_edpar *edi, char** names, int *nnames)  /* get
     {
         srenew(names, count);
         sprintf(buf, "Vfl_%d", count);
-        names[count-1] = strdup(buf);
+        names[count-1] = gmx_strdup(buf);
         actual         = actual->next_edi;
         count++;
     }
@@ -1205,6 +1202,7 @@ 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)
         {
             ed->edo = gmx_fio_fopen(opt2fn("-eo", nfile, fnm), "a+");
@@ -2454,7 +2452,7 @@ static void nice_legend(const char ***setname, int *nsets, char **LegendStr, cha
     sprintf(tmp, "%c %s", EDgroupchar, value);
     add_to_string_aligned(LegendStr, tmp);
     sprintf(tmp2, "%s (%s)", tmp, unit);
-    (*setname)[*nsets] = strdup(tmp2);
+    (*setname)[*nsets] = gmx_strdup(tmp2);
     (*nsets)++;
 }
 
@@ -3186,3 +3184,16 @@ void do_edsam(t_inputrec     *ir,
 
     ed->bFirst = FALSE;
 }
+
+void done_ed(gmx_edsam_t *ed)
+{
+    if (*ed)
+    {
+        /* ed->edo is opened sometimes with xvgropen, sometimes with
+         * gmx_fio_fopen, so we use the least common denominator for
+         * closing. */
+        gmx_fio_fclose((*ed)->edo);
+    }
+
+    /* TODO deallocate ed and set pointer to NULL */
+}
index 9a1c410ba53753e3fd8b9f87e23d6a0224c05a21..e6ab9810cdc4dbe0c1e63d176d3da5b78e8874e1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * 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.
@@ -48,7 +48,8 @@
 #ifndef GMX_ESSENTIALDYNAMICS_EDSAM_H
 #define GMX_ESSENTIALDYNAMICS_EDSAM_H
 
-#include "typedefs.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -128,6 +129,11 @@ void dd_make_local_ed_indices(gmx_domdec_t *dd, gmx_edsam_t ed);
 void do_flood(t_commrec *cr, t_inputrec *ir, rvec x[], rvec force[], gmx_edsam_t ed,
               matrix box, gmx_int64_t step, gmx_bool bNS);
 
+/*! \brief Clean up
+ *
+ * \param ed                The essential dynamics data
+ */
+void done_ed(gmx_edsam_t *ed);
 
 #ifdef __cplusplus
 }
diff --git a/src/gromacs/ewald/CMakeLists.txt b/src/gromacs/ewald/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b6c515e
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+file(GLOB EWALD_SOURCES *.c)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${EWALD_SOURCES} PARENT_SCOPE)
+
+if (BUILD_TESTING)
+#    add_subdirectory(tests)
+endif()
similarity index 86%
rename from src/gromacs/mdlib/ewald.c
rename to src/gromacs/ewald/ewald.c
index 9a12d41e884c51b9c52b1573aba8762d46010cb4..eda483e35d2ab0dac086a909c934d3e31905fa5c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "ewald.h"
 
-#include <stdio.h>
 #include <math.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "physics.h"
-#include "coulomb.h"
-#include "macros.h"
+#include <stdio.h>
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/gmxcomplex.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/smalloc.h"
 
-#define TOL 2e-5
-
-struct ewald_tab
+struct gmx_ewald_tab_t
 {
     int        nx, ny, nz, kmax;
     cvec     **eir;
     t_complex *tab_xy, *tab_qxyz;
 };
 
+void init_ewald_tab(struct gmx_ewald_tab_t **et, const t_inputrec *ir, FILE *fp)
+{
+    int n;
 
+    snew(*et, 1);
+    if (fp)
+    {
+        fprintf(fp, "Will do ordinary reciprocal space Ewald sum.\n");
+    }
 
-/* TODO: fix thread-safety */
+    (*et)->nx       = ir->nkx+1;
+    (*et)->ny       = ir->nky+1;
+    (*et)->nz       = ir->nkz+1;
+    (*et)->kmax     = max((*et)->nx, max((*et)->ny, (*et)->nz));
+    (*et)->eir      = NULL;
+    (*et)->tab_xy   = NULL;
+    (*et)->tab_qxyz = NULL;
+}
 
 /* the other routines are in complex.h */
 static t_complex conjmul(t_complex a, t_complex b)
@@ -76,9 +86,6 @@ static t_complex conjmul(t_complex a, t_complex b)
     return c;
 }
 
-
-
-
 static void tabulate_eir(int natom, rvec x[], int kmax, cvec **eir, rvec lll)
 {
     int  i, j, m;
@@ -112,27 +119,6 @@ static void tabulate_eir(int natom, rvec x[], int kmax, cvec **eir, rvec lll)
     }
 }
 
-void init_ewald_tab(ewald_tab_t *et, const t_inputrec *ir, FILE *fp)
-{
-    int n;
-
-    snew(*et, 1);
-    if (fp)
-    {
-        fprintf(fp, "Will do ordinary reciprocal space Ewald sum.\n");
-    }
-
-    (*et)->nx       = ir->nkx+1;
-    (*et)->ny       = ir->nky+1;
-    (*et)->nz       = ir->nkz+1;
-    (*et)->kmax     = max((*et)->nx, max((*et)->ny, (*et)->nz));
-    (*et)->eir      = NULL;
-    (*et)->tab_xy   = NULL;
-    (*et)->tab_qxyz = NULL;
-}
-
-
-
 real do_ewald(t_inputrec *ir,
               rvec x[],        rvec f[],
               real chargeA[],  real chargeB[],
@@ -140,7 +126,7 @@ real do_ewald(t_inputrec *ir,
               t_commrec *cr,   int natoms,
               matrix lrvir,    real ewaldcoeff,
               real lambda,     real *dvdlambda,
-              ewald_tab_t et)
+              struct gmx_ewald_tab_t *et)
 {
     real     factor     = -1.0/(4*ewaldcoeff*ewaldcoeff);
     real     scaleRecip = 4.0*M_PI/(box[XX]*box[YY]*box[ZZ])*ONE_4PI_EPS0/ir->epsilon_r; /* 1/(Vol*e0) */
@@ -300,3 +286,45 @@ real do_ewald(t_inputrec *ir,
 
     return energy;
 }
+
+real ewald_charge_correction(t_commrec *cr, t_forcerec *fr, real lambda,
+                             matrix box,
+                             real *dvdlambda, tensor vir)
+
+{
+    real vol, fac, qs2A, qs2B, vc, enercorr;
+    int  d;
+
+    if (MASTER(cr))
+    {
+        /* Apply charge correction */
+        vol = box[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
+
+        fac = M_PI*ONE_4PI_EPS0/(fr->epsilon_r*2.0*vol*vol*sqr(fr->ewaldcoeff_q));
+
+        qs2A = fr->qsum[0]*fr->qsum[0];
+        qs2B = fr->qsum[1]*fr->qsum[1];
+
+        vc = (qs2A*(1 - lambda) + qs2B*lambda)*fac;
+
+        enercorr = -vol*vc;
+
+        *dvdlambda += -vol*(qs2B - qs2A)*fac;
+
+        for (d = 0; d < DIM; d++)
+        {
+            vir[d][d] += vc;
+        }
+
+        if (debug)
+        {
+            fprintf(debug, "Total charge correction: Vcharge=%g\n", enercorr);
+        }
+    }
+    else
+    {
+        enercorr = 0;
+    }
+
+    return enercorr;
+}
diff --git a/src/gromacs/ewald/ewald.h b/src/gromacs/ewald/ewald.h
new file mode 100644 (file)
index 0000000..227f786
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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_EWALD_EWALD_H
+#define GMX_EWALD_EWALD_H
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Forward declaration of type for managing Ewald tables */
+struct gmx_ewald_tab_t;
+
+/*! \brief Initialize the tables used in the Ewald long-ranged part */
+void
+init_ewald_tab(struct gmx_ewald_tab_t **et, const t_inputrec *ir,
+               FILE *fp);
+
+/*! \brief Do the long-ranged part of an Ewald calculation */
+real
+do_ewald(t_inputrec *ir,
+         rvec x[],        rvec f[],
+         real chargeA[],  real chargeB[],
+         rvec box,
+         t_commrec *cr,  int natoms,
+         matrix lrvir,   real ewaldcoeff,
+         real lambda,    real *dvdlambda,
+         struct gmx_ewald_tab_t *et);
+
+/*! \brief Calculate the correction to the Ewald sum, due to a net system
+ * charge.
+ *
+ * Should only be called on one thread. */
+real
+ewald_charge_correction(t_commrec *cr, t_forcerec *fr, real lambda, matrix box,
+                        real *dvdlambda, tensor vir);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 90%
rename from src/gromacs/gmxlib/ewald_util.c
rename to src/gromacs/ewald/long-range-correction.c
index a319f0073fbe5f12422d6c1d22fd0f90fd421d27..5a5b96ca3458b54180472d98840e99a837d39aa0 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <math.h>
-#include "gromacs/math/utilities.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "vec.h"
-#include "coulomb.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "txtdump.h"
-#include "gromacs/fileio/futil.h"
-#include "names.h"
-#include "macros.h"
-
-real calc_ewaldcoeff_q(real rc, real dtol)
-{
-    real x = 5, low, high;
-    int  n, i = 0;
-
-
-    do
-    {
-        i++;
-        x *= 2;
-    }
-    while (gmx_erfc(x*rc) > dtol);
-
-    n    = i+60; /* search tolerance is 2^-60 */
-    low  = 0;
-    high = x;
-    for (i = 0; i < n; i++)
-    {
-        x = (low+high)/2;
-        if (gmx_erfc(x*rc) > dtol)
-        {
-            low = x;
-        }
-        else
-        {
-            high = x;
-        }
-    }
-    return x;
-}
+#include "gmxpre.h"
 
-static real ewald_function_lj(real x, real rc)
-{
-    real xrc, xrc2, xrc4, factor;
-    xrc  = x*rc;
-    xrc2 = xrc*xrc;
-    xrc4 = xrc2*xrc2;
-#ifdef GMX_DOUBLE
-    factor = exp(-xrc2)*(1 + xrc2 + xrc4/2.0);
-#else
-    factor = expf(-xrc2)*(1 + xrc2 + xrc4/2.0);
-#endif
+#include "long-range-correction.h"
 
-    return factor;
-}
-
-real calc_ewaldcoeff_lj(real rc, real dtol)
-{
-    real x = 5, low, high;
-    int  n, i = 0;
-
-    do
-    {
-        i++;
-        x *= 2.0;
-    }
-    while (ewald_function_lj(x, rc) > dtol);
+#include <math.h>
 
-    n    = i + 60; /* search tolerance is 2^-60 */
-    low  = 0;
-    high = x;
-    for (i = 0; i < n; ++i)
-    {
-        x = (low + high) / 2.0;
-        if (ewald_function_lj(x, rc) > dtol)
-        {
-            low = x;
-        }
-        else
-        {
-            high = x;
-        }
-    }
-    return x;
-}
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
 
 /* There's nothing special to do here if just masses are perturbed,
  * but if either charge or type is perturbed then the implementation
@@ -631,45 +551,3 @@ void ewald_LRcorrection(int start, int end,
         }
     }
 }
-
-real ewald_charge_correction(t_commrec *cr, t_forcerec *fr, real lambda,
-                             matrix box,
-                             real *dvdlambda, tensor vir)
-
-{
-    real vol, fac, qs2A, qs2B, vc, enercorr;
-    int  d;
-
-    if (MASTER(cr))
-    {
-        /* Apply charge correction */
-        vol = box[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
-
-        fac = M_PI*ONE_4PI_EPS0/(fr->epsilon_r*2.0*vol*vol*sqr(fr->ewaldcoeff_q));
-
-        qs2A = fr->qsum[0]*fr->qsum[0];
-        qs2B = fr->qsum[1]*fr->qsum[1];
-
-        vc = (qs2A*(1 - lambda) + qs2B*lambda)*fac;
-
-        enercorr = -vol*vc;
-
-        *dvdlambda += -vol*(qs2B - qs2A)*fac;
-
-        for (d = 0; d < DIM; d++)
-        {
-            vir[d][d] += vc;
-        }
-
-        if (debug)
-        {
-            fprintf(debug, "Total charge correction: Vcharge=%g\n", enercorr);
-        }
-    }
-    else
-    {
-        enercorr = 0;
-    }
-
-    return enercorr;
-}
similarity index 68%
rename from src/gromacs/legacyheaders/coulomb.h
rename to src/gromacs/ewald/long-range-correction.h
index 089b2d20fd2bcacf66011f778cd109a28d26dffb..3832894d0d5d37f7056e879d1c3a5caf461885ad 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _coulomb_h
-#define _coulomb_h
+#ifndef GMX_EWALD_LONG_RANGE_CORRECTION_H
+#define GMX_EWALD_LONG_RANGE_CORRECTION_H
 
-#include <stdio.h>
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* Ewald related stuff */
-
-void
-init_ewald_tab(ewald_tab_t *et, const t_inputrec *ir,
-               FILE *fp);
-/* initialize the ewald table (as found in the t_forcerec) */
-
-real
-calc_ewaldcoeff_q(real rc, real dtol);
-/* Determines the Ewald parameter, both for Ewald and PME */
-
-extern real calc_ewaldcoeff_lj(real rc, real dtol);
-/* Determines the Ewald parameters for LJ-PME */
-
-real
-do_ewald(t_inputrec *ir,
-         rvec x[],        rvec f[],
-         real chargeA[],  real chargeB[],
-         rvec box,
-         t_commrec *cr,  int natoms,
-         matrix lrvir,   real ewaldcoeff,
-         real lambda,    real *dvdlambda,
-         ewald_tab_t et);
-/* Do an Ewald calculation for the long range electrostatics. */
-
+/*! \brief Calculate long-range Ewald correction terms.
+ *
+ * For the group cutoff scheme (only), calculates the correction to
+ * the Ewald sums (electrostatic and/or LJ) due to pairs excluded from
+ * the long-ranged part.
+ *
+ * For both cutoff schemes, but only for Coulomb interactions,
+ * calculates correction for surface dipole terms. */
 void
 ewald_LRcorrection(int start, int end,
                    t_commrec *cr, int thread, t_forcerec *fr,
@@ -86,18 +73,6 @@ ewald_LRcorrection(int start, int end,
                    real *Vcorr_q, real *Vcorr_lj,
                    real lambda_q, real lambda_lj,
                    real *dvdlambda_q, real *dvdlambda_lj);
-/* Calculate the Long range correction to the Ewald sums,
- * electrostatic and/or LJ, due to excluded pairs and/or
- * surface dipole terms.
- */
-
-real
-ewald_charge_correction(t_commrec *cr, t_forcerec *fr, real lambda, matrix box,
-                        real *dvdlambda, tensor vir);
-/* Calculate the Long range correction to the Ewald sum,
- * due to a net system charge.
- * Should only be called on one thread.
- */
 
 #ifdef __cplusplus
 }
diff --git a/src/gromacs/ewald/pme-internal.h b/src/gromacs/ewald/pme-internal.h
new file mode 100644 (file)
index 0000000..b6d2bdd
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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.
+ */
+
+/* TODO This file is a temporary holding area for stuff local to the
+ * PME code, before it acquires some more normal ewald/file.c and
+ * ewald/file.h structure.  In future clean up, get rid of this file,
+ * to build more normal. */
+
+#ifndef GMX_EWALD_PME_INTERNAL_H
+#define GMX_EWALD_PME_INTERNAL_H
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/gmxcomplex.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int gmx_pme_reinit(gmx_pme_t *         pmedata,
+                   t_commrec *         cr,
+                   gmx_pme_t           pme_src,
+                   const t_inputrec *  ir,
+                   ivec                grid_size);
+/* As gmx_pme_init, but takes most settings, except the grid, from pme_src */
+
+/* The following three routines are for PME/PP node splitting in pme_pp.c */
+
+/* Abstract type for PME <-> PP communication */
+typedef struct gmx_pme_pp *gmx_pme_pp_t;
+
+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);
+/* 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.
+ */
+
+gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr);
+/* Initialize the PME-only side of the PME <-> PP communication */
+
+void gmx_pme_send_switchgrid(t_commrec *cr, ivec grid_size, real ewaldcoeff_q, real ewaldcoeff_lj);
+/* Tell our PME-only node to switch to a new grid size */
+
+/* Return values for gmx_pme_recv_q_x */
+enum {
+    pmerecvqxX,            /* calculate PME mesh interactions for new x    */
+    pmerecvqxFINISH,       /* the simulation should finish, we should quit */
+    pmerecvqxSWITCHGRID,   /* change the PME grid size                     */
+    pmerecvqxRESETCOUNTERS /* reset the cycle and flop counters            */
+};
+
+int gmx_pme_recv_coeffs_coords(gmx_pme_pp_t pme_pp,
+                               int *natoms,
+                               real **chargeA, real **chargeB,
+                               real **sqrt_c6A, real **sqrt_c6B,
+                               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_int64_t *step,
+                               ivec grid_size, real *ewaldcoeff_q, real *ewaldcoeff_lj);
+;
+/* With return value:
+ * pmerecvqxX:             all parameters set, chargeA and chargeB can be NULL
+ * pmerecvqxFINISH:        no parameters set
+ * pmerecvqxSWITCHGRID:    only grid_size and *ewaldcoeff are set
+ * pmerecvqxRESETCOUNTERS: *step is set
+ */
+
+void gmx_pme_send_force_vir_ener(gmx_pme_pp_t pme_pp,
+                                 rvec *f, matrix vir_q, real energy_q,
+                                 matrix vir_lj, real energy_lj,
+                                 real dvdlambda_q, real dvdlambda_lj,
+                                 float cycles);
+/* Send the PME mesh force, virial and energy to the PP-only nodes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 93%
rename from src/programs/mdrun/pme_loadbal.c
rename to src/gromacs/ewald/pme-load-balancing.c
index d6fd68f37269d10692d625172706519c053c2cf3..31d69e954dd7d0e4e4564d42e8c3d3dca2b51592 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include "gmxpre.h"
+
+#include "pme-load-balancing.h"
+
+#include "config.h"
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/ewald/pme-internal.h"
+#include "gromacs/legacyheaders/calcgrid.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "calcgrid.h"
-#include "pme.h"
-#include "vec.h"
-#include "domdec.h"
-#include "nbnxn_cuda_data_mgmt.h"
-#include "force.h"
-#include "macros.h"
-#include "md_logging.h"
-#include "pme_loadbal.h"
 
 /* Parameters and setting for one PP-PME setup */
 typedef struct {
@@ -436,17 +440,17 @@ static void switch_to_stage1(pme_load_balancing_t pme_lb)
     pme_lb->cur = pme_lb->start - 1;
 }
 
-gmx_bool pme_load_balance(pme_load_balancing_t pme_lb,
-                          t_commrec           *cr,
-                          FILE                *fp_err,
-                          FILE                *fp_log,
-                          t_inputrec          *ir,
-                          t_state             *state,
-                          double               cycles,
-                          interaction_const_t *ic,
-                          nonbonded_verlet_t  *nbv,
-                          gmx_pme_t           *pmedata,
-                          gmx_int64_t          step)
+gmx_bool pme_load_balance(pme_load_balancing_t        pme_lb,
+                          t_commrec                  *cr,
+                          FILE                       *fp_err,
+                          FILE                       *fp_log,
+                          t_inputrec                 *ir,
+                          t_state                    *state,
+                          double                      cycles,
+                          interaction_const_t        *ic,
+                          struct nonbonded_verlet_t  *nbv,
+                          gmx_pme_t                  *pmedata,
+                          gmx_int64_t                 step)
 {
     gmx_bool     OK;
     pme_setup_t *set;
@@ -698,30 +702,26 @@ gmx_bool pme_load_balance(pme_load_balancing_t pme_lb,
     }
 
     bUsesSimpleTables = uses_simple_tables(ir->cutoff_scheme, nbv, 0);
-    if (pme_lb->cutoff_scheme == ecutsVERLET &&
-        nbv->grp[0].kernel_type == nbnxnk8x8x8_CUDA)
-    {
-        nbnxn_cuda_pme_loadbal_update_param(nbv->cu_nbv, ic);
-
-        /* With tMPI + GPUs some ranks may be sharing GPU(s) and therefore
-         * also sharing texture references. To keep the code simple, we don't
-         * treat texture references as shared resources, but this means that
-         * the coulomb_tab texture ref will get updated by multiple threads.
-         * Hence, to ensure that the non-bonded kernels don't start before all
-         * texture binding operations are finished, we need to wait for all ranks
-         * to arrive here before continuing.
-         *
-         * Note that we could omit this barrier if GPUs are not shared (or
-         * texture objects are used), but as this is initialization code, there
-         * is not point in complicating things.
-         */
+    nbnxn_cuda_pme_loadbal_update_param(nbv, ic);
+
+    /* With tMPI + GPUs some ranks may be sharing GPU(s) and therefore
+     * also sharing texture references. To keep the code simple, we don't
+     * treat texture references as shared resources, but this means that
+     * the coulomb_tab texture ref will get updated by multiple threads.
+     * Hence, to ensure that the non-bonded kernels don't start before all
+     * texture binding operations are finished, we need to wait for all ranks
+     * to arrive here before continuing.
+     *
+     * Note that we could omit this barrier if GPUs are not shared (or
+     * texture objects are used), but as this is initialization code, there
+     * is not point in complicating things.
+     */
 #ifdef GMX_THREAD_MPI
-        if (PAR(cr))
-        {
-            gmx_barrier(cr);
-        }
-#endif  /* GMX_THREAD_MPI */
+    if (PAR(cr) && use_GPU(nbv))
+    {
+        gmx_barrier(cr);
     }
+#endif  /* GMX_THREAD_MPI */
 
     /* Usually we won't need the simple tables with GPUs.
      * But we do with hybrid acceleration and with free energy.
similarity index 72%
rename from src/programs/mdrun/pme_loadbal.h
rename to src/gromacs/ewald/pme-load-balancing.h
index f2b9f0152b8b01879869bad34afb0ca717a387dd..13261a8c1f14b192f897a62815995585cd6ff3d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _pme_loadbal_h
-#define _pme_loadbal_h
+#ifndef GMX_EWALD_PME_LOAD_BALANCING_H
+#define GMX_EWALD_PME_LOAD_BALANCING_H
+
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/state.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 typedef struct pme_load_balancing *pme_load_balancing_t;
 
@@ -56,17 +66,17 @@ void pme_loadbal_init(pme_load_balancing_t *pme_lb_p,
  * factors as well as DD load balancing.
  * Returns TRUE the load balancing continues, FALSE is the balancing is done.
  */
-gmx_bool pme_load_balance(pme_load_balancing_t pme_lb,
-                          t_commrec           *cr,
-                          FILE                *fp_err,
-                          FILE                *fp_log,
-                          t_inputrec          *ir,
-                          t_state             *state,
-                          double               cycles,
-                          interaction_const_t *ic,
-                          nonbonded_verlet_t  *nbv,
-                          gmx_pme_t           *pmedata,
-                          gmx_int64_t          step);
+gmx_bool pme_load_balance(pme_load_balancing_t        pme_lb,
+                          t_commrec                  *cr,
+                          FILE                       *fp_err,
+                          FILE                       *fp_log,
+                          t_inputrec                 *ir,
+                          t_state                    *state,
+                          double                      cycles,
+                          interaction_const_t        *ic,
+                          struct nonbonded_verlet_t  *nbv,
+                          gmx_pme_t                  *pmedata,
+                          gmx_int64_t                 step);
 
 /* Restart the PME load balancing discarding all timings gathered up till now */
 void restart_pme_loadbal(pme_load_balancing_t pme_lb, int n);
@@ -76,4 +86,8 @@ void pme_loadbal_done(pme_load_balancing_t pme_lb,
                       t_commrec *cr, FILE *fplog,
                       gmx_bool bNonBondedOnGPU);
 
-#endif /* _pme_loadbal_h */
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 98%
rename from src/gromacs/mdlib/pme_pp.c
rename to src/gromacs/ewald/pme-pp.c
index 0aee97b824d4376cc52e0cc23e3f3d6cc44f174a..cd1e4dbeb81125c65158010ed9ebed45d7c5ae6a 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "config.h"
 
+#include <math.h>
 #include <stdio.h>
 #include <string.h>
-#include <math.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "pme.h"
-#include "network.h"
-#include "domdec.h"
-#include "sighandler.h"
 
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/ewald/pme-internal.h"
+#include "gromacs/ewald/pme.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/sighandler.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
 
 enum {
     eCommType_ChargeA, eCommType_ChargeB, eCommType_SQRTC6A, eCommType_SQRTC6B,
similarity index 99%
rename from src/gromacs/mdlib/pme.c
rename to src/gromacs/ewald/pme.c
index 82b597d5f0c3eeea5fc1a180b9ed4497480f833c..3a5c710a957c3eb69330a6c192234c5371fc59d8 100644 (file)
  * /Erik 001109
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <assert.h>
-#include "typedefs.h"
-#include "txtdump.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "coulomb.h"
-#include "gmx_fatal.h"
 #include "pme.h"
-#include "network.h"
-#include "physics.h"
-#include "nrnb.h"
-#include "macros.h"
 
+#include "config.h"
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "gromacs/ewald/pme-internal.h"
+#include "gromacs/fft/fft.h"
 #include "gromacs/fft/parallel_3dfft.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/pdbio.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
 #include "gromacs/math/gmxcomplex.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
+/* Include the SIMD macro file and then check for support */
+#include "gromacs/simd/simd.h"
+#include "gromacs/simd/simd_math.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
+
+#ifdef DEBUG_PME
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
+#endif
 
-/* Include the SIMD macro file and then check for support */
-#include "gromacs/simd/simd.h"
-#include "gromacs/simd/simd_math.h"
 #ifdef GMX_SIMD_HAVE_REAL
 /* Turn on arbitrary width SIMD intrinsics for PME solve */
 #    define PME_SIMD_SOLVE
@@ -165,6 +177,8 @@ typedef struct {
     int recv_size;   /* Receive buffer width, used with OpenMP */
 } pme_grid_comm_t;
 
+typedef real *splinevec[DIM];
+
 typedef struct {
 #ifdef GMX_MPI
     MPI_Comm         mpi_comm;
@@ -1433,7 +1447,7 @@ static void spread_coefficients_bsplines_thread(pmegrid_t                    *pm
 #define PME_SPREAD_SIMD4_ALIGNED
 #define PME_ORDER 4
 #endif
-#include "pme_simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_BSPLINE(4);
 #endif
@@ -1442,7 +1456,7 @@ static void spread_coefficients_bsplines_thread(pmegrid_t                    *pm
 #ifdef PME_SIMD4_SPREAD_GATHER
 #define PME_SPREAD_SIMD4_ALIGNED
 #define PME_ORDER 5
-#include "pme_simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_BSPLINE(5);
 #endif
@@ -1742,7 +1756,7 @@ static void pmegrids_destroy(pmegrids_t *grids)
 
 static void realloc_work(pme_work_t *work, int nkx)
 {
-    int simd_width;
+    int simd_width, i;
 
     if (nkx > work->nalloc)
     {
@@ -1769,6 +1783,12 @@ static void realloc_work(pme_work_t *work, int nkx)
         snew_aligned(work->tmp2,  work->nalloc+simd_width, simd_width*sizeof(real));
         snew_aligned(work->eterm, work->nalloc+simd_width, simd_width*sizeof(real));
         srenew(work->m2inv, work->nalloc);
+#ifndef NDEBUG
+        for (i = 0; i < work->nalloc+simd_width; i++)
+        {
+            work->denom[i] = 1; /* init to 1 to avoid 1/0 exceptions of simd padded elements */
+        }
+#endif
     }
 }
 
@@ -2596,7 +2616,7 @@ static void gather_f_bsplines(gmx_pme_t pme, real *grid,
 #define PME_GATHER_F_SIMD4_ALIGNED
 #define PME_ORDER 4
 #endif
-#include "pme_simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_FSPLINE(4);
 #endif
@@ -2605,7 +2625,7 @@ static void gather_f_bsplines(gmx_pme_t pme, real *grid,
 #ifdef PME_SIMD4_SPREAD_GATHER
 #define PME_GATHER_F_SIMD4_ALIGNED
 #define PME_ORDER 5
-#include "pme_simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_FSPLINE(5);
 #endif
similarity index 63%
rename from src/gromacs/legacyheaders/pme.h
rename to src/gromacs/ewald/pme.h
index da0b4a1c5dfdaa325f17293d320b7e66b22ca805..708626b36bb73640fb3ab492ef3ea449880ff184 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _pme_h
-#define _pme_h
+#ifndef GMX_EWALD_PME_H
+#define GMX_EWALD_PME_H
 
 #include <stdio.h>
-#include "typedefs.h"
-#include "../math/gmxcomplex.h"
-#include "../timing/walltime_accounting.h"
-#include "../legacyheaders/network.h"
+
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef real *splinevec[DIM];
-
 enum {
     GMX_SUM_GRID_FORWARD, GMX_SUM_GRID_BACKWARD
 };
@@ -63,13 +68,6 @@ int gmx_pme_init(gmx_pme_t *pmedata, t_commrec *cr,
  * Return value 0 indicates all well, non zero is an error code.
  */
 
-int gmx_pme_reinit(gmx_pme_t *         pmedata,
-                   t_commrec *         cr,
-                   gmx_pme_t           pme_src,
-                   const t_inputrec *  ir,
-                   ivec                grid_size);
-/* As gmx_pme_init, but takes most settings, except the grid, from pme_src */
-
 int gmx_pme_destroy(FILE *log, gmx_pme_t *pmedata);
 /* Destroy the pme data structures resepectively.
  * Return value 0 indicates all well, non zero is an error code.
@@ -127,30 +125,6 @@ void gmx_pme_calc_energy(gmx_pme_t pme, int n, rvec *x, real *q, real *V);
  * Currently does not work in parallel or with free energy.
  */
 
-/* The following three routines are for PME/PP node splitting in pme_pp.c */
-
-/* Abstract type for PME <-> PP communication */
-typedef struct gmx_pme_pp *gmx_pme_pp_t;
-
-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);
-/* 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.
- */
-
-gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr);
-/* Initialize the PME-only side of the PME <-> PP communication */
-
 void gmx_pme_send_parameters(t_commrec *cr,
                              const interaction_const_t *ic,
                              gmx_bool bFreeEnergy_q, gmx_bool bFreeEnergy_lj,
@@ -170,9 +144,6 @@ void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
 void gmx_pme_send_finish(t_commrec *cr);
 /* Tell our PME-only node to finish */
 
-void gmx_pme_send_switchgrid(t_commrec *cr, ivec grid_size, real ewaldcoeff_q, real ewaldcoeff_lj);
-/* Tell our PME-only node to switch to a new grid size */
-
 void gmx_pme_send_resetcounters(t_commrec *cr, gmx_int64_t step);
 /* Tell our PME-only node to reset all cycle and flop counters */
 
@@ -183,41 +154,6 @@ void gmx_pme_receive_f(t_commrec *cr,
                        float *pme_cycles);
 /* PP nodes receive the long range forces from the PME nodes */
 
-/* Return values for gmx_pme_recv_q_x */
-enum {
-    pmerecvqxX,            /* calculate PME mesh interactions for new x    */
-    pmerecvqxFINISH,       /* the simulation should finish, we should quit */
-    pmerecvqxSWITCHGRID,   /* change the PME grid size                     */
-    pmerecvqxRESETCOUNTERS /* reset the cycle and flop counters            */
-};
-
-int gmx_pme_recv_coeffs_coords(gmx_pme_pp_t pme_pp,
-                               int *natoms,
-                               real **chargeA, real **chargeB,
-                               real **sqrt_c6A, real **sqrt_c6B,
-                               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_int64_t *step,
-                               ivec grid_size, real *ewaldcoeff_q, real *ewaldcoeff_lj);
-;
-/* With return value:
- * pmerecvqxX:             all parameters set, chargeA and chargeB can be NULL
- * pmerecvqxFINISH:        no parameters set
- * pmerecvqxSWITCHGRID:    only grid_size and *ewaldcoeff are set
- * pmerecvqxRESETCOUNTERS: *step is set
- */
-
-void gmx_pme_send_force_vir_ener(gmx_pme_pp_t pme_pp,
-                                 rvec *f, matrix vir_q, real energy_q,
-                                 matrix vir_lj, real energy_lj,
-                                 real dvdlambda_q, real dvdlambda_lj,
-                                 float cycles);
-/* Send the PME mesh force, virial and energy to the PP-only nodes */
-
 #ifdef __cplusplus
 }
 #endif
index cb5a51f736a77587c2354730a844cb46cd2809a8..60d6402d863b16b7fbe6aed14e51aa63e4016c69 100644 (file)
 
 # GLOB is used to get full paths
 file(GLOB FFT_SOURCES
-     fft.c fft5d.cpp parallel_3dfft.c)
+     fft.cpp fft5d.cpp parallel_3dfft.cpp)
 
 if (GMX_FFT_FFTPACK)
-    file(GLOB FFT_SPECIFIC_SOURCES fft_fftpack.c)
+    file(GLOB FFT_SPECIFIC_SOURCES fft_fftpack.cpp)
     list(APPEND FFT_SPECIFIC_SOURCES
          ${CMAKE_SOURCE_DIR}/src/external/fftpack/fftpack.c)
 endif()
@@ -45,15 +45,13 @@ if (GMX_FFT_FFTW3)
     file(GLOB FFT_SPECIFIC_SOURCES fft_fftw3.cpp)
 endif()
 if (GMX_FFT_MKL)
-    file(GLOB FFT_SPECIFIC_SOURCES fft_mkl.c)
+    file(GLOB FFT_SPECIFIC_SOURCES fft_mkl.cpp)
 endif()
 
 set(LIBGROMACS_SOURCES
     ${LIBGROMACS_SOURCES} ${FFT_SOURCES} ${FFT_SPECIFIC_SOURCES} PARENT_SCOPE)
 
-set(FFT_PUBLIC_HEADERS
-    fft.h)
-gmx_install_headers(fft ${FFT_PUBLIC_HEADERS})
+gmx_install_headers(fft.h)
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
similarity index 98%
rename from src/gromacs/fft/fft.c
rename to src/gromacs/fft/fft.cpp
index 591ff87e708fd9f4fedbcf4e239f65ef137f6ff7..2d8a81e17b58b2df9c82c4429eb7e1bbc966842f 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "fft.h"
+
+#include "config.h"
+
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 
-#include "types/simple.h"
-#include "gmx_fatal.h"
-#include "gromacs/fft/fft.h"
 #include "gromacs/math/gmxcomplex.h"
-
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 
 /* This file contains common fft utility functions, but not
  * the actual transform implementations. Check the
index ac575ac14ab4cb657bfffb5363bb2b6c051d25cd..69fe46289b18bfe3b73bc7d6354b3bade249d2ce 100644 (file)
@@ -54,8 +54,8 @@
 
 #include <stdio.h>
 
-#include "../legacyheaders/types/simple.h"
-#include "../math/gmxcomplex.h"
+#include "gromacs/math/gmxcomplex.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 94fde316da46617bedc65f40f2117a72855e52dd..93f518a85b680b9303b3a2ef236882474acebd7e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <algorithm>
+#include "fft5d.h"
 
+#include "config.h"
+
+#include <assert.h>
+#include <float.h>
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#include <algorithm>
+
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
+
 #ifdef NOGMX
 #define GMX_PARALLEL_ENV_INITIALIZED 1
 #else
@@ -52,8 +61,6 @@
 #endif
 #endif
 
-#include "gromacs/utility/gmxmpi.h"
-
 #ifdef GMX_OPENMP
 /* TODO: Do we still need this? Are we still planning ot use fftw + OpenMP? */
 #define FFT5D_THREADS
 /* #define FFT5D_FFTW_THREADS (now set by cmake) */
 #endif
 
-#include "fft5d.h"
-#include <float.h>
-#include <math.h>
-#include <assert.h>
-#include "gromacs/utility/smalloc.h"
-
 #ifndef __FLT_EPSILON__
 #define __FLT_EPSILON__ FLT_EPSILON
 #define __DBL_EPSILON__ DBL_EPSILON
 FILE* debug = 0;
 #endif
 
-#include "gmx_fatal.h"
-
-
 #ifdef GMX_FFT_FFTW3
 #include "thread_mpi/mutex.h"
+
 #include "gromacs/utility/exceptions.h"
 /* none of the fftw3 calls, except execute(), are thread-safe, so
    we need to serialize them with this mutex. */
@@ -1006,7 +1005,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
     s = 0;
 
     /*lin: x,y,z*/
-    if (plan->flags&FFT5D_DEBUG && thread == 0)
+    if ((plan->flags&FFT5D_DEBUG) && thread == 0)
     {
         print_localdata(lin, "%d %d: copy in lin\n", s, plan);
     }
@@ -1066,7 +1065,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
             time_fft += MPI_Wtime()-time;
         }
 #endif
-        if (plan->flags&FFT5D_DEBUG && thread == 0)
+        if ((plan->flags&FFT5D_DEBUG) && thread == 0)
         {
             print_localdata(lout, "%d %d: FFT %d\n", s, plan);
         }
@@ -1187,7 +1186,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
             time_local += MPI_Wtime()-time;
         }
 #endif
-        if (plan->flags&FFT5D_DEBUG && thread == 0)
+        if ((plan->flags&FFT5D_DEBUG) && thread == 0)
         {
             print_localdata(lin, "%d %d: tranposed %d\n", s+1, plan);
         }
@@ -1231,7 +1230,7 @@ void fft5d_execute(fft5d_plan plan, int thread, fft5d_time times)
     }
 #endif
 
-    if (plan->flags&FFT5D_DEBUG && thread == 0)
+    if ((plan->flags&FFT5D_DEBUG) && thread == 0)
     {
         print_localdata(lout, "%d %d: FFT %d\n", s, plan);
     }
index feab8329fa400e1ff49aca3014b79bd12778fd19..ba6753d473e453058e79caa75be20ce7f8fd537c 100644 (file)
@@ -36,9 +36,7 @@
 #ifndef FFT5D_H_
 #define FFT5D_H_
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #ifdef NOGMX
 /*#define GMX_MPI*/
similarity index 98%
rename from src/gromacs/fft/fft_fftpack.c
rename to src/gromacs/fft/fft_fftpack.cpp
index f56f40d0b0ba9492a68639e7234e57c7d59723c9..1301723da1aeddeceb2bc0b0cd00185c23907f9e 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <errno.h>
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-
-#include "gromacs/fft/fft.h"
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gmx_fatal.h"
 
 #include "external/fftpack/fftpack.h"
 
+#include "gromacs/fft/fft.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
+
 /*! \internal
  * \brief
  * Contents of the FFTPACK fft datatype.
index 16900074fa1e117f318a96a6ca658195b71f85bd..dee2ff284b473c41aa250438cbde4f824cf9dd53 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <errno.h>
 #include <stdlib.h>
 
 #include <fftw3.h>
 
+#include "thread_mpi/mutex.h"
+
 #include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
 
 #ifdef GMX_DOUBLE
 #define FFTWPREFIX(name) fftw_ ## name
@@ -51,9 +54,6 @@
 #define FFTWPREFIX(name) fftwf_ ## name
 #endif
 
-#include "thread_mpi/mutex.h"
-#include "gromacs/utility/exceptions.h"
-
 /* none of the fftw3 calls, except execute(), are thread-safe, so
    we need to serialize them with this mutex. */
 static tMPI::mutex big_fftw_mutex;
similarity index 99%
rename from src/gromacs/fft/fft_mkl.c
rename to src/gromacs/fft/fft_mkl.cpp
index e142c84d3bfbcd117bd6bf933584c88e7a76927b..fc9694e5eb91d08612e8d87034d791f29c2d1e34 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -33,9 +33,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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <errno.h>
 #include <stdlib.h>
@@ -44,7 +42,7 @@
 #include <mkl_service.h>
 
 #include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 /* For MKL version (<10.0), we should define MKL_LONG. */
similarity index 97%
rename from src/gromacs/fft/parallel_3dfft.c
rename to src/gromacs/fft/parallel_3dfft.cpp
index 7312cbedc79309abdb6fb5b3b9fc31ac0ed91766..3c04fb24fc57d7ad177f927519555b9c124ed735 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "parallel_3dfft.h"
+
+#include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
 
 #include "gromacs/fft/fft.h"
-#include "gromacs/fft/parallel_3dfft.h"
+#include "gromacs/fft/fft5d.h"
 #include "gromacs/math/gmxcomplex.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
-
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-
-#include "fft5d.h"
 
 struct gmx_parallel_3dfft  {
     fft5d_plan p1, p2;
@@ -133,7 +130,7 @@ gmx_parallel_3dfft_real_limits(gmx_parallel_3dfft_t      pfft_setup,
 
 static void reorder_ivec_yzx(ivec v)
 {
-    real tmp;
+    int tmp;
 
     tmp   = v[0];
     v[XX] = v[2];
index 7d4c0d84b37c27116be99cd5a567ccf9105325d7..145b0a97b7bb241ffa35f3f217125cdc5c5a5e64 100644 (file)
 #ifndef GMX_FFT_PARALLEL_3DFFT_H
 #define GMX_FFT_PARALLEL_3DFFT_H
 
-#include "../legacyheaders/types/nrnb.h"
-#include "../legacyheaders/types/simple.h"
-#include "../math/gmxcomplex.h"
-#include "../utility/gmxmpi.h"
-#include "fft.h"
+#include "gromacs/fft/fft.h"
+#include "gromacs/math/gmxcomplex.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index bc3dd9ce71e08c6fee8fcdc52732f283ca2c06cb..dfe4dbd3311a2ad01ac646e8c88457340e7b6141 100644 (file)
  * \author Roland Schulz <roland@utk.edu>
  * \ingroup module_fft
  */
+#include "gmxpre.h"
+
+#include "gromacs/fft/fft.h"
+
 #include <vector>
 
 #include <gtest/gtest.h>
 
-#include "gromacs/fft/fft.h"
 #include "gromacs/fft/parallel_3dfft.h"
 #include "gromacs/utility/stringutil.h"
 
@@ -90,11 +93,8 @@ class BaseFFTTest : public ::testing::Test
             // TODO: These tolerances are just something that has been observed
             // to be sufficient to pass the tests.  It would be nicer to
             // actually argue about why they are sufficient (or what is).
-#ifdef GMX_DOUBLE
-            checker_.setDefaultTolerance(gmx::test::relativeRealTolerance(10.0, 512));
-#else
-            checker_.setDefaultTolerance(gmx::test::relativeRealTolerance(10.0, 64));
-#endif
+            checker_.setDefaultTolerance(
+                    gmx::test::relativeToleranceAsPrecisionDependentUlp(10.0, 64, 512));
         }
         ~BaseFFTTest()
         {
index 7d3d02c5f75d4a0dbf3dd8ec0e9b75aaf906e002..0c638a78a8b7e026bb47f96b48ff3bca28d3bd9b 100644 (file)
@@ -42,14 +42,14 @@ endif()
 
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${FILEIO_SOURCES} PARENT_SCOPE)
 
-set(FILEIO_PUBLIC_HEADERS
+gmx_install_headers(
     confio.h
     enxio.h
     filenm.h
-    futil.h
     gmxfio.h
     matio.h
     mdoutf.h
+    mtxio.h
     pdbio.h
     tpxio.h
     trajectory_writing.h
@@ -58,8 +58,8 @@ set(FILEIO_PUBLIC_HEADERS
     trxio.h
     xdr_datatype.h
     xtcio.h
+    xvgr.h
     )
-gmx_install_headers(fileio ${FILEIO_PUBLIC_HEADERS})
 
 if (GMX_USE_TNG AND TNG_IO_DEFINITIONS)
     set_property(SOURCE tngio.cpp
index 18cf7a1c5936996849a5ced67aceba01d340679b..ef01aa45f771f253c55c0b94b7ee93e5ce333e86 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "confio.h"
 
-#include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
 #include <errno.h>
-#include "macros.h"
+#include <math.h>
+#include <stdio.h>
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
-#include "confio.h"
-#include "vec.h"
-#include "symtab.h"
-#include "futil.h"
-#include "xdrf.h"
-#include "filenm.h"
-#include "pdbio.h"
-#include "tpxio.h"
-#include "trxio.h"
-#include "gmx_fatal.h"
-#include "copyrite.h"
-#include "pbc.h"
-#include "mtop_util.h"
-#include "gmxfio.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define CHAR_SHIFT 24
 
@@ -254,7 +255,7 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr, char *line)
         if (fr->title == NULL)
         {
             fgets2(line, STRLEN, fp);
-            fr->title = strdup(line);
+            fr->title = gmx_strdup(line);
         }
         bEnd = FALSE;
         while (!bEnd && fgets2(line, STRLEN, fp))
@@ -1145,6 +1146,18 @@ static void read_whole_conf(const char *infile, char *title,
     gmx_fio_fclose(in);
 }
 
+static gmx_bool gmx_one_before_eof(FILE *fp)
+{
+    char     data[4];
+    gmx_bool beof;
+
+    if ((beof = fread(data, 1, 1, fp)) == 1)
+    {
+        gmx_fseek(fp, -1, SEEK_CUR);
+    }
+    return !beof;
+}
+
 gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr)
 {
     t_atoms  atoms;
@@ -1153,7 +1166,7 @@ gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr)
     double   tt;
     int      ndec = 0, i;
 
-    if (gmx_eof(status))
+    if (gmx_one_before_eof(status))
     {
         return FALSE;
     }
@@ -1470,8 +1483,6 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
             gmx_fio_fclose(out);
             break;
         case efTPR:
-        case efTPB:
-        case efTPA:
             gmx_fatal(FARGS, "Sorry, can not write a topology to %s", outfile);
             break;
         default:
@@ -1525,8 +1536,6 @@ void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
             gmx_fio_fclose(out);
             break;
         case efTPR:
-        case efTPB:
-        case efTPA:
             gmx_fatal(FARGS, "Sorry, can not write a topology to %s", outfile);
             break;
         default:
@@ -1598,8 +1607,6 @@ void get_stx_coordnum(const char *infile, int *natoms)
         case efESP:
             *natoms = get_espresso_coordnum(infile);
             break;
-        case efTPA:
-        case efTPB:
         case efTPR:
         {
             t_tpxheader tpx;
@@ -1668,8 +1675,6 @@ void read_stx_conf(const char *infile, char *title, t_atoms *atoms,
             read_espresso_conf(infile, atoms, x, v, box);
             break;
         case efTPR:
-        case efTPB:
-        case efTPA:
             snew(mtop, 1);
             i = read_tpx(infile, NULL, box, &natoms, x, v, NULL, mtop);
             if (ePBC)
index b1d37770d8d43bfab0b6ed8a7be8d4b6961b24c1..2b149c23a82b59884c77e6b218554834b8e03e24 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_FILEIO_CONFIO_H
 #define GMX_FILEIO_CONFIO_H
 
+#include <stdio.h>
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 /* For reading coordinate files it is assumed that enough memory
  * has been allocated beforehand.
@@ -48,6 +50,9 @@
 extern "C" {
 #endif
 
+struct gmx_mtop_t;
+struct t_atoms;
+
 int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr, char *line);
 /* read a Gromos96 coordinate or trajectory file,                       *
  * returns the number of atoms                                          *
@@ -66,29 +71,29 @@ gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr);
 int gro_first_x_or_v(FILE *status, t_trxframe *fr);
 /* read first/next x and/or v frame from gro file */
 
-void write_hconf_indexed_p(FILE *out, const char *title, t_atoms *atoms,
+void write_hconf_indexed_p(FILE *out, const char *title, struct t_atoms *atoms,
                            int nx, const atom_id index[], int ndec,
                            rvec *x, rvec *v, matrix box);
 
-void write_hconf_p(FILE *out, const char *title, t_atoms *atoms, int ndec,
+void write_hconf_p(FILE *out, const char *title, struct t_atoms *atoms, int ndec,
                    rvec *x, rvec *v, matrix box);
 /* Write a Gromos file with precision ndec: number of decimal places in x,
  * v has one place more. */
 
 void write_sto_conf_indexed(const char *outfile, const char *title,
-                            t_atoms *atoms,
+                            struct t_atoms *atoms,
                             rvec x[], rvec *v, int ePBC, matrix box,
                             atom_id nindex, atom_id index[]);
 /* like write_sto_conf, but indexed */
 
 void write_sto_conf(const char *outfile, const char *title,
-                    t_atoms *atoms,
+                    struct t_atoms *atoms,
                     rvec x[], rvec *v, int ePBC, matrix box);
 /* write atoms, x, v (if .gro and not NULL) and box (if not NULL)
  * to an STO (.gro or .pdb) file */
 
 void write_sto_conf_mtop(const char *outfile, const char *title,
-                         gmx_mtop_t *mtop,
+                         struct gmx_mtop_t *mtop,
                          rvec x[], rvec *v, int ePBC, matrix box);
 /* As write_sto_conf, but uses a gmx_mtop_t struct */
 
@@ -96,7 +101,7 @@ void get_stx_coordnum (const char *infile, int *natoms);
 /* read the number of atoms from an STX file */
 
 void read_stx_conf(const char *infile, char *title,
-                   t_atoms *atoms,
+                   struct t_atoms *atoms,
                    rvec x[], rvec *v, int *ePBC, matrix box);
 /* Read atoms, x, v and box from an STX file.
  * If ePBC!=NULL return the type of pbc in *ePBC or -1 if unknown.
index 1a7585f3fbaf2141c44f9bcf68682ade01a883d8..c9b34b1da1f0538caabee990e9f9d6e0caaa1c46 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "enxio.h"
 
+#include <stdlib.h>
 #include <string.h>
 
-#include "futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmxfio.h"
-#include "enxio.h"
-#include "vec.h"
-#include "xdrf.h"
-#include "macros.h"
 
 /* The source code in this file should be thread-safe.
          Please keep it that way. */
@@ -110,31 +112,31 @@ static void enxsubblock_free(t_enxsubblock *sb)
 {
     if (sb->fval_alloc)
     {
-        free(sb->fval);
+        sfree(sb->fval);
         sb->fval_alloc = 0;
         sb->fval       = NULL;
     }
     if (sb->dval_alloc)
     {
-        free(sb->dval);
+        sfree(sb->dval);
         sb->dval_alloc = 0;
         sb->dval       = NULL;
     }
     if (sb->ival_alloc)
     {
-        free(sb->ival);
+        sfree(sb->ival);
         sb->ival_alloc = 0;
         sb->ival       = NULL;
     }
     if (sb->lval_alloc)
     {
-        free(sb->lval);
+        sfree(sb->lval);
         sb->lval_alloc = 0;
         sb->lval       = NULL;
     }
     if (sb->cval_alloc)
     {
-        free(sb->cval);
+        sfree(sb->cval);
         sb->cval_alloc = 0;
         sb->cval       = NULL;
     }
@@ -146,10 +148,10 @@ static void enxsubblock_free(t_enxsubblock *sb)
         {
             if (sb->sval[i])
             {
-                free(sb->sval[i]);
+                sfree(sb->sval[i]);
             }
         }
-        free(sb->sval);
+        sfree(sb->sval);
         sb->sval_alloc = 0;
         sb->sval       = NULL;
     }
@@ -231,7 +233,7 @@ static void enxblock_free(t_enxblock *eb)
         {
             enxsubblock_free(&(eb->sub[i]));
         }
-        free(eb->sub);
+        sfree(eb->sub);
         eb->nsub_alloc = 0;
         eb->sub        = NULL;
     }
@@ -265,7 +267,7 @@ void free_enxframe(t_enxframe *fr)
     {
         enxblock_free(&(fr->block[b]));
     }
-    free(fr->block);
+    sfree(fr->block);
 }
 
 void add_blocks_enxframe(t_enxframe *fr, int n)
@@ -372,7 +374,7 @@ static void edr_strings(XDR *xdr, gmx_bool bRead, int file_version,
         }
         else
         {
-            nm->unit = strdup("kJ/mol");
+            nm->unit = gmx_strdup("kJ/mol");
         }
     }
 }
@@ -920,7 +922,6 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr)
     int           i, b;
     gmx_bool      bRead, bOK, bOK1, bSane;
     real          tmp1, tmp2, rdum;
-    char          buf[22];
     /*int       d_size;*/
 
     bOK   = TRUE;
@@ -973,9 +974,9 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr)
     {
         fprintf(stderr, "\nWARNING: there may be something wrong with energy file %s\n",
                 gmx_fio_getname(ef->fio));
-        fprintf(stderr, "Found: step=%s, nre=%d, nblock=%d, time=%g.\n"
+        fprintf(stderr, "Found: step=%"GMX_PRId64 ", nre=%d, nblock=%d, time=%g.\n"
                 "Trying to skip frame expect a crash though\n",
-                gmx_step_str(fr->step, buf), fr->nre, fr->nblock, fr->t);
+                fr->step, fr->nre, fr->nblock, fr->t);
     }
     if (bRead && fr->nre > fr->e_alloc)
     {
index 922467a0cc3d40756fc45127fb5511438bb35333..c8434ab2b53135cb6b2c2639b5b4f75f9f14509e 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_FILEIO_ENXIO_H
 #define GMX_FILEIO_ENXIO_H
 
-#include "../legacyheaders/typedefs.h"
-#include "../legacyheaders/pbc.h"
-#include "gmxfio.h"
-#include "xdr_datatype.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xdr_datatype.h"
+#include "gromacs/legacyheaders/types/energy.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/state.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_groups_t;
+
 /**************************************************************
  * These are the base datatypes + functions for reading and
  * writing energy files (.edr). They are either called directly
@@ -185,7 +188,7 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr);
 /* Reads enx_frames, memory in fr is (re)allocated if necessary */
 
 void get_enx_state(const char *fn, real t,
-                   gmx_groups_t *groups, t_inputrec *ir,
+                   struct gmx_groups_t *groups, t_inputrec *ir,
                    t_state *state);
 /*
  * Reads state variables from enx file fn at time t.
index 62f4521d86fc3b3e9b664dac290d898e73f0e6f5..782424df600a423c45856ff35feda0a4e24b246c 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.
  */
-#include "filenm.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "filenm.h"
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 
-#include "futil.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
-#include "types/simple.h"
-#include "types/commrec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* XDR should be available on all platforms now,
  * but we keep the possibility of turning it off...
@@ -60,9 +56,6 @@
 /* Use bitflag ... */
 #define IS_SET(fn) ((fn.flag & ffSET) != 0)
 #define IS_OPT(fn) ((fn.flag & ffOPT) != 0)
-#define IS_MULT(fn) ((fn.flag & ffMULT) != 0)
-#define UN_SET(fn) (fn.flag = (fn.flag & ~ffSET))
-#define DO_SET(fn) (fn.flag = (fn.flag |  ffSET))
 
 enum
 {
@@ -77,7 +70,7 @@ static const int trxs[] =
 #ifdef USE_XDR
     efXTC, efTRR, efCPT,
 #endif
-    efTRJ, efGRO, efG96, efPDB, efTNG
+    efGRO, efG96, efPDB, efTNG
 };
 #define NTRXS asize(trxs)
 
@@ -95,7 +88,7 @@ static const int tros[] =
 #ifdef USE_XDR
     efXTC, efTRR,
 #endif
-    efTRJ, efGRO, efG96, efPDB, efTNG
+    efGRO, efG96, efPDB, efTNG
 };
 #define NTROS asize(tros)
 
@@ -104,7 +97,7 @@ static const int trns[] =
 #ifdef USE_XDR
     efTRR, efCPT,
 #endif
-    efTRJ, efTNG
+    efTNG
 };
 #define NTRNS asize(trns)
 
@@ -114,29 +107,19 @@ static const int stos[] =
 
 static const int stxs[] =
 {
-    efGRO, efG96, efPDB, efBRK, efENT, efESP,
+    efGRO, efG96, efPDB, efBRK, efENT, efESP
 #ifdef USE_XDR
-    efTPR,
+    , efTPR
 #endif
-    efTPB, efTPA
 };
 #define NSTXS asize(stxs)
 
-static const int tpxs[] =
-{
-#ifdef USE_XDR
-    efTPR,
-#endif
-    efTPB, efTPA
-};
-#define NTPXS asize(tpxs)
-
 static const int tpss[] =
 {
 #ifdef USE_XDR
     efTPR,
 #endif
-    efTPB, efTPA, efGRO, efG96, efPDB, efBRK, efENT
+    efGRO, efG96, efPDB, efBRK, efENT
 };
 #define NTPSS asize(tpss)
 
@@ -161,7 +144,6 @@ static const t_deffile
     { eftGEN, ".???", "traj", NULL,
       "Full precision trajectory", NTRNS, trns },
     { eftXDR, ".trr", "traj", NULL, "Trajectory in portable xdr format" },
-    { eftBIN, ".trj", "traj", NULL, "Trajectory file (architecture specific)" },
     { eftGEN, ".???", "traj_comp", NULL,
       "Compressed trajectory (tng format or portable xdr format)", NTRCOMPRESSED, trcompressed},
     { eftXDR, ".xtc", "traj", NULL,
@@ -185,11 +167,8 @@ static const t_deffile
     { eftASC, ".ndx", "index",  "-n", "Index file", },
     { eftASC, ".top", "topol",  "-p", "Topology file"},
     { eftASC, ".itp", "topinc", NULL, "Include file for topology"},
-    { eftGEN, ".???", "topol", "-s", "Run input file", NTPXS, tpxs },
     { eftGEN, ".???", "topol", "-s", "Structure+mass(db)", NTPSS, tpss },
     { eftXDR, ".tpr", "topol",  "-s", "Portable xdr run input file"},
-    { eftASC, ".tpa", "topol",  "-s", "Ascii run input file"},
-    { eftBIN, ".tpb", "topol",  "-s", "Binary 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" },
@@ -237,8 +216,6 @@ const char *ftp2ext_generic(int ftp)
                 return "sto";
             case efSTX:
                 return "stx";
-            case efTPX:
-                return "tpx";
             case efTPS:
                 return "tps";
             default:
@@ -335,26 +312,15 @@ const char *ftp2defnm(int ftp)
     }
 }
 
-static void check_opts(int nf, t_filenm fnm[])
+const char *ftp2defopt(int ftp)
 {
-    int              i;
-    const t_deffile *df;
-
-    for (i = 0; (i < nf); i++)
+    if ((0 <= ftp) && (ftp < efNR))
     {
-        df = &(deffile[fnm[i].ftp]);
-        if (fnm[i].opt == NULL)
-        {
-            if (df->defopt == NULL)
-            {
-                gmx_fatal(FARGS, "No default cmd-line option for %s (type %d)\n",
-                          deffile[fnm[i].ftp].ext, fnm[i].ftp);
-            }
-            else
-            {
-                fnm[i].opt = df->defopt;
-            }
-        }
+        return deffile[ftp].defopt;
+    }
+    else
+    {
+        return NULL;
     }
 }
 
@@ -393,246 +359,6 @@ int fn2ftp(const char *fn)
     return i;
 }
 
-static void set_extension(char *buf, int ftp)
-{
-    int              len, extlen;
-    const t_deffile *df;
-
-    /* check if extension is already at end of filename */
-    df     = &(deffile[ftp]);
-    len    = strlen(buf);
-    extlen = strlen(df->ext);
-    if ((len <= extlen) || (gmx_strcasecmp(&(buf[len - extlen]), df->ext) != 0))
-    {
-        strcat(buf, df->ext);
-    }
-}
-
-static void add_filenm(t_filenm *fnm, const char *filenm)
-{
-    srenew(fnm->fns, fnm->nfiles+1);
-    fnm->fns[fnm->nfiles] = strdup(filenm);
-    fnm->nfiles++;
-}
-
-static void set_grpfnm(t_filenm *fnm, const char *name, const char *deffnm)
-{
-    char       buf[256], buf2[256];
-    int        i, type;
-    gmx_bool   bValidExt;
-    int        nopts;
-    const int *ftps;
-
-    nopts = deffile[fnm->ftp].ntps;
-    ftps  = deffile[fnm->ftp].tps;
-    if ((nopts == 0) || (ftps == NULL))
-    {
-        gmx_fatal(FARGS, "nopts == 0 || ftps == NULL");
-    }
-
-    bValidExt = FALSE;
-    if (name && deffnm == NULL)
-    {
-        strcpy(buf, name);
-        /* First check whether we have a valid filename already */
-        type = fn2ftp(name);
-        if ((fnm->flag & ffREAD) && (fnm->ftp == efTRX))
-        {
-            /*if file exist don't add an extension for trajectory reading*/
-            bValidExt = gmx_fexist(name);
-        }
-        for (i = 0; (i < nopts) && !bValidExt; i++)
-        {
-            if (type == ftps[i])
-            {
-                bValidExt = TRUE;
-            }
-        }
-    }
-    else if (deffnm != NULL)
-    {
-        strcpy(buf, deffnm);
-    }
-    else
-    {
-        /* No name given, set the default name */
-        strcpy(buf, ftp2defnm(fnm->ftp));
-    }
-
-    if (!bValidExt && (fnm->flag & ffREAD))
-    {
-        /* for input-files only: search for filenames in the directory */
-        for (i = 0; (i < nopts) && !bValidExt; i++)
-        {
-            type = ftps[i];
-            strcpy(buf2, buf);
-            set_extension(buf2, type);
-            if (gmx_fexist(buf2))
-            {
-                bValidExt = TRUE;
-                strcpy(buf, buf2);
-            }
-        }
-    }
-
-    if (!bValidExt)
-    {
-        /* Use the first extension type */
-        set_extension(buf, ftps[0]);
-    }
-
-    add_filenm(fnm, buf);
-}
-
-static void set_filenm(t_filenm *fnm, const char *name, const char *deffnm,
-                       gmx_bool bReadNode)
-{
-    /* Set the default filename, extension and option for those fields that
-     * are not already set. An extension is added if not present, if fn = NULL
-     * or empty, the default filename is given.
-     */
-    char buf[256];
-    int  i, len, extlen;
-
-    if ((fnm->flag & ffREAD) && !bReadNode)
-    {
-        return;
-    }
-
-    if ((fnm->ftp < 0) || (fnm->ftp >= efNR))
-    {
-        gmx_fatal(FARGS, "file type out of range (%d)", fnm->ftp);
-    }
-
-    if (name)
-    {
-        strcpy(buf, name);
-    }
-    if ((fnm->flag & ffREAD) && name && gmx_fexist(name))
-    {
-        /* check if filename ends in .gz or .Z, if so remove that: */
-        len = strlen(name);
-        for (i = 0; i < NZEXT; i++)
-        {
-            extlen = strlen(z_ext[i]);
-            if (len > extlen)
-            {
-                if (gmx_strcasecmp(name+len-extlen, z_ext[i]) == 0)
-                {
-                    buf[len-extlen] = '\0';
-                    break;
-                }
-            }
-        }
-    }
-
-    if (deffile[fnm->ftp].ntps)
-    {
-        set_grpfnm(fnm, name ? buf : NULL, deffnm);
-    }
-    else
-    {
-        if (name == NULL || deffnm != NULL)
-        {
-            if (deffnm != NULL)
-            {
-                strcpy(buf, deffnm);
-            }
-            else
-            {
-                strcpy(buf, ftp2defnm(fnm->ftp));
-            }
-        }
-        set_extension(buf, fnm->ftp);
-
-        add_filenm(fnm, buf);
-    }
-}
-
-static void set_filenms(int nf, t_filenm fnm[], const char *deffnm, gmx_bool bReadNode)
-{
-    int i;
-
-    for (i = 0; (i < nf); i++)
-    {
-        if (!IS_SET(fnm[i]))
-        {
-            set_filenm(&(fnm[i]), fnm[i].fn, deffnm, bReadNode);
-        }
-    }
-}
-
-void parse_file_args(int *argc, char *argv[], int nf, t_filenm fnm[],
-                     const char *deffnm, gmx_bool bReadNode)
-{
-    int       i, j;
-    gmx_bool *bRemove;
-
-    check_opts(nf, fnm);
-
-    for (i = 0; (i < nf); i++)
-    {
-        UN_SET(fnm[i]);
-    }
-
-    if (*argc > 1)
-    {
-        snew(bRemove, (*argc)+1);
-        i = 1;
-        do
-        {
-            for (j = 0; (j < nf); j++)
-            {
-                if (strcmp(argv[i], fnm[j].opt) == 0)
-                {
-                    DO_SET(fnm[j]);
-                    bRemove[i] = TRUE;
-                    i++;
-                    /* check if we are out of arguments for this option */
-                    if ((i >= *argc) || (argv[i][0] == '-'))
-                    {
-                        set_filenm(&fnm[j], fnm[j].fn, deffnm, bReadNode);
-                    }
-                    /* sweep up all file arguments for this option */
-                    while ((i < *argc) && (argv[i][0] != '-'))
-                    {
-                        set_filenm(&fnm[j], argv[i], NULL, bReadNode);
-                        bRemove[i] = TRUE;
-                        i++;
-                        /* only repeat for 'multiple' file options: */
-                        if (!IS_MULT(fnm[j]))
-                        {
-                            break;
-                        }
-                    }
-
-                    break; /* jump out of 'j' loop */
-                }
-            }
-            /* No file found corresponding to option argv[i] */
-            if (j == nf)
-            {
-                i++;
-            }
-        }
-        while (i < *argc);
-
-        /* Remove used entries */
-        for (i = j = 0; (i <= *argc); i++)
-        {
-            if (!bRemove[i])
-            {
-                argv[j++] = argv[i];
-            }
-        }
-        (*argc) = j - 1;
-        sfree(bRemove);
-    }
-
-    set_filenms(nf, fnm, deffnm, bReadNode);
-
-}
-
 const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
 {
     int i;
@@ -817,8 +543,8 @@ int add_suffix_to_output_names(t_filenm *fnm, int nfile, const char *suffix)
                 extpos  = strrchr(buf, '.');
                 *extpos = '\0';
                 sprintf(newname, "%s%s.%s", buf, suffix, extpos + 1);
-                free(fnm[i].fns[j]);
-                fnm[i].fns[j] = strdup(newname);
+                sfree(fnm[i].fns[j]);
+                fnm[i].fns[j] = gmx_strdup(newname);
             }
         }
     }
@@ -836,7 +562,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
         ret[i] = tfn[i]; /* just directly copy all non-string fields */
         if (tfn[i].opt)
         {
-            ret[i].opt = strdup(tfn[i].opt);
+            ret[i].opt = gmx_strdup(tfn[i].opt);
         }
         else
         {
@@ -845,7 +571,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
 
         if (tfn[i].fn)
         {
-            ret[i].fn = strdup(tfn[i].fn);
+            ret[i].fn = gmx_strdup(tfn[i].fn);
         }
         else
         {
@@ -857,7 +583,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
             snew(ret[i].fns, tfn[i].nfiles);
             for (j = 0; j < tfn[i].nfiles; j++)
             {
-                ret[i].fns[j] = strdup(tfn[i].fns[j]);
+                ret[i].fns[j] = gmx_strdup(tfn[i].fns[j]);
             }
         }
     }
index 12933f6315fd18cd71645fa0f367a9f934d9ebd9..dbd2bf730b3d3c044736482b8a4e0ad28e57c7a0 100644 (file)
@@ -3,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,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.
@@ -38,7 +38,8 @@
 #ifndef GMX_FILEIO_FILENM_H
 #define GMX_FILEIO_FILENM_H
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -47,14 +48,14 @@ extern "C" {
 /* this enum should correspond to the array deffile in gmxlib/filenm.c */
 enum {
     efMDP,
-    efTRX, efTRO, efTRN, efTRR, efTRJ, efCOMPRESSED, efXTC, efTNG,
+    efTRX, efTRO, efTRN, efTRR, efCOMPRESSED, efXTC, efTNG,
     efEDR,
     efSTX, efSTO, efGRO, efG96, efPDB, efBRK, efENT, efESP, efPQR,
     efCPT,
     efLOG, efXVG, efOUT,
     efNDX,
     efTOP, efITP,
-    efTPX, efTPS, efTPR, efTPA, efTPB,
+    efTPS, efTPR,
     efTEX, efRTP, efATP, efHDB,
     efDAT, efDLG,
     efMAP, efEPS, efMAT, efM2P,
@@ -81,6 +82,7 @@ typedef struct {
 #define ffOPT   1<<3
 #define ffLIB   1<<4
 #define ffMULT  1<<5
+#define ffALLOW_MISSING 1<<6
 #define ffRW    (ffREAD | ffWRITE)
 #define ffOPTRD (ffREAD | ffOPT)
 #define ffOPTWR (ffWRITE| ffOPT)
@@ -114,14 +116,12 @@ const char *ftp2desc(int ftp);
 const char *ftp2defnm(int ftp);
 /* Return default file name for file type */
 
+const char *ftp2defopt(int ftp);
+/* Return default option name for file type */
+
 const char *ftp2ftype(int ftp);
 /* Return Binary or ASCII depending on file type */
 
-void parse_file_args(int *argc, char *argv[], int nf, t_filenm fnm[],
-                     const char *deffnm, gmx_bool bReadNode);
-/* Parse command line for file names. When bKeep is set args are
- * not removed from argv. */
-
 const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[]);
 /* Return the filename belonging to cmd-line option opt, or NULL when
  * no such option. */
diff --git a/src/gromacs/fileio/futil.h b/src/gromacs/fileio/futil.h
deleted file mode 100644 (file)
index ddaaef1..0000000
+++ /dev/null
@@ -1,183 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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_FUTIL_H
-#define GMX_FILEIO_FUTIL_H
-
-#include <stdio.h>
-#include "../legacyheaders/typedefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-/* Native windows uses backslash path separators.
- * Cygwin and everybody else in the world use slash.
- */
-#include "../utility/gmx_header_config.h"
-#ifdef GMX_NATIVE_WINDOWS
-#define DIR_SEPARATOR '\\'
-#else
-#define DIR_SEPARATOR '/'
-#endif
-
-/* Now get the maximum path size. */
-#ifdef PATH_MAX
-#  define GMX_PATH_MAX PATH_MAX
-#elif defined MAX_PATH
-#  define GMX_PATH_MAX MAX_PATH
-#else
-#  define GMX_PATH_MAX 4096
-#endif
-
-typedef gmx_int64_t    gmx_off_t;
-
-void no_buffers(void);
-/* Turn off buffering of files (which is default) for debugging purposes */
-
-gmx_bool gmx_fexist(const char *fname);
-/* Return TRUE when fname exists, FALSE otherwise */
-
-gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr);
-/* Return TRUE when fname exists, FALSE otherwise, bcast from master to others */
-
-gmx_bool gmx_eof(FILE *fp);
-/* Return TRUE on end-of-file, FALSE otherwise */
-
-gmx_bool is_pipe(FILE *fp);
-/* Check whether the file (opened by gmx_ffopen) is a pipe */
-
-/*  Make a backup of file if necessary.
-    Return false if there was a problem.
- */
-gmx_bool make_backup(const char * file);
-
-FILE *gmx_ffopen(const char *file, const char *mode);
-/* Return a valid file pointer when successful, exits otherwise
- * If the file is in compressed format, open a pipe which uncompresses
- * the file! Therefore, files must be closed with gmx_ffclose (see below)
- */
-
-int gmx_ffclose(FILE *fp);
-/* Close files or pipes */
-
-
-void frewind(FILE *fp);
-/* Does not rewind pipes, but does so for normal files */
-
-#define rewind frewind
-
-
-int gmx_fseek(FILE *stream, gmx_off_t offset, int whence);
-/* OS-independent fseek. 64-bit when available */
-
-gmx_off_t gmx_ftell(FILE *stream);
-/* OS-independent fseek. 64-bit when available. */
-
-
-gmx_bool is_pipe(FILE *fp);
-
-char *gmxlibfn(const char *file);
-/* allocates and returns a string with the full file name for a library file */
-
-FILE *libopen(const char *file);
-/* Open a library file for reading. This looks in the current directory
- * first, and then in the library directory. If the file is not found,
- * it terminates with a fatal_error
- */
-
-/* Opaque data type to list directories */
-typedef struct gmx_directory *
-    gmx_directory_t;
-
-/* Open a directory for reading. The first argument should be a pointer
- * to a declared gmx_directory_t variable. Returns 0 on success.
- */
-int
-gmx_directory_open(gmx_directory_t *p_gmxdir, const char *dirname);
-
-
-/* Given an initialized gmx_directory_t, if there are more files in
- * the directory this routine returns 0 and write the next name
- * into the USER-PROVIDED buffer name. The last argument is the max
- * number of characters that will be written. Just as strncpy, the
- * string will NOT be terminated it it is longer than maxlength_name.
- */
-int
-gmx_directory_nextfile(gmx_directory_t gmxdir, char *name, int maxlength_name);
-
-/* Release all data for a directory structure */
-int
-gmx_directory_close(gmx_directory_t gmxdir);
-
-
-char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal);
-
-FILE *low_libopen(const char *file, gmx_bool bFatal);
-/* The same as the above, but does not terminate if (!bFatal) */
-
-/* Create unique name for temp file (wrapper around mkstemp).
- * Buf should be at least 7 bytes long
- */
-void gmx_tmpnam(char *buf);
-
-/* truncte the file to the specified length */
-int gmx_truncatefile(char *path, gmx_off_t length);
-
-/* rename/move the file (atomically, if the OS makes that available) oldname
-   to newname */
-int gmx_file_rename(const char *oldname, const char *newname);
-
-/* copy the file (data only) oldname to newname. if copy_if_empty==FALSE,
-   the file won't be copied if it's empty.*/
-int gmx_file_copy(const char *oldname, const char *newname, gmx_bool copy_if_empty);
-
-/* do an fsync() on an open file pointer.
-   Only use this during checkpointing! */
-int gmx_fsync(FILE *fp);
-
-void gmx_chdir(const char *directory);
-void gmx_getcwd(char *buffer, size_t size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* GMX_FILEIO_FUTIL_H */
index 0bee3665fe8ff68198180ae8f5266333fd11e9d6..9839291218526b1bbfa188a44f7795ec8d5bfc73 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #ifdef GMX_INTERNAL_XDR
 
 
-#include <stdlib.h>
+#include "gmx_system_xdr.h"
+
 #include <limits.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "gmx_system_xdr.h"
-
 
 /* NB - THIS FILE IS ONLY USED ON MICROSOFT WINDOWS, since that
  * system doesn't provide any standard XDR system libraries. It will
index d9909d56ac46f5a2dedbfc8570d379445eeeb50d..dc204ec69780e9c990fb7618214383569f8ddcc9 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gmxfio.h"
+
+#include "config.h"
 
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
 
 #include "thread_mpi/threads.h"
 
-#include "gmx_fatal.h"
-#include "macros.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio_int.h"
+#include "gromacs/fileio/md5.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
-#include "filenm.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gmxfio.h"
-#include "md5.h"
-
-#include "gmxfio_int.h"
+#include "gromacs/utility/snprintf.h"
 
 /* This is the new improved and thread safe version of gmxfio. */
 
@@ -86,51 +87,20 @@ static tMPI_Thread_mutex_t open_file_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
 static const int ftpXDR[] =
 { efTPR, efTRR, efEDR, efXTC, efTNG, efMTX, efCPT };
 static const int ftpASC[] =
-{ efTPA, efGRO, efPDB };
+{ efGRO, efPDB, efG96 };
 static const int ftpBIN[] =
-{ efTPB, efTRJ, efTNG };
+{ efTNG };
 #ifdef HAVE_XML
 static const int ftpXML[] =
 {   efXML};
 #endif
 
-const char *itemstr[eitemNR] =
-{
-    "[header]", "[inputrec]", "[box]", "[topology]", "[coordinates]",
-    "[velocities]", "[forces]"
-};
-
 const char *eioNames[eioNR] =
 {
     "REAL", "INT", "GMX_STE_T", "UCHAR", "NUCHAR", "USHORT", "RVEC", "NRVEC",
     "IVEC", "STRING"
 };
 
-
-
-/* Comment strings for TPA only */
-const char *comment_str[eitemNR] = {
-    "; The header holds information on the number of atoms etc. and on whether\n"
-    "; certain items are present in the file or not.\n"
-    "; \n"
-    ";                             WARNING\n"
-    ";                   DO NOT EDIT THIS FILE BY HAND\n"
-    "; The GROMACS preprocessor performs a lot of checks on your input that\n"
-    "; you ignore when editing this. Your simulation may crash because of this\n",
-    "; The inputrec holds the parameters for MD such as the number of steps,\n"
-    "; the timestep and the cut-offs.\n",
-    "; The simulation box in nm.\n",
-    "; The topology section describes the topology of the molecules\n"
-    "; i.e. bonds, angles and dihedrals etc. and also holds the force field\n"
-    "; parameters.\n",
-    "; The atomic coordinates in nm\n",
-    "; The atomic velocities in nm/ps\n",
-    "; The forces on the atoms in nm/ps^2\n"
-};
-
-
-
-
 /******************************************************************
  *
  * Internal functions:
@@ -433,41 +403,34 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
     gmx_bool  bRead, bReadWrite;
     int       xdrid;
 
-    if (fn2ftp(fn) == efTPA)
+    /* sanitize the mode string */
+    if (strncmp(mode, "r+", 2) == 0)
+    {
+        strcpy(newmode, "r+");
+    }
+    else if (mode[0] == 'r')
+    {
+        strcpy(newmode, "r");
+    }
+    else if (strncmp(mode, "w+", 2) == 0)
+    {
+        strcpy(newmode, "w+");
+    }
+    else if (mode[0] == 'w')
     {
-        strcpy(newmode, mode);
+        strcpy(newmode, "w");
+    }
+    else if (strncmp(mode, "a+", 2) == 0)
+    {
+        strcpy(newmode, "a+");
+    }
+    else if (mode[0] == 'a')
+    {
+        strcpy(newmode, "a");
     }
     else
     {
-        /* sanitize the mode string */
-        if (strncmp(mode, "r+", 2) == 0)
-        {
-            strcpy(newmode, "r+");
-        }
-        else if (mode[0] == 'r')
-        {
-            strcpy(newmode, "r");
-        }
-        else if (strncmp(mode, "w+", 2) == 0)
-        {
-            strcpy(newmode, "w+");
-        }
-        else if (mode[0] == 'w')
-        {
-            strcpy(newmode, "w");
-        }
-        else if (strncmp(mode, "a+", 2) == 0)
-        {
-            strcpy(newmode, "a+");
-        }
-        else if (mode[0] == 'a')
-        {
-            strcpy(newmode, "a");
-        }
-        else
-        {
-            gmx_fatal(FARGS, "DEATH HORROR in gmx_fio_open, mode is '%s'", mode);
-        }
+        gmx_fatal(FARGS, "DEATH HORROR in gmx_fio_open, mode is '%s'", mode);
     }
 
     /* Check if it should be opened as a binary file */
@@ -489,7 +452,7 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
     if (fn)
     {
         fio->iFTP   = fn2ftp(fn);
-        fio->fn     = strdup(fn);
+        fio->fn     = gmx_strdup(fn);
         fio->bStdio = FALSE;
 
         /* If this file type is in the list of XDR files, open it like that */
@@ -546,14 +509,6 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
             gmx_fseek(fio->fp, 0, SEEK_END);
         }
     }
-    else
-    {
-        /* Use stdin/stdout for I/O */
-        fio->iFTP   = efTPA;
-        fio->fp     = bRead ? stdin : stdout;
-        fio->fn     = strdup("STDIO");
-        fio->bStdio = TRUE;
-    }
     fio->bRead             = bRead;
     fio->bReadWrite        = bReadWrite;
     fio->bDouble           = (sizeof(real) == sizeof(double));
index 021d6eec8ffe7b41de148f3c88ce0168c94c183d..bc656d2ef98fda4fbaae00711778d25d4d713078 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_FILEIO_GMXFIO_H
 
 #include <stdio.h>
-#include "../legacyheaders/typedefs.h"
-#include "futil.h"
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -63,9 +66,6 @@ enum {
 
 typedef struct t_fileio t_fileio;
 
-extern const char *itemstr[eitemNR];
-extern const char *comment_str[eitemNR];
-
 /* NOTE ABOUT THREAD SAFETY:
 
    The functions are all thread-safe, provided that two threads don't
@@ -80,11 +80,6 @@ extern const char *comment_str[eitemNR];
 t_fileio *gmx_fio_open(const char *fn, const char *mode);
 /* Open a new file for reading or writing.
  * The file type will be deduced from the file name.
- * If fn is NULL, stdin / stdout will be used for Ascii I/O (TPA type)
- * mode may be "r", "w", or "a". You should append a "b" to the mode
- * if you are writing a binary file, but the routine will also
- * doublecheck it and try to do it if you forgot. This has no effect on
- * unix, but is important on windows.
  */
 
 int gmx_fio_close(t_fileio *fp);
@@ -147,7 +142,7 @@ void gmx_fio_checktype(t_fileio *fio);
  ***************************************************/
 
 void gmx_fio_rewind(t_fileio *fio);
-/* Rewind the tpa file in fio */
+/* Rewind the file in fio */
 
 int gmx_fio_flush(t_fileio *fio);
 /* Flush the fio, returns 0 on success */
index bf35b85aafd7826426299f2112c045a73a0ac8cb..a451b0c072b644d237b1284c8369de90c019505c 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.
  */
+#include "gmxpre.h"
 
+#include "config.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
 
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "futil.h"
-#include "filenm.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio_int.h"
+#include "gromacs/fileio/md5.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmxfio.h"
-#include "md5.h"
-
-#include "gmxfio_int.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* This is the part that reads dummy and ascii files.  */
@@ -295,8 +294,9 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
     int             i, m, res = 0, *iptr, ix;
     gmx_int64_t     s;
     double          d, x;
+    char            c;
     real           *ptr;
-    unsigned char   uc, *ucptr;
+    unsigned char  *ucptr;
     char           *cptr;
 #define NEXT_ITEM_BUF_LEN 128
     char            ni_buf[NEXT_ITEM_BUF_LEN];
@@ -329,10 +329,10 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
             }
             break;
         case eioUCHAR:
-            res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%c", &uc);
+            res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%c", &c);
             if (item)
             {
-                *((unsigned char *) item) = uc;
+                *((unsigned char *) item) = (unsigned char)c;
             }
             break;
         case eioNUCHAR:
@@ -362,6 +362,7 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
             }
             break;
         case eioNRVEC:
+            assert(item);
             for (i = 0; (i < nitem); i++)
             {
                 ptr = ((rvec *) item)[i];
@@ -369,10 +370,7 @@ static gmx_bool do_ascread(t_fileio *fio, void *item, int nitem, int eio,
                 {
                     res = sscanf(next_item(fp, ni_buf, NEXT_ITEM_BUF_LEN), "%lf\n",
                                  &x);
-                    if (item)
-                    {
-                        ptr[m] = x;
-                    }
+                    ptr[m] = x;
                 }
             }
             break;
index 7cc1c559386046c3b9b4ef3d5067d56f6c41527b..9238af5fa137a37ce3e2428ac359f48e3f31ff00 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
 
-#include "macros.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio_int.h"
+#include "gromacs/fileio/md5.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
-#include "filenm.h"
-#include "gmxfio.h"
-#include "md5.h"
-
-#include "gmxfio_int.h"
 
 /* This is the part that reads dummy and ascii files.  */
 
index cedde9ae907317e4960af5a66ddbf6df88dcc871..e7010b15f32fbecc34189362cb6f11e9712f0f16 100644 (file)
@@ -58,7 +58,7 @@
 
 #include "thread_mpi/lock.h"
 
-#include "xdrf.h"
+#include "gromacs/fileio/xdrf.h"
 
 /* the reader/writer functions  for t_iotype */
 typedef gmx_bool read_func (t_fileio *fio, void *item, int nitem, int eio,
index e1b7031ed3f6f6b2ede3595a4e3b4951f6ac5445..bdfa1ec4d80b9d3bc2e061dc2becc3f316bfac01 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
-#include <stdio.h>
 #include <errno.h>
+#include <stdio.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
 
-#include "macros.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio_int.h"
+#include "gromacs/fileio/md5.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
-#include "filenm.h"
-#include "gmxfio.h"
-#include "md5.h"
-
-#include "gmxfio_int.h"
 
 
 /*******************************************************************
index 47ad3ca59c3c9a37592d6a9293a37720caea027b..ca1b70d21e43521ea239790646026fcd292672ed 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
+
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
 
-#include "gmx_fatal.h"
-#include "macros.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio_int.h"
+#include "gromacs/fileio/md5.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "futil.h"
-#include "filenm.h"
-#include "gmxfio.h"
-#include "md5.h"
-
-#include "gmxfio_int.h"
 
 /* This is the part that reads xdr files.  */
 
index d83d7e6bd191e45f007e10cf8460ca4a90c0e5c6..401cfa8883691e9731e56380661d4c906068ed56 100644 (file)
@@ -34,9 +34,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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <limits.h>
 #include <math.h>
@@ -44,9 +42,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "xdrf.h"
-#include "xdr_datatype.h"
-#include "futil.h"
+#include "gromacs/fileio/xdr_datatype.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/utility/futil.h"
 
 /* This is just for clarity - it can never be anything but 4! */
 #define XDR_INT_SIZE 4
@@ -1132,7 +1130,6 @@ xtc_get_next_frame_number(FILE *fp, XDR *xdrs, int natoms)
             }
         }
     }
-    return -1;
 }
 
 
@@ -1173,7 +1170,6 @@ static float xtc_get_next_frame_time(FILE *fp, XDR *xdrs, int natoms,
             return -1;
         }
     }
-    return -1;
 }
 
 
@@ -1221,7 +1217,6 @@ xtc_get_current_frame_time(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK)
             }
         }
     }
-    return -1;
 }
 
 /* Currently not used, just for completeness */
@@ -1271,7 +1266,6 @@ xtc_get_current_frame_number(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK)
             }
         }
     }
-    return -1;
 }
 
 
@@ -1304,7 +1298,6 @@ static gmx_off_t xtc_get_next_frame_start(FILE *fp, XDR *xdrs, int natoms)
             return -1;
         }
     }
-    return -1;
 }
 
 
index 0adabce0269e1217adf51793c754c5ed7e84eb1f..6d464f8c91b1b8574ad8d64da302cfd3b839181b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "matio.h"
 
-#include <stdio.h>
 #include <ctype.h>
+#include <stdio.h>
 
 #include <algorithm>
 
-#include "sysstuff.h"
-#include "futil.h"
-#include "gromacs/utility/cstringutil.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "matio.h"
-#include "gmxfio.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/math/utilities.h"
-#include "copyrite.h"
-
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 
 #define round(a) (int)(a+0.5)
 
@@ -102,19 +98,6 @@ void done_matrix(int nx, real ***m)
     *m = NULL;
 }
 
-void clear_matrix(int nx, int ny, real **m)
-{
-    int x, y;
-
-    for (x = 0; x < nx; x++)
-    {
-        for (y = 0; y < ny; y++)
-        {
-            m[x][y] = 0;
-        }
-    }
-}
-
 gmx_bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2)
 {
     return (e1.c1 == e2.c1) && (e1.c2 == e2.c2);
@@ -160,7 +143,7 @@ int getcmap(FILE *in, const char *fn, t_mapping **map)
         sscanf(line, "%s%s%lf%lf%lf", code, desc, &r, &g, &b);
         m[i].code.c1 = code[0];
         m[i].code.c2 = 0;
-        m[i].desc    = strdup(desc);
+        m[i].desc    = gmx_strdup(desc);
         m[i].rgb.r   = r;
         m[i].rgb.g   = g;
         m[i].rgb.b   = b;
@@ -177,7 +160,7 @@ int readcmap(const char *fn, t_mapping **map)
 
     in = libopen(fn);
     n  = getcmap(in, fn, map);
-    gmx_fio_fclose(in);
+    gmx_ffclose(in);
 
     return n;
 }
@@ -220,7 +203,7 @@ static char *fgetline(char **line, int llmax, int *llalloc, FILE *in)
     return fg;
 }
 
-void skipstr(char *line)
+static void skipstr(char *line)
 {
     int i, c;
 
@@ -239,7 +222,7 @@ void skipstr(char *line)
     line[c-i] = '\0';
 }
 
-char *line2string(char **line)
+static char *line2string(char **line)
 {
     int i;
 
@@ -275,7 +258,7 @@ char *line2string(char **line)
     return *line;
 }
 
-void parsestring(char *line, const char *label, char *string)
+static void parsestring(char *line, const char *label, char *string)
 {
     if (strstr(line, label))
     {
@@ -287,7 +270,7 @@ void parsestring(char *line, const char *label, char *string)
     }
 }
 
-void read_xpm_entry(FILE *in, t_matrix *mm)
+static void read_xpm_entry(FILE *in, t_matrix *mm)
 {
     t_mapping   *map;
     char        *line_buf = NULL, *line = NULL, *str, buf[256] = {0};
@@ -440,7 +423,7 @@ void read_xpm_entry(FILE *in, t_matrix *mm)
             line = strchr(line, '\"');
             line++;
             line2string(&line);
-            map[m].desc = strdup(line);
+            map[m].desc = gmx_strdup(line);
             m++;
         }
     }
@@ -565,7 +548,7 @@ void read_xpm_entry(FILE *in, t_matrix *mm)
     sfree(line_buf);
 }
 
-int read_xpm_matrix(const char *fnm, t_matrix **matrix)
+int read_xpm_matrix(const char *fnm, t_matrix **mat)
 {
     FILE *in;
     char *line = NULL;
@@ -579,8 +562,8 @@ int read_xpm_matrix(const char *fnm, t_matrix **matrix)
     {
         if (strstr(line, "/* XPM */"))
         {
-            srenew(*matrix, nmat+1);
-            read_xpm_entry(in, &(*matrix)[nmat]);
+            srenew(*mat, nmat+1);
+            read_xpm_entry(in, &(*mat)[nmat]);
             nmat++;
         }
     }
@@ -596,15 +579,15 @@ int read_xpm_matrix(const char *fnm, t_matrix **matrix)
     return nmat;
 }
 
-real **matrix2real(t_matrix *matrix, real **mat)
+real **matrix2real(t_matrix *in, real **out)
 {
     t_mapping *map;
     double     tmp;
     real      *rmap;
     int        i, j, nmap;
 
-    nmap = matrix->nmap;
-    map  = matrix->map;
+    nmap = in->nmap;
+    map  = in->map;
     snew(rmap, nmap);
 
     for (i = 0; i < nmap; i++)
@@ -620,34 +603,34 @@ real **matrix2real(t_matrix *matrix, real **mat)
         rmap[i] = tmp;
     }
 
-    if (mat == NULL)
+    if (out == NULL)
     {
-        snew(mat, matrix->nx);
-        for (i = 0; i < matrix->nx; i++)
+        snew(out, in->nx);
+        for (i = 0; i < in->nx; i++)
         {
-            snew(mat[i], matrix->ny);
+            snew(out[i], in->ny);
         }
     }
-    for (i = 0; i < matrix->nx; i++)
+    for (i = 0; i < in->nx; i++)
     {
-        for (j = 0; j < matrix->ny; j++)
+        for (j = 0; j < in->ny; j++)
         {
-            mat[i][j] = rmap[matrix->matrix[i][j]];
+            out[i][j] = rmap[in->matrix[i][j]];
         }
     }
 
     sfree(rmap);
 
     fprintf(stderr, "Converted a %dx%d matrix with %d levels to reals\n",
-            matrix->nx, matrix->ny, nmap);
+            in->nx, in->ny, nmap);
 
-    return mat;
+    return out;
 }
 
-void write_xpm_header(FILE *out,
-                      const char *title, const char *legend,
-                      const char *label_x, const char *label_y,
-                      gmx_bool bDiscrete)
+static void write_xpm_header(FILE *out,
+                             const char *title, const char *legend,
+                             const char *label_x, const char *label_y,
+                             gmx_bool bDiscrete)
 {
     fprintf(out,  "/* XPM */\n");
     try
@@ -683,9 +666,9 @@ static int calc_nmid(int nlevels, real lo, real mid, real hi)
                     nlevels-1);
 }
 
-void write_xpm_map3(FILE *out, int n_x, int n_y, int *nlevels,
-                    real lo, real mid, real hi,
-                    t_rgb rlo, t_rgb rmid, t_rgb rhi)
+static void write_xpm_map3(FILE *out, int n_x, int n_y, int *nlevels,
+                           real lo, real mid, real hi,
+                           t_rgb rlo, t_rgb rmid, t_rgb rhi)
 {
     int    i, nmid;
     real   r, g, b, clev_lo, clev_hi;
@@ -803,12 +786,12 @@ static void pr_discrete_cmap(FILE *out, int *nlevel, int i0)
 
 
 
-void write_xpm_map_split(FILE *out, int n_x, int n_y,
-                         int *nlevel_top, real lo_top, real hi_top,
-                         t_rgb rlo_top, t_rgb rhi_top,
-                         gmx_bool bDiscreteColor,
-                         int *nlevel_bot, real lo_bot, real hi_bot,
-                         t_rgb rlo_bot, t_rgb rhi_bot)
+static void write_xpm_map_split(FILE *out, int n_x, int n_y,
+                                int *nlevel_top, real lo_top, real hi_top,
+                                t_rgb rlo_top, t_rgb rhi_top,
+                                gmx_bool bDiscreteColor,
+                                int *nlevel_bot, real lo_bot, real hi_bot,
+                                t_rgb rlo_bot, t_rgb rhi_bot)
 {
     int    ntot;
 
@@ -834,8 +817,8 @@ void write_xpm_map_split(FILE *out, int n_x, int n_y,
 }
 
 
-void write_xpm_map(FILE *out, int n_x, int n_y, int *nlevels, real lo, real hi,
-                   t_rgb rlo, t_rgb rhi)
+static void write_xpm_map(FILE *out, int n_x, int n_y, int *nlevels,
+                          real lo, real hi, t_rgb rlo, t_rgb rhi)
 {
     int    i, nlo;
     real   invlevel, r, g, b;
@@ -872,8 +855,8 @@ void write_xpm_map(FILE *out, int n_x, int n_y, int *nlevels, real lo, real hi,
     }
 }
 
-void write_xpm_axis(FILE *out, const char *axis, gmx_bool bSpatial, int n,
-                    real *label)
+static void write_xpm_axis(FILE *out, const char *axis, gmx_bool bSpatial,
+                           int n, real *label)
 {
     int i;
 
@@ -895,8 +878,8 @@ void write_xpm_axis(FILE *out, const char *axis, gmx_bool bSpatial, int n,
     }
 }
 
-void write_xpm_data(FILE *out, int n_x, int n_y, real **matrix,
-                    real lo, real hi, int nlevels)
+static void write_xpm_data(FILE *out, int n_x, int n_y, real **mat,
+                           real lo, real hi, int nlevels)
 {
     int  i, j, c;
     real invlevel;
@@ -911,7 +894,7 @@ void write_xpm_data(FILE *out, int n_x, int n_y, real **matrix,
         fprintf(out, "\"");
         for (i = 0; (i < n_x); i++)
         {
-            c = gmx_nint((matrix[i][j]-lo)*invlevel);
+            c = gmx_nint((mat[i][j]-lo)*invlevel);
             if (c < 0)
             {
                 c = 0;
@@ -940,8 +923,8 @@ void write_xpm_data(FILE *out, int n_x, int n_y, real **matrix,
     }
 }
 
-void write_xpm_data3(FILE *out, int n_x, int n_y, real **matrix,
-                     real lo, real mid, real hi, int nlevels)
+static void write_xpm_data3(FILE *out, int n_x, int n_y, real **mat,
+                            real lo, real mid, real hi, int nlevels)
 {
     int  i, j, c = 0, nmid;
     real invlev_lo, invlev_hi;
@@ -959,13 +942,13 @@ void write_xpm_data3(FILE *out, int n_x, int n_y, real **matrix,
         fprintf(out, "\"");
         for (i = 0; (i < n_x); i++)
         {
-            if (matrix[i][j] >= mid)
+            if (mat[i][j] >= mid)
             {
-                c = nmid+gmx_nint((matrix[i][j]-mid)*invlev_hi);
+                c = nmid+gmx_nint((mat[i][j]-mid)*invlev_hi);
             }
-            else if (matrix[i][j] >= lo)
+            else if (mat[i][j] >= lo)
             {
-                c = gmx_nint((matrix[i][j]-lo)*invlev_lo);
+                c = gmx_nint((mat[i][j]-lo)*invlev_lo);
             }
             else
             {
@@ -1000,9 +983,9 @@ void write_xpm_data3(FILE *out, int n_x, int n_y, real **matrix,
     }
 }
 
-void write_xpm_data_split(FILE *out, int n_x, int n_y, real **matrix,
-                          real lo_top, real hi_top, int nlevel_top,
-                          real lo_bot, real hi_bot, int nlevel_bot)
+static void write_xpm_data_split(FILE *out, int n_x, int n_y, real **mat,
+                                 real lo_top, real hi_top, int nlevel_top,
+                                 real lo_bot, real hi_bot, int nlevel_bot)
 {
     int  i, j, c;
     real invlev_top, invlev_bot;
@@ -1021,18 +1004,18 @@ void write_xpm_data_split(FILE *out, int n_x, int n_y, real **matrix,
         {
             if (i < j)
             {
-                c = nlevel_bot+round((matrix[i][j]-lo_top)*invlev_top);
+                c = nlevel_bot+round((mat[i][j]-lo_top)*invlev_top);
                 if ((c < nlevel_bot) || (c >= nlevel_bot+nlevel_top))
                 {
-                    gmx_fatal(FARGS, "Range checking i = %d, j = %d, c = %d, bot = %d, top = %d matrix[i,j] = %f", i, j, c, nlevel_bot, nlevel_top, matrix[i][j]);
+                    gmx_fatal(FARGS, "Range checking i = %d, j = %d, c = %d, bot = %d, top = %d matrix[i,j] = %f", i, j, c, nlevel_bot, nlevel_top, mat[i][j]);
                 }
             }
             else if (i > j)
             {
-                c = round((matrix[i][j]-lo_bot)*invlev_bot);
+                c = round((mat[i][j]-lo_bot)*invlev_bot);
                 if ((c < 0) || (c >= nlevel_bot+nlevel_bot))
                 {
-                    gmx_fatal(FARGS, "Range checking i = %d, j = %d, c = %d, bot = %d, top = %d matrix[i,j] = %f", i, j, c, nlevel_bot, nlevel_top, matrix[i][j]);
+                    gmx_fatal(FARGS, "Range checking i = %d, j = %d, c = %d, bot = %d, top = %d matrix[i,j] = %f", i, j, c, nlevel_bot, nlevel_top, mat[i][j]);
                 }
             }
             else
@@ -1114,7 +1097,7 @@ void write_xpm3(FILE *out, unsigned int flags,
                 const char *title, const char *legend,
                 const char *label_x, const char *label_y,
                 int n_x, int n_y, real axis_x[], real axis_y[],
-                real *matrix[], real lo, real mid, real hi,
+                real *mat[], real lo, real mid, real hi,
                 t_rgb rlo, t_rgb rmid, t_rgb rhi, int *nlevels)
 {
     /* See write_xpm.
@@ -1130,14 +1113,14 @@ void write_xpm3(FILE *out, unsigned int flags,
     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);
-    write_xpm_data3(out, n_x, n_y, matrix, lo, mid, hi, *nlevels);
+    write_xpm_data3(out, n_x, n_y, mat, lo, mid, hi, *nlevels);
 }
 
 void write_xpm_split(FILE *out, unsigned int flags,
                      const char *title, const char *legend,
                      const char *label_x, const char *label_y,
                      int n_x, int n_y, real axis_x[], real axis_y[],
-                     real *matrix[],
+                     real *mat[],
                      real lo_top, real hi_top, int *nlevel_top,
                      t_rgb rlo_top, t_rgb rhi_top,
                      real lo_bot, real hi_bot, int *nlevel_bot,
@@ -1166,7 +1149,7 @@ void write_xpm_split(FILE *out, unsigned int flags,
                         bDiscreteColor, nlevel_bot, lo_bot, hi_bot, rlo_bot, rhi_bot);
     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);
-    write_xpm_data_split(out, n_x, n_y, matrix, lo_top, hi_top, *nlevel_top,
+    write_xpm_data_split(out, n_x, n_y, mat, lo_top, hi_top, *nlevel_top,
                          lo_bot, hi_bot, *nlevel_bot);
 }
 
@@ -1174,7 +1157,7 @@ void write_xpm(FILE *out, unsigned int flags,
                const char *title, const char *legend,
                const char *label_x, const char *label_y,
                int n_x, int n_y, real axis_x[], real axis_y[],
-               real *matrix[], real lo, real hi,
+               real *mat[], real lo, real hi,
                t_rgb rlo, t_rgb rhi, int *nlevels)
 {
     /* out        xpm file
@@ -1202,5 +1185,5 @@ void write_xpm(FILE *out, unsigned int flags,
     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);
-    write_xpm_data(out, n_x, n_y, matrix, lo, hi, *nlevels);
+    write_xpm_data(out, n_x, n_y, mat, lo, hi, *nlevels);
 }
index b2547c229d3d05a2014a7349869ecc2898bc5743..1facdf56086fcbad3a0d94bca628f5e9cf4abb01 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_FILEIO_MATIO_H
 #define GMX_FILEIO_MATIO_H
 
-#include "../legacyheaders/typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/rgb.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+typedef struct {
+    char c1; /* should all be non-zero (and printable and not '"') */
+    char c2; /*
+              * should all be zero (single char color names: smaller xpm's)
+              * or should all be non-zero (double char color names: more colors)
+              */
+} t_xpmelmt;
+
+typedef short t_matelmt;
+
+typedef struct {
+    t_xpmelmt   code; /* see comment for t_xpmelmt */
+    const char *desc;
+    t_rgb       rgb;
+} t_mapping;
+
+#define MAT_SPATIAL_X (1<<0)
+#define MAT_SPATIAL_Y (1<<1)
+/* Defines if x and y are spatial dimensions,
+ * when not, there are n axis ticks at the middle of the elements,
+ * when set, there are n+1 axis ticks at the edges of the elements.
+ */
+
+typedef struct {
+    unsigned int flags; /* The possible flags are defined above */
+    int          nx, ny;
+    int          y0;
+    char         title[256];
+    char         legend[256];
+    char         label_x[256];
+    char         label_y[256];
+    gmx_bool     bDiscrete;
+    real        *axis_x;
+    real        *axis_y;
+    t_matelmt  **matrix;
+    int          nmap;
+    t_mapping   *map;
+} t_matrix;
+/* title      matrix title
+ * legend     label for the continuous legend
+ * label_x    label for the x-axis
+ * label_y    label for the y-axis
+ * nx, ny     size of the matrix
+ * axis_x[]   the x-ticklabels
+ * axis_y[]   the y-ticklables
+ * *matrix[]  element x,y is matrix[x][y]
+ * nmap       number of color levels for the output(?)
+ */
+
 gmx_bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2);
 
 t_matelmt searchcmap(int n, t_mapping map[], t_xpmelmt c);
@@ -63,10 +116,10 @@ void printcmap(FILE *out, int n, t_mapping map[]);
 void writecmap(const char *fn, int n, t_mapping map[]);
 /* print mapping table to fn */
 
-int read_xpm_matrix(const char *fnm, t_matrix **matrix);
+int read_xpm_matrix(const char *fnm, t_matrix **mat);
 /* Reads a number of matrices from .xpm file fnm and returns this number */
 
-real **matrix2real(t_matrix *matrix, real **mat);
+real **matrix2real(t_matrix *in, real **out);
 /* Converts an matrix in a t_matrix struct to a matrix of reals
  * When mat==NULL memory will be allocated
  * Returns NULL when something went wrong
@@ -79,7 +132,7 @@ void write_xpm3(FILE *out, unsigned int flags,
                 const char *title, const char *legend,
                 const char *label_x, const char *label_y,
                 int n_x, int n_y, real axis_x[], real axis_y[],
-                real *matrix[], real lo, real mid, real hi,
+                real *mat[], real lo, real mid, real hi,
                 t_rgb rlo, t_rgb rmid, t_rgb rhi, int *nlevels);
 /* See write_xpm.
  * Writes a colormap varying as rlo -> rmid -> rhi.
@@ -88,7 +141,7 @@ void write_xpm_split(FILE *out, unsigned int flags,
                      const char *title, const char *legend,
                      const char *label_x, const char *label_y,
                      int n_x, int n_y, real axis_x[], real axis_y[],
-                     real *matrix[],
+                     real *mat[],
                      real lo_top, real hi_top, int *nlevel_top,
                      t_rgb rlo_top, t_rgb rhi_top,
                      real lo_bot, real hi_bot, int *nlevel_bot,
@@ -104,7 +157,7 @@ void write_xpm(FILE *out, unsigned int flags,
                const char *title, const char *legend,
                const char *label_x, const char *label_y,
                int n_x, int n_y, real t_x[], real t_y[],
-               real *matrix[], real lo, real hi,
+               real *mat[], real lo, real hi,
                t_rgb rlo, t_rgb rhi, int *nlevels);
 /* out        xpm file
  * flags      flags, defined types/matrix.h
@@ -120,7 +173,7 @@ void write_xpm(FILE *out, unsigned int flags,
  * n_x, n_y   size of the matrix
  * axis_x[]   the x-ticklabels (n_x or n_x+1)
  * axis_y[]   the y-ticklables (n_y or n_y+1)
- * *matrix[]  element x,y is matrix[x][y]
+ * *mat[]     element x,y is mat[x][y]
  * lo         output lower than lo is set to lo
  * hi         output higher than hi is set to hi
  * rlo        rgb value for level lo
@@ -132,8 +185,6 @@ real **mk_matrix(int nx, int ny, gmx_bool b1D);
 
 void done_matrix(int nx, real ***m);
 
-void clear_matrix(int nx, int ny, real **m);
-
 #ifdef __cplusplus
 }
 #endif
index 8154a6e81153e79c4d6dc5d71ecca6847cbc41f1..ff74cc68d073b5a4b4c5b73926a7c8424b48e48c 100644 (file)
@@ -36,9 +36,9 @@
  * the use of GMX_INTEGER_BIG_ENDIAN, and the renaming of the
  * functions md5_init, md5_append and md5_finish to have a gmx_ prefix
  * (to avoid name clashes). */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #ifdef GMX_INTEGER_BIG_ENDIAN
 #define ARCH_IS_BIG_ENDIAN 1
@@ -99,6 +99,7 @@
  */
 
 #include "md5.h"
+
 #include <string.h>
 
 #undef BYTE_ORDER   /* 1 = big-endian, -1 = little-endian, 0 = unknown */
@@ -188,7 +189,6 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
 #else
     /* Define storage for little-endian or both types of CPUs. */
     md5_word_t        xbuf[16];
-    /* cppcheck-suppress unassignedVariable */
     const md5_word_t *X;
 #endif
 
index 1118cc06531bdd388470fd99a25449cb92f9614e..bda0a7ac85d842308719eefc8e965be0711ee060 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,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.
  * 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 "mdoutf.h"
 
-#include "gromacs/legacyheaders/xvgr.h"
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/fileio/tngio.h"
+#include "gromacs/fileio/trajectory_writing.h"
+#include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/xtcio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/legacyheaders/mdrun.h"
 #include "gromacs/legacyheaders/types/commrec.h"
-#include "gromacs/legacyheaders/mvdata.h"
-#include "gromacs/legacyheaders/domdec.h"
-#include "trnio.h"
-#include "xtcio.h"
-#include "tngio.h"
-#include "trajectory_writing.h"
-#include "checkpoint.h"
-#include "copyrite.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 struct gmx_mdoutf {
     t_fileio         *fp_trn;
@@ -184,8 +185,8 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
         {
             if (bAppendFiles)
             {
-                of->fp_dhdl = gmx_fio_fopen(opt2fn("-field", nfile, fnm),
-                                            filemode);
+                of->fp_field = gmx_fio_fopen(opt2fn("-field", nfile, fnm),
+                                             filemode);
             }
             else
             {
@@ -411,6 +412,9 @@ void done_mdoutf(gmx_mdoutf_t of)
     }
     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);
     }
 
index a063c1fd8f0d5a4c87a901d97e89876d58b753f4..8e241f4e3e366425ceba47533ddaa23192802f50 100644 (file)
 #define GMX_FILEIO_MDOUTF_H
 
 #include <stdio.h>
-#include "../legacyheaders/types/simple.h"
-#include "../legacyheaders/types/topology.h"
-#include "../legacyheaders/types/inputrec.h"
-#include "../legacyheaders/types/oenv.h"
-#include "../legacyheaders/network.h"
-#include "filenm.h"
-#include "enxio.h"
+
+#include "gromacs/fileio/enxio.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/basedefinitions.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct gmx_mtop_t;
 
 typedef struct gmx_mdoutf *gmx_mdoutf_t;
 
@@ -58,7 +66,7 @@ gmx_mdoutf_t init_mdoutf(FILE              *fplog,
                          int                mdrun_flags,
                          const t_commrec   *cr,
                          const t_inputrec  *ir,
-                         gmx_mtop_t        *mtop,
+                         struct gmx_mtop_t *mtop,
                          const output_env_t oenv,
                          gmx_wallcycle_t    wcycle);
 
@@ -93,7 +101,7 @@ void done_mdoutf(gmx_mdoutf_t of);
 void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                                       gmx_mdoutf_t of,
                                       int mdof_flags,
-                                      gmx_mtop_t *top_global,
+                                      struct gmx_mtop_t *top_global,
                                       gmx_int64_t step, double t,
                                       t_state *state_local, t_state *state_global,
                                       rvec *f_local, rvec *f_global);
@@ -105,5 +113,8 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
 #define MDOF_CPT          (1<<4)
 #define MDOF_IMD          (1<<5)
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* GMX_FILEIO_MDOUTF_H */
similarity index 97%
rename from src/gromacs/linearalgebra/mtxio.c
rename to src/gromacs/fileio/mtxio.c
index 0a82d271c600941c7e831ddf2e527162977fc9d0..f2a27e0eaffec0c879a850eea83ad97d229299be 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.
  */
-#include "mtxio.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "mtxio.h"
 
 /* This module provides routines to read/write sparse or full storage
  * matrices from/to files. It is normally used for the Hessian matrix
  * in normal mode analysis.
  */
 
-#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xdrf.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
-
+#include "gromacs/utility/baseversion.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 /* Just a number to identify our file type */
@@ -109,7 +106,7 @@ void gmx_mtxio_write(const char *             filename,
     gmx_fio_do_int(fio, i);
 
     /* Write generating Gromacs version */
-    gmx_fio_write_string(fio, GromacsVersion());
+    gmx_fio_write_string(fio, gmx_version());
 
     /* Write 1 for double, 0 for single precision */
     if (sizeof(real) == sizeof(double))
similarity index 94%
rename from src/gromacs/linearalgebra/mtxio.h
rename to src/gromacs/fileio/mtxio.h
index a3e66452c483bc3f5d941a70d06f2c8fcb799512..4f9216e5d3728f3d09962d86d7a334b9316e6889 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * in normal mode analysis.
  */
 
-#ifndef GMX_LINEARALGEBRA_MTXIO_H
-#define GMX_LINEARALGEBRA_MTXIO_H
+#ifndef GMX_FILEIO_MTXIO_H
+#define GMX_FILEIO_MTXIO_H
 
-#include "../legacyheaders/types/simple.h"
-
-#include "sparsematrix.h"
+#include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 439b80a59e5bad4b3557ce447e0e0a3ff78f5bc4..20bd556dae66b0e680a567c5c0de966aa9c40076 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "pdbio.h"
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
-#include "vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "symtab.h"
-#include "pdbio.h"
-#include "vec.h"
-#include "copyrite.h"
-#include "futil.h"
-#include "atomprop.h"
-#include "physics.h"
-#include "pbc.h"
-#include "gmxfio.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
 
 typedef struct {
     int ai, aj;
@@ -274,7 +274,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     int               nlongname = 0;
     int               chainnum, lastchainnum;
     int               lastresind, lastchainresind;
-    gmx_residuetype_t rt;
+    gmx_residuetype_t*rt;
     const char       *p_restype;
     const char       *p_lastrestype;
 
@@ -392,7 +392,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
 
         if (atoms->pdbinfo && atoms->pdbinfo[i].bAnisotropic)
         {
-            fprintf(out, "ANISOU%5u  %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
+            fprintf(out, "ANISOU%5d  %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
                     (i+1)%100000, nm, resnm, ch, resnr,
                     (resic == '\0') ? ' ' : resic,
                     atoms->pdbinfo[i].uij[0], atoms->pdbinfo[i].uij[1],
index ab53be32925cc2863acbc36776a5e02db3e4213f..3e13161126c3d9c07b9765b303f720c8a21cb8b1 100644 (file)
 #ifndef GMX_FILEIO_PDBIO_H
 #define GMX_FILEIO_PDBIO_H
 
-#include "../legacyheaders/sysstuff.h"
-#include "../legacyheaders/typedefs.h"
-#include "../legacyheaders/symtab.h"
-#include "../legacyheaders/atomprop.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_atomprop;
+struct t_atoms;
+struct t_topology;
+
 typedef struct gmx_conect_t *gmx_conect;
 
 /* Enumerated type for pdb records. The other entries are ignored
@@ -94,13 +97,13 @@ void gmx_write_pdb_box(FILE *out, int ePBC, matrix box);
  * This function is fundamentally broken as far as thread-safety is concerned.
  */
 
-void write_pdbfile_indexed(FILE *out, const char *title, t_atoms *atoms,
+void write_pdbfile_indexed(FILE *out, const char *title, struct t_atoms *atoms,
                            rvec x[], int ePBC, matrix box, char chain,
                            int model_nr, atom_id nindex, const atom_id index[],
                            gmx_conect conect, gmx_bool bTerSepChains);
 /* REALLY low level */
 
-void write_pdbfile(FILE *out, const char *title, t_atoms *atoms,
+void write_pdbfile(FILE *out, const char *title, struct t_atoms *atoms,
                    rvec x[], int ePBC, matrix box, char chain,
                    int model_nr, gmx_conect conect, gmx_bool bTerSepChains);
 /* Low level pdb file writing routine.
@@ -116,18 +119,18 @@ void write_pdbfile(FILE *out, const char *title, t_atoms *atoms,
  * which may be useful for visualization purposes.
  */
 
-void get_pdb_atomnumber(t_atoms *atoms, gmx_atomprop_t aps);
+void get_pdb_atomnumber(struct t_atoms *atoms, struct gmx_atomprop *aps);
 /* Routine to extract atomic numbers from the atom names */
 
 int read_pdbfile(FILE *in, char *title, int *model_nr,
-                 t_atoms *atoms, rvec x[], int *ePBC, matrix box,
+                 struct t_atoms *atoms, rvec x[], int *ePBC, matrix box,
                  gmx_bool bChange, gmx_conect conect);
 /* Function returns number of atoms found.
  * ePBC and gmx_conect structure may be NULL.
  */
 
 void read_pdb_conf(const char *infile, char *title,
-                   t_atoms *atoms, rvec x[], int *ePBC, matrix box,
+                   struct t_atoms *atoms, rvec x[], int *ePBC, matrix box,
                    gmx_bool bChange, gmx_conect conect);
 /* 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.
@@ -153,7 +156,7 @@ gmx_bool gmx_conect_exist(gmx_conect conect, int ai, int aj);
 void gmx_conect_add(gmx_conect conect, int ai, int aj);
 /* Add a connection between ai and aj (numbered from 0 to natom-1) */
 
-gmx_conect gmx_conect_generate(t_topology *top);
+gmx_conect gmx_conect_generate(struct t_topology *top);
 /* Generate a conect structure from a topology */
 
 gmx_conect gmx_conect_init(void);
index d46168b576a313c2360c3e51a27244cc1f80b287..7d6ff971f8f0b88bc3ae6c359a0ffe271b1a87da 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.
  */
-#include "strdb.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "strdb.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
-
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 gmx_bool get_a_line(FILE *fp, char line[], int n)
 {
@@ -145,7 +142,7 @@ int get_strings(const char *db, char ***strings)
 #ifdef DEBUG
         fprintf(stderr, "Have read: %s\n", buf);
 #endif
-        ptr[i] = strdup(buf);
+        ptr[i] = gmx_strdup(buf);
     }
     gmx_ffclose(in);
 
@@ -226,7 +223,7 @@ int get_file(const char *db, char ***strings)
             maxi += 50;
             srenew(ptr, maxi);
         }
-        ptr[i] = strdup(buf);
+        ptr[i] = gmx_strdup(buf);
         i++;
     }
     nstr = i;
index 3ef5acdaba170be3e5ce0fdbcfb677937b77d895..dc35b915adeec5d2e2bef526cfff4559d8c69de7 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <stdio.h>
 
-#include "../legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
index a215baa297e9b4b6dff7f52d2013e773bb7f5ac0..6c5cbef3498731ad88b6e7074bce1c9f10b96629 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_fileio
  */
-#include <gtest/gtest.h>
-#include <string>
+#include "gmxpre.h"
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/fileio/tngio.h"
+
+#include <string>
+
+#include <gtest/gtest.h>
+
 #include "gromacs/fileio/tngio_for_tools.h"
+#include "gromacs/utility/path.h"
 
 #include "testutils/testfilemanager.h"
 
index 062a771665a1fb0dce1f2be6150288ee9f910d5c..735d649423d480023d3a93757770078d8244b5f4 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.
  */
-#include "gromacs/fileio/timecontrol.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "timecontrol.h"
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 
 /* The source code in this file should be thread-safe.
          Please keep it that way. */
index 68301685212d5009c1dbc2eb87b88ca25200c25b..512d26d827a507ef472d0ccf4a383dd6f364a272 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,8 @@
 #ifndef GMX_FILEIO_TIMECONTROL_H
 #define GMX_FILEIO_TIMECONTROL_H
 
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C"
index 35c94c2eeb6e2766a4e34d74b9e3040d6cbfcd42..2ae31c288ec8027b20e44edc3a818da2db567c34 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.
  */
-#include "tngio.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "tngio.h"
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "config.h"
 
 #ifdef GMX_USE_TNG
 #include "tng/tng_io.h"
 #endif
 
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/main.h"
-#include "gromacs/legacyheaders/physics.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
-#include "gmxfio.h"
+#include "gromacs/utility/sysinfo.h"
 
 static const char *modeToVerb(char mode)
 {
@@ -88,10 +86,7 @@ void gmx_tng_open(const char       *filename,
      */
     if (mode == 'w')
     {
-#ifndef GMX_FAHCORE
-        /* only make backups for normal gromacs */
         make_backup(filename);
-#endif
     }
 
     /* tng must not be pointing at already allocated memory.
@@ -147,9 +142,8 @@ void gmx_tng_open(const char       *filename,
 //             tng_last_program_name_set(*tng, programInfo);
 //         }
 
-#if defined(HAVE_UNISTD_H) && !defined(__MINGW32__)
         char username[256];
-        if (!getlogin_r(username, 256))
+        if (!gmx_getusername(username, 256))
         {
             if (mode == 'w')
             {
@@ -162,7 +156,6 @@ void gmx_tng_open(const char       *filename,
 //         {
 //             tng_last_user_name_set(*tng, username);
 //         }
-#endif
     }
 #else
     gmx_file("GROMACS was compiled without TNG support, cannot handle this file type");
index 1f439c537aba1467d33471c63d22032fd114265f..578b8f57edb3bd1c328cade6a75dac4e403987c4 100644 (file)
 #ifndef GMX_FILEIO_TNGIO_H
 #define GMX_FILEIO_TNGIO_H
 
-#include "gromacs/legacyheaders/typedefs.h"
 #include "tng/tng_io_fwd.h"
 
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -46,6 +49,8 @@ extern "C" {
 }
 #endif
 
+struct gmx_mtop_t;
+
 /*! \brief Open a TNG trajectory file
  *
  * \param filename   Name of file to open
@@ -67,8 +72,8 @@ void gmx_tng_close(tng_trajectory_t *tng);
  * \param tng   Valid handle to a TNG trajectory
  * \param mtop  Pointer to a topology (can be NULL)
  */
-void gmx_tng_add_mtop(tng_trajectory_t  tng,
-                      const gmx_mtop_t *mtop);
+void gmx_tng_add_mtop(tng_trajectory_t         tng,
+                      const struct gmx_mtop_t *mtop);
 
 /*! \brief Do all TNG preparation for full-precision whole-system
  * trajectory writing during MD simulations.
@@ -77,9 +82,9 @@ void gmx_tng_add_mtop(tng_trajectory_t  tng,
  * \param mtop  Global topology
  * \param ir    Input settings (for writing frequencies)
  */
-void gmx_tng_prepare_md_writing(tng_trajectory_t  tng,
-                                const gmx_mtop_t *mtop,
-                                const t_inputrec *ir);
+void gmx_tng_prepare_md_writing(tng_trajectory_t         tng,
+                                const struct gmx_mtop_t *mtop,
+                                const t_inputrec        *ir);
 
 /*! \brief Set the default compression precision for TNG writing
  *
@@ -95,9 +100,9 @@ void gmx_tng_set_compression_precision(tng_trajectory_t tng,
  * \param mtop  Global topology
  * \param ir    Input settings (for writing frequencies)
  */
-void gmx_tng_prepare_low_prec_writing(tng_trajectory_t  tng,
-                                      const gmx_mtop_t *mtop,
-                                      const t_inputrec *ir);
+void gmx_tng_prepare_low_prec_writing(tng_trajectory_t         tng,
+                                      const struct gmx_mtop_t *mtop,
+                                      const t_inputrec        *ir);
 
 /*! \brief Write a frame to a TNG file
  *
index 997b40942f33ed251a7bccd50f417ecf41bae413..15a92c1398d67a3ed4f0b5375082759a3a08e9fc 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.
  */
+#include "gmxpre.h"
+
 #include "tngio_for_tools.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <math.h>
 
-#include "tngio.h"
-#include "trx.h"
-
 #ifdef GMX_USE_TNG
 #include "tng/tng_io.h"
 #endif
 
-#include "gromacs/legacyheaders/types/atoms.h"
-#include "gromacs/legacyheaders/physics.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-
-#include "gromacs/utility/common.h"
+#include "gromacs/fileio/tngio.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/units.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 void gmx_prepare_tng_writing(const char              *filename,
@@ -540,7 +537,6 @@ gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
                         size = sizeof(double);
                         break;
                     default:
-                        size = 0; /* Just to make the compiler happy. */
                         gmx_incons("Illegal datatype of box shape values!");
                 }
                 for (int i = 0; i < DIM; i++)
index f0a31eb250354fce3f5faf692e88e1cdb598760f..c4993a272597c699af2e7447b9246e6040b04d1d 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_FILEIO_TNGIO_FOR_TOOLS_H
 #define GMX_FILEIO_TNGIO_FOR_TOOLS_H
 
-#include "gromacs/legacyheaders/typedefs.h"
+#include <stdio.h>
+
 #include "tng/tng_io_fwd.h"
 
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -46,13 +50,16 @@ extern "C" {
 }
 #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 gmx_mtop_t        *mtop,
+                             const struct gmx_mtop_t *mtop,
                              const atom_id           *index,
                              const char              *indexGroupName);
 
@@ -67,7 +74,7 @@ void gmx_prepare_tng_writing(const char              *filename,
  * atoms.
  */
 void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
-                                 t_trxframe             *frame,
+                                 struct t_trxframe      *frame,
                                  int                     natoms);
 
 /*! \brief Creates a molecule containing only the indexed atoms and sets
@@ -80,7 +87,7 @@ void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
 
 /*! \brief Read the first/next TNG frame. */
 gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
-                                 t_trxframe                 *fr,
+                                 struct t_trxframe          *fr,
                                  gmx_int64_t                *requestedIds,
                                  int                         numRequestedIds);
 
index de2e2640c9b87b7515926aca732141101b0d75de..4fba747508fc6bb1bec86b89c7fd93924bf11bf7 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 /* This file is completely threadsafe - keep it that way! */
 
+#include "tpxio.h"
+
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "names.h"
-#include "symtab.h"
-#include "futil.h"
-#include "filenm.h"
-#include "gmxfio.h"
-#include "tpxio.h"
-#include "txtdump.h"
-#include "confio.h"
-#include "atomprop.h"
-#include "copyrite.h"
-#include "vec.h"
-#include "mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define TPX_TAG_RELEASE  "release"
 
@@ -224,50 +225,6 @@ static const t_ftupd ftupd[] = {
 /* Needed for backward compatibility */
 #define MAXNODES 256
 
-static void _do_section(t_fileio *fio, int key, gmx_bool bRead, const char *src,
-                        int line)
-{
-    char     buf[STRLEN];
-    gmx_bool bDbg;
-
-    if (gmx_fio_getftp(fio) == efTPA)
-    {
-        if (!bRead)
-        {
-            gmx_fio_write_string(fio, itemstr[key]);
-            bDbg       = gmx_fio_getdebug(fio);
-            gmx_fio_setdebug(fio, FALSE);
-            gmx_fio_write_string(fio, comment_str[key]);
-            gmx_fio_setdebug(fio, bDbg);
-        }
-        else
-        {
-            if (gmx_fio_getdebug(fio))
-            {
-                fprintf(stderr, "Looking for section %s (%s, %d)",
-                        itemstr[key], src, line);
-            }
-
-            do
-            {
-                gmx_fio_do_string(fio, buf);
-            }
-            while ((gmx_strcasecmp(buf, itemstr[key]) != 0));
-
-            if (gmx_strcasecmp(buf, itemstr[key]) != 0)
-            {
-                gmx_fatal(FARGS, "\nCould not find section heading %s", itemstr[key]);
-            }
-            else if (gmx_fio_getdebug(fio))
-            {
-                fprintf(stderr, " and found it\n");
-            }
-        }
-    }
-}
-
-#define do_section(fio, key, bRead) _do_section(fio, key, bRead, __FILE__, __LINE__)
-
 /**************************************************************
  *
  * Now the higer level routines that do io of the structures and arrays
@@ -2722,7 +2679,7 @@ static void do_symtab(t_fileio *fio, t_symtab *symtab, gmx_bool bRead)
         for (i = 0; (i < nr); i++)
         {
             gmx_fio_do_string(fio, buf);
-            symbuf->buf[i] = strdup(buf);
+            symbuf->buf[i] = gmx_strdup(buf);
         }
     }
     else
@@ -3199,7 +3156,7 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
     gmx_fio_checktype(fio);
     gmx_fio_setdebug(fio, bDebugMode());
 
-    /* NEW! XDR tpb file */
+    /* XDR binary topology file */
     precision = sizeof(real);
     if (bRead)
     {
@@ -3304,7 +3261,6 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
                   gmx_fio_getname(fio), fver, tpx_version);
     }
 
-    do_section(fio, eitemHEADER, bRead);
     gmx_fio_do_int(fio, tpx->natoms);
     if (fver >= 28)
     {
@@ -3399,7 +3355,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
 #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);
-    do_section(fio, eitemBOX, bRead);
     if (tpx.bBox)
     {
         gmx_fio_ndo_rvec(fio, state->box, DIM);
@@ -3446,7 +3401,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     if (file_version < 26)
     {
         do_test(fio, tpx.bIr, ir);
-        do_section(fio, eitemIR, bRead);
         if (tpx.bIr)
         {
             if (ir)
@@ -3473,7 +3427,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     }
 
     do_test(fio, tpx.bTop, mtop);
-    do_section(fio, eitemTOP, bRead);
     if (tpx.bTop)
     {
         if (mtop)
@@ -3487,7 +3440,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
         }
     }
     do_test(fio, tpx.bX, state->x);
-    do_section(fio, eitemX, bRead);
     if (tpx.bX)
     {
         if (bRead)
@@ -3498,7 +3450,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     }
 
     do_test(fio, tpx.bV, state->v);
-    do_section(fio, eitemV, bRead);
     if (tpx.bV)
     {
         if (bRead)
@@ -3509,7 +3460,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     }
 
     do_test(fio, tpx.bF, f);
-    do_section(fio, eitemF, bRead);
     if (tpx.bF)
     {
         gmx_fio_ndo_rvec(fio, f, state->natoms);
@@ -3527,7 +3477,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     if (file_version >= 26)
     {
         do_test(fio, tpx.bIr, ir);
-        do_section(fio, eitemIR, bRead);
         if (tpx.bIr)
         {
             if (file_version >= 53)
@@ -3711,15 +3660,7 @@ int read_tpx_top(const char *fn,
 
 gmx_bool fn2bTPX(const char *file)
 {
-    switch (fn2ftp(file))
-    {
-        case efTPR:
-        case efTPB:
-        case efTPA:
-            return TRUE;
-        default:
-            return FALSE;
-    }
+    return (efTPR == fn2ftp(file));
 }
 
 static void done_gmx_groups_t(gmx_groups_t *g)
index 0e64f3b0706231e29e9f3c0c2982490cc0fecb07..0b3ca43e312d08841fb44c7c0725ea8f92664363 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * can also be used with the routines in gmxfio.h
  *
  **************************************************************/
-#include "../legacyheaders/typedefs.h"
-#include "gmxfio.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/state.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_mtop_t;
+struct t_atoms;
+struct t_block;
+struct t_topology;
+
 typedef struct
 {
     int   bIr;       /* Non zero if input_rec is present               */
@@ -79,10 +85,7 @@ typedef struct
  * These routines handle reading and writing of preprocessed
  * topology files in any of the following formats:
  * TPR : topology in XDR format, portable accross platforms
- * TPB : binary topology, not portable accross platforms
- * TPA : ascii topology (possibbly huge)
  * TRR : trajectory in XDR format (non compressed)
- * TRJ : trajectory in binary format
  *
  * Files are written in the precision with which the source are compiled,
  * but double and single precision can be read by either.
@@ -107,34 +110,30 @@ void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK,
  */
 
 void write_tpx_state(const char *fn,
-                     t_inputrec *ir, t_state *state, gmx_mtop_t *mtop);
+                     t_inputrec *ir, t_state *state, struct gmx_mtop_t *mtop);
 /* Write a file, and close it again.
- * If fn == NULL, an efTPA file will be written to stdout (which
- * will not be closed afterwards)
  */
 
 void read_tpx_state(const char *fn,
                     t_inputrec *ir, t_state *state, rvec *f,
-                    gmx_mtop_t *mtop);
+                    struct gmx_mtop_t *mtop);
 int read_tpx(const char *fn,
              t_inputrec *ir, matrix box, int *natoms,
-             rvec *x, rvec *v, rvec *f, gmx_mtop_t *mtop);
+             rvec *x, rvec *v, rvec *f, struct gmx_mtop_t *mtop);
 /* Read a file, and close it again.
- * If fn == NULL, an efTPA file will be read from stdin (which
- * will not be closed afterwards)
  * When step, t or lambda are NULL they will not be stored.
  * Returns ir->ePBC, if it could be read from the file.
  */
 
 int read_tpx_top(const char *fn,
                  t_inputrec *ir, matrix box, int *natoms,
-                 rvec *x, rvec *v, rvec *f, t_topology *top);
+                 rvec *x, rvec *v, rvec *f, struct t_topology *top);
 /* As read_tpx, but for the old t_topology struct */
 
 gmx_bool fn2bTPX(const char *file);
 /* return if *file is one of the TPX file types */
 
-gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top,
+gmx_bool read_tps_conf(const char *infile, char *title, 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.
@@ -143,7 +142,7 @@ gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top,
  * else if bMass=TRUE, read the masses into top.atoms from the mass database.
  */
 
-void tpx_make_chain_identifiers(t_atoms *atoms, t_block *mols);
+void tpx_make_chain_identifiers(struct t_atoms *atoms, struct t_block *mols);
 
 #ifdef __cplusplus
 }
index 0d90e8ea5325ffbe41231c2baa538e13425bb9a2..01b83b7de14a6aba03bb4fcfe95f21185761284a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "vec.h"
-#include "sim_util.h"
-#include "mdrun.h"
-#include "confio.h"
 #include "trajectory_writing.h"
-#include "mdoutf.h"
 
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/mdoutf.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/smalloc.h"
 
 void
 do_md_trajectory_writing(FILE           *fplog,
@@ -147,7 +145,6 @@ do_md_trajectory_writing(FILE           *fplog,
         if (bCPT)
         {
             (*nchkpt)++;
-            bCPT = FALSE;
         }
         debug_gmx();
         if (bLastStep && step_rel == ir->nsteps &&
index 632794677773f3044a9bde371c68fa5b9977be9d..37956342b12935f467d4e37efff681e0969a0748 100644 (file)
 #define GMX_FILEIO_TRAJECTORY_WRITING_H
 
 #include <stdio.h>
-#include "filenm.h"
-#include "mdoutf.h"
-#include "../legacyheaders/typedefs.h"
-#include "../legacyheaders/mdebin.h"
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/mdoutf.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/timing/wallcycle.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*! \brief Wrapper routine for writing trajectories during mdrun
  *
@@ -75,4 +81,8 @@ do_md_trajectory_writing(FILE           *fplog,
                          );
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* GMX_FILEIO_TRAJECTORY_WRITING_H */
index 91634ce09acf1d3074dec4a721fab2e2de0c54d4..a1d6c8cbd7730ee617dbb51351c39ef689e3b425 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "trnio.h"
 
 #include <string.h>
-#include "sysstuff.h"
+
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "txtdump.h"
-#include "names.h"
-#include "futil.h"
-#include "trnio.h"
-#include "gmxfio.h"
 
 #define BUFSIZE     128
 #define GROMACS_MAGIC   1993
index c5ae63e453790a716eb2d9ce007367ad3e1466d4..0dcc1e03993b579fc6bfa0f0f22d62f76baa104d 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,8 +40,8 @@
 
 /**************************************************************
  *
- * These routines handle trj (trajectory) I/O, they read and
- * write trj/trr files. The routines should be able to read single
+ * These routines handle trr (trajectory) I/O, they read and
+ * write trr files. The routines should be able to read single
  * and double precision files without the user noting it.
  * The files are backward compatible, therefore the header holds
  * some unused variables.
@@ -53,8 +53,7 @@
  *
  **************************************************************/
 
-#include "../legacyheaders/typedefs.h"
-#include "gmxfio.h"
+#include "gromacs/fileio/gmxfio.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -84,7 +83,7 @@ typedef struct           /* This struct describes the order and the   */
 } t_trnheader;
 
 t_fileio *open_trn(const char *fn, const char *mode);
-/* Open a trj / trr file */
+/* Open a trr / trr file */
 
 void close_trn(t_fileio *fio);
 /* Close it */
index b0f5096f78abe4b6c13a7f6eb3b959befa3c3114..9e551b5405c2f48a16b99182e77061140f3a0ddd 100644 (file)
 #ifndef GMX_FILEIO_TRX_H
 #define GMX_FILEIO_TRX_H
 
-#include "../legacyheaders/types/atoms.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_atoms;
+
 typedef struct gmxvmdplugin t_gmxvmdplugin;
 
-typedef struct trxframe
+typedef struct t_trxframe
 {
     int      flags;            /* flags for read_first/next_frame  */
     int      not_ok;           /* integrity flags                  */
@@ -76,7 +80,7 @@ typedef struct trxframe
     real            lambda;    /* free energy perturbation lambda  */
     int             fep_state; /* which fep state are we in? */
     gmx_bool        bAtoms;
-    t_atoms        *atoms;     /* atoms struct (natoms)            */
+    struct t_atoms *atoms;     /* atoms struct (natoms)            */
     gmx_bool        bPrec;
     real            prec;      /* precision of x, fraction of 1 nm */
     gmx_bool        bX;
index 2c9eb34e53000fa5875a6d23d43192125d4e8d5c..8e70f73716fc8a234b7446db8e5b2a2b27d31de4 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.
  */
+#include "gmxpre.h"
+
 #include "trxio.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <assert.h>
 #include <math.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#ifdef GMX_USE_PLUGINS
-#include "vmdio.h"
-#endif
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
+#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/trnio.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/fileio/xtcio.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "pbc.h"
-#include "gmxfio.h"
-#include "trxio.h"
-#include "tpxio.h"
-#include "trnio.h"
-#include "tngio.h"
-#include "tngio_for_tools.h"
-#include "names.h"
-#include "vec.h"
-#include "futil.h"
-#include "xtcio.h"
-#include "pdbio.h"
-#include "confio.h"
-#include "checkpoint.h"
-#include "xdrf.h"
 
-#include "gromacs/fileio/timecontrol.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#ifdef GMX_USE_PLUGINS
+#include "gromacs/fileio/vmdio.h"
+#endif
 
 /* defines for frame counter output */
 #define SKIP1   10
@@ -339,7 +337,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
 
     switch (ftp)
     {
-        case efTRJ:
         case efTRR:
         case efTNG:
             break;
@@ -354,7 +351,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
 
     switch (ftp)
     {
-        case efTRJ:
         case efTRR:
         case efTNG:
             if (fr->bV)
@@ -396,7 +392,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
         case efXTC:
             write_xtc(status->fio, nind, fr->step, fr->time, fr->box, xout, prec);
             break;
-        case efTRJ:
         case efTRR:
             fwrite_trn(status->fio, nframes_read(status),
                        fr->time, fr->step, fr->box, nind, xout, vout, fout);
@@ -434,8 +429,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
 
     switch (ftp)
     {
-        case efTRN:
-        case efTRJ:
         case efTRR:
         case efTNG:
             if (vout)
@@ -535,7 +528,6 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
 
     switch (gmx_fio_getftp(status->fio))
     {
-        case efTRJ:
         case efTRR:
             break;
         default:
@@ -552,7 +544,6 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
         case efXTC:
             write_xtc(status->fio, fr->natoms, fr->step, fr->time, fr->box, fr->x, prec);
             break;
-        case efTRJ:
         case efTRR:
             fwrite_trn(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);
@@ -815,7 +806,6 @@ gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status, t_trxfram
         }
         switch (ftp)
         {
-            case efTRJ:
             case efTRR:
                 bRet = gmx_next_frame(status, fr);
                 break;
@@ -949,7 +939,6 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status,
     }
     switch (ftp)
     {
-        case efTRJ:
         case efTRR:
             break;
         case efCPT:
index d3b64a91c87fe2af217e8e3d15c95f0c37b6e146..0d32e364051a95bccbe9a4cecb6bae2050dc91e4 100644 (file)
 #ifndef GMX_FILEIO_TRXIO_H
 #define GMX_FILEIO_TRXIO_H
 
-#include "../legacyheaders/typedefs.h"
-#include "filenm.h"
-#include "../legacyheaders/readinp.h"
-#include "pdbio.h"
-#include "../legacyheaders/oenv.h"
-#include "gmxfio.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/readinp.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,6 +51,11 @@ extern "C" {
 }
 #endif
 
+struct gmx_mtop_t;
+struct t_atoms;
+struct t_topology;
+struct t_trxframe;
+
 /* a dedicated status type contains fp, etc. */
 typedef struct t_trxstatus t_trxstatus;
 
@@ -68,23 +72,23 @@ int prec2ndec(real prec);
  * 1/(nm) */
 real ndec2prec(int ndec);
 
-void clear_trxframe(t_trxframe *fr, gmx_bool bFirst);
+void clear_trxframe(struct t_trxframe *fr, gmx_bool bFirst);
 /* Set all content gmx_booleans to FALSE.
  * When bFirst = TRUE, set natoms=-1, all pointers to NULL
  *                     and all data to zero.
  */
 
-void set_trxframe_ePBC(t_trxframe *fr, int ePBC);
+void set_trxframe_ePBC(struct t_trxframe *fr, int ePBC);
 /* Set the type of periodic boundary conditions, ePBC=-1 is not set */
 
 int nframes_read(t_trxstatus *status);
 /* Returns the number of frames read from the trajectory */
 
-int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
+int write_trxframe_indexed(t_trxstatus *status, struct t_trxframe *fr, int nind,
                            const atom_id *ind, gmx_conect gc);
 /* Write an indexed frame to a TRX file, see write_trxframe. gc may be NULL */
 
-int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc);
+int write_trxframe(t_trxstatus *status, struct t_trxframe *fr, gmx_conect gc);
 /* Write a frame to a TRX file.
  * Only entries for which the gmx_boolean is TRUE will be written,
  * except for step, time, lambda and/or box, which may not be
@@ -94,7 +98,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc);
  * gc is important for pdb file writing only and may be NULL.
  */
 
-int write_trx(t_trxstatus *status, int nind, const atom_id *ind, t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const atom_id *ind, struct t_atoms *atoms,
               int step, real time, matrix box, rvec x[], rvec *v,
               gmx_conect gc);
 /* Write an indexed frame to a TRX file.
@@ -102,15 +106,15 @@ int write_trx(t_trxstatus *status, int nind, const atom_id *ind, t_atoms *atoms,
  * atoms can be NULL for file types which don't need atom names.
  */
 
-void trjtools_gmx_prepare_tng_writing(const char       *filename,
-                                      char              filemode,
-                                      t_trxstatus      *in,
-                                      t_trxstatus     **out,
-                                      const char       *infile,
-                                      const int         natoms,
-                                      const gmx_mtop_t *mtop,
-                                      const atom_id    *index,
-                                      const char       *index_group_name);
+void trjtools_gmx_prepare_tng_writing(const char               *filename,
+                                      char                      filemode,
+                                      t_trxstatus              *in,
+                                      t_trxstatus             **out,
+                                      const char               *infile,
+                                      const int                 natoms,
+                                      const struct gmx_mtop_t  *mtop,
+                                      const atom_id            *index,
+                                      const char               *index_group_name);
 /* Sets up *out for writing TNG. If *in != NULL and contains a TNG trajectory
  * some data, e.g. molecule system, will be copied over from *in to *out.
  * If *in == NULL a file name (infile) of a TNG file can be provided instead
@@ -129,11 +133,11 @@ void trjtools_gmx_prepare_tng_writing(const char       *filename,
  * tng_trajectory_t are encapsulated, so client trajectory-writing
  * code with a t_trxstatus can't just call the TNG writing
  * function. */
-void write_tng_frame(t_trxstatus *status,
-                     t_trxframe  *fr);
+void write_tng_frame(t_trxstatus        *status,
+                     struct t_trxframe  *fr);
 
 void close_trx(t_trxstatus *status);
-/* Close trj file as opened with read_first_x, read_frist_frame
+/* Close trajectory file as opened with read_first_x, read_frist_frame
  * or open_trx. Identical to close_trj.
  */
 
@@ -199,7 +203,7 @@ int check_times(real t);
 #define FRAME_NOT_OK  (HEADER_NOT_OK | DATA_NOT_OK)
 
 int read_first_frame(const output_env_t oenv, t_trxstatus **status,
-                     const char *fn, t_trxframe *fr, int flags);
+                     const char *fn, struct t_trxframe *fr, int flags);
 /* Read the first frame which is in accordance with flags, which are
  * defined further up in this file.
  * Returns natoms when succeeded, 0 otherwise.
@@ -209,7 +213,7 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status,
  */
 
 gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status,
-                         t_trxframe *fr);
+                         struct t_trxframe *fr);
 /* Reads the next frame which is in accordance with fr->flags.
  * Returns TRUE when succeeded, FALSE otherwise.
  */
@@ -229,14 +233,14 @@ gmx_bool read_next_x(const output_env_t oenv, t_trxstatus *status, real *t, rvec
  */
 
 void close_trj(t_trxstatus *status);
-/* Close trj file as opened with read_first_x, read_frist_frame
+/* 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 trj file as opened with read_first_x */
+/* Rewind trajectory file as opened with read_first_x */
 
-t_topology *read_top(const char *fn, int *ePBC);
+struct t_topology *read_top(const char *fn, int *ePBC);
 /* Extract a topology data structure from a topology file.
  * If ePBC!=NULL *ePBC gives the pbc type.
  */
index 7d9c67c779d33613f2baf4c9d32d2be47739eb1c..621160a9e8f91fe49085b0e71be53b01d8c1eb43 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.
  */
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "vmdio.h"
+
+#include "config.h"
 
 /* Derived from PluginMgr.C and catdcd.c */
 
 /*                                                                           */
 /*****************************************************************************/
 
-#include <stdlib.h>
+#include <assert.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <assert.h>
 
-#include <config.h>
 /*
  * Plugin header files; get plugin source from www.ks.uiuc.edu/Research/vmd"
  */
 #ifndef _WIN32_IE
 #define _WIN32_IE 0x0500 /* SHGetFolderPath is available since WinXP/IE5 */
 #endif
-#include <windows.h>
 #include <shlobj.h>
+#include <windows.h>
 #endif
-#include "gromacs/utility/smalloc.h"
-#include "futil.h"
-#include "vmdio.h"
-
 
-#include "types/simple.h"
-#include "vec.h"
-#include "gmxfio.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 typedef int (*initfunc)(void);
index 6e11d75d54d837b20e53387aecfd9b6c8184dbf5..ec4d1250ad99aef4071a00b66571327c19f0a61a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_VMDIO_H_
-#define GMX_FILEIO_VMDIO_H_
+#ifndef GMX_FILEIO_VMDIO_H
+#define GMX_FILEIO_VMDIO_H
 
 #include "external/vmd_molfile/molfile_plugin.h"
-#include "trx.h"
+
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_trxframe;
+
 struct gmxvmdplugin
 {
     molfile_plugin_t *api;
@@ -51,11 +53,11 @@ struct gmxvmdplugin
     gmx_bool          bV;
 };
 
-int read_first_vmd_frame(const char *fn, struct trxframe *fr);
-gmx_bool read_next_vmd_frame(struct trxframe *fr);
+int read_first_vmd_frame(const char *fn, struct t_trxframe *fr);
+gmx_bool read_next_vmd_frame(struct t_trxframe *fr);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* GMX_FILEIO_VMDIO_H_ */
+#endif
index dba6c5c15eb6dc57338160bd98eb033dc8bbf7fc..a0ae4e15cb9719aa319be7a9eafbef634b198fdc 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.
  */
-#include "writeps.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "writeps.h"
 
 #include <stdio.h>
 
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
-
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 const char *fontnm[efontNR] = {
     "Times-Roman", "Times-Italic",     "Times-Bold",    "Times-BoldItalic",
index 243fc4ff55437943bad463f8dda6abd0d6efa1a6..33b8dadde2be052507bdb54a8d36414895ed9283 100644 (file)
 #define GMX_FILEIO_WRITEPS_H
 
 #include <stdio.h>
-#include "../legacyheaders/types/matrix.h"
-#include "../legacyheaders/types/simple.h"
+
+#include "gromacs/legacyheaders/types/rgb.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index e48afd19bbe2acb1e05c82e3a6203aed8a4b88fe..5af573e7b3b9ef1a698dcca7d95a397283c72397 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "xdrf.h"
-#include "gmx_fatal.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 int xdr_real(XDR *xdrs, real *r)
@@ -109,7 +107,7 @@ int xdr_int64(XDR *xdrs, gmx_int64_t *i)
     imaj   = (int)imaj64;
     imin   = (int)imin64;
     ret    = xdr_int(xdrs, &imaj);
-    ret    = xdr_int(xdrs, &imin);
+    ret   |= xdr_int(xdrs, &imin);
 
     *i = (((gmx_int64_t)imaj << 32) | ((gmx_int64_t)imin & two_p32_m1));
 
index 830867f72883f9b0edc4071d7ffac3959718ffc1..dd2959e9863924c8b3f5e9ae6ebdffe0d0fcfba2 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,9 @@
 #define GMX_FILEIO_XDRF_H
 
 #include <stdio.h>
-#include "../legacyheaders/typedefs.h"
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __PGI    /*Portland group compiler*/
 #define int64_t long long
@@ -47,7 +49,7 @@
 #include "config.h"
 
 #ifdef GMX_INTERNAL_XDR
-#include "gmx_system_xdr.h"
+#include "gromacs/fileio/gmx_system_xdr.h"
 #else
 #include <rpc/rpc.h>
 #include <rpc/xdr.h>
index da52ac6bc24cb12c78b909bc1f953158c3ef2ae7..248146417a3c9b66342d7cf088c48563922c8f4c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
-#include "typedefs.h"
-#include "xdrf.h"
-#include "gmxfio.h"
 #include "xtcio.h"
+
+#include <string.h>
+
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "futil.h"
-#include "gmx_fatal.h"
 
 #define XTC_MAGIC 1995
 
index 494cd863beb12afc577af0b1ae6c0b154a84fea9..2c50fb89f0bc5300b79069b29f7e84593636ea39 100644 (file)
@@ -2,8 +2,8 @@
  * 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, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_FILEIO_XTCIO_H
 #define GMX_FILEIO_XTCIO_H
 
-#include "../legacyheaders/typedefs.h"
-#include "gmxfio.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 96%
rename from src/gromacs/gmxlib/xvgr.cpp
rename to src/gromacs/fileio/xvgr.cpp
index 11e362ebeb5a7a3db4876dde9a4a0577d569c9c0..f38f950b8c4bbf977d08ce59f0a6f825c2a1414c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
+#include "xvgr.h"
 
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
+#include <ctype.h>
+#include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
-#include "copyrite.h"
-#include "oenv.h"
-#include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
-#include "viewit.h"
-#include "vec.h"
 #include "gromacs/fileio/gmxfio.h"
-
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/sysinfo.h"
 
 gmx_bool output_env_get_print_xvgr_codes(const output_env_t oenv)
 {
@@ -241,22 +232,22 @@ void xvgr_header(FILE *fp, const char *title, const char *xaxis,
                  const output_env_t oenv)
 {
     char   pukestr[100], buf[STRLEN];
-    time_t t;
 
     if (output_env_get_print_xvgr_codes(oenv))
     {
-        time(&t);
-        gmx_ctime_r(&t, buf, STRLEN);
+        gmx_format_current_time(buf, STRLEN);
         fprintf(fp, "# This file was created %s", buf);
         try
         {
             gmx::BinaryInformationSettings settings;
             settings.generatedByHeader(true);
             settings.linePrefix("# ");
-            gmx::printBinaryInformation(fp, gmx::getProgramContext(), settings);
+            gmx::printBinaryInformation(fp, output_env_get_program_context(oenv),
+                                        settings);
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-        fprintf(fp, "# %s is part of G R O M A C S:\n#\n", ShortProgram());
+        fprintf(fp, "# %s is part of G R O M A C S:\n#\n",
+                output_env_get_program_display_name(oenv));
         bromacs(pukestr, 99);
         fprintf(fp, "# %s\n#\n", pukestr);
         fprintf(fp, "@    title \"%s\"\n", xvgrstr(title, oenv, buf, STRLEN));
@@ -502,24 +493,25 @@ static char *fgets3(FILE *fp, char **ptr, int *len, int maxlen)
 
 static int wordcount(char *ptr)
 {
-    int i, n, is[2];
+    int i, n = 0, is[2];
     int cur = 0;
 #define prev (1-cur)
 
-    if (strlen(ptr) == 0)
-    {
-        return 0;
-    }
-    /* fprintf(stderr,"ptr='%s'\n",ptr); */
-    n = 1;
-    for (i = 0; (ptr[i] != '\0'); i++)
+    if (NULL != ptr)
     {
-        is[cur] = isspace(ptr[i]);
-        if ((i > 0)  && (is[cur] && !is[prev]))
+        for (i = 0; (ptr[i] != '\0'); i++)
         {
-            n++;
+            is[cur] = isspace(ptr[i]);
+            if ((0 == i) && !is[cur])
+            {
+                n++;
+            }
+            else if ((i > 0)  && (!is[cur] && is[prev]))
+            {
+                n++;
+            }
+            cur = prev;
         }
-        cur = prev;
     }
     return n;
 }
@@ -536,17 +528,17 @@ static char *read_xvgr_string(const char *line)
         ptr1 = strchr(ptr0, '"');
         if (ptr1 != NULL)
         {
-            str            = strdup(ptr0);
+            str            = gmx_strdup(ptr0);
             str[ptr1-ptr0] = '\0';
         }
         else
         {
-            str = strdup("");
+            str = gmx_strdup("");
         }
     }
     else
     {
-        str = strdup("");
+        str = gmx_strdup("");
     }
 
     return str;
@@ -691,6 +683,8 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
 
     *y = yy;
     sfree(tmpbuf);
+    sfree(base);
+    sfree(fmt);
 
     if (legend_nalloc > 0)
     {
similarity index 96%
rename from src/gromacs/legacyheaders/xvgr.h
rename to src/gromacs/fileio/xvgr.h
index 22123bdd0441be5c86cc108d698225a18138a236..542387b1892575cb8a4e38bf519a9df5ef1a6807 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_XVGR_H
+#define GMX_FILEIO_XVGR_H
 
-#ifndef _xvgr_h
-#define _xvgr_h
+#include <stdio.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "viewit.h"
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -191,4 +192,4 @@ real **read_xvg_time(const char *fn,
 }
 #endif
 
-#endif  /* _xvgr_h */
+#endif
index 7c3b7da4a00b1b6183ea07e32449e77f9f8e1de4..19772897542846ae9505d66fffe081a59a3449fd 100644 (file)
 
 file(GLOB GMXANA_SOURCES *.c *.cpp)
 
-set(GMXANA_PUBLIC_HEADERS
+gmx_install_headers(
     gstat.h
     )
-gmx_install_headers(gmxana ${GMXANA_PUBLIC_HEADERS})
 
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXANA_SOURCES} PARENT_SCOPE)
 
index de46abf7ff78fcef8c0126334f3d4796a6e842ab..a1fc18e8d1b67861ccb9b9d72f17d280a773e659 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
-#include "physics.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "txtdump.h"
-#include "bondf.h"
-#include "xvgr.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "gstat.h"
+
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/trxio.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 void print_one(const output_env_t oenv, const char *base, const char *name,
                const char *title, const char *ylabel, int nf, real time[],
@@ -71,7 +70,7 @@ void print_one(const output_env_t oenv, const char *base, const char *name,
     {
         fprintf(fp, "%10g  %10g\n", time[k], data[k]);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 static int calc_RBbin(real phi, int gmx_unused multiplicity, real gmx_unused core_frac)
@@ -301,7 +300,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
         {
             fprintf(fp, "%10.3f  %10d\n", time[j], tr_f[j]);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     /* Compute histogram from # transitions per dihedral */
@@ -331,7 +330,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans,
                 fprintf(fp, "%10.3f  %10d\n", ttime/i, tr_f[i]);
             }
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     sfree(tr_f);
@@ -589,7 +588,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist,
                     }
                 }
                 fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
-                gmx_ffclose(fp);
+                xvgrclose(fp);
             }
 
             /* and finally print out occupancies to a single file */
@@ -616,7 +615,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist,
     }
 
     sfree(chi_prtrj);
-    gmx_ffclose(fpall);
+    xvgrclose(fpall);
     fprintf(stderr, "\n");
 
 }
@@ -676,7 +675,7 @@ void calc_distribution_props(int nh, int histo[], real start,
     *S2 = tdc*tdc+tds*tds;
 }
 
-static void calc_angles(t_pbc *pbc,
+static void calc_angles(struct t_pbc *pbc,
                         int n3, atom_id index[], real ang[], rvec x_s[])
 {
     int  i, ix, t1, t2;
@@ -730,7 +729,7 @@ static real calc_fraction(real angles[], int nangles)
     }
 }
 
-static void calc_dihs(t_pbc *pbc,
+static void calc_dihs(struct t_pbc *pbc,
                       int n4, atom_id index[], real ang[], rvec x_s[])
 {
     int  i, ix, t1, t2, t3;
@@ -818,15 +817,15 @@ void read_ang_dih(const char *trj_fn,
                   real *dih[],
                   const output_env_t oenv)
 {
-    t_pbc       *pbc;
-    t_trxstatus *status;
-    int          i, angind, natoms, total, teller;
-    int          nangles, n_alloc;
-    real         t, fraction, pifac, aa, angle;
-    real        *angles[2];
-    matrix       box;
-    rvec        *x;
-    int          cur = 0;
+    struct t_pbc *pbc;
+    t_trxstatus  *status;
+    int           i, angind, natoms, total, teller;
+    int           nangles, n_alloc;
+    real          t, fraction, pifac, aa, angle;
+    real         *angles[2];
+    matrix        box;
+    rvec         *x;
+    int           cur = 0;
 #define prev (1-cur)
 
     snew(pbc, 1);
index 5e273a0bc01f8172f893e405a42fcf776711bcd8..ac5135bef4fcc177a2f530245cab9f29df03083b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <stdio.h>
-#include "types/simple.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 
 /*Make range-array (Permutation identity) for sorting */
 void rangeArray(int *ar, int size)
index ea173f15c7dac866ad9a690bc99d88da75f89d30..85bb9ec93cba7e3ff56188966e59a1b9726bccef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef _binsearch_h
 #define _binsearch_h
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C"
index 7eb7155eedb0134a0d6aedf22216045738260590..fab0b3444a4d606d4551836efe410766b32f722b 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "cmat.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "xvgr.h"
+
 #include "gromacs/fileio/matio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 t_mat *init_mat(int n1, gmx_bool b1D)
 {
@@ -232,7 +231,7 @@ void low_rmsd_dist(const char *fn, real maxrms, int nn, real **mat,
     {
         fprintf(fp, "%10g  %10d\n", i/fac, histo[i]);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     sfree(histo);
 }
 
index e7786a1e06a586b7cde4c01d95a3638f3298eb81..64673ec1354bba23cb7a6daf8d65c2f905834d14 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 #ifndef _cmat_h
 #define _cmat_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 typedef struct {
     int  i, j;
diff --git a/src/gromacs/gmxana/correl.c b/src/gromacs/gmxana/correl.c
deleted file mode 100644 (file)
index b4a2c9b..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "gromacs/fft/fft.h"
-#include "gromacs/utility/smalloc.h"
-#include "correl.h"
-
-#define SWAP(a, b) tempr = (a); (a) = (b); (b) = tempr
-
-void four1(real data[], int nn, int isign)
-{
-    int    n, mmax, m, j, istep, i;
-    double wtemp, wr, wpr, wpi, wi, theta;
-    real   tempr, tempi;
-
-    n = nn << 1;
-    j = 1;
-    for (i = 1; i < n; i += 2)
-    {
-        if (j > i)
-        {
-            SWAP(data[j], data[i]);
-            SWAP(data[j+1], data[i+1]);
-        }
-        m = n >> 1;
-        while (m >= 2 && j > m)
-        {
-            j  -= m;
-            m >>= 1;
-        }
-        j += m;
-    }
-    mmax = 2;
-    while (n > mmax)
-    {
-        istep = 2*mmax;
-        theta = 6.28318530717959/(isign*mmax);
-        wtemp = sin(0.5*theta);
-        wpr   = -2.0*wtemp*wtemp;
-        wpi   = sin(theta);
-        wr    = 1.0;
-        wi    = 0.0;
-        for (m = 1; m < mmax; m += 2)
-        {
-            for (i = m; i <= n; i += istep)
-            {
-                j          = i+mmax;
-                tempr      = wr*data[j]-wi*data[j+1];
-                tempi      = wr*data[j+1]+wi*data[j];
-                data[j]    = data[i]-tempr;
-                data[j+1]  = data[i+1]-tempi;
-                data[i]   += tempr;
-                data[i+1] += tempi;
-            }
-            wr = (wtemp = wr)*wpr-wi*wpi+wr;
-            wi = wi*wpr+wtemp*wpi+wi;
-        }
-        mmax = istep;
-    }
-}
-
-#undef SWAP
-
-static void realft(real data[], int n, int isign)
-{
-    int    i, i1, i2, i3, i4, n2p3;
-    real   c1 = 0.5, c2, h1r, h1i, h2r, h2i;
-    double wr, wi, wpr, wpi, wtemp, theta;
-
-    theta = 3.141592653589793/(double) n;
-    if (isign == 1)
-    {
-        c2 = -0.5;
-        four1(data, n, 1);
-    }
-    else
-    {
-        c2    = 0.5;
-        theta = -theta;
-    }
-    wtemp = sin(0.5*theta);
-    wpr   = -2.0*wtemp*wtemp;
-    wpi   = sin(theta);
-    wr    = 1.0+wpr;
-    wi    = wpi;
-    n2p3  = 2*n+3;
-    for (i = 2; i <= n/2; i++)
-    {
-        i4       = 1+(i3 = n2p3-(i2 = 1+(i1 = i+i-1)));
-        h1r      = c1*(data[i1]+data[i3]);
-        h1i      = c1*(data[i2]-data[i4]);
-        h2r      = -c2*(data[i2]+data[i4]);
-        h2i      = c2*(data[i1]-data[i3]);
-        data[i1] = h1r+wr*h2r-wi*h2i;
-        data[i2] = h1i+wr*h2i+wi*h2r;
-        data[i3] = h1r-wr*h2r+wi*h2i;
-        data[i4] = -h1i+wr*h2i+wi*h2r;
-        wr       = (wtemp = wr)*wpr-wi*wpi+wr;
-        wi       = wi*wpr+wtemp*wpi+wi;
-    }
-    if (isign == 1)
-    {
-        data[1] = (h1r = data[1])+data[2];
-        data[2] = h1r-data[2];
-    }
-    else
-    {
-        data[1] = c1*((h1r = data[1])+data[2]);
-        data[2] = c1*(h1r-data[2]);
-        four1(data, n, -1);
-    }
-}
-
-static void twofft(real data1[], real data2[], real fft1[], real fft2[], int n)
-{
-    int  nn3, nn2, jj, j;
-    real rep, rem, aip, aim;
-
-    nn3 = 1+(nn2 = 2+n+n);
-    for (j = 1, jj = 2; j <= n; j++, jj += 2)
-    {
-        fft1[jj-1] = data1[j];
-        fft1[jj]   = data2[j];
-    }
-    four1(fft1, n, 1);
-    fft2[1] = fft1[2];
-    fft1[2] = fft2[2] = 0.0;
-    for (j = 3; j <= n+1; j += 2)
-    {
-        rep         = 0.5*(fft1[j]+fft1[nn2-j]);
-        rem         = 0.5*(fft1[j]-fft1[nn2-j]);
-        aip         = 0.5*(fft1[j+1]+fft1[nn3-j]);
-        aim         = 0.5*(fft1[j+1]-fft1[nn3-j]);
-        fft1[j]     = rep;
-        fft1[j+1]   = aim;
-        fft1[nn2-j] = rep;
-        fft1[nn3-j] = -aim;
-        fft2[j]     = aip;
-        fft2[j+1]   = -rem;
-        fft2[nn2-j] = aip;
-        fft2[nn3-j] = rem;
-    }
-}
-
-void correl(real data1[], real data2[], int n, real ans[])
-{
-    int     no2, i;
-    real    dum, *fft;
-
-    snew(fft, 2*n+1);
-    twofft(data1, data2, fft, ans, n);
-    no2 = n/2;
-    for (i = 2; i <= n+2; i += 2)
-    {
-        dum      = ans[i-1];
-        ans[i-1] = (fft[i-1]*dum+fft[i]*ans[i])/no2;
-        ans[i]   = (fft[i]*dum-fft[i-1]*ans[i])/no2;
-    }
-    ans[2] = ans[n+1];
-    realft(ans, no2, -1);
-    sfree(fft);
-}
index 585422bde3626d1b9389954ddc4129349bfd44b1..bd08b5247a0b1b43d76416a7c22ea2d6dad709c7 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 /* dens_filter.c
  * Routines for Filters and convolutions
  */
 
-#include <math.h>
-#include "typedefs.h"
 #include "dens_filter.h"
+
+#include <math.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
 
 #ifdef GMX_DOUBLE
 #define EXP(x) (exp(x))
index d10b2fa7bc545dc872122521691e6aa0cb741c06..acbc23ae156d09474e162d16da974650bb4bcb3b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,7 +36,8 @@
 #ifndef _dens_filter_h
 #define _dens_filter_h
 
-#include "types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C"
index 11ee4eaea02e047789b1a88be26da662a4fa3cbc..b7578cef623f03e97c71f8f2dd82ae9b537ae70a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdlib.h>
 #include <string.h>
 
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gstat.h"
-#include "gmx_fatal.h"
-#include "index.h"
 
 t_dlist *mk_dlist(FILE *log,
                   t_atoms *atoms, int *nlist,
                   gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
-                  int maxchi, int r0, gmx_residuetype_t rt)
+                  int maxchi, int r0, gmx_residuetype_t *rt)
 {
     int       ires, i, j, k, ii;
     t_dihatms atm, prev;
index 973660bdc8654ad10f65c819274892ef285f93ec..0338366db0c28712d22cfa6e082b7ab043812287 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "symtab.h"
 
 void replace_atom(t_topology *top, int inr, char *anm, char *resnm,
                   real q, real m, int type)
index 2d555dc274572e1d05f76e3bcb22e81e41b478b3..8d65ffbc59ab3123577f8604cf5b7af5a2a8f26e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
 #include "eigio.h"
-#include "gromacs/fileio/trnio.h"
+
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/trnio.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
                        rvec **xref, gmx_bool *bDMR,
index e77db733c817a22599c4dc0a74d9ed4589c09ae5..b254923bb6812bc59b2cd037e8660d63166449bf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 #ifndef _eigio_h
 #define _eigio_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 enum {
     eWXR_NO, eWXR_YES, eWXR_NOFIT
diff --git a/src/gromacs/gmxana/expfit.c b/src/gromacs/gmxana/expfit.c
deleted file mode 100644 (file)
index 406f5a3..0000000
+++ /dev/null
@@ -1,726 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include <string.h>
-
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "vec.h"
-#include "index.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
-
-const int   nfp_ffn[effnNR] = { 0, 1, 2, 3, 2, 5, 7, 9, 4, 3};
-
-const char *s_ffn[effnNR+2] = {
-    NULL, "none", "exp", "aexp", "exp_exp", "vac",
-    "exp5", "exp7", "exp9", "erffit", NULL, NULL
-};
-/* We don't allow errest as a choice on the command line */
-
-const char *longs_ffn[effnNR] = {
-    "no fit",
-    "y = exp(-x/a1)",
-    "y = a2 exp(-x/a1)",
-    "y = a2 exp(-x/a1) + (1-a2) exp(-x/a3)",
-    "y = exp(-v) (cosh(wv) + 1/w sinh(wv)), v = x/(2 a1), w = sqrt(1 - a2)",
-    "y = a1 exp(-x/a2) +  a3 exp(-x/a4) + a5",
-    "y = a1 exp(-x/a2) +  a3 exp(-x/a4) + a5 exp(-x/a6) + a7",
-    "y = a1 exp(-x/a2) +  a3 exp(-x/a4) + a5 exp(-x/a6) + a7 exp(-x/a8) + a9",
-    "y = 1/2*(a1+a2) - 1/2*(a1-a2)*erf( (x-a3) /a4^2)",
-    "y = a2*ee(a1,x) + (1-a2)*ee(a2,x)"
-};
-
-extern gmx_bool mrqmin_new(real x[], real y[], real sig[], int ndata, real a[],
-                           int ia[], int ma, real **covar, real **alpha, real *chisq,
-                           void (*funcs)(real, real [], real *, real []),
-                           real *alamda);
-
-static real myexp(real x, real A, real tau)
-{
-    if ((A == 0) || (tau == 0))
-    {
-        return 0;
-    }
-    return A*exp(-x/tau);
-}
-
-void erffit (real x, real a[], real *y, real dyda[])
-{
-/* Fuction
- *     y=(a1+a2)/2-(a1-a2)/2*erf((x-a3)/a4^2)
- */
-
-    real erfarg;
-    real erfval;
-    real erfarg2;
-    real derf;
-
-    erfarg  = (x-a[3])/(a[4]*a[4]);
-    erfarg2 = erfarg*erfarg;
-    erfval  = gmx_erf(erfarg)/2;
-    derf    = M_2_SQRTPI*(a[1]-a[2])/2*exp(-erfarg2)/(a[4]*a[4]);
-    *y      = (a[1]+a[2])/2-(a[1]-a[2])*erfval;
-    dyda[1] = 1/2-erfval;
-    dyda[2] = 1/2+erfval;
-    dyda[3] = derf;
-    dyda[4] = 2*derf*erfarg;
-}
-
-
-
-static void exp_one_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = exp(-x/a1)
-     *
-     */
-
-    real e1;
-
-    e1      = exp(-x/a[1]);
-    *y      = e1;
-    dyda[1] = x*e1/sqr(a[1]);
-}
-
-static void exp_two_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = a2 exp(-x/a1)
-     *
-     */
-
-    real e1;
-
-    e1      = exp(-x/a[1]);
-    *y      = a[2]*e1;
-    dyda[1] = x*a[2]*e1/sqr(a[1]);
-    dyda[2] = e1;
-}
-
-static void exp_3_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = a2 exp(-x/a1) + (1-a2) exp(-x/a3)
-     *
-     */
-
-    real e1, e2;
-
-    e1      = exp(-x/a[1]);
-    e2      = exp(-x/a[3]);
-    *y      = a[2]*e1 + (1-a[2])*e2;
-    dyda[1] = x*a[2]*e1/sqr(a[1]);
-    dyda[2] = e1-e2;
-    dyda[3] = x*(1-a[2])*e2/sqr(a[3]);
-}
-
-static void exp_5_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = a1 exp(-x/a2) + a3 exp(-x/a4) + a5
-     *
-     */
-
-    real e1, e2;
-
-    e1      = exp(-x/a[2]);
-    e2      = exp(-x/a[4]);
-    *y      = a[1]*e1 + a[3]*e2 + a[5];
-
-    if (debug)
-    {
-        fprintf(debug, "exp_5_parm called: x = %10.3f  y = %10.3f\n"
-                "a = ( %8.3f  %8.3f  %8.3f  %8.3f  %8.3f)\n",
-                x, *y, a[1], a[2], a[3], a[4], a[5]);
-    }
-    dyda[1] = e1;
-    dyda[2] = x*e1/sqr(a[2]);
-    dyda[3] = e2;
-    dyda[4] = x*e2/sqr(a[4]);
-    dyda[5] = 0;
-}
-
-static void exp_7_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = a1 exp(-x/a2) + a3 exp(-x/a4) + a5 exp(-x/a6) + a7
-     *
-     */
-
-    real e1, e2, e3;
-
-    e1      = exp(-x/a[2]);
-    e2      = exp(-x/a[4]);
-    e3      = exp(-x/a[6]);
-    *y      = a[1]*e1 + a[3]*e2 + a[5]*e3 + a[7];
-
-    dyda[1] = e1;
-    dyda[2] = x*e1/sqr(a[2]);
-    dyda[3] = e2;
-    dyda[4] = x*e2/sqr(a[4]);
-    dyda[5] = e3;
-    dyda[6] = x*e3/sqr(a[6]);
-    dyda[7] = 0;
-}
-
-static void exp_9_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = a1 exp(-x/a2) + a3 exp(-x/a4) + a5 exp(-x/a6) + a7
-     *
-     */
-
-    real e1, e2, e3, e4;
-
-    e1      = exp(-x/a[2]);
-    e2      = exp(-x/a[4]);
-    e3      = exp(-x/a[6]);
-    e4      = exp(-x/a[8]);
-    *y      = a[1]*e1 + a[3]*e2 + a[5]*e3 + a[7]*e4 + a[9];
-
-    dyda[1] = e1;
-    dyda[2] = x*e1/sqr(a[2]);
-    dyda[3] = e2;
-    dyda[4] = x*e2/sqr(a[4]);
-    dyda[5] = e3;
-    dyda[6] = x*e3/sqr(a[6]);
-    dyda[7] = e4;
-    dyda[8] = x*e4/sqr(a[8]);
-    dyda[9] = 0;
-}
-
-static void vac_2_parm(real x, real a[], real *y, real dyda[])
-{
-    /* Fit to function
-     *
-     * y = 1/2 (1 - 1/w) exp(-(1+w)v) + 1/2 (1 + 1/w) exp(-(1-w)v)
-     *
-     *   = exp(-v) (cosh(wv) + 1/w sinh(wv))
-     *
-     *    v = x/(2 a1)
-     *    w = sqrt(1 - a2)
-     *
-     *    For tranverse current autocorrelation functions:
-     *       a1 = tau
-     *       a2 = 4 tau (eta/rho) k^2
-     *
-     */
-
-    double v, det, omega, omega2, em, ec, es;
-
-    v   = x/(2*a[1]);
-    det = 1 - a[2];
-    em  = exp(-v);
-    if (det != 0)
-    {
-        omega2  = fabs(det);
-        omega   = sqrt(omega2);
-        if (det > 0)
-        {
-            ec = em*0.5*(exp(omega*v)+exp(-omega*v));
-            es = em*0.5*(exp(omega*v)-exp(-omega*v))/omega;
-        }
-        else
-        {
-            ec = em*cos(omega*v);
-            es = em*sin(omega*v)/omega;
-        }
-        *y      = ec + es;
-        dyda[2] = (v/det*ec+(v-1/det)*es)/(-2.0);
-        dyda[1] = (1-det)*v/a[1]*es;
-    }
-    else
-    {
-        *y      = (1+v)*em;
-        dyda[2] = -v*v*em*(0.5+v/6);
-        dyda[1] = v*v/a[1]*em;
-    }
-}
-
-static void errest_3_parm(real x, real a[], real *y, real dyda[])
-{
-    real e1, e2, v1, v2;
-
-    if (a[1])
-    {
-        e1 = exp(-x/a[1]) - 1;
-    }
-    else
-    {
-        e1 = 0;
-    }
-    if (a[3])
-    {
-        e2 = exp(-x/a[3]) - 1;
-    }
-    else
-    {
-        e2 = 0;
-    }
-
-    if (x > 0)
-    {
-        v1      = 2*a[1]*(e1*a[1]/x + 1);
-        v2      = 2*a[3]*(e2*a[3]/x + 1);
-        *y      = a[2]*v1 + (1-a[2])*v2;
-        dyda[1] = 2*     a[2] *(v1/a[1] + e1);
-        dyda[3] = 2*(1 - a[2])*(v2/a[3] + e2);
-        dyda[2] = (v1 - v2);
-    }
-    else
-    {
-        *y      = 0;
-        dyda[1] = 0;
-        dyda[3] = 0;
-        dyda[2] = 0;
-    }
-}
-
-typedef void (*myfitfn)(real x, real a[], real *y, real dyda[]);
-myfitfn mfitfn[effnNR] = {
-    exp_one_parm, exp_one_parm, exp_two_parm, exp_3_parm, vac_2_parm,
-    exp_5_parm,   exp_7_parm,   exp_9_parm, erffit,  errest_3_parm
-};
-
-real fit_function(int eFitFn, real *parm, real x)
-{
-    static real y, dum[8];
-
-    mfitfn[eFitFn](x, parm-1, &y, dum);
-
-    return y;
-}
-
-/* lmfit_exp supports up to 3 parameter fitting of exponential functions */
-static gmx_bool lmfit_exp(int nfit, real x[], real y[], real dy[], real ftol,
-                          real parm[], real dparm[], gmx_bool bVerbose,
-                          int eFitFn, int fix)
-{
-    real     chisq, ochisq, alamda;
-    real    *a, **covar, **alpha, *dum;
-    gmx_bool bCont;
-    int      i, j, ma, mfit, *lista, *ia;
-
-    if ((eFitFn < 0) || (eFitFn >= effnNR))
-    {
-        gmx_fatal(FARGS, "fitfn = %d, should be in 0..%d (%s,%d)",
-                  effnNR-1, eFitFn, __FILE__, __LINE__);
-    }
-
-    ma = mfit = nfp_ffn[eFitFn];   /* number of parameters to fit */
-    snew(a, ma+1);
-    snew(covar, ma+1);
-    snew(alpha, ma+1);
-    snew(lista, ma+1);
-    snew(ia, ma+1);
-    snew(dum, ma+1);
-    for (i = 1; (i < ma+1); i++)
-    {
-        lista[i] = i;
-        ia[i]    = 1; /* fixed bug B.S.S 19/11  */
-        snew(covar[i], ma+1);
-        snew(alpha[i], ma+1);
-    }
-    if (fix)
-    {
-        if (bVerbose)
-        {
-            fprintf(stderr, "Will keep parameters fixed during fit procedure: %d\n",
-                    fix);
-        }
-        for (i = 0; i < ma; i++)
-        {
-            if (fix & 1<<i)
-            {
-                ia[i+1] = 0;
-            }
-        }
-    }
-    if (debug)
-    {
-        fprintf(debug, "%d parameter fit\n", mfit);
-    }
-
-    /* Initial params */
-    alamda = -1;  /* Starting value   */
-    chisq  = 1e12;
-    for (i = 0; (i < mfit); i++)
-    {
-        a[i+1] = parm[i];
-    }
-
-    j = 0;
-    if (bVerbose)
-    {
-        fprintf(stderr, "%4s  %10s  %10s  %10s  %10s  %10s %10s\n",
-                "Step", "chi^2", "Lambda", "A1", "A2", "A3", "A4");
-    }
-    do
-    {
-        ochisq = chisq;
-        /* mrqmin(x-1,y-1,dy-1,nfit,a,ma,lista,mfit,covar,alpha,
-         *   &chisq,expfn[mfit-1],&alamda)
-         */
-        if (!mrqmin_new(x-1, y-1, dy-1, nfit, a, ia, ma, covar, alpha, &chisq,
-                        mfitfn[eFitFn], &alamda))
-        {
-            return FALSE;
-        }
-
-        if (bVerbose)
-        {
-            fprintf(stderr, "%4d  %10.5e  %10.5e  %10.5e",
-                    j, chisq, alamda, a[1]);
-            if (mfit > 1)
-            {
-                fprintf(stderr, "  %10.5e", a[2]);
-            }
-            if (mfit > 2)
-            {
-                fprintf(stderr, "  %10.5e", a[3]);
-            }
-            if (mfit > 3)
-            {
-                fprintf(stderr, " %10.5e", a[4]);
-            }
-            fprintf(stderr, "\n");
-        }
-        j++;
-        bCont = ((fabs(ochisq - chisq) > fabs(ftol*chisq)) ||
-                 ((ochisq == chisq)));
-    }
-    while (bCont && (alamda != 0.0) && (j < 50));
-    if (bVerbose)
-    {
-        fprintf(stderr, "\n");
-    }
-
-    /* Now get the covariance matrix out */
-    alamda = 0;
-
-    /*  mrqmin(x-1,y-1,dy-1,nfit,a,ma,lista,mfit,covar,alpha,
-     * &chisq,expfn[mfit-1],&alamda)
-     */
-    if (!mrqmin_new(x-1, y-1, dy-1, nfit, a, ia, ma, covar, alpha, &chisq,
-                    mfitfn[eFitFn], &alamda))
-    {
-        return FALSE;
-    }
-
-    for (j = 0; (j < mfit); j++)
-    {
-        parm[j]  = a[j+1];
-        dparm[j] = covar[j+1][j+1];
-    }
-
-    for (i = 0; (i < ma+1); i++)
-    {
-        sfree(covar[i]);
-        sfree(alpha[i]);
-    }
-    sfree(a);
-    sfree(covar);
-    sfree(alpha);
-    sfree(lista);
-    sfree(dum);
-
-    return TRUE;
-}
-
-real do_lmfit(int ndata, real c1[], real sig[], real dt, real x0[],
-              real begintimefit, real endtimefit, const output_env_t oenv,
-              gmx_bool bVerbose, int eFitFn, real fitparms[], int fix)
-{
-    FILE *fp;
-    char  buf[32];
-
-    int   i, j, nparm, nfitpnts;
-    real  integral, ttt;
-    real *parm, *dparm;
-    real *x, *y, *dy;
-    real  ftol = 1e-4;
-
-    nparm = nfp_ffn[eFitFn];
-    if (debug)
-    {
-        fprintf(debug, "There are %d points to fit %d vars!\n", ndata, nparm);
-        fprintf(debug, "Fit to function %d from %g through %g, dt=%g\n",
-                eFitFn, begintimefit, endtimefit, dt);
-    }
-
-    snew(x, ndata);
-    snew(y, ndata);
-    snew(dy, ndata);
-
-    j = 0;
-    for (i = 0; i < ndata; i++)
-    {
-        ttt = x0 ? x0[i] : dt*i;
-        if (ttt >= begintimefit && ttt <= endtimefit)
-        {
-            x[j] = ttt;
-            y[j] = c1[i];
-
-            /* mrqmin does not like sig to be zero */
-            if (sig[i] < 1.0e-7)
-            {
-                dy[j] = 1.0e-7;
-            }
-            else
-            {
-                dy[j] = sig[i];
-            }
-            if (debug)
-            {
-                fprintf(debug, "j= %d, i= %d, x= %g, y= %g, dy= %g\n",
-                        j, i, x[j], y[j], dy[j]);
-            }
-            j++;
-        }
-    }
-    nfitpnts = j;
-    integral = 0;
-    if (nfitpnts < nparm)
-    {
-        fprintf(stderr, "Not enough data points for fitting!\n");
-    }
-    else
-    {
-        snew(parm, nparm);
-        snew(dparm, nparm);
-        if (fitparms)
-        {
-            for (i = 0; (i < nparm); i++)
-            {
-                parm[i] = fitparms[i];
-            }
-        }
-
-        if (!lmfit_exp(nfitpnts, x, y, dy, ftol, parm, dparm, bVerbose, eFitFn, fix))
-        {
-            fprintf(stderr, "Fit failed!\n");
-        }
-        else if (nparm <= 3)
-        {
-            /* Compute the integral from begintimefit */
-            if (nparm == 3)
-            {
-                integral = (parm[0]*myexp(begintimefit, parm[1],  parm[0]) +
-                            parm[2]*myexp(begintimefit, 1-parm[1], parm[2]));
-            }
-            else if (nparm == 2)
-            {
-                integral = parm[0]*myexp(begintimefit, parm[1],  parm[0]);
-            }
-            else if (nparm == 1)
-            {
-                integral = parm[0]*myexp(begintimefit, 1,  parm[0]);
-            }
-            else
-            {
-                gmx_fatal(FARGS, "nparm = %d in file %s, line %d",
-                          nparm, __FILE__, __LINE__);
-            }
-
-            /* Generate THE output */
-            if (bVerbose)
-            {
-                fprintf(stderr, "FIT: # points used in fit is: %d\n", nfitpnts);
-                fprintf(stderr, "FIT: %21s%21s%21s\n",
-                        "parm0     ", "parm1 (ps)   ", "parm2 (ps)    ");
-                fprintf(stderr, "FIT: ------------------------------------------------------------\n");
-                fprintf(stderr, "FIT: %8.3g +/- %8.3g%9.4g +/- %8.3g%8.3g +/- %8.3g\n",
-                        parm[0], dparm[0], parm[1], dparm[1], parm[2], dparm[2]);
-                fprintf(stderr, "FIT: Integral (calc with fitted function) from %g ps to inf. is: %g\n",
-                        begintimefit, integral);
-
-                sprintf(buf, "test%d.xvg", nfitpnts);
-                fp = xvgropen(buf, "C(t) + Fit to C(t)", "Time (ps)", "C(t)", oenv);
-                fprintf(fp, "# parm0 = %g, parm1 = %g, parm2 = %g\n",
-                        parm[0], parm[1], parm[2]);
-                for (j = 0; (j < nfitpnts); j++)
-                {
-                    ttt = x0 ? x0[j] : dt*j;
-                    fprintf(fp, "%10.5e  %10.5e  %10.5e\n",
-                            ttt, c1[j], fit_function(eFitFn, parm, ttt));
-                }
-                xvgrclose(fp);
-            }
-        }
-        if (fitparms)
-        {
-            for (i = 0; (i < nparm); i++)
-            {
-                fitparms[i] = parm[i];
-            }
-        }
-        sfree(parm);
-        sfree(dparm);
-    }
-
-    sfree(x);
-    sfree(y);
-    sfree(dy);
-
-    return integral;
-}
-
-void do_expfit(int ndata, real c1[], real dt, real begintimefit, real endtimefit)
-{
-    int   i, n;
-    real *x, *y, *Dy;
-    real  aa, bb, saa, sbb, A, tau, dA, dtau;
-
-    fprintf(stderr, "Will fit data from %g (ps) to %g (ps).\n",
-            begintimefit, endtimefit);
-
-    snew(x, ndata); /* allocate the maximum necessary space */
-    snew(y, ndata);
-    snew(Dy, ndata);
-    n = 0;
-
-    for (i = 0; (i < ndata); i++)
-    {
-        if ( (dt*i >= begintimefit) && (dt*i <= endtimefit) )
-        {
-            x[n]  = dt*i;
-            y[n]  = c1[i];
-            Dy[n] = 0.5;
-            fprintf(stderr, "n= %d, i= %d, x= %g, y= %g\n", n, i, x[n], y[n]);
-            n++;
-        }
-    }
-    fprintf(stderr, "# of data points used in the fit is : %d\n\n", n);
-    expfit(n, x, y, Dy, &aa, &saa, &bb, &sbb);
-
-    A    = exp(aa);
-    dA   = exp(aa)*saa;
-    tau  = -1.0/bb;
-    dtau = sbb/sqr(bb);
-    fprintf(stderr, "Fitted to y=exp(a+bx):\n");
-    fprintf(stderr, "a = %10.5f\t b = %10.5f", aa, bb);
-    fprintf(stderr, "\n");
-    fprintf(stderr, "Fitted to y=Aexp(-x/tau):\n");
-    fprintf(stderr, "A  = %10.5f\t tau  = %10.5f\n", A, tau);
-    fprintf(stderr, "dA = %10.5f\t dtau = %10.5f\n", dA, dtau);
-}
-
-
-void expfit(int n, real *x, real *y, real *Dy, real *a, real *sa,
-            real *b, real *sb)
-{
-    real *w, *ly, A, SA, B, SB;
-    int   i;
-    real  sum, xbar, ybar, Sxx, Sxy, wr2, chi2, gamma, Db;
-
-#define ZERO 0.0
-#define ONE 1.0
-#define ONEP5 1.5
-#define TWO 2.0
-
-#define sqr(x) ((x)*(x))
-
-    /*allocate memory */
-    snew(w, n);
-    snew(ly, n);
-
-    /* Calculate weights and values of ln(y). */
-    for (i = 0; (i < n); i++)
-    {
-        w[i]  = sqr(y[i]/Dy[i]);
-        ly[i] = log(y[i]);
-    }
-
-    /* The weighted averages of x and y: xbar and ybar. */
-    sum  = ZERO;
-    xbar = ZERO;
-    ybar = ZERO;
-    for (i = 0; (i < n); i++)
-    {
-        sum  += w[i];
-        xbar += w[i]*x[i];
-        ybar += w[i]*ly[i];
-    }
-    xbar /= sum;
-    ybar /= sum;
-
-    /* The centered product sums Sxx and Sxy, and hence A and B. */
-    Sxx = ZERO;
-    Sxy = ZERO;
-    for (i = 0; (i < n); i++)
-    {
-        Sxx += w[i]*sqr(x[i]-xbar);
-        Sxy += w[i]*(x[i]-xbar)*(ly[i]-ybar);
-    }
-    B = Sxy/Sxx;
-    A = ybar-B*xbar;
-
-    /* Chi-squared (chi2) and gamma. */
-    chi2  = ZERO;
-    gamma = ZERO;
-    for (i = 0; (i < n); i++)
-    {
-        wr2    = w[i]*sqr(ly[i]-A-B*x[i]);
-        chi2  += wr2;
-        gamma += wr2*(x[i]-xbar);
-    }
-
-    /* Refined values of A and B. Also SA and SB. */
-    Db  = -ONEP5*gamma/Sxx;
-    B  += Db;
-    A  -= ONEP5*chi2/sum-xbar*Db;
-    SB  = sqrt((chi2/(n-2))/Sxx);
-    SA  = SB*sqrt(Sxx/sum+sqr(xbar));
-    *a  = A;
-    *b  = B;
-    *sa = SA;
-    *sb = SB;
-}
index 7ee4bf867cb51ed0ac2df7b43e14c9dbd5bf01e2..24b5a955d1a8c23ee37335083f0ad023bc7c16ba 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "fitahx.h"
-#include "vec.h"
 
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 static void my_calc_xcm(int nbb, atom_id bbind[], rvec x[], rvec xcm)
index ea5bca18bb6554d58f362ad1c8c94563bedf2492..399028ef054e7de3da18a4b06e4ff7e98d124395 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,8 +39,8 @@
 #define _fitahx_h
 
 
-#include "typedefs.h"
-#include "hxprops.h"
+#include "gromacs/gmxana/hxprops.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 extern real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[],
                     rvec x[], int nca, atom_id caindex[], gmx_bool bFit);
index a9ee8113de24ba2119bab8c271d90ef89d61d8a7..d06a4b41d8e91e8ffde3df410454fe98a4181083 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
 #include "geminate.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include <math.h>
+#include <stdlib.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 static void missing_code_message()
 {
@@ -515,7 +515,7 @@ static double eq10v2(double theoryCt[], double time[], int manytimes,
 /* This returns the real-valued index(!) to an ACF, equidistant on a log scale. */
 static double getLogIndex(const int i, const t_gemParams *params)
 {
-    return (exp(((double)(i)) * params->logQuota) -1);
+    return gmx_expm1(((double)(i)) * params->logQuota);
 }
 
 extern t_gemParams *init_gemParams(const double sigma, const double D,
index dc95b06d96329220e8f9413e9b748a57fe203f0f..91bb0974210a17b7b2b3110ef7a1b154e365255e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _GEMINATE_H
 #define _GEMINATE_H
 
+#include <stddef.h>
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
 enum {
     gemNULL, gemNONE, gemDD, gemAD, gemAA, gemA4, gemNR
 };
index acac0e9bebee62e18c135cd139f45f68d0237ad0..787c935e249d1aeb30e71dd8ae201ebdd7d56423 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, by the GROMACS development team, led by
+ * 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.
@@ -189,9 +189,6 @@ gmx_principal(int argc, char *argv[]);
 int
 gmx_rama(int argc, char *argv[]);
 
-int
-gmx_rdf(int argc, char *argv[]);
-
 int
 gmx_rotmat(int argc, char *argv[]);
 
@@ -270,9 +267,6 @@ gmx_membed(int argc, char *argv[]);
 int
 gmx_pme_error(int argc, char *argv[]);
 
-int
-gmx_options(int argc, char *argv[]);
-
 int
 gmx_sans(int argc, char *argv[]);
 
index 67bb1e7c6c339fe5c684fa8d0ec629c658c35bb9..73832bb487c0d46972fbb7e80cc595d71d9b3a61 100644 (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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <stdlib.h>
 #include <string.h>
 
+#include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
-#include "copyrite.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/cstringutil.h"
-#include "vec.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/statistics/statistics.h"
-#include "gromacs/commandline/pargs.h"
-#include "typedefs.h"
-#include "xvgr.h"
-#include "macros.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static const char *etitles[] = { "E-docked", "Free Energy" };
 
@@ -197,7 +196,7 @@ static void analyse_em_all(int npdb, t_pdbfile *pdbf[], const char *edocked,
         {
             fprintf(fp, "%12lf\n", bFreeSort ? pdbf[i]->efree : pdbf[i]->edocked);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 }
 
index f0d58de9f9c3dd920a79749be51d0f66fc280334..b7b83105f39a30ebe5438b44466c47a69827eb51 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/matio.h"
+#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/matio.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "rmpbc.h"
-#include "txtdump.h"
-#include "eigio.h"
-#include "physics.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void calc_entropy_qh(FILE *fp, int n, real eigval[], real temp, int nskip)
 {
@@ -78,7 +76,7 @@ static void calc_entropy_qh(FILE *fp, int n, real eigval[], real temp, int nskip
             lambda = eigval[i]*AMU;
             w      = sqrt(BOLTZMANN*temp/lambda)/NANO;
             hwkT   = (hbar*w)/(BOLTZMANN*temp);
-            dS     = (hwkT/(exp(hwkT) - 1) - log(1-exp(-hwkT)));
+            dS     = (hwkT/gmx_expm1(hwkT) - gmx_log1p(-exp(-hwkT)));
             S     += dS;
             if (debug)
             {
@@ -486,7 +484,7 @@ static void overlap(const char *outfile, int natoms,
         fprintf(out, "%5d  %5.3f\n", eignr2[x]+1, overlap/noutvec);
     }
 
-    gmx_ffclose(out);
+    xvgrclose(out);
 }
 
 static void project(const char *trajfile, t_topology *top, int ePBC, matrix topbox,
@@ -647,7 +645,7 @@ static void project(const char *trajfile, t_topology *top, int ePBC, matrix topb
         for (v = 0; v < noutvec; v++)
         {
             sprintf(str, "vec %d", eignr[outvec[v]]+1);
-            ylabel[v] = strdup(str);
+            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),
@@ -672,7 +670,7 @@ static void project(const char *trajfile, t_topology *top, int ePBC, matrix topb
             }
             fprintf(xvgrout, "%10.5f %10.5f\n", inprod[0][i], inprod[noutvec-1][i]);
         }
-        gmx_ffclose(xvgrout);
+        xvgrclose(xvgrout);
     }
 
     if (threedplotfile)
@@ -713,8 +711,8 @@ static void project(const char *trajfile, t_topology *top, int ePBC, matrix topb
         init_t_atoms(&atoms, nframes, FALSE);
         snew(x, nframes);
         snew(b, nframes);
-        atnm  = strdup("C");
-        resnm = strdup("PRJ");
+        atnm  = gmx_strdup("C");
+        resnm = gmx_strdup("PRJ");
 
         if (nframes > 10000)
         {
@@ -879,7 +877,7 @@ static void components(const char *outfile, int natoms,
     {
         v = outvec[g];
         sprintf(str, "vec %d", eignr[v]+1);
-        ylabel[g] = strdup(str);
+        ylabel[g] = gmx_strdup(str);
         snew(y[g], 4);
         for (s = 0; s < 4; s++)
         {
@@ -936,7 +934,7 @@ static void rmsf(const char *outfile, int natoms, real *sqrtm,
             gmx_fatal(FARGS, "Selected vector %d is larger than the number of eigenvalues (%d)", eignr[v]+1, neig);
         }
         sprintf(str, "vec %d", eignr[v]+1);
-        ylabel[g] = strdup(str);
+        ylabel[g] = gmx_strdup(str);
         snew(y[g], natoms);
         for (i = 0; i < natoms; i++)
         {
@@ -1103,7 +1101,7 @@ int gmx_anaeig(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW | PCA_BE_NICE,
+                           PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 480c1c67b2c164ebcab95e860b7e8afa63c5a8c2..e02ce3650f1fd899f9928c201b5f3920179f4b90 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
-#include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "copyrite.h"
-#include "gromacs/fileio/futil.h"
-#include "readinp.h"
-#include "txtdump.h"
-#include "gstat.h"
-#include "gromacs/statistics/statistics.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
-#include "geminate.h"
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/correlationfunctions/integrate.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/geminate.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/linearalgebra/matrix.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/statistics/statistics.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /* must correspond to char *avbar_opt[] declared in main() */
 enum {
@@ -86,7 +89,7 @@ static void power_fit(int n, int nset, real **val, real *t)
         fprintf(stdout, "First time is not larger than 0, using index number as time for power fit\n");
         for (i = 0; i < n; i++)
         {
-            x[i] = log(i+1);
+            x[i] = gmx_log1p(i);
         }
     }
 
@@ -153,7 +156,7 @@ static void plot_coscont(const char *ccfile, int n, int nset, real **val,
     }
     fprintf(stdout, "\n");
 
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 static void regression_analysis(int n, gmx_bool bXYdy,
@@ -293,7 +296,7 @@ void histogram(const char *distfile, real binwidth, int n, int nset, real **val,
             fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
         }
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 static int real_comp(const void *a, const void *b)
@@ -391,7 +394,7 @@ static void average(const char *avfile, int avbar_opt,
     }
 }
 
-static real anal_ee_inf(real *parm, real T)
+static real anal_ee_inf(double *parm, real T)
 {
     return sqrt(parm[1]*2*parm[0]/T+parm[3]*2*parm[2]/T);
 }
@@ -408,7 +411,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
     double   blav, var;
     char   **leg;
     real    *tbs, *ybs, rtmp, dens, *fitsig, twooe, tau1_est, tau_sig;
-    real     fitparm[4];
+    double   fitparm[4];
     real     ee, a, tau1, tau2;
 
     if (n < 4)
@@ -628,8 +631,9 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
 
         if (bFitAc)
         {
-            int   fitlen;
-            real *ac, acint, ac_fit[4];
+            int    fitlen;
+            real  *ac, acint;
+            double ac_fit[4];
 
             snew(ac, n);
             for (i = 0; i < n; i++)
@@ -692,7 +696,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
     sfree(fitsig);
     sfree(ybs);
     sfree(tbs);
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 static void luzar_correl(int nn, real *time, int nset, real **val, real temp,
@@ -787,14 +791,15 @@ static void do_fit(FILE *out, int n, gmx_bool bYdy,
                    int ny, real *x0, real **val,
                    int npargs, t_pargs *ppa, const output_env_t oenv)
 {
-    real *c1 = NULL, *sig = NULL, *fitparm;
-    real  tendfit, tbeginfit;
-    int   i, efitfn, nparm;
+    real   *c1 = NULL, *sig = NULL;
+    double *fitparm;
+    real    tendfit, tbeginfit;
+    int     i, efitfn, nparm;
 
     efitfn = get_acffitfn();
-    nparm  = nfp_ffn[efitfn];
+    nparm  = effnNparams(efitfn);
     fprintf(out, "Will fit to the following function:\n");
-    fprintf(out, "%s\n", longs_ffn[efitfn]);
+    fprintf(out, "%s\n", effnDescription(efitfn));
     c1 = val[n];
     if (bYdy)
     {
@@ -936,6 +941,7 @@ static void do_ballistic(const char *balFile, int nData,
         }
         sfree(ctd);
         sfree(td);
+        xvgrclose(fp);
     }
     else
     {
@@ -997,6 +1003,7 @@ static void do_geminate(const char *gemFile, int nData,
     sfree(ctd);
     sfree(ctdGem);
     sfree(td);
+    xvgrclose(fp);
 }
 
 int gmx_analyze(int argc, char *argv[])
@@ -1362,7 +1369,7 @@ int gmx_analyze(int argc, char *argv[])
                 fprintf(out, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
             }
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
         fprintf(stderr, "\r%d, time=%g\n", j-1, (j-1)*dt);
     }
     if (ccfile)
index 534f9153cd47d73ea42158b76963101f4c939c12..abbe1f8820ac9b7402ce2afaa225a0f3ada17597 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "physics.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "vec.h"
-#include "index.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
-#include "gstat.h"
+#include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/fileio/trnio.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void dump_dih_trn(int nframes, int nangles, real **dih, const char *fn,
                          real *time)
@@ -181,7 +180,7 @@ int gmx_g_angle(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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, asize(bugs), bugs,
                            &oenv))
     {
@@ -306,7 +305,7 @@ int gmx_g_angle(int argc, char *argv[])
             }
             fprintf(out, "\n");
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
     }
     if (opt2bSet("-or", NFILE, fnm))
     {
@@ -324,7 +323,7 @@ int gmx_g_angle(int argc, char *argv[])
             fprintf(out, "%10.5f  %10.3f\n", time[i], trans_frac[i]);
             tfrac += trans_frac[i];
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
 
         tfrac /= nframes;
         fprintf(stderr, "Average trans fraction: %g\n", tfrac);
@@ -466,7 +465,7 @@ int gmx_g_angle(int argc, char *argv[])
         fprintf(out, "%10g  %10f\n", 180.0, angstat[0]*norm_fac);
     }
 
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     do_view(oenv, opt2fn("-od", NFILE, fnm), "-nxy");
     if (bAver)
index 4f7ad985a90a5817353d2cea2d65845c85ac9114..d6d937152718a51bf7f052af7616eddeebe1fe39 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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-#include <string.h>
 #include <ctype.h>
-#include <math.h>
 #include <float.h>
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "macros.h"
 #include "gromacs/fileio/enxio.h"
-#include "physics.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/utility/cstringutil.h"
-#include "names.h"
-#include "mdebin.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 
 /* Structure for the names of lambda vector components */
@@ -356,7 +355,7 @@ static void lambda_vec_print(const lambda_vec_t *lv, char *str, gmx_bool named)
         str += sprintf(str, "dH/dl");
         if (strlen(lv->lc->names[lv->dhdl]) > 0)
         {
-            str += sprintf(str, " (%s)", lv->lc->names[lv->dhdl]);
+            sprintf(str, " (%s)", lv->lc->names[lv->dhdl]);
         }
     }
 }
@@ -3973,7 +3972,11 @@ int gmx_bar(int argc, char *argv[])
     {
         lambda_vec_print_short(results[nresults-1].b->native_lambda, buf);
         fprintf(fpi, xvg2format, buf, dg_tot);
-        gmx_ffclose(fpi);
+        xvgrclose(fpi);
+    }
+    if (fpb != NULL)
+    {
+        xvgrclose(fpb);
     }
 
     do_view(oenv, opt2fn_null("-o", NFILE, fnm), "-xydy");
index 263ed985e4c7f30acafff0542b98f696ec0c68da..c858b356adbba6598722fd48b9e7533e9783ada6 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "xvgr.h"
-#include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define MAX_ENDS 3
 
@@ -261,7 +258,7 @@ int gmx_bundle(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -428,17 +425,17 @@ int gmx_bundle(int argc, char *argv[])
     {
         close_trx(fpdb);
     }
-    gmx_ffclose(flen);
-    gmx_ffclose(fdist);
-    gmx_ffclose(fz);
-    gmx_ffclose(ftilt);
-    gmx_ffclose(ftiltr);
-    gmx_ffclose(ftiltl);
+    xvgrclose(flen);
+    xvgrclose(fdist);
+    xvgrclose(fz);
+    xvgrclose(ftilt);
+    xvgrclose(ftiltr);
+    xvgrclose(ftiltl);
     if (bKink)
     {
-        gmx_ffclose(fkink);
-        gmx_ffclose(fkinkr);
-        gmx_ffclose(fkinkl);
+        xvgrclose(fkink);
+        xvgrclose(fkinkr);
+        xvgrclose(fkinkl);
     }
 
     return 0;
index 93a5e02c33184d59b039ff088948046023d320b2..8756ac7bc17a9b90ab67c2a7e056d4aafa5909a5 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdio.h>
+#include <string.h>
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "macros.h"
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-#include <string.h>
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "gromacs/fileio/matio.h"
 #include "gmx_ana.h"
 
 static gmx_bool bAllowed(real phi, real psi)
@@ -440,7 +441,7 @@ static int reset_em_all(int nlist, t_dlist dlist[], int nf,
     return j;
 }
 
-static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
+static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
                           int nf, int maxchi, real **dih,
                           int nlist, t_dlist dlist[],
                           atom_id index[],
@@ -682,15 +683,15 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
         snew(leg, NJC);
         for (i = 0; (i < NKKKPHI); i++)
         {
-            leg[i] = strdup(kkkphi[i].name);
+            leg[i] = gmx_strdup(kkkphi[i].name);
         }
         for (i = 0; (i < NKKKPSI); i++)
         {
-            leg[i+NKKKPHI] = strdup(kkkpsi[i].name);
+            leg[i+NKKKPHI] = gmx_strdup(kkkpsi[i].name);
         }
         for (i = 0; (i < NKKKCHI); i++)
         {
-            leg[i+NKKKPHI+NKKKPSI] = strdup(kkkchi1[i].name);
+            leg[i+NKKKPHI+NKKKPSI] = gmx_strdup(kkkchi1[i].name);
         }
         xvgr_legend(fp, NJC, (const char**)leg, oenv);
         fprintf(fp, "%5s ", "#Res.");
@@ -708,7 +709,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
             }
             fprintf(fp, "\n");
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
         for (i = 0; (i < NJC); i++)
         {
             sfree(leg[i]);
@@ -808,7 +809,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t rt,
                     }
                 }
                 fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
-                gmx_ffclose(fp);
+                xvgrclose(fp);
                 if (bSSHisto)
                 {
                     for (k = 0; (k < 3); k++)
@@ -939,7 +940,7 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
             {
                 gmx_ffclose(gp);
             }
-            gmx_ffclose(fp);
+            xvgrclose(fp);
             if (bOm)
             {
                 sprintf(fn, "ramomega%s.xpm", dlist[i].name);
@@ -996,7 +997,7 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
             {
                 fprintf(fp, "%10g  %10g\n", RAD2DEG*dih[Xi1][j], RAD2DEG*dih[Xi2][j]);
             }
-            gmx_ffclose(fp);
+            xvgrclose(fp);
         }
         else
         {
@@ -1019,15 +1020,15 @@ static void print_transitions(const char *fn, int maxchi, int nlist,
     char *leg[edMax];
 #define NLEG asize(leg)
 
-    leg[0] = strdup("Phi");
-    leg[1] = strdup("Psi");
-    leg[2] = strdup("Omega");
-    leg[3] = strdup("Chi1");
-    leg[4] = strdup("Chi2");
-    leg[5] = strdup("Chi3");
-    leg[6] = strdup("Chi4");
-    leg[7] = strdup("Chi5");
-    leg[8] = strdup("Chi6");
+    leg[0] = gmx_strdup("Phi");
+    leg[1] = gmx_strdup("Psi");
+    leg[2] = gmx_strdup("Omega");
+    leg[3] = gmx_strdup("Chi1");
+    leg[4] = gmx_strdup("Chi2");
+    leg[5] = gmx_strdup("Chi3");
+    leg[6] = gmx_strdup("Chi4");
+    leg[7] = gmx_strdup("Chi5");
+    leg[8] = gmx_strdup("Chi6");
 
     /* Print order parameters */
     fp = xvgropen(fn, "Dihedral Rotamer Transitions", "Residue", "Transitions/ns",
@@ -1057,7 +1058,7 @@ static void print_transitions(const char *fn, int maxchi, int nlist,
         /* fprintf(fp,"%12s\n",dlist[i].name);  this confuses xmgrace */
         fprintf(fp, "\n");
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 static void order_params(FILE *log,
@@ -1083,7 +1084,7 @@ static void order_params(FILE *log,
 
     for (i = 0; i < NLEG; i++)
     {
-        leg[i] = strdup(const_leg[i]);
+        leg[i] = gmx_strdup(const_leg[i]);
     }
 
     /* Print order parameters */
@@ -1135,7 +1136,7 @@ static void order_params(FILE *log,
         fprintf(fp, "\n");
         /* fprintf(fp,"%12s\n",dlist[i].name);  this confuses xmgrace */
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     if (NULL != pdbfn)
     {
@@ -1362,7 +1363,7 @@ int gmx_chi(int argc, char *argv[])
     gmx_bool           bDo_rt, bDo_oh, bDo_ot, bDo_jc;
     real               dt = 0, traj_t_ns;
     output_env_t       oenv;
-    gmx_residuetype_t  rt;
+    gmx_residuetype_t *rt;
 
     atom_id            isize, *index;
     int                ndih, nactdih, nf;
@@ -1390,7 +1391,7 @@ int gmx_chi(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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, asize(bugs), bugs,
                            &oenv))
     {
index 4919de60897ffb785ffe390c425f728141cf093f..034e10a2b05b03580b9ebb4575efdb2c44807c54 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/trxio.h"
-#include "gromacs/utility/cstringutil.h"
-#include "vec.h"
-#include "macros.h"
-#include "index.h"
-#include "gromacs/random/random.h"
-#include "pbc.h"
-#include "rmpbc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/matio.h"
-#include "cmat.h"
+#include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trnio.h"
-#include "viewit.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/cmat.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/random/random.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /* print to two file pointers at once (i.e. stderr and log) */
 static gmx_inline
@@ -139,11 +136,6 @@ typedef struct {
     int *nb;
 } t_nnb;
 
-void pr_energy(FILE *fp, real e)
-{
-    fprintf(fp, "Energy: %8.4f\n", e);
-}
-
 void cp_index(int nn, int from[], int to[])
 {
     int i;
@@ -283,7 +275,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
 
     if (NULL != fp)
     {
-        fclose(fp);
+        xvgrclose(fp);
     }
 }
 
@@ -998,7 +990,7 @@ static void ana_trans(t_clusters *clust, int nf,
         {
             fprintf(fp, "%5d %5d\n", i+1, ntrans[i]);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     sfree(ntrans);
     for (i = 0; i < clust->ncl; i++)
@@ -1021,7 +1013,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                              gmx_bool bFit, FILE *log, t_rgb rlo, t_rgb rhi,
                              const output_env_t oenv)
 {
-    FILE        *fp = NULL;
+    FILE        *size_fp = NULL;
     char         buf[STRLEN], buf1[40], buf2[40], buf3[40], *trxsfn;
     t_trxstatus *trxout  = NULL;
     t_trxstatus *trxsout = NULL;
@@ -1096,7 +1088,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
 
     if (clustidfn)
     {
-        fp = xvgropen(clustidfn, "Clusters", output_env_get_xvgr_tlabel(oenv), "Cluster #", oenv);
+        FILE *fp = xvgropen(clustidfn, "Clusters", output_env_get_xvgr_tlabel(oenv), "Cluster #", oenv);
         if (output_env_get_print_xvgr_codes(oenv))
         {
             fprintf(fp, "@    s0 symbol 2\n");
@@ -1107,14 +1099,14 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
         {
             fprintf(fp, "%8g %8d\n", time[i], clust->cl[i]);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     if (sizefn)
     {
-        fp = xvgropen(sizefn, "Cluster Sizes", "Cluster #", "# Structures", oenv);
+        size_fp = xvgropen(sizefn, "Cluster Sizes", "Cluster #", "# Structures", oenv);
         if (output_env_get_print_xvgr_codes(oenv))
         {
-            fprintf(fp, "@g%d type %s\n", 0, "bar");
+            fprintf(size_fp, "@g%d type %s\n", 0, "bar");
         }
     }
     snew(structure, nf);
@@ -1163,7 +1155,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
         }
         if (sizefn)
         {
-            fprintf(fp, "%8d %8d\n", cl, nstr);
+            fprintf(size_fp, "%8d %8d\n", cl, nstr);
         }
         clrmsd  = 0;
         midstr  = 0;
@@ -1309,6 +1301,11 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
     {
         sfree(trxsfn);
     }
+
+    if (size_fp)
+    {
+        xvgrclose(size_fp);
+    }
 }
 
 static void convert_mat(t_matrix *mat, t_mat *rms)
@@ -1518,13 +1515,13 @@ int gmx_cluster(int argc, char *argv[])
         { efXVG, "-sz",   "clust-size", ffOPTWR},
         { efXPM, "-tr",   "clust-trans", ffOPTWR},
         { efXVG, "-ntr",  "clust-trans", ffOPTWR},
-        { efXVG, "-clid", "clust-id.xvg", ffOPTWR},
+        { efXVG, "-clid", "clust-id",   ffOPTWR},
         { efTRX, "-cl",   "clusters.pdb", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
                            &oenv))
     {
@@ -1873,7 +1870,7 @@ int gmx_cluster(int argc, char *argv[])
             {
                 fprintf(fp, "%10d  %10g\n", i, eigenvalues[i]);
             }
-            gmx_ffclose(fp);
+            xvgrclose(fp);
             break;
         case m_monte_carlo:
             orig     = init_mat(rms->nn, FALSE);
index d84c79c2d82050fd6f2605cb30371ed03228d608..5e524f2dcff8ed0aa00684f7f74a1c9221cf2cbe 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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "rmpbc.h"
 #include "gromacs/commandline/pargs.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "index.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "calcgrid.h"
-#include "nrnb.h"
-#include "physics.h"
-#include "coulomb.h"
-#include "pme.h"
-#include "gstat.h"
-#include "gromacs/fileio/matio.h"
-#include "mtop_util.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
 
 static void clust_size(const char *ndx, const char *trx, const char *xpm,
                        const char *xpmw, const char *ncl, const char *acl,
@@ -152,7 +144,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
         {
             index[i] = i;
         }
-        gname = strdup("mols");
+        gname = gmx_strdup("mols");
     }
     else
     {
@@ -338,10 +330,10 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     }
     while (read_next_frame(oenv, status, &fr));
     close_trx(status);
-    gmx_ffclose(fp);
-    gmx_ffclose(gp);
-    gmx_ffclose(hp);
-    gmx_ffclose(tp);
+    xvgrclose(fp);
+    xvgrclose(gp);
+    xvgrclose(hp);
+    xvgrclose(tp);
 
     gmx_mtop_atomlookup_destroy(alook);
 
@@ -384,7 +376,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
         nhisto += (int)((j+1)*nelem/n_x);
     }
     fprintf(fp, "%5d  %8.3f\n", j+1, 0.0);
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     fprintf(stderr, "Total number of atoms in clusters =  %d\n", nhisto);
 
@@ -508,7 +500,7 @@ int gmx_clustsize(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 4b9391fd1f6f8317cf888c12fbb32eeb8403c582..af82b05a04cf358f4ce7b14009089984f1d035c2 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "gromacs/fileio/filenm.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "typedefs.h"
-#include "xvgr.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-#include "vec.h"
-#include "index.h"
-#include "pbc.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/pdbio.h"
-#include "txtdump.h"
-#include "viewit.h"
-#include "rmpbc.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 void calc_rm_cm(int isize, atom_id index[], t_atoms *atoms, rvec x[], rvec xcm)
 {
@@ -177,7 +172,7 @@ int find_next_match_atoms_in_res(int *i1, atom_id index1[],
     {
         if (debug)
         {
-            fprintf(debug, "{%d %d}", *i1+bFW ? dx : dy, *i2+bFW ? dy : dx );
+            fprintf(debug, "{%d %d}", *i1 + (bFW ? dx : dy), *i2 + (bFW ? dy : dx) );
         }
         if (bFW)
         {
@@ -520,9 +515,9 @@ int gmx_confrms(int argc, char *argv[])
         { efTPS, "-f1",  "conf1.gro", ffREAD  },
         { efSTX, "-f2",  "conf2",     ffREAD  },
         { efSTO, "-o",   "fit.pdb",   ffWRITE },
-        { efNDX, "-n1", "fit1.ndx",  ffOPTRD },
-        { efNDX, "-n2", "fit2.ndx",  ffOPTRD },
-        { efNDX, "-no", "match.ndx", ffOPTWR }
+        { efNDX, "-n1",  "fit1",      ffOPTRD },
+        { efNDX, "-n2",  "fit2",      ffOPTRD },
+        { efNDX, "-no",  "match",     ffOPTWR }
     };
 #define NFILE asize(fnm)
 
@@ -556,7 +551,7 @@ int gmx_confrms(int argc, char *argv[])
     real    *msds;
 
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE | PCA_CAN_VIEW,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -616,12 +611,12 @@ int gmx_confrms(int argc, char *argv[])
             fprintf(fp, "[ Match_%s_%s ]\n", conf1file, groupnames1);
             for (i = 0; i < isize1; i++)
             {
-                fprintf(fp, "%4u%s", index1[i]+1, (i%15 == 14 || i == isize1-1) ? "\n" : " ");
+                fprintf(fp, "%4d%s", index1[i]+1, (i%15 == 14 || i == isize1-1) ? "\n" : " ");
             }
             fprintf(fp, "[ Match_%s_%s ]\n", conf2file, groupnames2);
             for (i = 0; i < isize2; i++)
             {
-                fprintf(fp, "%4u%s", index2[i]+1, (i%15 == 14 || i == isize2-1) ? "\n" : " ");
+                fprintf(fp, "%4d%s", index2[i]+1, (i%15 == 14 || i == isize2-1) ? "\n" : " ");
             }
         }
     }
@@ -641,7 +636,7 @@ int gmx_confrms(int argc, char *argv[])
             if (warn < 20)
             {
                 fprintf(stderr,
-                        "Warning: atomnames at index %d don't match: %u %s, %u %s\n",
+                        "Warning: atomnames at index %d don't match: %d %s, %d %s\n",
                         i+1, index1[i]+1, name1, index2[i]+1, name2);
             }
             warn++;
index f3e575f2288a5cbb9555b707ea9ac1fb8887ddb4..2bde8f74b7152f09e254b129b78b2ed07926f489 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
-#include <time.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/trnio.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "rmpbc.h"
-#include "txtdump.h"
 #include "gromacs/fileio/matio.h"
-#include "eigio.h"
-#include "physics.h"
-#include "gmx_ana.h"
-#include "gromacs/utility/cstringutil.h"
+#include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/trxio.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/sysinfo.h"
 
 int gmx_covar(int argc, char *argv[])
 {
@@ -144,7 +133,6 @@ int gmx_covar(int argc, char *argv[])
     int             d, dj, nfit;
     atom_id        *index, *ifit;
     gmx_bool        bDiffMass1, bDiffMass2;
-    time_t          now;
     char            timebuf[STRLEN];
     t_rgb           rlo, rmi, rhi;
     real           *eigenvectors;
@@ -165,7 +153,7 @@ int gmx_covar(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -576,7 +564,7 @@ int gmx_covar(int argc, char *argv[])
     {
         fprintf (out, "%10d %g\n", (int)i+1, eigenvalues[ndim-1-i]);
     }
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     if (bFit)
     {
@@ -605,8 +593,7 @@ int gmx_covar(int argc, char *argv[])
 
     out = gmx_ffopen(logfile, "w");
 
-    time(&now);
-    gmx_ctime_r(&now, timebuf, STRLEN);
+    gmx_format_current_time(timebuf, STRLEN);
     fprintf(out, "Covariance analysis log, written %s\n", timebuf);
 
     fprintf(out, "Program: %s\n", argv[0]);
index 94b6d94db2bc29fa412aceabf80cb3a0f39edab3..ead28e0a76c15563643d637d6eaf2df37b871e31 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, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include <assert.h>
+#include <stdlib.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "xvgr.h"
-#include "rmpbc.h"
-#include "pbc.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/statistics/statistics.h"
-#include "gmx_ana.h"
-#include "macros.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define SQR(x) (pow(x, 2.0))
 #define EPSI0 (EPSILON0*E_CHARGE*E_CHARGE*AVOGADRO/(KILO*NANO)) /* EPSILON0 in SI units */
@@ -469,7 +469,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
                 xshfr[i] = 0.0;
             }
         }
-
+        assert(time != NULL);
 
 
         if (nfr == 0)
@@ -857,12 +857,12 @@ int gmx_current(int argc, char *argv[])
         { efTPS,  NULL,  NULL, ffREAD }, /* this is for the topology */
         { efNDX, NULL, NULL, ffOPTRD },
         { efTRX, "-f", NULL, ffREAD },   /* and this for the trajectory */
-        { efXVG, "-o", "current.xvg", ffWRITE },
-        { efXVG, "-caf", "caf.xvg", ffOPTWR },
-        { efXVG, "-dsp", "dsp.xvg", ffWRITE },
-        { efXVG, "-md", "md.xvg", ffWRITE },
-        { efXVG, "-mj", "mj.xvg", ffWRITE},
-        { efXVG, "-mc", "mc.xvg", ffOPTWR }
+        { efXVG, "-o",   "current", ffWRITE },
+        { efXVG, "-caf", "caf",     ffOPTWR },
+        { efXVG, "-dsp", "dsp",     ffWRITE },
+        { efXVG, "-md",  "md",      ffWRITE },
+        { efXVG, "-mj",  "mj",      ffWRITE },
+        { efXVG, "-mc",  "mc",      ffOPTWR }
     };
 
 #define NFILE asize(fnm)
@@ -992,16 +992,20 @@ int gmx_current(int argc, char *argv[])
                temp, trust, bfit, efit, bvit, evit, status, isize, nmols, nshift,
                index0, indexm, mass2, qmol, eps_rf, oenv);
 
-    gmx_ffclose(fmj);
-    gmx_ffclose(fmd);
-    gmx_ffclose(fmjdsp);
-    if (bACF)
-    {
-        gmx_ffclose(outf);
-    }
-    if (bINT)
+    xvgrclose(fmj);
+    xvgrclose(fmd);
+    xvgrclose(fmjdsp);
+    if (fr.bV)
     {
-        gmx_ffclose(mcor);
+        if (bACF)
+        {
+            xvgrclose(outf);
+        }
+        xvgrclose(fcur);
+        if (bINT)
+        {
+            xvgrclose(mcor);
+        }
     }
 
     return 0;
index b03ae2a90844e41945a6b998564887b68f1c8b35..7d30ccce8eabcde7bbbacfca4091deb2ca2bbbfd 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <math.h>
-#include <ctype.h>
+#include "gmxpre.h"
 
-#include "sysstuff.h"
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
 #include <string.h>
-#include "gromacs/utility/cstringutil.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "gmx_ana.h"
-#include "macros.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     char *atomname;
@@ -118,7 +117,7 @@ int get_electrons(t_electron **eltab, const char *fn)
             gmx_fatal(FARGS, "Invalid line in datafile at line %d\n", i+1);
         }
         (*eltab)[i].nr_el    = tempnr;
-        (*eltab)[i].atomname = strdup(tempname);
+        (*eltab)[i].atomname = gmx_strdup(tempname);
     }
     gmx_ffclose(in);
 
@@ -274,7 +273,7 @@ void calc_electron_density(const char *fn, atom_id **index, int gnx[],
                     slice = (z / (*slWidth));
                 }
                 sought.nr_el    = 0;
-                sought.atomname = strdup(*(top->atoms.atomname[index[n][i]]));
+                sought.atomname = gmx_strdup(*(top->atoms.atomname[index[n][i]]));
 
                 /* now find the number of electrons. This is not efficient. */
                 found = (t_electron *)
@@ -552,7 +551,7 @@ void plot_density(double *slDensity[], const char *afile, int nslices,
         fprintf(den, "\n");
     }
 
-    gmx_ffclose(den);
+    xvgrclose(den);
 }
 
 int gmx_density(int argc, char *argv[])
@@ -670,14 +669,14 @@ int gmx_density(int argc, char *argv[])
     t_filenm           fnm[] = { /* files for g_density       */
         { efTRX, "-f", NULL,  ffREAD },
         { efNDX, NULL, NULL,  ffOPTRD },
-        { efTPX, NULL, NULL,  ffREAD },
+        { efTPR, NULL, NULL,  ffREAD },
         { efDAT, "-ei", "electrons", ffOPTRD }, /* file with nr. of electrons */
         { efXVG, "-o", "density", ffWRITE },
     };
 
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, asize(bugs), bugs,
                            &oenv))
     {
@@ -692,7 +691,7 @@ int gmx_density(int argc, char *argv[])
     /* Calculate axis */
     axis = toupper(axtitle[0]) - 'X';
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */
     if (dens_opt[0][0] == 'n')
     {
         for (i = 0; (i < top->atoms.nr); i++)
index 8675a164358a603785d9e9a8ea62142a87c59c8e..bf263eae7fa06d80a51309b9e342a59a985cef57 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "txtdump.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gstat.h"
-#include "gromacs/fileio/matio.h"
-#include "pbc.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_densmap(int argc, char *argv[])
 {
@@ -166,7 +158,7 @@ int gmx_densmap(int argc, char *argv[])
 
     npargs = asize(pa);
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, npargs, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -254,7 +246,9 @@ int gmx_densmap(int argc, char *argv[])
     {
         n1      = (int)(2*amax/bin + 0.5);
         nradial = (int)(rmax/bin + 0.5);
+        /* cppcheck-suppress zerodiv fixed in 1.68-dev */
         invspa  = n1/(2*amax);
+        /* cppcheck-suppress zerodiv fixed in 1.68-dev */
         invspz  = nradial/rmax;
         if (bMirror)
         {
index 16f98c0c035d9847f0415367981008f04c0803d1..bf4f6c68eae8d774fb74cf7813803fa13d7e72f1 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <ctype.h>
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/cstringutil.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "gromacs/fileio/matio.h"
-#include "dens_filter.h"
-#include "binsearch.h"
-#include "powerspect.h"
-#include "gmx_ana.h"
-#include "copyrite.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/binsearch.h"
+#include "gromacs/gmxana/dens_filter.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/gmxana/powerspect.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #ifdef GMX_DOUBLE
 #define FLOOR(x) ((int) floor(x))
@@ -357,21 +355,21 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
                             t_interf ****intf2, const output_env_t oenv)
 {
     /*Returns two pointers to 3D arrays of t_interf structs containing (position,thickness) of the interface(s)*/
-    FILE       *xvg;
-    real       *zDensavg; /* zDensavg[z]*/
-    int         i, j, k, n;
-    int         xysize;
-    int         ndx1, ndx2, *zperm;
-    real        densmid;
-    real        splitpoint, startpoint, endpoint;
-    real       *sigma1, *sigma2;
-    real        beginfit1[4];
-    real        beginfit2[4];
-    real       *fit1 = NULL, *fit2 = NULL;
-    const real *avgfit1;
-    const real *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*/
+    FILE         *xvg;
+    real         *zDensavg; /* zDensavg[z]*/
+    int           i, j, k, n;
+    int           xysize;
+    int           ndx1, ndx2, *zperm;
+    real          densmid;
+    real          splitpoint, startpoint, endpoint;
+    real         *sigma1, *sigma2;
+    double        beginfit1[4];
+    double        beginfit2[4];
+    double       *fit1 = NULL, *fit2 = NULL;
+    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*/
     /*Create int1(t,xy) and int2(t,xy) arrays with correct number of interf_t elements*/
     xysize = xslices*yslices;
     snew(int1, tblocks);
@@ -615,7 +613,9 @@ static void writesurftoxpms(t_interf ***surf1, t_interf ***surf2, int tblocks, i
     sfree(yticks);
 }
 
-static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks, int xbins, int ybins, char **fnms)
+static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks,
+                     int xbins, int ybins, char **fnms,
+                     const output_env_t oenv)
 {
     FILE *raw1, *raw2;
     int   i, j, n;
@@ -627,8 +627,10 @@ static void writeraw(t_interf ***int1, t_interf ***int2, int tblocks, int xbins,
         gmx::BinaryInformationSettings settings;
         settings.generatedByHeader(true);
         settings.linePrefix("# ");
-        gmx::printBinaryInformation(raw1, gmx::getProgramContext(), settings);
-        gmx::printBinaryInformation(raw2, gmx::getProgramContext(), settings);
+        gmx::printBinaryInformation(raw1, output_env_get_program_context(oenv),
+                                    settings);
+        gmx::printBinaryInformation(raw2, output_env_get_program_context(oenv),
+                                    settings);
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
     fprintf(raw1, "# Legend: nt nx ny\n# Xbin Ybin Z t\n");
@@ -725,7 +727,7 @@ int gmx_densorder(int argc, char *argv[])
 
 
     t_filenm fnm[] = {
-        { efTPX, "-s",  NULL, ffREAD },               /* this is for the topology */
+        { 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 */
         { efDAT, "-o", "Density4D", ffOPTWR},         /* This is for outputting the entire 4D densityfield in binary format */
@@ -750,7 +752,7 @@ int gmx_densorder(int argc, char *argv[])
     bRawOut  = opt2bSet("-or", NFILE, fnm);
     bGraph   = opt2bSet("-og", NFILE, fnm);
     bOut     = opt2bSet("-o", NFILE, fnm);
-    top      = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC);
+    top      = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC);
     snew(grpname, 1);
     snew(index, 1);
     snew(ngx, 1);
@@ -798,7 +800,7 @@ int gmx_densorder(int argc, char *argv[])
         {
             gmx_fatal(FARGS, "No or not correct number (2) of output-files: %d", nfxpm);
         }
-        writeraw(surf1, surf2, tblock, xslices, yslices, rawfiles);
+        writeraw(surf1, surf2, tblock, xslices, yslices, rawfiles, oenv);
     }
 
 
index 13faf8be965e79c4c2a521c47af13d2ab36635d6..7561aece02dacae4842ef7da2e11a03e9e15dc48 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-
-#include "copyrite.h"
-#include "typedefs.h"
-#include "gstat.h"
+#include <string.h>
+
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/correlationfunctions/integrate.h"
+#include "gromacs/fft/fft.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/gmxcomplex.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "xvgr.h"
-#include "correl.h"
-#include "gmx_ana.h"
-#include "gmx_fatal.h"
-
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/math/gmxcomplex.h"
 #include "gromacs/math/utilities.h"
+#include "gmx_ana.h"
 
 /* Determines at which point in the array the fit should start */
 int calc_nbegin(int nx, real x[], real tbegin)
@@ -157,6 +162,8 @@ void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
     t_complex *tmp, gw, hw, kw;
     int        i, nnx, nxsav;
     real       fac, nu, dt, *ptr, maxeps, numax;
+    gmx_fft_t  fft;
+    int        fftcode;
 
     nxsav = nx;
     /*while ((dy[nx-1] == 0.0) && (nx > 0))
@@ -171,15 +178,24 @@ void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
     {
         nnx *= 2;
     }
+
     snew(tmp, 2*nnx);
     printf("Doing FFT of %d points\n", nnx);
     for (i = 0; (i < nx); i++)
     {
         tmp[i].re = dy[i];
     }
-    ptr = &tmp[0].re;
-    four1(ptr-1, nnx, -1);
-
+    if ((fftcode = gmx_fft_init_1d_real(&fft, nnx,
+                                        GMX_FFT_FLAG_NONE)) != 0)
+    {
+        gmx_fatal(FARGS, "gmx_fft_init_1d_real returned %d", fftcode);
+    }
+    if ((fftcode = gmx_fft_1d_real(fft, GMX_FFT_COMPLEX_TO_REAL,
+                                   (void *)tmp, (void *)tmp)) != 0)
+    {
+        gmx_fatal(FARGS, "gmx_fft_1d_real returned %d", fftcode);
+    }
+    gmx_fft_destroy(fft);
     dt = x[1]-x[0];
     if (epsRF == 0)
     {
@@ -223,8 +239,8 @@ void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
     }
     printf("MAXEPS = %10.5e at frequency %10.5e GHz (tauD = %8.1f ps)\n",
            maxeps, numax, 1000/(2*M_PI*numax));
-    gmx_ffclose(fp);
-    gmx_ffclose(cp);
+    xvgrclose(fp);
+    xvgrclose(cp);
     sfree(tmp);
 }
 
@@ -261,17 +277,16 @@ int gmx_dielectric(int argc, char *argv[])
 #define NFILE asize(fnm)
     output_env_t oenv;
     int          i, j, nx, ny, nxtail, eFitFn, nfitparm;
-    real         dt, integral, fitintegral, *fitparms, fac, rffac;
+    real         dt, integral, fitintegral, fac, rffac;
+    double      *fitparms;
     double     **yd;
     real       **y;
     const char  *legend[] = { "Correlation", "Std. Dev.", "Fit", "Combined", "Derivative" };
-    static int   fix      = 0, bFour = 0, bX = 1, nsmooth = 3;
+    static int   fix      = 0, bX = 1, nsmooth = 3;
     static real  tendInt  = 5.0, tbegin = 5.0, tend = 500.0;
     static real  A        = 0.5, tau1 = 10.0, tau2 = 1.0, eps0 = 80, epsRF = 78.5, tail = 500.0;
     real         lambda;
     t_pargs      pa[] = {
-        { "-fft", FALSE, etBOOL, {&bFour},
-          "use fast fourier transform for correlation function" },
         { "-x1",  FALSE, etBOOL, {&bX},
           "use first column as [IT]x[it]-axis rather than first data set" },
         { "-eint", FALSE, etREAL, {&tendInt},
@@ -300,7 +315,7 @@ int gmx_dielectric(int argc, char *argv[])
           "Number of points for smoothing" }
     };
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -360,7 +375,7 @@ int gmx_dielectric(int argc, char *argv[])
     }
 
     eFitFn   = sffn2effn(s_ffn);
-    nfitparm = nfp_ffn[eFitFn];
+    nfitparm = effnNparams(eFitFn);
     snew(fitparms, 4);
     fitparms[0] = tau1;
     if (nfitparm > 1)
index d2ff55801d0e586006721e0ebfdaca1033f3afb5..a73621310cbfac484054871bb40745df032a197f 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <string.h>
+#include "gmxpre.h"
+
 #include <math.h>
+#include <string.h>
 
 #include <algorithm>
 
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "pbc.h"
-#include "bondf.h"
-#include "gromacs/fileio/futil.h"
-#include "xvgr.h"
-#include "txtdump.h"
-#include "gromacs/statistics/statistics.h"
-#include "gstat.h"
-#include "index.h"
-#include "gromacs/random/random.h"
-#include "names.h"
-#include "physics.h"
-#include "calcmu.h"
+#include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/matio.h"
-#include "gmx_ana.h"
-#include "copyrite.h"
 #include "gromacs/fileio/trxio.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/calcmu.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/linearalgebra/nrjac.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/random/random.h"
+#include "gromacs/statistics/statistics.h"
+#include "gromacs/topology/index.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define e2d(x) ENM2DEBYE*(x)
 #define EANG2CM  E_CHARGE*1.0e-10       /* e Angstrom to Coulomb meter */
@@ -406,7 +404,7 @@ static void print_gkrbin(const char *fn, t_gkrbin *gb,
         /* Swap x0 and x1 */
         x0 = x1;
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
@@ -688,7 +686,7 @@ static void dump_slab_dipoles(const char *fn, int idim, int nslice,
                 slab_dipole[i][ZZ]/nframes,
                 mutot);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     do_view(oenv, fn, "-autoscale xy -nxy");
 }
 
@@ -954,7 +952,7 @@ static void do_dip(t_topology *top, int ePBC, real volume,
             gmx::BinaryInformationSettings settings;
             settings.generatedByHeader(true);
             settings.linePrefix("# ");
-            gmx::printBinaryInformation(dip3d, gmx::getProgramContext(),
+            gmx::printBinaryInformation(dip3d, output_env_get_program_context(oenv),
                                         settings);
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
@@ -1338,18 +1336,18 @@ static void do_dip(t_topology *top, int ePBC, real volume,
         close_trj(status);
     }
 
-    gmx_ffclose(outmtot);
-    gmx_ffclose(outaver);
-    gmx_ffclose(outeps);
+    xvgrclose(outmtot);
+    xvgrclose(outaver);
+    xvgrclose(outeps);
 
     if (fnadip)
     {
-        gmx_ffclose(adip);
+        xvgrclose(adip);
     }
 
     if (cosaver)
     {
-        gmx_ffclose(caver);
+        xvgrclose(caver);
     }
 
     if (dip3d)
@@ -1458,7 +1456,7 @@ static void do_dip(t_topology *top, int ePBC, real volume,
             fprintf(outdd, "%10g  %10f\n",
                     (i*mu_max)/ndipbin, dipole_bin[i]/(double)teller);
         }
-        gmx_ffclose(outdd);
+        xvgrclose(outdd);
         sfree(dipole_bin);
     }
     if (bGkr)
@@ -1591,7 +1589,7 @@ int gmx_dipoles(int argc, char *argv[])
     t_filenm       fnm[] = {
         { efEDR, "-en", NULL,         ffOPTRD },
         { efTRX, "-f", NULL,           ffREAD },
-        { efTPX, NULL, NULL,           ffREAD },
+        { efTPR, NULL, NULL,           ffREAD },
         { efNDX, NULL, NULL,           ffOPTRD },
         { efXVG, "-o",   "Mtot",       ffWRITE },
         { efXVG, "-eps", "epsilon",    ffWRITE },
@@ -1615,7 +1613,7 @@ 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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -1665,7 +1663,7 @@ int gmx_dipoles(int argc, char *argv[])
     }
 
     snew(top, 1);
-    ePBC = read_tpx_top(ftp2fn(efTPX, NFILE, fnm), NULL, box,
+    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), NULL, box,
                         &natoms, NULL, NULL, NULL, top);
 
     snew(gnx, ncos);
index eb41e318998920a109c8c1f9b59103afc72e481a..311e7a198d7bc44f532d065a763bf953d714287f 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "macros.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "vec.h"
-#include "gromacs/fileio/confio.h"
-#include "gromacs/utility/smalloc.h"
-#include "nrnb.h"
-#include "disre.h"
 #include "gromacs/commandline/pargs.h"
-#include "force.h"
-#include "gstat.h"
-#include "main.h"
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "index.h"
-#include "mdatoms.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "mdrun.h"
-#include "names.h"
-#include "gromacs/fileio/matio.h"
-#include "mtop_util.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int  n;
@@ -713,7 +716,7 @@ int gmx_disre(int argc, char *argv[])
     gmx_rmpbc_t     gpbc = NULL;
 
     t_filenm        fnm[] = {
-        { efTPX, NULL, NULL, ffREAD },
+        { efTPR, NULL, NULL, ffREAD },
         { efTRX, "-f", NULL, ffREAD },
         { efXVG, "-ds", "drsum",  ffWRITE },
         { efXVG, "-da", "draver", ffWRITE },
@@ -728,7 +731,7 @@ int gmx_disre(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -741,9 +744,9 @@ int gmx_disre(int argc, char *argv[])
         init5(ntop);
     }
 
-    read_tpxheader(ftp2fn(efTPX, NFILE, fnm), &header, FALSE, NULL, NULL);
+    read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &header, FALSE, NULL, NULL);
     snew(xtop, header.natoms);
-    read_tpx(ftp2fn(efTPX, NFILE, fnm), &ir, box, &ntopatoms, xtop, NULL, NULL, &mtop);
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), &ir, box, &ntopatoms, xtop, NULL, NULL, &mtop);
     bPDB = opt2bSet("-q", NFILE, fnm);
     if (bPDB)
     {
@@ -783,6 +786,8 @@ int gmx_disre(int argc, char *argv[])
 
     if (ftp2bSet(efNDX, NFILE, fnm))
     {
+        /* TODO: Nothing is written to this file if -c is provided, but it is
+         * still opened... */
         rd_index(ftp2fn(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
         xvg = xvgropen(opt2fn("-dr", NFILE, fnm), "Individual Restraints", "Time (ps)",
                        "nm", oenv);
@@ -930,20 +935,23 @@ int gmx_disre(int argc, char *argv[])
         }
         dump_disre_matrix(opt2fn_null("-x", NFILE, fnm), &dr, fcd.disres.nres,
                           j, &top->idef, &mtop, max_dr, nlevels, bThird);
-        gmx_ffclose(out);
-        gmx_ffclose(aver);
-        gmx_ffclose(numv);
-        gmx_ffclose(maxxv);
-        if (isize > 0)
-        {
-            gmx_ffclose(xvg);
-            do_view(oenv, opt2fn("-dr", NFILE, fnm), "-nxy");
-        }
+        xvgrclose(out);
+        xvgrclose(aver);
+        xvgrclose(numv);
+        xvgrclose(maxxv);
         do_view(oenv, opt2fn("-dn", NFILE, fnm), "-nxy");
         do_view(oenv, opt2fn("-da", NFILE, fnm), "-nxy");
         do_view(oenv, opt2fn("-ds", NFILE, fnm), "-nxy");
         do_view(oenv, opt2fn("-dm", NFILE, fnm), "-nxy");
     }
+    if (isize > 0)
+    {
+        xvgrclose(xvg);
+        if (!clust)
+        {
+            do_view(oenv, opt2fn("-dr", NFILE, fnm), "-nxy");
+        }
+    }
 
     gmx_log_close(fplog);
 
index 9f9901065376dec55e7dfa39a39e60133f4c643e..05e76b02013e89ecf59eccc61459613cac0ce8c5 100644 (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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include <stdlib.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/strdb.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "mshift.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
 #include "gromacs/fileio/matio.h"
-#include "index.h"
-#include "gstat.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/fileio/strdb.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "viewit.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static int strip_dssp(char *dsspfile, int nres,
                       gmx_bool bPhobres[], real t,
@@ -213,7 +212,7 @@ static void check_oo(t_atoms *atoms)
 
     int   i;
 
-    OOO = strdup("O");
+    OOO = gmx_strdup("O");
 
     for (i = 0; (i < atoms->nr); i++)
     {
@@ -353,7 +352,7 @@ void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
     leg[0] = "Structure";
     for (s = 0; s < (size_t)mat->nmap; s++)
     {
-        leg[s+1] = strdup(map[s].desc);
+        leg[s+1] = gmx_strdup(map[s].desc);
     }
 
     fp = xvgropen(outfile, "Secondary Structure",
@@ -427,7 +426,7 @@ void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
     }
     fprintf(fp, "\n");
 
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     sfree(leg);
     sfree(count);
 }
@@ -495,7 +494,7 @@ int gmx_do_dssp(int argc, char *argv[])
     gmx_bool          *bPhbres, bDoAccSurf;
     real               t;
     int                i, j, natoms, nframe = 0;
-    matrix             box;
+    matrix             box = {{0}};
     int                gnx;
     char              *grpnm, *ss_str;
     atom_id           *index;
@@ -523,7 +522,7 @@ int gmx_do_dssp(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -623,8 +622,7 @@ int gmx_do_dssp(int argc, char *argv[])
     }
 
     mat.map  = NULL;
-    mat.nmap = getcmap(libopen(opt2fn("-map", NFILE, fnm)),
-                       opt2fn("-map", NFILE, fnm), &(mat.map));
+    mat.nmap = readcmap(opt2fn("-map", NFILE, fnm), &(mat.map));
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
     if (natoms > atoms->nr)
@@ -660,17 +658,11 @@ int gmx_do_dssp(int argc, char *argv[])
         write_pdbfile_indexed(tapein, NULL, atoms, x, ePBC, box, ' ', -1, gnx, index, NULL, TRUE);
         gmx_ffclose(tapein);
 
-#ifdef GMX_NO_SYSTEM
-        printf("Warning-- No calls to system(3) supported on this platform.");
-        printf("Warning-- Skipping execution of 'system(\"%s\")'.", dssp);
-        exit(1);
-#else
         if (0 != system(dssp))
         {
             gmx_fatal(FARGS, "Failed to execute command: %s\n",
                       "Try specifying your dssp version with the -ver option.", dssp);
         }
-#endif
 
         /* strip_dssp returns the number of lines found in the dssp file, i.e.
          * the number of residues plus the separator lines */
@@ -691,7 +683,7 @@ int gmx_do_dssp(int argc, char *argv[])
     close_trj(status);
     if (fTArea)
     {
-        gmx_ffclose(fTArea);
+        xvgrclose(fTArea);
     }
     gmx_rmpbc_done(gpbc);
 
@@ -740,7 +732,7 @@ int gmx_do_dssp(int argc, char *argv[])
             {
                 fprintf(acc, "%5d  %10g %10g\n", i+1, av_area[i], norm_av_area[i]);
             }
-            gmx_ffclose(acc);
+            xvgrclose(acc);
         }
     }
 
index 281e500a2a25cd6ed22dd385326a7bcce8d3d1b0..52a7d9d61ef50703e1d77167b23039cee49b8b36 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/correlationfunctions/integrate.h"
+#include "gromacs/fft/fft.h"
 #include "gromacs/fileio/confio.h"
-#include "copyrite.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "macros.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "correl.h"
 #include "gmx_ana.h"
-#include "gromacs/fft/fft.h"
-#include "gromacs/fileio/trxio.h"
 
 enum {
     VACF, MVACF, DOS, DOS_SOLID, DOS_DIFF, DOS_CP, DOS_S, DOS_A, DOS_E, DOS_NR
@@ -181,7 +181,7 @@ static real wSsolid(real nu, real beta)
     }
     else
     {
-        return bhn/(exp(bhn)-1) - log(1-exp(-bhn));
+        return bhn/gmx_expm1(bhn) - gmx_log1p(-exp(-bhn));
     }
 }
 
@@ -209,7 +209,7 @@ static real wEsolid(real nu, real beta)
     }
     else
     {
-        return bhn/2 + bhn/(exp(bhn)-1)-1;
+        return bhn/2 + bhn/gmx_expm1(bhn)-1;
     }
 }
 
@@ -306,7 +306,7 @@ int gmx_dos(int argc, char *argv[])
 
     t_filenm            fnm[] = {
         { efTRN, "-f",    NULL,    ffREAD  },
-        { efTPX, "-s",    NULL,    ffREAD  },
+        { efTPR, "-s",    NULL,    ffREAD  },
         { efNDX, NULL,    NULL,    ffOPTRD },
         { efXVG, "-vacf", "vacf",  ffWRITE },
         { efXVG, "-mvacf", "mvacf", ffWRITE },
@@ -322,7 +322,7 @@ int gmx_dos(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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, npargs, ppa, asize(desc), desc,
                            asize(bugs), bugs, &oenv))
     {
@@ -343,7 +343,7 @@ int gmx_dos(int argc, char *argv[])
     please_cite(fplog, "Pascal2011a");
     please_cite(fplog, "Caleman2011b");
 
-    read_tps_conf(ftp2fn(efTPX, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box,
+    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box,
                   TRUE);
     V     = det(box);
     tmass = 0;
index 5eebeb12320eae0bac99a2ff48b77554efdd08dc..0513f8f8a63f76033f60ebbe177b1378fed0ff83 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,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.
  * 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 "copyrite.h"
-#include "gromacs/fileio/filenm.h"
-#include "macros.h"
-#include "pbc.h"
-#include "gromacs/utility/smalloc.h"
+#include "gmxpre.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "xvgr.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_dyecoupl(int argc, char *argv[])
 {
@@ -98,7 +101,6 @@ int gmx_dyecoupl(int argc, char *argv[])
     int          ndon, nacc;
     atom_id     *donindex, *accindex;
     char        *grpnm;
-    t_atoms     *atoms = NULL;
     t_trxstatus *status;
     t_trxframe   fr;
 
@@ -126,7 +128,8 @@ int gmx_dyecoupl(int argc, char *argv[])
                 rrange, krange, rincr, kincr, Rfrac;
     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 | PCA_BE_NICE, NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+    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))
     {
         return 0;
     }
@@ -162,10 +165,10 @@ int gmx_dyecoupl(int argc, char *argv[])
     }
 
     printf("Select group with donor atom pairs defining the transition moment\n");
-    get_index(atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm);
+    get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm);
 
     printf("Select group with acceptor atom pairs defining the transition moment\n");
-    get_index(atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm);
+    get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm);
 
     /*check if groups are identical*/
     grident = TRUE;
@@ -355,7 +358,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 
             if (bRKout)
             {
-                gmx_ffclose(rkfp);
+                xvgrclose(rkfp);
             }
 
             if (bDatout)
@@ -365,7 +368,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 
             if (bInstEffout)
             {
-                gmx_ffclose(iefp);
+                xvgrclose(iefp);
             }
 
 
@@ -416,7 +419,7 @@ int gmx_dyecoupl(int argc, char *argv[])
                     fprintf(rhfp, "%12.7f %12.7f\n", (i + 0.5) * rincr + rmin,
                             rhist[i]);
                 }
-                gmx_ffclose(rhfp);
+                xvgrclose(rhfp);
             }
 
             if (bKhistout)
@@ -453,7 +456,7 @@ int gmx_dyecoupl(int argc, char *argv[])
                     fprintf(khfp, "%12.7f %12.7f\n", (i + 0.5) * kincr + kmin,
                             khist[i]);
                 }
-                gmx_ffclose(khfp);
+                xvgrclose(khfp);
             }
 
             printf("\nAverages:\n");
index 65de201a1b6284567932f364b18bb7a34d93fc47..63fb697756d84766509652fadefec326d89c0a35 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/math/3dview.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/smalloc.h"
-#include "index.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "physics.h"
-#include "gmx_ana.h"
-#include "macros.h"
 #include "gromacs/fileio/trxio.h"
-
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/3dtransforms.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void rot_conf(t_atoms *atoms, rvec x[], rvec v[], real trans, real angle,
                      rvec head, rvec tail, int isize, atom_id index[],
@@ -112,31 +110,34 @@ static void rot_conf(t_atoms *atoms, rvec x[], rvec v[], real trans, real angle,
 
     /* Now the total rotation matrix: */
     /* Rotate a couple of times */
-    rotate(ZZ, -phi, Rz);
-    rotate(YY, M_PI/2-theta, Ry);
-    rotate(XX, angle*DEG2RAD, Rx);
+    gmx_mat4_init_rotation(ZZ, -phi, Rz);
+    gmx_mat4_init_rotation(YY, M_PI/2-theta, Ry);
+    gmx_mat4_init_rotation(XX, angle*DEG2RAD, Rx);
     Rx[WW][XX] = trans;
-    rotate(YY, theta-M_PI/2, Rinvy);
-    rotate(ZZ, phi, Rinvz);
+    gmx_mat4_init_rotation(YY, theta-M_PI/2, Rinvy);
+    gmx_mat4_init_rotation(ZZ, phi, Rinvz);
 
-    mult_matrix(temp1, Ry, Rz);
-    mult_matrix(temp2, Rinvy, Rx);
-    mult_matrix(temp3, temp2, temp1);
-    mult_matrix(Mtot, Rinvz, temp3);
+    gmx_mat4_mmul(temp1, Ry, Rz);
+    gmx_mat4_mmul(temp2, Rinvy, Rx);
+    gmx_mat4_mmul(temp3, temp2, temp1);
+    gmx_mat4_mmul(Mtot, Rinvz, temp3);
 
-    print_m4(debug, "Rz", Rz);
-    print_m4(debug, "Ry", Ry);
-    print_m4(debug, "Rx", Rx);
-    print_m4(debug, "Rinvy", Rinvy);
-    print_m4(debug, "Rinvz", Rinvz);
-    print_m4(debug, "Mtot", Mtot);
+    if (debug)
+    {
+        gmx_mat4_print(debug, "Rz", Rz);
+        gmx_mat4_print(debug, "Ry", Ry);
+        gmx_mat4_print(debug, "Rx", Rx);
+        gmx_mat4_print(debug, "Rinvy", Rinvy);
+        gmx_mat4_print(debug, "Rinvz", Rinvz);
+        gmx_mat4_print(debug, "Mtot", Mtot);
+    }
 
     for (i = 0; (i < isize); i++)
     {
         ai = index[i];
-        m4_op(Mtot, xout[ai], xv);
+        gmx_mat4_transform_point(Mtot, xout[ai], xv);
         rvec_add(xv, xcm, xout[ai]);
-        m4_op(Mtot, v[ai], xv);
+        gmx_mat4_transform_point(Mtot, v[ai], xv);
         copy_rvec(xv, vout[ai]);
     }
 }
@@ -207,6 +208,11 @@ int gmx_dyndom(int argc, char *argv[])
         return 0;
     }
 
+    if (maxangle == 0)
+    {
+        gmx_fatal(FARGS, "maxangle not given");
+    }
+
     get_stx_coordnum (opt2fn("-f", NFILE, fnm), &natoms);
     init_t_atoms(&atoms, natoms, TRUE);
     snew(x, natoms);
index cd55910022a5f869a8c1c40bd0f6dbb390f3ef78..9fedfee2c8bf6f8acfffb17303869d4758ff00c9 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/confio.h"
-#include "symtab.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/strdb.h"
-#include "index.h"
-#include "vec.h"
-#include "typedefs.h"
-#include "gromacs/gmxlib/conformation-utilities.h"
-#include "physics.h"
-#include "atomprop.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "pbc.h"
-#include "princ.h"
-#include "txtdump.h"
-#include "viewit.h"
-#include "rmpbc.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct
 {
@@ -344,7 +340,7 @@ void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
     for (i = 1; (i < 12); i++)
     {
         fprintf(out,
-                "%-6s%5u  %-4.4s%3.3s %c%4d%c   %8.3f%8.3f%8.3f%6.2f%6.2f\n",
+                "%-6s%5d  %-4.4s%3.3s %c%4d%c   %8.3f%8.3f%8.3f%6.2f%6.2f\n",
                 "ATOM  ", natoms + 1 + i, "CA", "LEG", space, nres + 1, space,
                 (xmin + (i * 0.12)) * 10, ymin * 10, zmin * 10, 1.0, bfac_min
                 + ((i - 1.0) * (bfac_max - bfac_min) / 10));
@@ -796,11 +792,9 @@ int gmx_editconf(int argc, char *argv[])
         gmx_fatal(FARGS, "Output file should be a .pdb file"
                   " when using the -grasp option\n");
     }
-    if ((bMead || bGrasp) && !((fn2ftp(infile) == efTPR) ||
-                               (fn2ftp(infile) == efTPA) ||
-                               (fn2ftp(infile) == efTPB)))
+    if ((bMead || bGrasp) && (fn2ftp(infile) != efTPR))
     {
-        gmx_fatal(FARGS, "Input file should be a .tp[abr] file"
+        gmx_fatal(FARGS, "Input file should be a .tpr file"
                   " when using the -mead option\n");
     }
 
index a521f90facd3c3133256b0e862b7587bbb7dc0fd..9a1e775ef66077cdc21fdb281c22ac810e1d8334 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <string.h>
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
 #include "gromacs/commandline/pargs.h"
-#include "disre.h"
-#include "names.h"
-#include "macros.h"
-#include "gmx_fatal.h"
 #include "gromacs/fileio/enxio.h"
-#include "vec.h"
-#include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define TIME_EXPLICIT 0
 #define TIME_CONTINUE 1
@@ -571,7 +571,7 @@ int gmx_eneconv(int argc, char *argv[])
           "Stop on errors in the file" }
     };
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa),
+    if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa),
                            pa, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
         return 0;
@@ -581,7 +581,6 @@ int gmx_eneconv(int argc, char *argv[])
     nset     = 0;
     timestep = 0.0;
     snew(fnms, argc);
-    nfile        = 0;
     lastfilestep = 0;
     laststep     = startstep = 0;
 
index 4e57212642cc76a12c9c750c5c55be20a3f5e059..4eacc7347fc7c19de49fb0bf558f086381897565 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <string.h>
+#include "gmxpre.h"
+
 #include <math.h>
+#include <string.h>
 
-#include "gromacs/utility/cstringutil.h"
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/enxio.h"
 #include "gromacs/commandline/pargs.h"
-#include "names.h"
-#include "macros.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "physics.h"
+#include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/strdb.h"
-#include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 
 static int search_str2(int nstr, char **str, char *key)
@@ -173,14 +172,14 @@ int gmx_enemat(int argc, char *argv[])
 
     t_filenm       fnm[] = {
         { efEDR, "-f", NULL, ffOPTRD },
-        { efDAT, "-groups", "groups.dat", ffREAD },
-        { efDAT, "-eref",   "eref.dat", ffOPTRD },
-        { efXPM, "-emat",   "emat", ffWRITE },
+        { efDAT, "-groups", "groups", ffREAD },
+        { efDAT, "-eref",   "eref",   ffOPTRD },
+        { efXPM, "-emat",   "emat",   ffWRITE },
         { efXVG, "-etot",   "energy", ffWRITE }
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -582,7 +581,7 @@ int gmx_enemat(int argc, char *argv[])
             }
             fprintf(out, "\n");
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
     }
     else
     {
index de70d3f40223c562be63cee6750a146fcefcebe8..98f8b715d073336354d1646a13be41d47d7195fd 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/enxio.h"
 #include "gromacs/commandline/pargs.h"
-#include "names.h"
-#include "copyrite.h"
-#include "macros.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "physics.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "viewit.h"
-#include "mtop_util.h"
-#include "gmx_ana.h"
-#include "mdebin.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static real       minthird = -1.0/3.0, minsixth = -1.0/6.0;
 
@@ -192,7 +192,7 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
     j = 0;
     for (k = 0; k < nre; k++)
     {
-        newnm[k] = strdup(nm[k].name);
+        newnm[k] = gmx_strdup(nm[k].name);
         /* Insert dashes in all the names */
         while ((ptr = strchr(newnm[k], ' ')) != NULL)
         {
@@ -559,7 +559,7 @@ static void analyse_disre(const char *voutfn,    int nframes,
         fprintf(vout, "%10d  %10.5e\n", j, mypow(violaver[j]/nframes, minthird));
     }
 #endif
-    gmx_ffclose(vout);
+    xvgrclose(vout);
 
     fprintf(stdout, "\nSum of violations averaged over simulation: %g nm\n",
             sumt);
@@ -621,8 +621,8 @@ static void einstein_visco(const char *fn, const char *fni, int nsets,
         }
         fprintf(fp1, "\n");
     }
-    gmx_ffclose(fp0);
-    gmx_ffclose(fp1);
+    xvgrclose(fp0);
+    xvgrclose(fp1);
 }
 
 typedef struct {
@@ -1420,7 +1420,7 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
                 intBulk  += 0.5*(eneset[11][i-1] + eneset[11][i])*factor;
                 fprintf(fp, "%10g  %10g  %10g\n", (i*Dt), integral, intBulk);
             }
-            gmx_ffclose(fp);
+            xvgrclose(fp);
 
             for (i = 0; i < 12; i++)
             {
@@ -1583,7 +1583,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
     }
     if (fp)
     {
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     sfree(fr);
 }
@@ -2028,7 +2028,7 @@ int gmx_energy(int argc, char *argv[])
     t_filenm           fnm[] = {
         { efEDR, "-f",    NULL,      ffREAD  },
         { efEDR, "-f2",   NULL,      ffOPTRD },
-        { efTPX, "-s",    NULL,      ffOPTRD },
+        { efTPR, "-s",    NULL,      ffOPTRD },
         { efXVG, "-o",    "energy",  ffWRITE },
         { efXVG, "-viol", "violaver", ffOPTWR },
         { efXVG, "-pairs", "pairs",   ffOPTWR },
@@ -2050,7 +2050,7 @@ int gmx_energy(int argc, char *argv[])
     npargs = asize(pa);
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -2145,7 +2145,7 @@ int gmx_energy(int argc, char *argv[])
         }
         if (bSum)
         {
-            leg[nset] = strdup("Sum");
+            leg[nset] = gmx_strdup("Sum");
             xvgr_legend(out, nset+1, (const char**)leg, oenv);
         }
         else
@@ -2173,7 +2173,7 @@ int gmx_energy(int argc, char *argv[])
 
         if (bORIRE || bOTEN)
         {
-            get_orires_parms(ftp2fn(efTPX, NFILE, fnm), &nor, &nex, &or_label, &oobs);
+            get_orires_parms(ftp2fn(efTPR, NFILE, fnm), &nor, &nex, &or_label, &oobs);
         }
 
         if (bORIRE)
@@ -2282,14 +2282,14 @@ int gmx_energy(int argc, char *argv[])
                 for (j = 0; j < 3; j++)
                 {
                     sprintf(buf, "eig%d", j+1);
-                    otenleg[(bOvec ? 12 : 3)*i+j] = strdup(buf);
+                    otenleg[(bOvec ? 12 : 3)*i+j] = gmx_strdup(buf);
                 }
                 if (bOvec)
                 {
                     for (j = 0; j < 9; j++)
                     {
                         sprintf(buf, "vec%d%s", j/3+1, j%3 == 0 ? "x" : (j%3 == 1 ? "y" : "z"));
-                        otenleg[12*i+3+j] = strdup(buf);
+                        otenleg[12*i+3+j] = gmx_strdup(buf);
                     }
                 }
             }
@@ -2298,7 +2298,7 @@ int gmx_energy(int argc, char *argv[])
     }
     else if (bDisRe)
     {
-        nbounds = get_bounds(ftp2fn(efTPX, NFILE, fnm), &bounds, &index, &pair, &npairs,
+        nbounds = get_bounds(ftp2fn(efTPR, NFILE, fnm), &bounds, &index, &pair, &npairs,
                              &mtop, &top, &ir);
         snew(violaver, npairs);
         out = xvgropen(opt2fn("-o", NFILE, fnm), "Sum of Violations",
@@ -2317,7 +2317,7 @@ int gmx_energy(int argc, char *argv[])
     }
     else if (bDHDL)
     {
-        get_dhdl_parms(ftp2fn(efTPX, NFILE, fnm), &ir);
+        get_dhdl_parms(ftp2fn(efTPR, NFILE, fnm), &ir);
     }
 
     /* Initiate energies and set them to zero */
@@ -2709,21 +2709,21 @@ int gmx_energy(int argc, char *argv[])
     close_enx(fp);
     if (out)
     {
-        gmx_ffclose(out);
+        xvgrclose(out);
     }
 
     if (bDRAll)
     {
-        gmx_ffclose(fp_pairs);
+        xvgrclose(fp_pairs);
     }
 
     if (bORT)
     {
-        gmx_ffclose(fort);
+        xvgrclose(fort);
     }
     if (bODT)
     {
-        gmx_ffclose(fodt);
+        xvgrclose(fodt);
     }
     if (bORA)
     {
@@ -2738,7 +2738,7 @@ int gmx_energy(int argc, char *argv[])
         {
             fprintf(out, "%5d  %g\n", or_label[i], orient[i]/norfr);
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
     }
     if (bODA)
     {
@@ -2753,7 +2753,7 @@ int gmx_energy(int argc, char *argv[])
         {
             fprintf(out, "%5d  %g\n", or_label[i], orient[i]/norfr-oobs[i]);
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
     }
     if (bODR)
     {
@@ -2768,11 +2768,11 @@ int gmx_energy(int argc, char *argv[])
         {
             fprintf(out, "%5d  %g\n", or_label[i], sqrt(odrms[i]/norfr));
         }
-        gmx_ffclose(out);
+        xvgrclose(out);
     }
     if (bOTEN)
     {
-        gmx_ffclose(foten);
+        xvgrclose(foten);
     }
 
     if (bDisRe)
@@ -2784,7 +2784,7 @@ int gmx_energy(int argc, char *argv[])
     {
         if (fp_dhdl)
         {
-            gmx_ffclose(fp_dhdl);
+            gmx_fio_fclose(fp_dhdl);
             printf("\n\nWrote %d lambda values with %d samples as ",
                    dh_lambdas, dh_samples);
             if (dh_hists > 0)
index 98c4c69a5d4aed4f688be5dfc6448bb0b69893af..cb26f11be0dd05705b2c6955dc73fa5467b0b844 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "gmx_ana.h"
-
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_filter(int argc, char *argv[])
 {
@@ -122,7 +119,7 @@ int gmx_filter(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 6abf410904ad2a55ba02072435b4cea8e27c86a6..befd4b4bbc5f0893c09248413e1ac1afb5e4971b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "gromacs/fileio/confio.h"
 #include "gromacs/commandline/pargs.h"
-#include "pbc.h"
-#include "force.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/math/utilities.h"
-#include "macros.h"
-#include "vec.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/tpxio.h"
-#include "mdrun.h"
-#include "main.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
-#include "index.h"
-#include "mtop_util.h"
-#include "gmx_ana.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void insert_ion(int nsa, int *nwater,
                        gmx_bool bSet[], int repl[], atom_id index[],
@@ -126,7 +122,7 @@ static char *aname(const char *mname)
     char *str;
     int   i;
 
-    str = strdup(mname);
+    str = gmx_strdup(mname);
     i   = strlen(str)-1;
     while (i > 1 && (isdigit(str[i]) || (str[i] == '+') || (str[i] == '-')))
     {
@@ -180,14 +176,14 @@ void sort_ions(int nsa, int nw, int repl[], atom_id index[],
         if (np)
         {
             snew(pptr, 1);
-            pptr[0] = strdup(p_name);
+            pptr[0] = gmx_strdup(p_name);
             snew(paptr, 1);
             paptr[0] = aname(p_name);
         }
         if (nn)
         {
             snew(nptr, 1);
-            nptr[0] = strdup(n_name);
+            nptr[0] = gmx_strdup(n_name);
             snew(naptr, 1);
             naptr[0] = aname(n_name);
         }
@@ -294,7 +290,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
             }
             /* Store this molecules section line */
             srenew(mol_line, nmol_line+1);
-            mol_line[nmol_line] = strdup(buf);
+            mol_line[nmol_line] = gmx_strdup(buf);
             nmol_line++;
         }
     }
@@ -399,14 +395,14 @@ int gmx_genion(int argc, char *argv[])
     output_env_t       oenv;
     gmx_rng_t          rng;
     t_filenm           fnm[] = {
-        { efTPX, NULL,  NULL,      ffREAD  },
+        { efTPR, NULL,  NULL,      ffREAD  },
         { efNDX, NULL,  NULL,      ffOPTRD },
         { efSTO, "-o",  NULL,      ffWRITE },
         { efTOP, "-p",  "topol",   ffOPTRW }
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
+    if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
                            asize(desc), desc, asize(bugs), bugs, &oenv))
     {
         return 0;
@@ -424,7 +420,7 @@ int gmx_genion(int argc, char *argv[])
     }
 
     /* Read atom positions and charges */
-    read_tps_conf(ftp2fn(efTPX, NFILE, fnm), title, &top, &ePBC, &x, &v, box, FALSE);
+    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), title, &top, &ePBC, &x, &v, box, FALSE);
     atoms = top.atoms;
 
     /* Compute total charge */
index 718846578d1ceee1ebc68405de44b837744d77f2..1dbe1e35e57d6a0723fb5bbd7d5a689178288f62 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "sysstuff.h"
-#include "gromacs/commandline/pargs.h"
 #include <string.h>
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
+
+#include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
-#include "macros.h"
-#include "vec.h"
-#include "index.h"
-#include "gmx_fatal.h"
-#include "gmx_ana.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_genpr(int argc, char *argv[])
 {
index 9ffb8f10512e19797b723fdba28223980fbfcbbd..6c70944e368e1b0352d3a1fc2914575efb1d389a 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "txtdump.h"
+#include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gstat.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 #include "gmx_ana.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
-
 real calc_gyro(rvec x[], int gnx, atom_id index[], t_atom atom[], real tm,
                rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans)
 {
@@ -237,7 +234,7 @@ int gmx_gyrate(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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -380,7 +377,7 @@ int gmx_gyrate(int argc, char *argv[])
         gmx_rmpbc_done(gpbc);
     }
 
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     if (bACF)
     {
index 697fb54d7c9041e5e1b94e3825f49c438f1edb69..bab0785283cc3abd0d298345679ab18d53d11918 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-
-#include "sysstuff.h"
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
-#include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /****************************************************************************/
 /* This program calculates the ordering of water molecules across a box, as */
@@ -258,7 +254,7 @@ void h2order_plot(rvec dipole[], real order[], const char *afile,
                 factor*dipole[slice][ZZ], order[slice]);
     }
 
-    gmx_ffclose(ord);
+    xvgrclose(ord);
 }
 
 int gmx_h2order(int argc, char *argv[])
@@ -307,21 +303,21 @@ int gmx_h2order(int argc, char *argv[])
         { efTRX, "-f", NULL,  ffREAD },     /* trajectory file            */
         { efNDX, NULL, NULL,  ffREAD },     /* index file         */
         { efNDX, "-nm", NULL, ffOPTRD },    /* index with micelle atoms   */
-        { efTPX, NULL, NULL,  ffREAD },     /* topology file              */
+        { efTPR, NULL, NULL,  ffREAD },     /* topology file              */
         { efXVG, "-o",  "order", ffWRITE }, /* xvgr output file       */
     };
 
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE, NFILE,
+                           PCA_CAN_VIEW | PCA_CAN_TIME, NFILE,
                            fnm, asize(pa), pa, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
         return 0;
     }
     bMicel = opt2bSet("-nm", NFILE, fnm);
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */
 
     rd_index(ftp2fn(efNDX, NFILE, fnm), 1, &ngx, &index, &grpname);
 
index 6fee2d60a64d1818309ce068857f4d11366b1698..ac8e40c5bf743eb14c399386d1c2ac00bf8e0774 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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <math.h>
+#include "gmxpre.h"
 
-/*#define HAVE_NN_LOOPS*/
+#include "config.h"
 
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "physics.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "index.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "gromacs/utility/cstringutil.h"
-#include "pbc.h"
-#include "correl.h"
-#include "gmx_ana.h"
-#include "geminate.h"
+#include <math.h>
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/correlationfunctions/crosscorr.h"
+#include "gromacs/correlationfunctions/expfit.h"
+#include "gromacs/correlationfunctions/integrate.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/geminate.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
+
+#include "geminate.h"
+
+/*#define HAVE_NN_LOOPS*/
 
 typedef short int t_E;
 typedef int t_EEst;
@@ -1183,7 +1188,7 @@ static void add_dh(t_donors *ddd, int id, int ih, int grp, unsigned char *databl
 {
     int i;
 
-    if (ISDON(datable[id]) || !datable)
+    if (!datable || ISDON(datable[id]))
     {
         if (ddd->dptr[id] == NOTSET)   /* New donor */
         {
@@ -2229,7 +2234,7 @@ static void do_hblife(const char *fn, t_hbdata *hb, gmx_bool bMerge, gmx_bool bC
         integral += x1;
     }
     integral *= dt;
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     printf("%s lifetime = %.2f ps\n", bContact ? "Contact" : "HB", integral);
     printf("Note that the lifetime obtained in this manner is close to useless\n");
     printf("Use the -ac option instead and check the Forward lifetime\n");
@@ -2374,9 +2379,10 @@ static real compute_weighted_rates(int n, real t[], real ct[], real nt[],
 static void smooth_tail(int n, real t[], real c[], real sigma_c[], real start,
                         const output_env_t oenv)
 {
-    FILE *fp;
-    real  e_1, fitparm[4];
-    int   i;
+    FILE  *fp;
+    real   e_1;
+    double fitparm[4];
+    int    i;
 
     e_1 = exp(-1);
     for (i = 0; (i < n); i++)
@@ -2395,7 +2401,8 @@ static void smooth_tail(int n, real t[], real c[], real sigma_c[], real start,
         fitparm[0] = 10;
     }
     fitparm[1] = 0.95;
-    do_lmfit(n, c, sigma_c, 0, t, start, t[n-1], oenv, bDebugMode(), effnEXP2, fitparm, 0);
+    do_lmfit(n, c, sigma_c, 0, t, start, t[n-1], oenv, bDebugMode(),
+             effnEXP2, fitparm, 0);
 }
 
 void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
@@ -2543,13 +2550,16 @@ static void parallel_print(int *data, int nThreads)
 
 static void normalizeACF(real *ct, real *gt, int nhb, int len)
 {
-    real ct_fac, gt_fac;
+    real ct_fac, gt_fac = 0;
     int  i;
 
     /* Xu and Berne use the same normalization constant */
 
     ct_fac = 1.0/ct[0];
-    gt_fac = (nhb == 0) ? 0 : 1.0/(real)nhb;
+    if (nhb != 0)
+    {
+        gt_fac = 1.0/(real)nhb;
+    }
 
     printf("Normalization for c(t) = %g for gh(t) = %g\n", ct_fac, gt_fac);
     for (i = 0; i < len; i++)
@@ -3264,7 +3274,7 @@ static void do_hbac(const char *fn, t_hbdata *hb,
                 fprintf(fp, "%10g  %10g  %10g  %10g  %10g\n",
                         hb->time[j]-hb->time[0], ct[j], cct[j], ght[j], kt[j]);
             }
-            gmx_ffclose(fp);
+            xvgrclose(fp);
 
             analyse_corr(nn, hb->time, ct, ght, kt, NULL, NULL, NULL,
                          fit_start, temp, smooth_tail_start, oenv);
@@ -3319,21 +3329,31 @@ static void init_hbframe(t_hbdata *hb, int nframes, real t)
     /*set_hb(hb->hbmap[i][j]->h[m],nframes-hb->hbmap[i][j]->n0,HB_NO);*/
 }
 
-static void analyse_donor_props(const char *fn, t_hbdata *hb, int nframes, real t,
-                                const output_env_t oenv)
+static FILE *open_donor_properties_file(const char        *fn,
+                                        t_hbdata          *hb,
+                                        const output_env_t oenv)
 {
-    static FILE *fp    = NULL;
-    const char  *leg[] = { "Nbound", "Nfree" };
-    int          i, j, k, nbound, nb, nhtot;
+    FILE       *fp    = NULL;
+    const char *leg[] = { "Nbound", "Nfree" };
 
-    if (!fn)
+    if (!fn || !hb)
     {
-        return;
+        return NULL;
     }
-    if (!fp)
+
+    fp = xvgropen(fn, "Donor properties", output_env_get_xvgr_tlabel(oenv), "Number", oenv);
+    xvgr_legend(fp, asize(leg), leg, oenv);
+
+    return fp;
+}
+
+static void analyse_donor_properties(FILE *fp, t_hbdata *hb, int nframes, real t)
+{
+    int i, j, k, nbound, nb, nhtot;
+
+    if (!fp || !hb)
     {
-        fp = xvgropen(fn, "Donor properties", output_env_get_xvgr_tlabel(oenv), "Number", oenv);
-        xvgr_legend(fp, asize(leg), leg, oenv);
+        return;
     }
     nbound = 0;
     nhtot  = 0;
@@ -3383,7 +3403,7 @@ static void dump_hbmap(t_hbdata *hb,
         for (i = 0; i < isize[grp]; i++)
         {
             fprintf(fp, (i%15) ? " " : "\n");
-            fprintf(fp, " %4u", index[grp][i]+1);
+            fprintf(fp, " %4d", index[grp][i]+1);
         }
         fprintf(fp, "\n");
         /*
@@ -3399,7 +3419,7 @@ static void dump_hbmap(t_hbdata *hb,
                 {
                     for (j = 0; (j < hb->d.nhydro[i]); j++)
                     {
-                        fprintf(fp, " %4u %4u", hb->d.don[i]+1,
+                        fprintf(fp, " %4d %4d", hb->d.don[i]+1,
                                 hb->d.hydro[i][j]+1);
                     }
                     fprintf(fp, "\n");
@@ -3412,7 +3432,7 @@ static void dump_hbmap(t_hbdata *hb,
                 if (hb->a.grp[i] == grp)
                 {
                     fprintf(fp, (i%15 && !first) ? " " : "\n");
-                    fprintf(fp, " %4u", hb->a.acc[i]+1);
+                    fprintf(fp, " %4d", hb->a.acc[i]+1);
                     first = FALSE;
                 }
             }
@@ -3443,7 +3463,7 @@ static void dump_hbmap(t_hbdata *hb,
                     sprintf(as, "%s", mkatomname(atoms, aaa));
                     if (bContact)
                     {
-                        fprintf(fp, " %6u %6u\n", ddd+1, aaa+1);
+                        fprintf(fp, " %6d %6d\n", ddd+1, aaa+1);
                         if (fplog)
                         {
                             fprintf(fplog, "%12s  %12s\n", ds, as);
@@ -3453,7 +3473,7 @@ static void dump_hbmap(t_hbdata *hb,
                     {
                         hhh = hb->d.hydro[i][m];
                         sprintf(hs, "%s", mkatomname(atoms, hhh));
-                        fprintf(fp, " %6u %6u %6u\n", ddd+1, hhh+1, aaa+1);
+                        fprintf(fp, " %6d %6d %6d\n", ddd+1, hhh+1, aaa+1);
                         if (fplog)
                         {
                             fprintf(fplog, "%12s  %12s  %12s\n", ds, hs, as);
@@ -3634,7 +3654,7 @@ int gmx_hbond(int argc, char *argv[])
     };
     t_filenm    fnm[] = {
         { efTRX, "-f",   NULL,     ffREAD  },
-        { efTPX, NULL,   NULL,     ffREAD  },
+        { efTPR, NULL,   NULL,     ffREAD  },
         { efNDX, NULL,   NULL,     ffOPTRD },
         /*    { efNDX, "-sel", "select", ffOPTRD },*/
         { efXVG, "-num", "hbnum",  ffWRITE },
@@ -3679,7 +3699,7 @@ int gmx_hbond(int argc, char *argv[])
     int                   grp, nabin, nrbin, bin, resdist, ihb;
     char                **leg;
     t_hbdata             *hb, *hbptr;
-    FILE                 *fp, *fpins = NULL, *fpnhb = NULL;
+    FILE                 *fp, *fpins = NULL, *fpnhb = NULL, *donor_properties = NULL;
     t_gridcell         ***grid;
     t_ncell              *icell, *jcell, *kcell;
     ivec                  ngrid;
@@ -3706,7 +3726,7 @@ int gmx_hbond(int argc, char *argv[])
     npargs = asize(pa);
     ppa    = add_acf_pargs(&npargs, pa);
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE, NFILE, fnm, npargs,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT, NFILE, fnm, npargs,
                            ppa, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
         return 0;
@@ -3819,7 +3839,7 @@ int gmx_hbond(int argc, char *argv[])
     hb = mk_hbdata(bHBmap, opt2bSet("-dan", NFILE, fnm), bMerge || bContact, bGem, gemmode);
 
     /* get topology */
-    read_tpx_top(ftp2fn(efTPX, NFILE, fnm), &ir, box, &natoms, NULL, NULL, NULL, &top);
+    read_tpx_top(ftp2fn(efTPR, NFILE, fnm), &ir, box, &natoms, NULL, NULL, NULL, &top);
 
     snew(grpnames, grNR);
     snew(index, grNR);
@@ -3938,6 +3958,8 @@ int gmx_hbond(int argc, char *argv[])
     /*if (bSelected)
        snew(donors[gr0D], dons[gr0D].nrd);*/
 
+    donor_properties = open_donor_properties_file(opt2fn_null("-don", NFILE, fnm), hb, oenv);
+
     if (bHBmap)
     {
         printf("Making hbmap structure...");
@@ -4366,10 +4388,7 @@ int gmx_hbond(int argc, char *argv[])
 #pragma omp barrier
 #pragma omp single
                 {
-                    if (hb != NULL)
-                    {
-                        analyse_donor_props(opt2fn_null("-don", NFILE, fnm), hb, k, t, oenv);
-                    }
+                    analyse_donor_properties(donor_properties, hb, k, t);
                 }
 
 #pragma omp single
@@ -4439,9 +4458,15 @@ int gmx_hbond(int argc, char *argv[])
     free_grid(ngrid, &grid);
 
     close_trj(status);
+
+    if (donor_properties)
+    {
+        xvgrclose(donor_properties);
+    }
+
     if (fpnhb)
     {
-        gmx_ffclose(fpnhb);
+        xvgrclose(fpnhb);
     }
 
     /* Compute maximum possible number of different hbonds */
@@ -4507,7 +4532,7 @@ int gmx_hbond(int argc, char *argv[])
         aver_nhb  += hb->nhb[i];
         aver_dist += hb->ndist[i];
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     aver_nhb  /= nframes;
     aver_dist /= nframes;
     /* Print HB distance distribution */
@@ -4530,7 +4555,7 @@ int gmx_hbond(int argc, char *argv[])
         {
             fprintf(fp, "%10g %10g\n", (i+0.5)*rbin, rdist[i]/(rbin*(real)sum));
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     /* Print HB angle distribution */
@@ -4551,7 +4576,7 @@ int gmx_hbond(int argc, char *argv[])
         {
             fprintf(fp, "%10g %10g\n", (i+0.5)*abin, adist[i]/(abin*(real)sum));
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     /* Print HB in alpha-helix */
@@ -4569,7 +4594,7 @@ int gmx_hbond(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     if (!bNN)
     {
@@ -4604,7 +4629,7 @@ int gmx_hbond(int argc, char *argv[])
                     gmx_fatal(FARGS, "Could not initiate t_gemParams params.");
                 }
             }
-            gemstring = strdup(gemType[hb->per->gemtype]);
+            gemstring = gmx_strdup(gemType[hb->per->gemtype]);
             do_hbac(opt2fn("-ac", NFILE, fnm), hb, nDump,
                     bMerge, bContact, fit_start, temp, r2cut > 0, smooth_tail_start, oenv,
                     gemstring, nThreads, NN, bBallistic, bGemFit);
@@ -4617,6 +4642,7 @@ int gmx_hbond(int argc, char *argv[])
         {
             t_matrix mat;
             int      id, ia, hh, x, y;
+            mat.flags = mat.y0 = 0;
 
             if ((nframes > 0) && (hb->nrhb > 0))
             {
@@ -4743,9 +4769,9 @@ int gmx_hbond(int argc, char *argv[])
             if (USE_THIS_GROUP(j) )
             {
                 sprintf(buf, "Donors %s", grpnames[j]);
-                legnames[i++] = strdup(buf);
+                legnames[i++] = gmx_strdup(buf);
                 sprintf(buf, "Acceptors %s", grpnames[j]);
-                legnames[i++] = strdup(buf);
+                legnames[i++] = gmx_strdup(buf);
             }
         }
         if (i != nleg)
@@ -4765,7 +4791,7 @@ int gmx_hbond(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     return 0;
index 78a020004815d4aac163e3af608a195c1f9f4711..29bab90a0742011d98fa6721915146a4c5585ea7 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+#include <string.h>
 
+#include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "fitahx.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "hxprops.h"
-#include "macros.h"
-#include "gromacs/math/utilities.h"
-#include "pbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/fitahx.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/gmxana/hxprops.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
 
 int gmx_helix(int argc, char *argv[])
 {
@@ -160,14 +156,14 @@ int gmx_helix(int argc, char *argv[])
     gmx_rmpbc_t    gpbc = NULL;
     gmx_bool       bRange;
     t_filenm       fnm[] = {
-        { efTPX, NULL,  NULL,   ffREAD  },
+        { efTPR, NULL,  NULL,   ffREAD  },
         { efNDX, NULL,  NULL,   ffREAD  },
         { efTRX, "-f",  NULL,   ffREAD  },
         { efSTO, "-cz", "zconf", ffWRITE },
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -176,7 +172,7 @@ int gmx_helix(int argc, char *argv[])
     bRange = (opt2parg_bSet("-ahxstart", asize(pa), pa) &&
               opt2parg_bSet("-ahxend", asize(pa), pa));
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC);
 
     natoms = read_first_x(oenv, &status, opt2fn("-f", NFILE, fnm), &t, &x, box);
 
@@ -211,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(efTPX, NFILE, fnm),
+    read_tpx(ftp2fn(efTPR, NFILE, fnm),
              NULL, NULL, &natoms, xref, NULL, NULL, NULL);
     calc_hxprops(nres, bb, xref);
     do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd);
@@ -293,10 +289,10 @@ int gmx_helix(int argc, char *argv[])
 
     for (i = 0; (i < efhNR); i++)
     {
-        gmx_ffclose(xf[i].fp);
+        xvgrclose(xf[i].fp);
         if (xf[i].bfp2)
         {
-            gmx_ffclose(xf[i].fp2);
+            xvgrclose(xf[i].fp2);
         }
         do_view(oenv, xf[i].filenm, "-nxy");
     }
index 981047233635dbfe8007f3317d04e3cc8b26a245..0cb969d0533b3221a92d6ed8b4e0752c1fb808a8 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "xvgr.h"
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "index.h"
-#include "pbc.h"
-#include "gmx_fatal.h"
-#include "gstat.h"
-#include "pbc.h"
-#include "gmx_ana.h"
-
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_helixorient(int argc, char *argv[])
 {
@@ -151,7 +148,7 @@ int gmx_helixorient(int argc, char *argv[])
 #define NPA asize(pa)
 
     t_filenm fnm[] = {
-        { efTPX, NULL, NULL, ffREAD },
+        { efTPR, NULL, NULL, ffREAD },
         { efTRX, "-f", NULL, ffREAD },
         { efNDX, NULL, NULL, ffOPTRD },
         { efDAT, "-oaxis",    "helixaxis", ffWRITE },
@@ -165,13 +162,13 @@ int gmx_helixorient(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
     }
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC);
 
     for (i = 0; i < 3; i++)
     {
@@ -514,8 +511,8 @@ int gmx_helixorient(int argc, char *argv[])
 
     gmx_ffclose(fpaxis);
     gmx_ffclose(fpcenter);
-    gmx_ffclose(fptilt);
-    gmx_ffclose(fprotation);
+    xvgrclose(fptilt);
+    xvgrclose(fprotation);
     gmx_ffclose(fprise);
     gmx_ffclose(fpradius);
     gmx_ffclose(fptwist);
index d9bbed9bada1b394ae047064d232bd3b46148ffb..37038b0af4cddef9acaec5e815272eeb6df09eab 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/matio.h"
-#include "binsearch.h"
-#include "powerspect.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/binsearch.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/gmxana/powerspect.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /* Print name of first atom in all groups in index file */
 static void print_types(atom_id index[], atom_id a[], int ngrps,
@@ -68,7 +65,7 @@ static void print_types(atom_id index[], atom_id a[], int ngrps,
     fprintf(stderr, "Using following groups: \n");
     for (i = 0; i < ngrps; i++)
     {
-        fprintf(stderr, "Groupname: %s First atomname: %s First atomnr %u\n",
+        fprintf(stderr, "Groupname: %s First atomname: %s First atomnr %d\n",
                 groups[i], *(top->atoms.atomname[a[index[i]]]), a[index[i]]);
     }
     fprintf(stderr, "\n");
@@ -630,7 +627,7 @@ 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           */
-        { efTPX, "-s", NULL,  ffREAD },               /* topology file                */
+        { efTPR, "-s", NULL,  ffREAD },               /* topology file                */
         { efXPM, "-o", "intf",  ffWRMULT},            /* XPM- surface maps     */
         { efOUT, "-or", "raw", ffOPTWRMULT },         /* xvgr output file           */
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* Fourier spectrum interfaces */
@@ -643,7 +640,7 @@ int gmx_hydorder(int argc, char *argv[])
     int          nfspect, nfxpm, nfraw;
     output_env_t oenv;
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -657,7 +654,7 @@ int gmx_hydorder(int argc, char *argv[])
     }
 
     ndxfnm = ftp2fn(efNDX, NFILE, fnm);
-    tpsfnm = ftp2fn(efTPX, NFILE, fnm);
+    tpsfnm = ftp2fn(efTPR, NFILE, fnm);
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */
index 7a9a689cc833cbdc61704f12eba7ec0906dc57dd..83a35de3b541f8cf74baa023375ba2d3e6eb57f5 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "txtdump.h"
 #include "gromacs/fileio/enxio.h"
-#include "gstat.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int  nlj, nqq;
@@ -182,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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -209,7 +207,7 @@ int gmx_lie(int argc, char *argv[])
         }
     }
     close_enx(fp);
-    gmx_ffclose(out);
+    xvgrclose(out);
     fprintf(stderr, "\n");
 
     if (nframes > 0)
index ae44cedd911af5f0b9793317c62b85fd113c45e4..9665117ac134f7b24f296a073bfeb44ae0358288 100644 (file)
  * on the code from g_anaeig. You can reach him as olange@gwdg.de. He
  * probably also holds copyright to the following code.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
-#include <ctype.h>
 #include <string.h>
-#include "readinp.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/matio.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "rmpbc.h"
-#include "txtdump.h"
-#include "eigio.h"
-#include "index.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct
 {
@@ -862,7 +856,6 @@ int gmx_make_edi(int argc, char *argv[])
         printf("\n");
     }
 
-    EigvecFile = NULL;
     EigvecFile = opt2fn("-f", NFILE, fnm);
 
     /*read eigenvectors from eigvec.trr*/
index 686ee49aaa59611fee725941e93d7eeb7159aac9..55dc3ab47b4027dda9599d1634b2d3994fb9d124 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <ctype.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/fileio/futil.h"
-#include "macros.h"
-#include "gromacs/utility/cstringutil.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
-#include "typedefs.h"
-#include "index.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "index.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
 
 /* It's not nice to have size limits, but we should not spend more time
  * on this ancient tool, but instead use the new selection library.
@@ -281,7 +277,7 @@ static gmx_bool parse_string(char **string, int *nr, int ngrps, char **grpname)
     {
         c = (*string)[0];
         (*string)++;
-        s  = strdup((*string));
+        s  = gmx_strdup((*string));
         sp = strchr(s, c);
         if (sp != NULL)
         {
@@ -750,7 +746,7 @@ static void remove_group(int nr, int nr2, t_blocka *block, char ***gn)
             {
                 block->index[i] = block->index[i+1]-shift;
             }
-            name = strdup((*gn)[nr]);
+            name = gmx_strdup((*gn)[nr]);
             sfree((*gn)[nr]);
             for (i = nr; i < block->nr-1; i++)
             {
@@ -799,7 +795,7 @@ static void split_group(t_atoms *atoms, int sel_nr, t_blocka *block, char ***gn,
             {
                 sprintf(buf, "%s_%s_%d", (*gn)[sel_nr], name, atoms->resinfo[resind].nr);
             }
-            (*gn)[block->nr-1] = strdup(buf);
+            (*gn)[block->nr-1] = gmx_strdup(buf);
         }
         block->a[block->nra] = a;
         block->nra++;
@@ -850,8 +846,12 @@ static int split_chain(t_atoms *atoms, rvec *x,
                 {
                     rvec_sub(x[ca_end], x[i], vec);
                 }
+                else
+                {
+                    break;
+                }
             }
-            while ((i < natoms) && (norm(vec) < 0.45));
+            while (norm(vec) < 0.45);
 
             end[nchain] = ca_end;
             while ((end[nchain]+1 < natoms) &&
@@ -886,7 +886,7 @@ static int split_chain(t_atoms *atoms, rvec *x,
             srenew(block->index, block->nr+1);
             srenew(*gn, block->nr);
             sprintf(buf, "%s_chain%d", (*gn)[sel_nr], j+1);
-            (*gn)[block->nr-1] = strdup(buf);
+            (*gn)[block->nr-1] = gmx_strdup(buf);
             for (i = block->index[sel_nr]; i < block->index[sel_nr+1]; i++)
             {
                 a = block->a[i];
@@ -1329,7 +1329,7 @@ static void edit_index(int natoms, t_atoms *atoms, rvec *x, t_blocka *block, cha
                 {
                     sscanf(string, "%s", gname);
                     sfree((*gn)[sel_nr]);
-                    (*gn)[sel_nr] = strdup(gname);
+                    (*gn)[sel_nr] = gmx_strdup(gname);
                 }
             }
         }
@@ -1447,7 +1447,7 @@ static void edit_index(int natoms, t_atoms *atoms, rvec *x, t_blocka *block, cha
                 copy2block(nr, index, block);
                 srenew(*gn, block->nr);
                 newgroup        = block->nr-1;
-                (*gn)[newgroup] = strdup(gname);
+                (*gn)[newgroup] = gmx_strdup(gname);
             }
             else
             {
index 029edf26c28abb9980bf2972a55f3cf4386f370f..d3a409ee28d6823409ca7449d7febf8935c8dc6a 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "macros.h"
-#include "vec.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/fileio/filenm.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/matio.h"
-#include "xvgr.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "rmpbc.h"
-#include "pbc.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 #define FARAWAY 10000
@@ -224,11 +221,11 @@ int gmx_mdmat(int argc, char *argv[])
     int          **nmat, **totnmat;
     real          *mean_n;
     int           *tot_n;
-    matrix         box;
+    matrix         box = {{0}};
     output_env_t   oenv;
     gmx_rmpbc_t    gpbc = NULL;
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_BE_NICE, NFILE, fnm,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME, NFILE, fnm,
                            asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -397,7 +394,7 @@ int gmx_mdmat(int argc, char *argv[])
             fprintf(fp, "%3d  %8.3f  %3d  %8.3f  %3d  %8.3f\n",
                     i+1, ratio, tot_n[i], mean_n[i], natm[i], mean_n[i]/natm[i]);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     return 0;
index 8fbb7d3712a6b426e4743d5e5b8adebadf2677dd..3c96ffb2c6a82b075ee849989d73701b512c78ee 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdlib.h>
-
-#include "sysstuff.h"
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "rmpbc.h"
-#include "gmx_ana.h"
-#include "names.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 static void periodic_dist(int ePBC,
@@ -203,7 +201,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
         gmx_rmpbc_done(gpbc);
     }
 
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     fprintf(stdout,
             "\nThe shortest periodic distance is %g (nm) at time %g (%s),\n"
@@ -363,7 +361,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
         {
             snew(leg, 1);
             sprintf(buf, "Internal in %s", grpn[0]);
-            leg[0] = strdup(buf);
+            leg[0] = gmx_strdup(buf);
             xvgr_legend(dist, 0, (const char**)leg, oenv);
             if (num)
             {
@@ -378,7 +376,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
                 for (k = i+1; (k < ng); k++, j++)
                 {
                     sprintf(buf, "%s-%s", grpn[i], grpn[k]);
-                    leg[j] = strdup(buf);
+                    leg[j] = gmx_strdup(buf);
                 }
             }
             xvgr_legend(dist, j, (const char**)leg, oenv);
@@ -394,7 +392,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
         for (i = 0; (i < ng-1); i++)
         {
             sprintf(buf, "%s-%s", grpn[0], grpn[i+1]);
-            leg[i] = strdup(buf);
+            leg[i] = gmx_strdup(buf);
         }
         xvgr_legend(dist, ng-1, (const char**)leg, oenv);
         if (num)
@@ -552,10 +550,10 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     while (read_next_x(oenv, status, &t, x0, box));
 
     close_trj(status);
-    gmx_ffclose(dist);
+    xvgrclose(dist);
     if (num)
     {
-        gmx_ffclose(num);
+        xvgrclose(num);
     }
     if (atm)
     {
@@ -565,6 +563,10 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     {
         close_trx(trxout);
     }
+    if (respertime)
+    {
+        xvgrclose(respertime);
+    }
 
     if (nres && !bEachResEachTime)
     {
@@ -582,6 +584,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
             }
             fprintf(res, "\n");
         }
+        xvgrclose(res);
     }
 
     sfree(x0);
@@ -652,7 +655,7 @@ int gmx_mindist(int argc, char *argv[])
         "each direction is considered, giving a total of 26 shifts.",
         "It also plots the maximum distance within the group and the lengths",
         "of the three box vectors.[PAR]",
-        "Also [gmx-distance] calculates distances."
+        "Also [gmx-distance] and [gmx-pairdist] calculate distances."
     };
     const char     *bugs[] = {
         "The [TT]-pi[tt] option is very slow."
@@ -713,7 +716,7 @@ int gmx_mindist(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 9e684f300d7c22f945d9aebbe6c5d2b4b99a1e07..21af93c9b029f207ab2f0c25c7cf115abd9dd240 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "macros.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static int calc_ntype(int nft, int *ft, t_idef *idef)
 {
@@ -131,7 +130,7 @@ static void fill_ft_ind(int nft, int *ft, t_idef *idef,
                         gmx_fatal(FARGS, "Unsupported function type '%s' selected",
                                   interaction_function[ftype].longname);
                 }
-                grpnames[ind] = strdup(buf);
+                grpnames[ind] = gmx_strdup(buf);
                 ind++;
             }
         }
@@ -274,7 +273,7 @@ int gmx_mk_angndx(int argc, char *argv[])
     int               *nr;
     char             **grpnames;
     t_filenm           fnm[] = {
-        { efTPX, NULL, NULL, ffREAD  },
+        { efTPR, NULL, NULL, ffREAD  },
         { efNDX, NULL, "angle", ffWRITE }
     };
 #define NFILE asize(fnm)
@@ -288,7 +287,7 @@ int gmx_mk_angndx(int argc, char *argv[])
 
     ft = select_ftype(opt[0], &nft, &mult);
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), NULL);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), NULL);
 
     ntype = calc_ntype(nft, ft, &(top->idef));
     snew(grpnames, ntype);
index 38c4fa11439ee8deb11101120d57e5306eade527..12c4269589daa88511e37e17a34ddd0f80169641 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
 #include "gromacs/fileio/confio.h"
-#include "xvgr.h"
-#include "index.h"
-#include "gmx_ana.h"
-#include "gmx_fatal.h"
 #include "gromacs/fileio/trxio.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static real dointerp(int n, rvec x1[], rvec x2[], rvec xx[],
                      int I, int N, real first, real last)
@@ -198,7 +197,7 @@ int gmx_morph(int argc, char *argv[])
 
     if (bRMS)
     {
-        gmx_ffclose(fp);
+        xvgrclose(fp);
         do_view(oenv, opt2fn("-or", NFILE, fnm), "-nxy");
     }
 
index d73f262606000225400d80864de904f7c1171ba2..eb36ac9e309189d85af0b87cd863a11b6f2ec41e 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/math/utilities.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "typedefs.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "gromacs/statistics/statistics.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "pbc.h"
-#include "vec.h"
-#include "gromacs/fileio/confio.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/statistics/statistics.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define FACTOR  1000.0  /* Convert nm^2/ps to 10e-5 cm^2/s */
 /* NORMAL = total diffusion coefficient (default). X,Y,Z is diffusion
@@ -216,7 +213,7 @@ static void corr_print(t_corr *curr, gmx_bool bTen, const char *fn, const char *
         }
         fprintf(out, "\n");
     }
-    gmx_ffclose(out);
+    xvgrclose(out);
 }
 
 /* called from corr_loop, to do the main calculations */
@@ -610,7 +607,7 @@ void printmol(t_corr *curr, const char *fn,
             }
         }
     }
-    gmx_ffclose(out);
+    xvgrclose(out);
     do_view(oenv, fn, "-graphtype bar");
 
     /* Compute variance, stddev and error */
@@ -1128,7 +1125,7 @@ int gmx_msd(int argc, char *argv[])
     output_env_t    oenv;
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 1d7d786c6dc1150be9215e2ea498d2326354fdfc..4560444e68827885052559546f1ce325b3c30aa9 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "copyrite.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "txtdump.h"
-#include "eigio.h"
-#include "mtop_util.h"
-#include "physics.h"
-#include "main.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/mtxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/linearalgebra/eigensolver.h"
-#include "gromacs/linearalgebra/mtxio.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static double cv_corr(double nu, double T)
 {
@@ -351,7 +343,7 @@ int gmx_nmeig(int argc, char *argv[])
 
     t_filenm               fnm[] = {
         { efMTX, "-f", "hessian",    ffREAD  },
-        { efTPX, NULL, NULL,         ffREAD  },
+        { efTPR, NULL, NULL,         ffREAD  },
         { efXVG, "-of", "eigenfreq", ffWRITE },
         { efXVG, "-ol", "eigenval",  ffWRITE },
         { efXVG, "-os", "spectrum",  ffOPTWR },
@@ -360,17 +352,17 @@ int gmx_nmeig(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, 0,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
     }
 
     /* Read tpr file for volume and number of harmonic terms */
-    read_tpxheader(ftp2fn(efTPX, NFILE, fnm), &tpx, TRUE, &version, &generation);
+    read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &tpx, TRUE, &version, &generation);
     snew(top_x, tpx.natoms);
 
-    read_tpx(ftp2fn(efTPX, NFILE, fnm), NULL, box, &natoms,
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms,
              top_x, NULL, NULL, &mtop);
     if (bCons)
     {
@@ -496,7 +488,7 @@ int gmx_nmeig(int argc, char *argv[])
     {
         fprintf (out, "%6d %15g\n", begin+i, eigenvalues[i]);
     }
-    gmx_ffclose(out);
+    xvgrclose(out);
 
 
     if (opt2bSet("-qc", NFILE, fnm))
@@ -585,14 +577,14 @@ int gmx_nmeig(int argc, char *argv[])
             qutot  += qu;
         }
     }
-    gmx_ffclose(out);
+    xvgrclose(out);
     if (NULL != spec)
     {
         for (j = 0; (j < maxspec); j++)
         {
             fprintf(spec, "%10g  %10g\n", 1.0*j, spectrum[j]);
         }
-        gmx_ffclose(spec);
+        xvgrclose(spec);
     }
     if (NULL != qc)
     {
@@ -602,7 +594,7 @@ int gmx_nmeig(int argc, char *argv[])
                nharm, nvsite);
         printf("Total correction to cV = %g J/mol K\n", qcvtot);
         printf("Total correction to  H = %g kJ/mol\n", qutot);
-        gmx_ffclose(qc);
+        xvgrclose(qc);
         please_cite(stdout, "Caleman2011b");
     }
     /* Writing eigenvectors. Note that if mass scaling was used, the eigenvectors
index e41ca0dd41494a0095702e31118ce9e64660c8fa..0d005fe5cd4088a62aa8771b52fd9b9b215106f8 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "txtdump.h"
-#include "physics.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
-#include "eigio.h"
-#include "gmx_ana.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 int gmx_nmens(int argc, char *argv[])
@@ -123,7 +120,7 @@ int gmx_nmens(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, 0,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 10ec827609d8e295166074f68aa8fb1e33bdd460..2fbe5cdb1f5ba111e9f4cca0d500fa5696835b89 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "txtdump.h"
-#include "physics.h"
-#include "eigio.h"
-#include "gmx_ana.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 int gmx_nmtraj(int argc, char *argv[])
@@ -140,7 +137,7 @@ int gmx_nmtraj(int argc, char *argv[])
 
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, 0,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
diff --git a/src/gromacs/gmxana/gmx_options.c b/src/gromacs/gmxana/gmx_options.c
deleted file mode 100644 (file)
index 0ed3e70..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/commandline/pargs.h"
-
-/*
- * This program is needed to create the files:
- *   options.html
- *   options.tex
- * for the html and latex manuals.
- * It should be ran with the option: -hidden
- */
-
-int
-gmx_options(int argc, char *argv[])
-{
-    const char  *desc[] = {
-        "GROMACS programs have some standard options,",
-        "of which some are hidden by default:"
-    };
-
-    const char  *bugs[] = {
-        "If the configuration script found Motif or Lesstif on your system, "
-        "you can use the graphical interface (if not, you will get an error):[BR]"
-        "[TT]-X[tt] gmx_bool [TT]no[tt] Use dialog box GUI to edit command line options",
-
-        "Optional files are not used unless the option is set, in contrast to "
-        "non-optional files, where the default file name is used when the "
-        "option is not set.",
-
-        "All GROMACS programs will accept file options without a file extension "
-        "or filename being specified. In such cases the default filenames will "
-        "be used. With multiple input file types, such as generic structure "
-        "format, the directory will be searched for files of each type with the "
-        "supplied or default name. When no such file is found, or with output "
-        "files the first file type will be used.",
-
-        "All GROMACS programs with the exception of [TT]mdrun[tt] "
-        "and [TT]eneconv[tt] check if the command line options "
-        "are valid.  If this is not the case, the program will be halted.",
-
-        "Enumerated options (enum) should be used with one of the arguments "
-        "listed in the option description, the argument may be abbreviated. "
-        "The first match to the shortest argument in the list will be selected.",
-
-        "Vector options can be used with 1 or 3 parameters. When only one "
-        "parameter is supplied the two others are also set to this value.",
-
-        "All GROMACS programs can read compressed or g-zipped files. There "
-        "might be a problem with reading compressed [TT].xtc[tt], "
-        "[TT].trr[tt] and [TT].trj[tt] files, but these will not compress "
-        "very well anyway.",
-
-        "Most GROMACS programs can process a trajectory with fewer atoms than "
-        "the run input or structure file, but only if the trajectory consists "
-        "of the first n atoms of the run input or structure file.",
-
-        "Many GROMACS programs will accept the [TT]-tu[tt] option to set the "
-        "time units to use in output files (e.g. for [TT]xmgr[tt] graphs or "
-        "[TT]xpm[tt] matrices) and in all time options."
-    };
-
-    output_env_t oenv = NULL;
-    if (!parse_common_args(&argc, argv, 0,
-                           0, NULL, 0, NULL, asize(desc), desc, asize(bugs), bugs, &oenv))
-    {
-        return 0;
-    }
-
-    return 0;
-}
index 98dd1865990695ba0fadb60397112ce05d23e4a4..2c2bf83c4ab3a2cf2f9c71f863ab9615c09e7078 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/confio.h"
-#include "cmat.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/cmat.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /****************************************************************************/
 /* This program calculates the order parameter per atom for an interface or */
@@ -327,8 +325,8 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
     sfree(index);
     sfree(isize);
 
-    gmx_ffclose(fpsg);
-    gmx_ffclose(fpsk);
+    xvgrclose(fpsg);
+    xvgrclose(fpsk);
 
     fpsg = xvgropen(sgslfn,
                     "S\\sg\\N Angle Order Parameter / Slab", "(nm)", "S\\sg\\N",
@@ -343,8 +341,8 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
         fprintf(fpsk, "%10g  %10g\n", (i+0.5)*box[slice_dim][slice_dim]/nslice,
                 sk_slice_tot[i]/nframes);
     }
-    gmx_ffclose(fpsg);
-    gmx_ffclose(fpsk);
+    xvgrclose(fpsg);
+    xvgrclose(fpsk);
 }
 
 
@@ -357,7 +355,7 @@ static void print_types(atom_id index[], atom_id a[], int ngrps,
     fprintf(stderr, "Using following groups: \n");
     for (i = 0; i < ngrps; i++)
     {
-        fprintf(stderr, "Groupname: %s First atomname: %s First atomnr %u\n",
+        fprintf(stderr, "Groupname: %s First atomname: %s First atomnr %d\n",
                 groups[i], *(top->atoms.atomname[a[index[i]]]), a[index[i]]);
     }
     fprintf(stderr, "\n");
@@ -832,9 +830,9 @@ void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bf
                                                         0.333 * order[atom][YY]));
         }
 
-        gmx_ffclose(ord);
-        gmx_ffclose(slOrd);
     }
+    xvgrclose(ord);
+    xvgrclose(slOrd);
 }
 
 void write_bfactors(t_filenm  *fnm, int nfile, atom_id *index, atom_id *a, int nslices, int ngrps, real **order, t_topology *top, real **distvals, output_env_t oenv)
@@ -962,7 +960,7 @@ int gmx_order(int argc, char *argv[])
         { efTRX, "-f", NULL,  ffREAD },               /* trajectory file              */
         { efNDX, "-n", NULL,  ffREAD },               /* index file           */
         { efNDX, "-nr", NULL,  ffREAD },              /* index for radial axis calculation       */
-        { efTPX, NULL, NULL,  ffREAD },               /* topology file                */
+        { efTPR, NULL, NULL,  ffREAD },               /* topology file                */
         { efXVG, "-o", "order", ffWRITE },            /* xvgr output file     */
         { efXVG, "-od", "deuter", ffWRITE },          /* xvgr output file           */
         { efPDB, "-ob", NULL, ffWRITE },              /* write Scd as B factors to PDB if permolecule           */
@@ -978,7 +976,7 @@ int gmx_order(int argc, char *argv[])
     const char   *sgfnm, *skfnm, *ndxfnm, *tpsfnm, *trxfnm;
     output_env_t  oenv;
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -990,7 +988,7 @@ int gmx_order(int argc, char *argv[])
     sgfnm  = opt2fn_null("-Sg", NFILE, fnm);
     skfnm  = opt2fn_null("-Sk", NFILE, fnm);
     ndxfnm = opt2fn_null("-n", NFILE, fnm);
-    tpsfnm = ftp2fn(efTPX, NFILE, fnm);
+    tpsfnm = ftp2fn(efTPR, NFILE, fnm);
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */
@@ -1061,7 +1059,7 @@ int gmx_order(int argc, char *argv[])
             fprintf(stderr, "Taking carbons as unsaturated!\n");
         }
 
-        top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */
+        top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */
 
         block = init_index(ftp2fn(efNDX, NFILE, fnm), &grpname);
         index = block->index;                   /* get indices from t_block block */
index fabca7c8d3cd497f6b728aabb869c917e2d74e26..50e0c55f129e69a4bf6ee1df85be777562d5afe2 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.
  */
+#include "gmxpre.h"
+
+#include "config.h"
+
 #include <algorithm>
 
 #include "gromacs/commandline/pargs.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "copyrite.h"
 #include "gromacs/fileio/tpxio.h"
-#include "readinp.h"
-#include "calcgrid.h"
-#include "checkpoint.h"
-#include "gmx_ana.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/calcgrid.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/calculate-ewald-splitting-coefficient.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
-#include "physics.h"
-#include "mdatoms.h"
-#include "coulomb.h"
-#include "mtop_util.h"
-#include "network.h"
-#include "main.h"
-#include "macros.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
-/* We use the same defines as in mvdata.c here */
+/* 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)); }}
@@ -1102,9 +1105,9 @@ int gmx_pme_error(int argc, char *argv[])
 
 
     static t_filenm fnm[] = {
-        { efTPX, "-s",     NULL,    ffREAD },
+        { efTPR, "-s",     NULL,    ffREAD },
         { efOUT, "-o",    "error",  ffWRITE },
-        { efTPX, "-so",   "tuned",  ffOPTWR }
+        { efTPR, "-so",   "tuned",  ffOPTWR }
     };
 
     output_env_t    oenv = NULL;
@@ -1126,12 +1129,8 @@ int gmx_pme_error(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     cr = init_commrec();
-#ifdef GMX_LIB_MPI
-    MPI_Barrier(MPI_COMM_WORLD);
-#endif
 
     PCA_Flags  = PCA_NOEXIT_ON_ARGS;
-    PCA_Flags |= (MASTER(cr) ? 0 : PCA_QUIET);
 
     if (!parse_common_args(&argc, argv, PCA_Flags,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
index ff0bfb0b32a672ef441de04647f8d6667f0c5612..12c108da9fbf73e9b75e62504e4657372f2e3f78 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "physics.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "index.h"
-#include "macros.h"
-#include "xvgr.h"
-#include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/linearalgebra/nrjac.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void gyro_eigen(double **gyr, double *eig, double **eigv, int *ord)
 {
@@ -141,7 +138,7 @@ int gmx_polystat(int argc, char *argv[])
     };
 
     t_filenm        fnm[] = {
-        { efTPX, NULL, NULL,  ffREAD  },
+        { efTPR, NULL, NULL,  ffREAD  },
         { efTRX, "-f", NULL,  ffREAD  },
         { efNDX, NULL, NULL,  ffOPTRD },
         { efXVG, "-o", "polystat",  ffWRITE },
@@ -179,14 +176,14 @@ int gmx_polystat(int argc, char *argv[])
     gmx_rmpbc_t  gpbc = NULL;
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
     }
 
     snew(top, 1);
-    ePBC = read_tpx_top(ftp2fn(efTPX, NFILE, fnm),
+    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
                         NULL, box, &natoms, NULL, NULL, NULL, top);
 
     fprintf(stderr, "Select a group of polymer mainchain atoms:\n");
@@ -235,7 +232,7 @@ int gmx_polystat(int argc, char *argv[])
             for (d2 = 0; d2 < DIM; d2++)
             {
                 sprintf(buf, "eig%d %c", d+1, 'x'+d2);
-                legp[d*DIM+d2] = strdup(buf);
+                legp[d*DIM+d2] = gmx_strdup(buf);
             }
         }
         xvgr_legend(outv, DIM*DIM, (const char**)legp, oenv);
@@ -467,14 +464,14 @@ int gmx_polystat(int argc, char *argv[])
 
     close_trx(status);
 
-    gmx_ffclose(out);
+    xvgrclose(out);
     if (outv)
     {
-        gmx_ffclose(outv);
+        xvgrclose(outv);
     }
     if (outp)
     {
-        gmx_ffclose(outp);
+        xvgrclose(outp);
     }
 
     sum_eed2_tot /= frame;
@@ -517,7 +514,7 @@ int gmx_polystat(int argc, char *argv[])
         {
             fprintf(outi, "%d  %8.4f\n", i+1, intd[i]);
         }
-        gmx_ffclose(outi);
+        xvgrclose(outi);
     }
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), "-nxy");
index 29fa31584bbb98ccb8df4ab23f7bb44eb72243b4..fb56240c3adee3119754814f5d9d2da34f635758 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
 #include <ctype.h>
-
-#include "sysstuff.h"
+#include <math.h>
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
-#include "gmx_ana.h"
-#include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/trxio.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define EPS0 8.85419E-12
 #define ELC 1.60219E-19
@@ -402,9 +398,9 @@ void plot_potential(double *potential[], double *charge[], double *field[],
         fprintf(fie, "\n");
     }
 
-    gmx_ffclose(pot);
-    gmx_ffclose(cha);
-    gmx_ffclose(fie);
+    xvgrclose(pot);
+    xvgrclose(cha);
+    xvgrclose(fie);
 }
 
 int gmx_potential(int argc, char *argv[])
@@ -462,7 +458,7 @@ int gmx_potential(int argc, char *argv[])
     t_filenm    fnm[] = {                      /* files for g_order       */
         { efTRX, "-f", NULL,  ffREAD },        /* trajectory file             */
         { efNDX, NULL, NULL,  ffREAD },        /* index file          */
-        { efTPX, NULL, NULL,  ffREAD },        /* topology file               */
+        { efTPR, NULL, NULL,  ffREAD },        /* topology file               */
         { efXVG, "-o", "potential", ffWRITE }, /* xvgr output file    */
         { efXVG, "-oc", "charge", ffWRITE },   /* xvgr output file    */
         { efXVG, "-of", "field", ffWRITE },    /* xvgr output file    */
@@ -470,7 +466,7 @@ int gmx_potential(int argc, char *argv[])
 
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, asize(bugs), bugs,
                            &oenv))
     {
@@ -480,7 +476,7 @@ int gmx_potential(int argc, char *argv[])
     /* Calculate axis */
     axis = toupper(axtitle[0]) - 'X';
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */
 
     snew(grpname, ngrps);
     snew(index, ngrps);
index 2e668f05f11f2cb0f6a112c228515c037b624817..9780027dd6448d7bad708d6593db57dc0da1529e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "txtdump.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gstat.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 void
@@ -122,7 +117,7 @@ int gmx_principal(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW | PCA_BE_NICE,
+                           PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index b9d708b837697050879725881ff0365104b4adf2..f48e3b6f8fa2a3ed068089a5db42e95756e8cbff 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "sysstuff.h"
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "physics.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
-#include "nrama.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/nrama.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 static void plot_rama(FILE *out, t_xrama *xr)
@@ -83,12 +80,12 @@ int gmx_rama(int argc, char *argv[])
     output_env_t oenv;
     t_filenm     fnm[] = {
         { efTRX, "-f", NULL,  ffREAD },
-        { efTPX, NULL, NULL,  ffREAD },
+        { efTPR, NULL, NULL,  ffREAD },
         { efXVG, NULL, "rama", ffWRITE }
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, 0, NULL, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -96,7 +93,7 @@ int gmx_rama(int argc, char *argv[])
 
 
     snew(xr, 1);
-    init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPX, NFILE, fnm), xr, 3);
+    init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPR, NFILE, fnm), xr, 3);
 
     out = xvgropen(ftp2fn(efXVG, NFILE, fnm), "Ramachandran Plot", "Phi", "Psi", oenv);
     xvgr_line_props(out, 0, elNone, ecFrank, oenv);
@@ -116,7 +113,7 @@ int gmx_rama(int argc, char *argv[])
     }
     while (new_data(xr));
     fprintf(stderr, "\n");
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
 
diff --git a/src/gromacs/gmxana/gmx_rdf.c b/src/gromacs/gmxana/gmx_rdf.c
deleted file mode 100644 (file)
index 22234f9..0000000
+++ /dev/null
@@ -1,951 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "index.h"
-#include "gromacs/utility/smalloc.h"
-#include "calcgrid.h"
-#include "nrnb.h"
-#include "coulomb.h"
-#include "gstat.h"
-#include "gromacs/fileio/matio.h"
-#include "gmx_ana.h"
-#include "names.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
-
-static void check_box_c(matrix box)
-{
-    if (fabs(box[ZZ][XX]) > GMX_REAL_EPS*box[ZZ][ZZ] ||
-        fabs(box[ZZ][YY]) > GMX_REAL_EPS*box[ZZ][ZZ])
-    {
-        gmx_fatal(FARGS,
-                  "The last box vector is not parallel to the z-axis: %f %f %f",
-                  box[ZZ][XX], box[ZZ][YY], box[ZZ][ZZ]);
-    }
-}
-
-static void calc_comg(int is, int *coi, int *index, gmx_bool bMass, t_atom *atom,
-                      rvec *x, rvec *x_comg)
-{
-    int  c, i, d;
-    rvec xc;
-    real mtot, m;
-
-    if (bMass && atom == NULL)
-    {
-        gmx_fatal(FARGS, "No masses available while mass weighting was requested");
-    }
-
-    for (c = 0; c < is; c++)
-    {
-        clear_rvec(xc);
-        mtot = 0;
-        for (i = coi[c]; i < coi[c+1]; i++)
-        {
-            if (bMass)
-            {
-                m = atom[index[i]].m;
-                for (d = 0; d < DIM; d++)
-                {
-                    xc[d] += m*x[index[i]][d];
-                }
-                mtot += m;
-            }
-            else
-            {
-                rvec_inc(xc, x[index[i]]);
-                mtot += 1.0;
-            }
-        }
-        svmul(1/mtot, xc, x_comg[c]);
-    }
-}
-
-static void split_group(int isize, int *index, char *grpname,
-                        t_topology *top, char type,
-                        int *is_out, int **coi_out)
-{
-    t_block *mols = NULL;
-    t_atom  *atom = NULL;
-    int      is, *coi;
-    int      cur, mol, res, i, a, i1;
-
-    /* Split up the group in molecules or residues */
-    switch (type)
-    {
-        case 'm':
-            mols = &top->mols;
-            break;
-        case 'r':
-            atom = top->atoms.atom;
-            break;
-        default:
-            gmx_fatal(FARGS, "Unknown rdf option '%s'", type);
-    }
-    snew(coi, isize+1);
-    is  = 0;
-    cur = -1;
-    mol = 0;
-    for (i = 0; i < isize; i++)
-    {
-        a = index[i];
-        if (type == 'm')
-        {
-            /* Check if the molecule number has changed */
-            i1 = mols->index[mol+1];
-            while (a >= i1)
-            {
-                mol++;
-                i1 = mols->index[mol+1];
-            }
-            if (mol != cur)
-            {
-                coi[is++] = i;
-                cur       = mol;
-            }
-        }
-        else if (type == 'r')
-        {
-            /* Check if the residue index has changed */
-            res = atom[a].resind;
-            if (res != cur)
-            {
-                coi[is++] = i;
-                cur       = res;
-            }
-        }
-    }
-    coi[is] = i;
-    srenew(coi, is+1);
-    printf("Group '%s' of %d atoms consists of %d %s\n",
-           grpname, isize, is,
-           (type == 'm' ? "molecules" : "residues"));
-
-    *is_out  = is;
-    *coi_out = coi;
-}
-
-static void do_rdf(const char *fnNDX, const char *fnTPS, const char *fnTRX,
-                   const char *fnRDF, const char *fnCNRDF, const char *fnHQ,
-                   gmx_bool bCM, const char *close,
-                   const char **rdft, gmx_bool bXY, gmx_bool bPBC, gmx_bool bNormalize,
-                   real cutoff, real binwidth, real fade, int ng,
-                   const output_env_t oenv)
-{
-    FILE          *fp;
-    t_trxstatus   *status;
-    char           outf1[STRLEN], outf2[STRLEN];
-    char           title[STRLEN], gtitle[STRLEN], refgt[30];
-    int            g, natoms, i, ii, j, k, nbin, j0, j1, n, nframes;
-    int          **count;
-    char         **grpname;
-    int           *isize, isize_cm = 0, nrdf = 0, max_i, isize0, isize_g;
-    atom_id      **index, *index_cm = NULL;
-    gmx_int64_t   *sum;
-    real           t, rmax2, cut2, r, r2, r2ii, invhbinw, normfac;
-    real           segvol, spherevol, prev_spherevol, **rdf;
-    rvec          *x, dx, *x0 = NULL, *x_i1, xi;
-    real          *inv_segvol, invvol, invvol_sum, rho;
-    gmx_bool       bClose, *bExcl, bTop, bNonSelfExcl;
-    matrix         box, box_pbc;
-    int          **npairs;
-    atom_id        ix, jx, ***pairs;
-    t_topology    *top  = NULL;
-    int            ePBC = -1, ePBCrdf = -1;
-    t_block       *mols = NULL;
-    t_blocka      *excl;
-    t_atom        *atom = NULL;
-    t_pbc          pbc;
-    gmx_rmpbc_t    gpbc = NULL;
-    int           *is   = NULL, **coi = NULL, cur, mol, i1, res, a;
-
-    excl = NULL;
-
-    bClose = (close[0] != 'n');
-
-    if (fnTPS)
-    {
-        snew(top, 1);
-        bTop = read_tps_conf(fnTPS, title, top, &ePBC, &x, NULL, box, TRUE);
-        if (bTop && !(bCM || bClose))
-        {
-            /* get exclusions from topology */
-            excl = &(top->excls);
-        }
-    }
-    snew(grpname, ng+1);
-    snew(isize, ng+1);
-    snew(index, ng+1);
-    fprintf(stderr, "\nSelect a reference group and %d group%s\n",
-            ng, ng == 1 ? "" : "s");
-    if (fnTPS)
-    {
-        get_index(&(top->atoms), fnNDX, ng+1, isize, index, grpname);
-        atom = top->atoms.atom;
-    }
-    else
-    {
-        rd_index(fnNDX, ng+1, isize, index, grpname);
-    }
-
-    if (bCM || bClose)
-    {
-        snew(is, 1);
-        snew(coi, 1);
-        if (bClose)
-        {
-            split_group(isize[0], index[0], grpname[0], top, close[0], &is[0], &coi[0]);
-        }
-    }
-    if (rdft[0][0] != 'a')
-    {
-        /* Split up all the groups in molecules or residues */
-        srenew(is, ng+1);
-        srenew(coi, ng+1);
-        for (g = ((bCM || bClose) ? 1 : 0); g < ng+1; g++)
-        {
-            split_group(isize[g], index[g], grpname[g], top, rdft[0][0], &is[g], &coi[g]);
-        }
-    }
-
-    if (bCM)
-    {
-        is[0] = 1;
-        snew(coi[0], is[0]+1);
-        coi[0][0] = 0;
-        coi[0][1] = isize[0];
-        isize0    = is[0];
-        snew(x0, isize0);
-    }
-    else if (bClose || rdft[0][0] != 'a')
-    {
-        isize0 = is[0];
-        snew(x0, isize0);
-    }
-    else
-    {
-        isize0 = isize[0];
-    }
-
-    natoms = read_first_x(oenv, &status, fnTRX, &t, &x, box);
-    if (!natoms)
-    {
-        gmx_fatal(FARGS, "Could not read coordinates from statusfile\n");
-    }
-    if (fnTPS)
-    {
-        /* check with topology */
-        if (natoms > top->atoms.nr)
-        {
-            gmx_fatal(FARGS, "Trajectory (%d atoms) does not match topology (%d atoms)",
-                      natoms, top->atoms.nr);
-        }
-    }
-    /* check with index groups */
-    for (i = 0; i < ng+1; i++)
-    {
-        for (j = 0; j < isize[i]; j++)
-        {
-            if (index[i][j] >= natoms)
-            {
-                gmx_fatal(FARGS, "Atom index (%d) in index group %s (%d atoms) larger "
-                          "than number of atoms in trajectory (%d atoms)",
-                          index[i][j], grpname[i], isize[i], natoms);
-            }
-        }
-    }
-
-    /* initialize some handy things */
-    if (ePBC == -1)
-    {
-        ePBC = guess_ePBC(box);
-    }
-    copy_mat(box, box_pbc);
-    if (bXY)
-    {
-        check_box_c(box);
-        switch (ePBC)
-        {
-            case epbcXYZ:
-            case epbcXY:   ePBCrdf = epbcXY;   break;
-            case epbcNONE: ePBCrdf = epbcNONE; break;
-            default:
-                gmx_fatal(FARGS, "xy-rdf's are not supported for pbc type'%s'",
-                          EPBC(ePBC));
-                break;
-        }
-        /* Make sure the z-height does not influence the cut-off */
-        box_pbc[ZZ][ZZ] = 2*max(box[XX][XX], box[YY][YY]);
-    }
-    else
-    {
-        ePBCrdf = ePBC;
-    }
-    if (bPBC)
-    {
-        rmax2   = 0.99*0.99*max_cutoff2(bXY ? epbcXY : epbcXYZ, box_pbc);
-    }
-    else
-    {
-        rmax2   = sqr(3*max(box[XX][XX], max(box[YY][YY], box[ZZ][ZZ])));
-    }
-    if (debug)
-    {
-        fprintf(debug, "rmax2 = %g\n", rmax2);
-    }
-
-    /* We use the double amount of bins, so we can correctly
-     * write the rdf and rdf_cn output at i*binwidth values.
-     */
-    nbin     = (int)(sqrt(rmax2) * 2 / binwidth);
-    invhbinw = 2.0 / binwidth;
-    cut2     = sqr(cutoff);
-
-    snew(count, ng);
-    snew(pairs, ng);
-    snew(npairs, ng);
-
-    snew(bExcl, natoms);
-    max_i = 0;
-    for (g = 0; g < ng; g++)
-    {
-        if (isize[g+1] > max_i)
-        {
-            max_i = isize[g+1];
-        }
-
-        /* this is THE array */
-        snew(count[g], nbin+1);
-
-        /* make pairlist array for groups and exclusions */
-        snew(pairs[g], isize[0]);
-        snew(npairs[g], isize[0]);
-        for (i = 0; i < isize[0]; i++)
-        {
-            /* We can only have exclusions with atomic rdfs */
-            if (!(bCM || bClose || rdft[0][0] != 'a'))
-            {
-                ix = index[0][i];
-                for (j = 0; j < natoms; j++)
-                {
-                    bExcl[j] = FALSE;
-                }
-                /* exclusions? */
-                if (excl)
-                {
-                    for (j = excl->index[ix]; j < excl->index[ix+1]; j++)
-                    {
-                        bExcl[excl->a[j]] = TRUE;
-                    }
-                }
-                k = 0;
-                snew(pairs[g][i], isize[g+1]);
-                bNonSelfExcl = FALSE;
-                for (j = 0; j < isize[g+1]; j++)
-                {
-                    jx = index[g+1][j];
-                    if (!bExcl[jx])
-                    {
-                        pairs[g][i][k++] = jx;
-                    }
-                    else if (ix != jx)
-                    {
-                        /* Check if we have exclusions other than self exclusions */
-                        bNonSelfExcl = TRUE;
-                    }
-                }
-                if (bNonSelfExcl)
-                {
-                    npairs[g][i] = k;
-                    srenew(pairs[g][i], npairs[g][i]);
-                }
-                else
-                {
-                    /* Save a LOT of memory and some cpu cycles */
-                    npairs[g][i] = -1;
-                    sfree(pairs[g][i]);
-                }
-            }
-            else
-            {
-                npairs[g][i] = -1;
-            }
-        }
-    }
-    sfree(bExcl);
-
-    snew(x_i1, max_i);
-    nframes    = 0;
-    invvol_sum = 0;
-    if (bPBC && (NULL != top))
-    {
-        gpbc = gmx_rmpbc_init(&top->idef, ePBC, natoms);
-    }
-
-    do
-    {
-        /* Must init pbc every step because of pressure coupling */
-        copy_mat(box, box_pbc);
-        if (bPBC)
-        {
-            if (top != NULL)
-            {
-                gmx_rmpbc(gpbc, natoms, box, x);
-            }
-            if (bXY)
-            {
-                check_box_c(box);
-                clear_rvec(box_pbc[ZZ]);
-            }
-            set_pbc(&pbc, ePBCrdf, box_pbc);
-
-            if (bXY)
-            {
-                /* Set z-size to 1 so we get the surface iso the volume */
-                box_pbc[ZZ][ZZ] = 1;
-            }
-        }
-        invvol      = 1/det(box_pbc);
-        invvol_sum += invvol;
-
-        if (bCM)
-        {
-            /* Calculate center of mass of the whole group */
-            calc_comg(is[0], coi[0], index[0], TRUE, atom, x, x0);
-        }
-        else if (!bClose && rdft[0][0] != 'a')
-        {
-            calc_comg(is[0], coi[0], index[0], rdft[0][6] == 'm', atom, x, x0);
-        }
-
-        for (g = 0; g < ng; g++)
-        {
-            if (rdft[0][0] == 'a')
-            {
-                /* Copy the indexed coordinates to a continuous array */
-                for (i = 0; i < isize[g+1]; i++)
-                {
-                    copy_rvec(x[index[g+1][i]], x_i1[i]);
-                }
-            }
-            else
-            {
-                /* Calculate the COMs/COGs and store in x_i1 */
-                calc_comg(is[g+1], coi[g+1], index[g+1], rdft[0][6] == 'm', atom, x, x_i1);
-            }
-
-            for (i = 0; i < isize0; i++)
-            {
-                if (bClose)
-                {
-                    /* Special loop, since we need to determine the minimum distance
-                     * over all selected atoms in the reference molecule/residue.
-                     */
-                    if (rdft[0][0] == 'a')
-                    {
-                        isize_g = isize[g+1];
-                    }
-                    else
-                    {
-                        isize_g = is[g+1];
-                    }
-                    for (j = 0; j < isize_g; j++)
-                    {
-                        r2 = 1e30;
-                        /* Loop over the selected atoms in the reference molecule */
-                        for (ii = coi[0][i]; ii < coi[0][i+1]; ii++)
-                        {
-                            if (bPBC)
-                            {
-                                pbc_dx(&pbc, x[index[0][ii]], x_i1[j], dx);
-                            }
-                            else
-                            {
-                                rvec_sub(x[index[0][ii]], x_i1[j], dx);
-                            }
-                            if (bXY)
-                            {
-                                r2ii = dx[XX]*dx[XX] + dx[YY]*dx[YY];
-                            }
-                            else
-                            {
-                                r2ii = iprod(dx, dx);
-                            }
-                            if (r2ii < r2)
-                            {
-                                r2 = r2ii;
-                            }
-                        }
-                        if (r2 > cut2 && r2 <= rmax2)
-                        {
-                            count[g][(int)(sqrt(r2)*invhbinw)]++;
-                        }
-                    }
-                }
-                else
-                {
-                    /* Real rdf between points in space */
-                    if (bCM || rdft[0][0] != 'a')
-                    {
-                        copy_rvec(x0[i], xi);
-                    }
-                    else
-                    {
-                        copy_rvec(x[index[0][i]], xi);
-                    }
-                    if (rdft[0][0] == 'a' && npairs[g][i] >= 0)
-                    {
-                        /* Expensive loop, because of indexing */
-                        for (j = 0; j < npairs[g][i]; j++)
-                        {
-                            jx = pairs[g][i][j];
-                            if (bPBC)
-                            {
-                                pbc_dx(&pbc, xi, x[jx], dx);
-                            }
-                            else
-                            {
-                                rvec_sub(xi, x[jx], dx);
-                            }
-
-                            if (bXY)
-                            {
-                                r2 = dx[XX]*dx[XX] + dx[YY]*dx[YY];
-                            }
-                            else
-                            {
-                                r2 = iprod(dx, dx);
-                            }
-                            if (r2 > cut2 && r2 <= rmax2)
-                            {
-                                count[g][(int)(sqrt(r2)*invhbinw)]++;
-                            }
-                        }
-                    }
-                    else
-                    {
-                        /* Cheaper loop, no exclusions */
-                        if (rdft[0][0] == 'a')
-                        {
-                            isize_g = isize[g+1];
-                        }
-                        else
-                        {
-                            isize_g = is[g+1];
-                        }
-                        for (j = 0; j < isize_g; j++)
-                        {
-                            if (bPBC)
-                            {
-                                pbc_dx(&pbc, xi, x_i1[j], dx);
-                            }
-                            else
-                            {
-                                rvec_sub(xi, x_i1[j], dx);
-                            }
-                            if (bXY)
-                            {
-                                r2 = dx[XX]*dx[XX] + dx[YY]*dx[YY];
-                            }
-                            else
-                            {
-                                r2 = iprod(dx, dx);
-                            }
-                            if (r2 > cut2 && r2 <= rmax2)
-                            {
-                                count[g][(int)(sqrt(r2)*invhbinw)]++;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        nframes++;
-    }
-    while (read_next_x(oenv, status, &t, x, box));
-    fprintf(stderr, "\n");
-
-    if (bPBC && (NULL != top))
-    {
-        gmx_rmpbc_done(gpbc);
-    }
-
-    close_trj(status);
-
-    sfree(x);
-
-    /* Average volume */
-    invvol = invvol_sum/nframes;
-
-    /* Calculate volume of sphere segments or length of circle segments */
-    snew(inv_segvol, (nbin+1)/2);
-    prev_spherevol = 0;
-    for (i = 0; (i < (nbin+1)/2); i++)
-    {
-        r = (i + 0.5)*binwidth;
-        if (bXY)
-        {
-            spherevol = M_PI*r*r;
-        }
-        else
-        {
-            spherevol = (4.0/3.0)*M_PI*r*r*r;
-        }
-        segvol         = spherevol-prev_spherevol;
-        inv_segvol[i]  = 1.0/segvol;
-        prev_spherevol = spherevol;
-    }
-
-    snew(rdf, ng);
-    for (g = 0; g < ng; g++)
-    {
-        /* We have to normalize by dividing by the number of frames */
-        if (rdft[0][0] == 'a')
-        {
-            normfac = 1.0/(nframes*invvol*isize0*isize[g+1]);
-        }
-        else
-        {
-            normfac = 1.0/(nframes*invvol*isize0*is[g+1]);
-        }
-
-        /* Do the normalization */
-        nrdf = max((nbin+1)/2, 1+2*fade/binwidth);
-        snew(rdf[g], nrdf);
-        for (i = 0; i < (nbin+1)/2; i++)
-        {
-            r = i*binwidth;
-            if (i == 0)
-            {
-                j = count[g][0];
-            }
-            else
-            {
-                j = count[g][i*2-1] + count[g][i*2];
-            }
-            if ((fade > 0) && (r >= fade))
-            {
-                rdf[g][i] = 1 + (j*inv_segvol[i]*normfac-1)*exp(-16*sqr(r/fade-1));
-            }
-            else
-            {
-                if (bNormalize)
-                {
-                    rdf[g][i] = j*inv_segvol[i]*normfac;
-                }
-                else
-                {
-                    rdf[g][i] = j/(binwidth*isize0*nframes);
-                }
-            }
-        }
-        for (; (i < nrdf); i++)
-        {
-            rdf[g][i] = 1.0;
-        }
-    }
-
-    if (rdft[0][0] == 'a')
-    {
-        sprintf(gtitle, "Radial distribution");
-    }
-    else
-    {
-        sprintf(gtitle, "Radial distribution of %s %s",
-                rdft[0][0] == 'm' ? "molecule" : "residue",
-                rdft[0][6] == 'm' ? "COM" : "COG");
-    }
-    fp = xvgropen(fnRDF, gtitle, "r", "", oenv);
-    if (bCM)
-    {
-        sprintf(refgt, " %s", "COM");
-    }
-    else if (bClose)
-    {
-        sprintf(refgt, " closest atom in %s.", close);
-    }
-    else
-    {
-        sprintf(refgt, "%s", "");
-    }
-    if (ng == 1)
-    {
-        if (output_env_get_print_xvgr_codes(oenv))
-        {
-            fprintf(fp, "@ subtitle \"%s%s - %s\"\n", grpname[0], refgt, grpname[1]);
-        }
-    }
-    else
-    {
-        if (output_env_get_print_xvgr_codes(oenv))
-        {
-            fprintf(fp, "@ subtitle \"reference %s%s\"\n", grpname[0], refgt);
-        }
-        xvgr_legend(fp, ng, (const char**)(grpname+1), oenv);
-    }
-    for (i = 0; (i < nrdf); i++)
-    {
-        fprintf(fp, "%10g", i*binwidth);
-        for (g = 0; g < ng; g++)
-        {
-            fprintf(fp, " %10g", rdf[g][i]);
-        }
-        fprintf(fp, "\n");
-    }
-    gmx_ffclose(fp);
-
-    do_view(oenv, fnRDF, NULL);
-
-    /* h(Q) function: fourier transform of rdf */
-    if (fnHQ)
-    {
-        int   nhq = 401;
-        real *hq, *integrand, Q;
-
-        /* Get a better number density later! */
-        rho = isize[1]*invvol;
-        snew(hq, nhq);
-        snew(integrand, nrdf);
-        for (i = 0; (i < nhq); i++)
-        {
-            Q            = i*0.5;
-            integrand[0] = 0;
-            for (j = 1; (j < nrdf); j++)
-            {
-                r             = j*binwidth;
-                integrand[j]  = (Q == 0) ? 1.0 : sin(Q*r)/(Q*r);
-                integrand[j] *= 4.0*M_PI*rho*r*r*(rdf[0][j]-1.0);
-            }
-            hq[i] = print_and_integrate(debug, nrdf, binwidth, integrand, NULL, 0);
-        }
-        fp = xvgropen(fnHQ, "h(Q)", "Q(/nm)", "h(Q)", oenv);
-        for (i = 0; (i < nhq); i++)
-        {
-            fprintf(fp, "%10g %10g\n", i*0.5, hq[i]);
-        }
-        gmx_ffclose(fp);
-        do_view(oenv, fnHQ, NULL);
-        sfree(hq);
-        sfree(integrand);
-    }
-
-    if (fnCNRDF)
-    {
-        normfac = 1.0/(isize0*nframes);
-        fp      = xvgropen(fnCNRDF, "Cumulative Number RDF", "r", "number", oenv);
-        if (ng == 1)
-        {
-            if (output_env_get_print_xvgr_codes(oenv))
-            {
-                fprintf(fp, "@ subtitle \"%s-%s\"\n", grpname[0], grpname[1]);
-            }
-        }
-        else
-        {
-            if (output_env_get_print_xvgr_codes(oenv))
-            {
-                fprintf(fp, "@ subtitle \"reference %s\"\n", grpname[0]);
-            }
-            xvgr_legend(fp, ng, (const char**)(grpname+1), oenv);
-        }
-        snew(sum, ng);
-        for (i = 0; (i <= nbin/2); i++)
-        {
-            fprintf(fp, "%10g", i*binwidth);
-            for (g = 0; g < ng; g++)
-            {
-                fprintf(fp, " %10g", (real)((double)sum[g]*normfac));
-                if (i*2+1 < nbin)
-                {
-                    sum[g] += count[g][i*2] + count[g][i*2+1];
-                }
-            }
-            fprintf(fp, "\n");
-        }
-        gmx_ffclose(fp);
-        sfree(sum);
-
-        do_view(oenv, fnCNRDF, NULL);
-    }
-
-    for (g = 0; g < ng; g++)
-    {
-        sfree(rdf[g]);
-    }
-    sfree(rdf);
-}
-
-
-int gmx_rdf(int argc, char *argv[])
-{
-    const char        *desc[] = {
-        "The structure of liquids can be studied by either neutron or X-ray",
-        "scattering. The most common way to describe liquid structure is by a",
-        "radial distribution function. However, this is not easy to obtain from",
-        "a scattering experiment.[PAR]",
-        "[THISMODULE] calculates radial distribution functions in different ways.",
-        "The normal method is around a (set of) particle(s), the other methods",
-        "are around the center of mass of a set of particles ([TT]-com[tt])",
-        "or to the closest particle in a set ([TT]-surf[tt]).",
-        "With all methods, the RDF can also be calculated around axes parallel",
-        "to the [IT]z[it]-axis with option [TT]-xy[tt].",
-        "With option [TT]-surf[tt] normalization can not be used.[PAR]",
-        "The option [TT]-rdf[tt] sets the type of RDF to be computed.",
-        "Default is for atoms or particles, but one can also select center",
-        "of mass or geometry of molecules or residues. In all cases, only",
-        "the atoms in the index groups are taken into account.",
-        "For molecules and/or the center of mass option, a run input file",
-        "is required.",
-        "Weighting other than COM or COG can currently only be achieved",
-        "by providing a run input file with different masses.",
-        "Options [TT]-com[tt] and [TT]-surf[tt] also work in conjunction",
-        "with [TT]-rdf[tt].[PAR]",
-        "If a run input file is supplied ([TT]-s[tt]) and [TT]-rdf[tt] is set",
-        "to [TT]atom[tt], exclusions defined",
-        "in that file are taken into account when calculating the RDF.",
-        "The option [TT]-cut[tt] is meant as an alternative way to avoid",
-        "intramolecular peaks in the RDF plot.",
-        "It is however better to supply a run input file with a higher number of",
-        "exclusions. For e.g. benzene a topology, setting nrexcl to 5",
-        "would eliminate all intramolecular contributions to the RDF.",
-        "Note that all atoms in the selected groups are used, also the ones",
-        "that don't have Lennard-Jones interactions.[PAR]",
-        "Option [TT]-cn[tt] produces the cumulative number RDF,",
-        "i.e. the average number of particles within a distance r.[PAR]"
-    };
-    static gmx_bool    bCM     = FALSE, bXY = FALSE, bPBC = TRUE, bNormalize = TRUE;
-    static real        cutoff  = 0, binwidth = 0.002, fade = 0.0;
-    static int         ngroups = 1;
-
-    static const char *closet[] = { NULL, "no", "mol", "res", NULL };
-    static const char *rdft[]   = { NULL, "atom", "mol_com", "mol_cog", "res_com", "res_cog", NULL };
-
-    t_pargs            pa[] = {
-        { "-bin",      FALSE, etREAL, {&binwidth},
-          "Binwidth (nm)" },
-        { "-com",      FALSE, etBOOL, {&bCM},
-          "RDF with respect to the center of mass of first group" },
-        { "-surf",     FALSE, etENUM, {closet},
-          "RDF with respect to the surface of the first group" },
-        { "-rdf",   FALSE, etENUM, {rdft},
-          "RDF type" },
-        { "-pbc",      FALSE, etBOOL, {&bPBC},
-          "Use periodic boundary conditions for computing distances. Without PBC the maximum range will be three times the largest box edge." },
-        { "-norm",     FALSE, etBOOL, {&bNormalize},
-          "Normalize for volume and density" },
-        { "-xy",       FALSE, etBOOL, {&bXY},
-          "Use only the x and y components of the distance" },
-        { "-cut",      FALSE, etREAL, {&cutoff},
-          "Shortest distance (nm) to be considered"},
-        { "-ng",       FALSE, etINT, {&ngroups},
-          "Number of secondary groups to compute RDFs around a central group" },
-        { "-fade",     FALSE, etREAL, {&fade},
-          "From this distance onwards the RDF is tranformed by g'(r) = 1 + [g(r)-1] exp(-(r/fade-1)^2 to make it go to 1 smoothly. If fade is 0.0 nothing is done." }
-    };
-#define NPA asize(pa)
-    const char        *fnTPS, *fnNDX;
-    output_env_t       oenv;
-
-    t_filenm           fnm[] = {
-        { efTRX, "-f",  NULL,     ffREAD },
-        { efTPS, NULL,  NULL,     ffOPTRD },
-        { efNDX, NULL,  NULL,     ffOPTRD },
-        { efXVG, "-o",  "rdf",    ffWRITE },
-        { efXVG, "-cn", "rdf_cn", ffOPTWR },
-        { efXVG, "-hq", "hq",     ffOPTWR },
-    };
-#define NFILE asize(fnm)
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
-    {
-        return 0;
-    }
-
-    if (bCM || closet[0][0] != 'n' || rdft[0][0] == 'm' || rdft[0][6] == 'm')
-    {
-        fnTPS = ftp2fn(efTPS, NFILE, fnm);
-    }
-    else
-    {
-        fnTPS = ftp2fn_null(efTPS, NFILE, fnm);
-    }
-    fnNDX = ftp2fn_null(efNDX, NFILE, fnm);
-
-    if (!fnTPS && !fnNDX)
-    {
-        gmx_fatal(FARGS, "Neither index file nor topology file specified\n"
-                  "Nothing to do!");
-    }
-
-    if (closet[0][0] != 'n')
-    {
-        if (bCM)
-        {
-            gmx_fatal(FARGS, "Can not have both -com and -surf");
-        }
-        if (bNormalize)
-        {
-            fprintf(stderr, "Turning of normalization because of option -surf\n");
-            bNormalize = FALSE;
-        }
-    }
-
-    do_rdf(fnNDX, fnTPS, ftp2fn(efTRX, NFILE, fnm),
-           opt2fn("-o", NFILE, fnm), opt2fn_null("-cn", NFILE, fnm),
-           opt2fn_null("-hq", NFILE, fnm),
-           bCM, closet[0], rdft, bXY, bPBC, bNormalize, cutoff, binwidth, fade, ngroups,
-           oenv);
-
-    return 0;
-}
index 90605021a4c891c0b2e9a1b7f4019d98edaccd80..f399105e7094c4be9e24b4c920635f2a99ddacf1 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
 #include <math.h>
-#include "macros.h"
-#include "typedefs.h"
-#include "xvgr.h"
-#include "copyrite.h"
+#include <stdlib.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "index.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "princ.h"
-#include "rmpbc.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "cmat.h"
-#include "viewit.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/cmat.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void norm_princ(t_atoms *atoms, int isize, atom_id *index, int natoms,
                        rvec *x)
@@ -228,7 +227,7 @@ int gmx_rms(int argc, char *argv[])
     int             ePBC;
     t_iatom        *iatom = NULL;
 
-    matrix          box;
+    matrix          box = {{0}};
     rvec           *x, *xp, *xm = NULL, **mat_x = NULL, **mat_x2, *mat_x2_j = NULL, vec1,
                     vec2;
     t_trxstatus    *status;
@@ -268,8 +267,8 @@ 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
-                           | PCA_BE_NICE, NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
+    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))
     {
         return 0;
@@ -1152,7 +1151,7 @@ int gmx_rms(int argc, char *argv[])
         }
         fprintf(fp, "\n");
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     if (bMirror)
     {
@@ -1190,7 +1189,7 @@ int gmx_rms(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     if (bAv)
@@ -1202,7 +1201,7 @@ int gmx_rms(int argc, char *argv[])
         {
             fprintf(fp, "%10d  %10g\n", j, rlstot/teller);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     if (bNorm)
@@ -1212,7 +1211,7 @@ int gmx_rms(int argc, char *argv[])
         {
             fprintf(fp, "%10d  %10g\n", j, rlsnorm[j]/teller);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     do_view(oenv, opt2fn_null("-a", NFILE, fnm), "-graphtype bar");
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
index 7e6515f29bd686eb6c68743e888204d2c90f2614..5616a4136ec9e8be679268fe10439f86dc50705e 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "names.h"
 #include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/matio.h"
+#include "gromacs/fileio/strdb.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/strdb.h"
-#include "vec.h"
-#include "macros.h"
-#include "index.h"
-#include "pbc.h"
-#include "xvgr.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/matio.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 static void calc_dist(int nind, atom_id index[], rvec x[], int ePBC, matrix box,
@@ -187,14 +185,14 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
         {
             lp += n;
             snew(equiv[neq], 1);
-            equiv[neq][0].nname = strdup(atomname);
+            equiv[neq][0].nname = gmx_strdup(atomname);
             while (sscanf(lp, "%d %s %s %n", &resnr, resname, atomname, &n) == 3)
             {
                 /* this is not efficient, but I'm lazy (again) */
                 srenew(equiv[neq], na+1);
                 equiv[neq][na].rnr   = resnr-1;
-                equiv[neq][na].rname = strdup(resname);
-                equiv[neq][na].aname = strdup(atomname);
+                equiv[neq][na].rname = gmx_strdup(resname);
+                equiv[neq][na].aname = gmx_strdup(atomname);
                 if (na > 0)
                 {
                     equiv[neq][na].nname = NULL;
@@ -268,7 +266,7 @@ static gmx_bool is_equiv(int neq, t_equiv **equiv, char **nname,
     }
     if (bFound)
     {
-        *nname = strdup(equiv[i-1][0].nname);
+        *nname = gmx_strdup(equiv[i-1][0].nname);
     }
 
     return bFound;
@@ -319,7 +317,7 @@ static int analyze_noe_equivalent(const char *eq_fn,
                                  rnrj, *atoms->resinfo[rnrj].name, *atoms->atomname[index[j]]);
                     if (nnm[i] && bEquiv)
                     {
-                        nnm[j] = strdup(nnm[i]);
+                        nnm[j] = gmx_strdup(nnm[i]);
                     }
                     if (bEquiv)
                     {
@@ -400,18 +398,18 @@ static int analyze_noe_equivalent(const char *eq_fn,
             noe_gr[gi].anr  = index[i];
             if (nnm[i])
             {
-                noe_gr[gi].aname = strdup(nnm[i]);
+                noe_gr[gi].aname = gmx_strdup(nnm[i]);
             }
             else
             {
-                noe_gr[gi].aname = strdup(*atoms->atomname[index[i]]);
+                noe_gr[gi].aname = gmx_strdup(*atoms->atomname[index[i]]);
                 if (noe_index[i] == noe_index[i+1])
                 {
                     noe_gr[gi].aname[strlen(noe_gr[gi].aname)-1] = '*';
                 }
             }
             noe_gr[gi].rnr   = atoms->atom[index[i]].resind;
-            noe_gr[gi].rname = strdup(*atoms->resinfo[noe_gr[gi].rnr].name);
+            noe_gr[gi].rname = gmx_strdup(*atoms->resinfo[noe_gr[gi].rnr].name);
             /* dump group definitions */
             if (debug)
             {
@@ -706,7 +704,7 @@ int gmx_rmsdist(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -800,7 +798,7 @@ int gmx_rmsdist(int argc, char *argv[])
     while (read_next_x(oenv, status, &t, x, box));
     fprintf(stderr, "\n");
 
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     close_trj(status);
 
index 97180622e4ad1935c6885fb79ad304f295a05e39..f96663cb77f6665ed674c7bec00c0ba8c8a003b5 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
 #include <math.h>
-#include "macros.h"
-#include "typedefs.h"
-#include "xvgr.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "index.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "gromacs/fileio/confio.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/princ.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static real find_pdb_bfac(t_atoms *atoms, t_resinfo *ri, char *atomnm)
 {
@@ -104,7 +102,7 @@ void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
             }
         }
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 static void average_residues(double f[], double **U, int uind,
@@ -278,7 +276,7 @@ int gmx_rmsf(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pargs), pargs, asize(desc), desc, 0, NULL,
                            &oenv))
     {
@@ -499,7 +497,7 @@ int gmx_rmsf(int argc, char *argv[])
                         pdb_bfac);
             }
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     else
     {
@@ -513,7 +511,7 @@ int gmx_rmsf(int argc, char *argv[])
                         bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1, sqrt(rmsf[i]));
             }
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     for (i = 0; i < isize; i++)
@@ -542,7 +540,7 @@ int gmx_rmsf(int argc, char *argv[])
                         bRes ? top.atoms.resinfo[top.atoms.atom[index[i]].resind].nr : index[i]+1, sqrt(rmsf[i]));
             }
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     if (opt2bSet("-oq", NFILE, fnm))
index b540f38d2c3dd96fb9387c4de40b4e5256c5b379..e48fc483f262fa549f38bf5da9608fdefa17dc33 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
-#include "sysstuff.h"
-#include "physics.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "index.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
-#include "gstat.h"
-#include "vec.h"
-#include "gmx_ana.h"
+#include "gromacs/correlationfunctions/autocorr.h"
 #include "gromacs/fileio/trxio.h"
-
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_rotacf(int argc, char *argv[])
 {
@@ -102,7 +99,7 @@ int gmx_rotacf(int argc, char *argv[])
     int             ePBC;
     t_filenm        fnm[] = {
         { efTRX, "-f", NULL,  ffREAD  },
-        { efTPX, NULL, NULL,  ffREAD },
+        { efTPR, NULL, NULL,  ffREAD },
         { efNDX, NULL, NULL,  ffREAD  },
         { efXVG, "-o", "rotacf",  ffWRITE }
     };
@@ -115,7 +112,7 @@ int gmx_rotacf(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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -143,7 +140,7 @@ int gmx_rotacf(int argc, char *argv[])
                   "these can not be atom doublets\n");
     }
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC);
 
     snew(c1, nvec);
     for (i = 0; (i < nvec); i++)
index 891a3bf9f5e8d4760c35998385062c3e1491e851..c9f3dc16ee2dedb68ccd7db3d54dfaa786465e90 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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void get_refx(output_env_t oenv, const char *trxfn, int nfitdim, int skip,
                      int gnx, int *index,
@@ -242,7 +237,7 @@ int gmx_rotmat(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -309,7 +304,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     close_trj(status);
 
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), "-nxy");
 
index 90c69cdf323dd38a2a31a001267792ce41ac2689..11d7f1565ad5438d17e253a76f93cbe4d466d5ae 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
 #include <string.h>
 
-#include "macros.h"
-#include "vec.h"
-#include "sysstuff.h"
-#include "typedefs.h"
+#include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "pbc.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
-
-#include "gromacs/legacyheaders/gmx_fatal.h"
 
 typedef struct {
     char *label;
@@ -89,7 +85,7 @@ static t_charge *mk_charge(t_atoms *atoms, t_block *cgs, int *nncg)
                     *(atoms->resinfo[resnr].name),
                     atoms->resinfo[resnr].nr,
                     anr+1);
-            cg[ncg].label = strdup(buf);
+            cg[ncg].label = gmx_strdup(buf);
             ncg++;
         }
     }
@@ -152,7 +148,7 @@ int gmx_saltbr(int argc, char *argv[])
     };
     t_filenm        fnm[] = {
         { efTRX, "-f",  NULL, ffREAD },
-        { efTPX, NULL,  NULL, ffREAD },
+        { efTPR, NULL,  NULL, ffREAD },
     };
 #define NFILE asize(fnm)
 
@@ -186,13 +182,13 @@ int gmx_saltbr(int argc, char *argv[])
     matrix             box;
     output_env_t       oenv;
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
     }
 
-    top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC);
     cg  = mk_charge(&top->atoms, &(top->cgs), &ncg);
     snew(cgdist, ncg);
     snew(nWithin, ncg);
@@ -248,7 +244,7 @@ int gmx_saltbr(int argc, char *argv[])
                     {
                         fprintf(fp, "%10g  %10g\n", time[k], cgdist[i][j][k]);
                     }
-                    gmx_ffclose(fp);
+                    xvgrclose(fp);
                 }
             }
         }
@@ -330,7 +326,7 @@ int gmx_saltbr(int argc, char *argv[])
         }
         for (m = 0; (m < 3); m++)
         {
-            gmx_ffclose(out[m]);
+            xvgrclose(out[m]);
             if (nset[m] == 0)
             {
                 remove(fn[m]);
index 68904bcdca163d8e3b1b3f1eda7841fe5cacd7a5..fdff37b0ad33d8e99053e0e2eb56944ee6de0814 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,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "xvgr.h"
-#include "copyrite.h"
-#include "gromacs/commandline/pargs.h"
-#include "index.h"
-#include "gstat.h"
-#include "gmx_ana.h"
-#include "nsfactor.h"
+#include "config.h"
 
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/matio.h"
+#include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/gmxana/nsfactor.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_sans(int argc, char *argv[])
 {
@@ -148,7 +145,7 @@ int gmx_sans(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     t_filenm   fnm[] = {
-        { efTPX,  "-s",       NULL,       ffREAD },
+        { efTPR,  "-s",       NULL,       ffREAD },
         { efTRX,  "-f",       NULL,       ffREAD },
         { efNDX,  NULL,       NULL,       ffOPTRD },
         { efDAT,  "-d",       "nsfactor", ffOPTRD },
@@ -160,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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -219,7 +216,7 @@ int gmx_sans(int argc, char *argv[])
 
     /* Try to read files */
     fnDAT = ftp2fn(efDAT, NFILE, fnm);
-    fnTPX = ftp2fn(efTPX, NFILE, fnm);
+    fnTPX = ftp2fn(efTPR, NFILE, fnm);
     fnTRX = ftp2fn(efTRX, NFILE, fnm);
 
     gnsf = gmx_neutronstructurefactors_init(fnDAT);
@@ -309,7 +306,7 @@ int gmx_sans(int argc, char *argv[])
                 fprintf(fp, "%10.6f%10.6f\n", prframecurrent->r[i], prframecurrent->gr[i]);
             }
             done_filenms(NFILE, fnmdup);
-            fclose(fp);
+            xvgrclose(fp);
             sfree(hdr);
             sfree(suffix);
             sfree(fnmdup);
@@ -330,7 +327,7 @@ int gmx_sans(int argc, char *argv[])
                 fprintf(fp, "%10.6f%10.6f\n", sqframecurrent->q[i], sqframecurrent->s[i]);
             }
             done_filenms(NFILE, fnmdup);
-            fclose(fp);
+            xvgrclose(fp);
             sfree(hdr);
             sfree(suffix);
             sfree(fnmdup);
index 5f35524e1c8439ea7e656c480639f3a17564e927..30967feab71464ac42c24f784e2984a6f2594ab8 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "xvgr.h"
-#include "copyrite.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/sfactor.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "calcgrid.h"
-#include "nrnb.h"
-#include "coulomb.h"
-#include "gstat.h"
-#include "gromacs/fileio/matio.h"
-#include "gmx_ana.h"
-#include "names.h"
-#include "sfactor.h"
 
 int gmx_saxs(int argc, char *argv[])
 {
@@ -96,7 +79,7 @@ int gmx_saxs(int argc, char *argv[])
         { efXVG, "-sq", "sq",      ffWRITE },
     };
 #define NFILE asize(fnm)
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
                            NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 911fdbff0f4af502a695b6d4e9e5576bb8eb6a29..5d8f47c117eab52f9b60894283c233ee8e0bcce6 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "readinp.h"
-#include "txtdump.h"
-#include "gstat.h"
-#include "xvgr.h"
-#include "physics.h"
-#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/matio.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 static int index2(int *ibox, int x, int y)
@@ -756,7 +756,7 @@ static void do_sham(const char *fn, const char *ndx,
                     index   = index3(ibox, i, j, k);
                     if (P[index] > 0)
                     {
-                        fprintf(fp, "%-6s%5u  %-4.4s%3.3s  %4d    %8.3f%8.3f%8.3f%6.2f%6.2f\n",
+                        fprintf(fp, "%-6s%5d  %-4.4s%3.3s  %4d    %8.3f%8.3f%8.3f%6.2f%6.2f\n",
                                 "ATOM", (index+1) %10000, "H", "H", (index+1)%10000,
                                 xxx[XX], xxx[YY], xxx[ZZ], 1.0, W[index]);
                     }
@@ -865,7 +865,7 @@ static void ehisto(const char *fh, int n, real **enerT, const output_env_t oenv)
         }
         fprintf(fp, "\n");
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 int gmx_sham(int argc, char *argv[])
@@ -988,7 +988,7 @@ int gmx_sham(int argc, char *argv[])
     int     npargs;
 
     npargs = asize(pa);
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, npargs, pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index c002ddeb76e330fce7da214bd86f6ffa2482bbc5..f426fe4e5135a2e6d29f6320744ba205b2900907 100644 (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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <stdio.h>
 #include <math.h>
+#include <stdio.h>
 
-#include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
-#include "xvgr.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "pbc.h"
-#include "physics.h"
-#include "names.h"
-#include "txtdump.h"
 #include "gromacs/fileio/trnio.h"
-#include "symtab.h"
-#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/smalloc.h"
 
 real pot(real x, real qq, real c6, real cn, int npow)
 {
@@ -190,7 +187,7 @@ int gmx_sigeps(int argc, char *argv[])
         oldx = x;
 
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
 
index 8ad45f3f3880112267b873f2ba884a7f70e3c874..7de848e5ebe73c76276f13d020e7094b0b112742 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gmx_ana.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
                          atom_id index[], rvec xref, gmx_bool bPBC)
@@ -185,15 +184,15 @@ int gmx_sorient(int argc, char *argv[])
         { efTRX, NULL,  NULL,  ffREAD },
         { efTPS, NULL,  NULL,  ffREAD },
         { efNDX, NULL,  NULL,  ffOPTRD },
-        { efXVG, NULL,  "sori.xvg",  ffWRITE },
-        { efXVG, "-no", "snor.xvg",  ffWRITE },
-        { efXVG, "-ro", "sord.xvg",  ffWRITE },
-        { efXVG, "-co", "scum.xvg",  ffWRITE },
-        { efXVG, "-rc", "scount.xvg",  ffWRITE }
+        { efXVG, NULL,  "sori",   ffWRITE },
+        { efXVG, "-no", "snor",   ffWRITE },
+        { efXVG, "-ro", "sord",   ffWRITE },
+        { efXVG, "-co", "scum",   ffWRITE },
+        { efXVG, "-rc", "scount", ffWRITE }
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -398,7 +397,7 @@ int gmx_sorient(int argc, char *argv[])
     {
         fprintf(fp, "%g %g\n", (i+0.5)*binwidth-1, 2*normfac*hist1[i]);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     sprintf(str, "Solvent normal orientation between %g and %g nm", rmin, rmax);
     fp = xvgropen(opt2fn("-no", NFILE, fnm), str, "cos(\\8q\\4\\s2\\N)", "", oenv);
@@ -410,7 +409,7 @@ int gmx_sorient(int argc, char *argv[])
     {
         fprintf(fp, "%g %g\n", (i+0.5)*binwidth, normfac*hist2[i]);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
 
     sprintf(str, "Solvent orientation");
@@ -426,7 +425,7 @@ int gmx_sorient(int argc, char *argv[])
                 histn[i] ? histi1[i]/histn[i] : 0,
                 histn[i] ? histi2[i]/histn[i] : 0);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     sprintf(str, "Cumulative solvent orientation");
     fp = xvgropen(opt2fn("-co", NFILE, fnm), str, "r (nm)", "", oenv);
@@ -445,7 +444,7 @@ int gmx_sorient(int argc, char *argv[])
         c2 += histi2[i]*normfac;
         fprintf(fp, "%g %g %g\n", (i+1)*rbinw, c1, c2);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     sprintf(str, "Solvent distribution");
     fp = xvgropen(opt2fn("-rc", NFILE, fnm), str, "r (nm)", "molecules/nm", oenv);
@@ -458,7 +457,7 @@ int gmx_sorient(int argc, char *argv[])
     {
         fprintf(fp, "%g %g\n", (i+0.5)*rbinw, histn[i]*normfac);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
     do_view(oenv, opt2fn("-no", NFILE, fnm), NULL);
index 32d2fefc36a505d920248932576fae3736b94d4d..600608d2e322611aba964abde422bf08db57bc9b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include "gmxpre.h"
 
+#include <math.h>
+#include <stdlib.h>
 
 #include "gromacs/commandline/pargs.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include <math.h>
-#include "index.h"
-#include "pbc.h"
-#include "rmpbc.h"
-#include "gmx_ana.h"
-#include "macros.h"
-
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/smalloc.h"
 
 static const double bohr = 0.529177249;  /* conversion factor to compensate for VMD plugin conversion... */
 
-static void mequit(void)
-{
-    printf("Memory allocation error\n");
-    exit(1);
-}
-
 int gmx_spatial(int argc, char *argv[])
 {
     const char     *desc[] = {
@@ -218,25 +209,13 @@ int gmx_spatial(int argc, char *argv[])
         MINBIN[i] -= (double)iNAB*rBINWIDTH;
         nbin[i]    = (long)ceil((MAXBIN[i]-MINBIN[i])/rBINWIDTH);
     }
-    bin = (long ***)malloc(nbin[XX]*sizeof(long **));
-    if (!bin)
-    {
-        mequit();
-    }
+    snew(bin, nbin[XX]);
     for (i = 0; i < nbin[XX]; ++i)
     {
-        bin[i] = (long **)malloc(nbin[YY]*sizeof(long *));
-        if (!bin[i])
-        {
-            mequit();
-        }
+        snew(bin[i], nbin[YY]);
         for (j = 0; j < nbin[YY]; ++j)
         {
-            bin[i][j] = (long *)calloc(nbin[ZZ], sizeof(long));
-            if (!bin[i][j])
-            {
-                mequit();
-            }
+            snew(bin[i][j], nbin[ZZ]);
         }
     }
     copy_mat(box, box_pbc);
index b4734d79d50d597dca24575ee180c1596eb22b40..559aa2aa69af0657f68e0663e100510d68e483e1 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "gmx_ana.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
                          atom_id index[], rvec xref, int ePBC)
@@ -205,13 +204,13 @@ int gmx_spol(int argc, char *argv[])
 
     t_filenm        fnm[] = {
         { efTRX, NULL,  NULL,  ffREAD },
-        { efTPX, NULL,  NULL,  ffREAD },
+        { efTPR, NULL,  NULL,  ffREAD },
         { efNDX, NULL,  NULL,  ffOPTRD },
-        { efXVG, NULL,  "scdist.xvg",  ffWRITE }
+        { efXVG, NULL,  "scdist",  ffWRITE }
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -219,7 +218,7 @@ int gmx_spol(int argc, char *argv[])
 
     snew(top, 1);
     snew(ir, 1);
-    read_tpx_top(ftp2fn(efTPX, NFILE, fnm),
+    read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
                  ir, box, &natoms, NULL, NULL, NULL, top);
 
     /* get index groups */
@@ -381,7 +380,7 @@ int gmx_spol(int argc, char *argv[])
         nmol += hist[i];
         fprintf(fp, "%g %g\n", i*bw, nmol/nf);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
 
index f1922f55373cb0249a5f3e95f4d8b485da36195b..d2a6b72d74d63c40746df6fcf16bc0080963d894 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
+#include "gmxpre.h"
 
 #include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/correlationfunctions/expfit.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "macros.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gmx_ana.h"
-#include "gromacs/fileio/trxio.h"
-
 
 #define NK  24
 #define NPK 4
@@ -80,10 +80,10 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
 {
     FILE  *fp, *fp_vk, *fp_cub = NULL;
     int    nk, ntc;
-    real **tcaf, **tcafc = NULL, eta;
+    real **tcaf, **tcafc = NULL, eta, *sig;
     int    i, j, k, kc;
     int    ncorr;
-    real   fitparms[3], *sig;
+    double fitparms[3];
 
     nk  = kset_c[nkc];
     ntc = nk*NPK;
@@ -101,7 +101,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
             }
             fprintf(fp, "\n");
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
         do_view(oenv, fn_trans, "-nxy");
     }
 
@@ -169,7 +169,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
         }
         fprintf(fp, "\n");
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     do_view(oenv, fn_tc, "-nxy");
 
     if (fn_cub)
@@ -220,7 +220,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
         }
         fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     do_view(oenv, fn_tcf, "-nxy");
 
     if (fn_cub)
@@ -247,10 +247,10 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
             fprintf(fp_cub, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
         }
         fprintf(fp_vk, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
-        gmx_ffclose(fp_cub);
+        xvgrclose(fp_cub);
         do_view(oenv, fn_cub, "-nxy");
     }
-    gmx_ffclose(fp_vk);
+    xvgrclose(fp_vk);
     do_view(oenv, fn_vk, "-nxy");
 }
 
@@ -339,7 +339,7 @@ int gmx_tcaf(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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 6f26469d7c45b8ede4fb2de984b86cea0c4b7c4f..d737ccfdf2506ddb78188e38006da8b578b2373b 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "rmpbc.h"
-#include "physics.h"
-#include "gromacs/fileio/confio.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/linearalgebra/nrjac.h"
-#include "gmx_fatal.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void low_print_data(FILE *fp, real time, rvec x[], int n, atom_id *index,
                            gmx_bool bDim[], const char *sffmt)
@@ -467,7 +464,7 @@ static void write_pdb_bfac(const char *fname, const char *xname,
             fprintf(fp, "%-5d  %10.3f  %10.3f  %10.3f\n", 1+i,
                     sum[index[i]][XX], sum[index[i]][YY], sum[index[i]][ZZ]);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
         max  = 0;
         maxi = 0;
         for (i = 0; i < isize; i++)
@@ -587,7 +584,7 @@ static void print_histo(const char *fn, int nhisto, int histo[], real binwidth,
     {
         fprintf(fp, "%10.3e  %10d\n", i*binwidth, histo[i]);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 }
 
 int gmx_traj(int argc, char *argv[])
@@ -687,24 +684,24 @@ int gmx_traj(int argc, char *argv[])
         { efTRX, "-f", NULL, ffREAD },
         { efTPS, NULL, NULL, ffREAD },
         { efNDX, NULL, NULL, ffOPTRD },
-        { efXVG, "-ox", "coord.xvg", ffOPTWR },
-        { efTRX, "-oxt", "coord.xtc", ffOPTWR },
-        { efXVG, "-ov", "veloc.xvg", ffOPTWR },
-        { efXVG, "-of", "force.xvg", ffOPTWR },
-        { efXVG, "-ob", "box.xvg",   ffOPTWR },
-        { efXVG, "-ot", "temp.xvg",  ffOPTWR },
-        { efXVG, "-ekt", "ektrans.xvg", ffOPTWR },
-        { efXVG, "-ekr", "ekrot.xvg", ffOPTWR },
-        { efXVG, "-vd", "veldist.xvg", ffOPTWR },
-        { efPDB, "-cv", "veloc.pdb", ffOPTWR },
-        { efPDB, "-cf", "force.pdb", ffOPTWR },
-        { efXVG, "-av", "all_veloc.xvg", ffOPTWR },
-        { efXVG, "-af", "all_force.xvg", ffOPTWR }
+        { efXVG, "-ox",  "coord",     ffOPTWR },
+        { efTRX, "-oxt", "coord",     ffOPTWR },
+        { efXVG, "-ov",  "veloc",     ffOPTWR },
+        { efXVG, "-of",  "force",     ffOPTWR },
+        { efXVG, "-ob",  "box",       ffOPTWR },
+        { efXVG, "-ot",  "temp",      ffOPTWR },
+        { efXVG, "-ekt", "ektrans",   ffOPTWR },
+        { efXVG, "-ekr", "ekrot",     ffOPTWR },
+        { efXVG, "-vd",  "veldist",   ffOPTWR },
+        { efPDB, "-cv",  "veloc",     ffOPTWR },
+        { efPDB, "-cf",  "force",     ffOPTWR },
+        { efXVG, "-av",  "all_veloc", ffOPTWR },
+        { efXVG, "-af",  "all_force", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW | PCA_BE_NICE,
+                           PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -1058,7 +1055,7 @@ int gmx_traj(int argc, char *argv[])
 
     if (bOX)
     {
-        gmx_ffclose(outx);
+        xvgrclose(outx);
     }
     if (bOXT)
     {
@@ -1066,27 +1063,27 @@ int gmx_traj(int argc, char *argv[])
     }
     if (bOV)
     {
-        gmx_ffclose(outv);
+        xvgrclose(outv);
     }
     if (bOF)
     {
-        gmx_ffclose(outf);
+        xvgrclose(outf);
     }
     if (bOB)
     {
-        gmx_ffclose(outb);
+        xvgrclose(outb);
     }
     if (bOT)
     {
-        gmx_ffclose(outt);
+        xvgrclose(outt);
     }
     if (bEKT)
     {
-        gmx_ffclose(outekt);
+        xvgrclose(outekt);
     }
     if (bEKR)
     {
-        gmx_ffclose(outekr);
+        xvgrclose(outekr);
     }
 
     if (bVD)
index 0e905041ce57f5456e80830e4bb506dcd1b7b29d..4a47131b235f1339e4968e2aaa0c4b6f81e58ce4 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
 #include <math.h>
-#include "macros.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
+#include <stdlib.h>
+#include <string.h>
+
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/tngio_for_tools.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "index.h"
-#include "vec.h"
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xtcio.h"
-#include "rmpbc.h"
-#include "pbc.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define TIME_EXPLICIT 0
 #define TIME_CONTINUE 1
@@ -506,7 +502,7 @@ int gmx_trjcat(int argc, char *argv[])
 
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE | PCA_TIME_UNIT, NFILE, fnm,
+    if (!parse_common_args(&argc, argv, PCA_TIME_UNIT, NFILE, fnm,
                            asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -590,7 +586,7 @@ int gmx_trjcat(int argc, char *argv[])
     {
         if (nfile_out != nset)
         {
-            char *buf = strdup(fnms_out[0]);
+            char *buf = gmx_strdup(fnms_out[0]);
             snew(fnms_out, nset);
             for (i = 0; (i < nset); i++)
             {
index 984c8cc078e5a1d68fdd4c11a2484ec927f7355d..73100255d9ed5e4d3e30e5f866cb792f411e9ebf 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
 #include <math.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "copyrite.h"
-#include "macros.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/fileio/tngio_for_tools.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/trnio.h"
-#include "gromacs/fileio/tngio_for_tools.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "index.h"
-#include "vec.h"
+#include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/xtcio.h"
-#include "rmpbc.h"
-#include "pbc.h"
-#include "viewit.h"
-#include "xvgr.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gromacs/math/do_fit.h"
-#include "gmx_fatal.h"
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 enum {
     euSel, euRect, euTric, euCompact, euNR
@@ -376,7 +370,7 @@ static void put_residue_com_in_box(int unitcell_enum, int ecenter,
             {
                 if (debug)
                 {
-                    fprintf(debug, "\nShifting position of residue %d (atoms %u-%u) "
+                    fprintf(debug, "\nShifting position of residue %d (atoms %d-%d) "
                             "by %g,%g,%g\n", atom[res_start].resind+1,
                             res_start+1, res_end+1, shift[XX], shift[YY], shift[ZZ]);
                 }
@@ -469,13 +463,12 @@ static void mk_filenm(char *base, const char *ext, int ndigit, int file_nr,
 
 void check_trn(const char *fn)
 {
-    if ((fn2ftp(fn) != efTRJ)  && (fn2ftp(fn) != efTRR))
+    if (fn2ftp(fn) != efTRR)
     {
         gmx_fatal(FARGS, "%s is not a trajectory file, exiting\n", fn);
     }
 }
 
-#ifndef GMX_NATIVE_WINDOWS
 void do_trunc(const char *fn, real t0)
 {
     t_fileio        *in;
@@ -492,7 +485,7 @@ void do_trunc(const char *fn, real t0)
         gmx_fatal(FARGS, "You forgot to set the truncation time");
     }
 
-    /* Check whether this is a .trj file */
+    /* Check whether this is a .trr file */
     check_trn(fn);
 
     in   = open_trn(fn, "r");
@@ -531,7 +524,7 @@ void do_trunc(const char *fn, real t0)
             {
                 fprintf(stderr, "Once again, I'm gonna DO this...\n");
                 close_trn(in);
-                if (0 != truncate(fn, fpos))
+                if (0 != gmx_truncate(fn, fpos))
                 {
                     gmx_fatal(FARGS, "Error truncating file %s", fn);
                 }
@@ -548,7 +541,6 @@ void do_trunc(const char *fn, real t0)
         }
     }
 }
-#endif
 
 /*! \brief Read a full molecular topology if useful and available.
  *
@@ -615,18 +607,18 @@ int gmx_trjconv(int argc, char *argv[])
         "[PAR]",
 
         "The following formats are supported for input and output:",
-        "[TT].xtc[tt], [TT].trr[tt], [TT].trj[tt], [TT].gro[tt], [TT].g96[tt]",
+        "[TT].xtc[tt], [TT].trr[tt], [TT].gro[tt], [TT].g96[tt]",
         "and [TT].pdb[tt].",
         "The file formats are detected from the file extension.",
         "The precision of [TT].xtc[tt] and [TT].gro[tt] output is taken from the",
         "input file for [TT].xtc[tt], [TT].gro[tt] and [TT].pdb[tt],",
         "and from the [TT]-ndec[tt] option for other input formats. The precision",
         "is always taken from [TT]-ndec[tt], when this option is set.",
-        "All other formats have fixed precision. [TT].trr[tt] and [TT].trj[tt]",
+        "All other formats have fixed precision. [TT].trr[tt]",
         "output can be single or double precision, depending on the precision",
         "of the [THISMODULE] binary.",
         "Note that velocities are only supported in",
-        "[TT].trr[tt], [TT].trj[tt], [TT].gro[tt] and [TT].g96[tt] files.[PAR]",
+        "[TT].trr[tt], [TT].gro[tt] and [TT].g96[tt] files.[PAR]",
 
         "Option [TT]-sep[tt] can be used to write every frame to a separate",
         "[TT].gro, .g96[tt] or [TT].pdb[tt] file. By default, all frames all written to one file.",
@@ -714,7 +706,7 @@ int gmx_trjconv(int argc, char *argv[])
         "can reduce the number of frames while using low-pass frequency",
         "filtering, this reduces aliasing of high frequency motions.[PAR]",
 
-        "Using [TT]-trunc[tt] [THISMODULE] can truncate [TT].trj[tt] in place, i.e.",
+        "Using [TT]-trunc[tt] [THISMODULE] can truncate [TT].trr[tt] in place, i.e.",
         "without copying the file. This is useful when a run has crashed",
         "during disk I/O (i.e. full disk), or when two contiguous",
         "trajectories must be concatenated without having double frames.[PAR]",
@@ -828,11 +820,9 @@ int gmx_trjconv(int argc, char *argv[])
           { &bVels }, "Read and write velocities if possible" },
         { "-force", FALSE, etBOOL,
           { &bForce }, "Read and write forces if possible" },
-#ifndef GMX_NATIVE_WINDOWS
         { "-trunc", FALSE, etTIME,
           { &ttrunc },
           "Truncate input trajectory file after this time (%t)" },
-#endif
         { "-exec", FALSE, etSTR,
           { &exec_command },
           "Execute command for every output frame with the "
@@ -925,7 +915,7 @@ int gmx_trjconv(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_BEGIN | PCA_CAN_END | PCA_CAN_VIEW |
-                           PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_TIME_UNIT,
                            NFILE, fnm, NPA, pa, asize(desc), desc,
                            0, NULL, &oenv))
     {
@@ -940,9 +930,7 @@ int gmx_trjconv(int argc, char *argv[])
 
     if (ttrunc != -1)
     {
-#ifndef GMX_NATIVE_WINDOWS
         do_trunc(in_file, ttrunc);
-#endif
     }
     else
     {
@@ -1032,9 +1020,9 @@ int gmx_trjconv(int argc, char *argv[])
         {
             /* check if velocities are possible in input and output files */
             ftpin = fn2ftp(in_file);
-            bVels = (ftp == efTRR || ftp == efTRJ || ftp == efGRO ||
+            bVels = (ftp == efTRR || ftp == efGRO ||
                      ftp == efG96 || ftp == efTNG)
-                && (ftpin == efTRR || ftpin == efTRJ || ftpin == efGRO ||
+                && (ftpin == efTRR || ftpin == efGRO ||
                     ftpin == efG96 || ftpin == efTNG || ftpin == efCPT);
         }
         if (bSeparate || bSplit)
@@ -1044,7 +1032,7 @@ int gmx_trjconv(int argc, char *argv[])
             {
                 gmx_fatal(FARGS, "Output file name '%s' does not contain a '.'", out_file);
             }
-            outf_base = strdup(out_file);
+            outf_base = gmx_strdup(out_file);
             outf_base[outf_ext - out_file] = '\0';
         }
 
@@ -1268,7 +1256,7 @@ int gmx_trjconv(int argc, char *argv[])
             useatoms.nr = nout;
         }
         /* select what to read */
-        if (ftp == efTRR || ftp == efTRJ)
+        if (ftp == efTRR)
         {
             flags = TRX_READ_X;
         }
@@ -1352,7 +1340,6 @@ int gmx_trjconv(int argc, char *argv[])
                     break;
                 case efXTC:
                 case efTRR:
-                case efTRJ:
                     out = NULL;
                     if (!bSplit && !bSubTraj)
                     {
@@ -1572,22 +1559,29 @@ int gmx_trjconv(int argc, char *argv[])
 
                 if (bWriteFrame)
                 {
+                    /* We should avoid modifying the input frame,
+                     * but since here we don't have the output frame yet,
+                     * we introduce a temporary output frame time variable.
+                     */
+                    real frout_time;
+
+                    frout_time = fr.time;
 
                     /* calc new time */
                     if (bTimeStep)
                     {
-                        fr.time = tzero+frame*timestep;
+                        frout_time = tzero + frame*timestep;
                     }
                     else
                     if (bSetTime)
                     {
-                        fr.time += tshift;
+                        frout_time += tshift;
                     }
 
                     if (bTDump)
                     {
                         fprintf(stderr, "\nDumping frame at t= %g %s\n",
-                                output_env_conv_time(oenv, fr.time), output_env_get_time_unit(oenv));
+                                output_env_conv_time(oenv, frout_time), output_env_get_time_unit(oenv));
                     }
 
                     /* check for writing at each delta_t */
@@ -1596,12 +1590,12 @@ int gmx_trjconv(int argc, char *argv[])
                     {
                         if (!bRound)
                         {
-                            bDoIt = bRmod(fr.time, tzero, delta_t);
+                            bDoIt = bRmod(frout_time, tzero, delta_t);
                         }
                         else
                         {
                             /* round() is not C89 compatible, so we do this:  */
-                            bDoIt = bRmod(floor(fr.time+0.5), floor(tzero+0.5),
+                            bDoIt = bRmod(floor(frout_time+0.5), floor(tzero+0.5),
                                           floor(delta_t+0.5));
                         }
                     }
@@ -1612,7 +1606,7 @@ int gmx_trjconv(int argc, char *argv[])
                         if ( ((outframe % SKIP) == 0) || (outframe < SKIP) )
                         {
                             fprintf(stderr, " ->  frame %6d time %8.3f      \r",
-                                    outframe, output_env_conv_time(oenv, fr.time));
+                                    outframe, output_env_conv_time(oenv, frout_time));
                         }
 
                         if (!bPFit)
@@ -1681,6 +1675,7 @@ int gmx_trjconv(int argc, char *argv[])
                         }
                         /* Copy the input trxframe struct to the output trxframe struct */
                         frout        = fr;
+                        frout.time   = frout_time;
                         frout.bV     = (frout.bV && bVels);
                         frout.bF     = (frout.bF && bForce);
                         frout.natoms = nout;
@@ -1727,12 +1722,12 @@ int gmx_trjconv(int argc, char *argv[])
 
                         if (!bRound)
                         {
-                            bSplitHere = bSplit && bRmod(fr.time, tzero, split_t);
+                            bSplitHere = bSplit && bRmod(frout.time, tzero, split_t);
                         }
                         else
                         {
                             /* round() is not C89 compatible, so we do this: */
-                            bSplitHere = bSplit && bRmod(floor(fr.time+0.5),
+                            bSplitHere = bSplit && bRmod(floor(frout.time+0.5),
                                                          floor(tzero+0.5),
                                                          floor(split_t+0.5));
                         }
@@ -1747,7 +1742,6 @@ int gmx_trjconv(int argc, char *argv[])
                                 write_tng_frame(trxout, &frout);
                                 // TODO when trjconv behaves better: work how to read and write lambda
                                 break;
-                            case efTRJ:
                             case efTRR:
                             case efXTC:
                                 if (bSplitHere)
@@ -1802,7 +1796,7 @@ int gmx_trjconv(int argc, char *argv[])
                             case efG96:
                             case efPDB:
                                 sprintf(title, "Generated by trjconv : %s t= %9.5f",
-                                        top_title, fr.time);
+                                        top_title, frout.time);
                                 if (bSeparate || bSplitHere)
                                 {
                                     out = gmx_ffopen(out_file2, "w");
@@ -1872,15 +1866,10 @@ int gmx_trjconv(int argc, char *argv[])
                             char c[255];
                             sprintf(c, "%s  %d", exec_command, file_nr-1);
                             /*fprintf(stderr,"Executing '%s'\n",c);*/
-#ifdef GMX_NO_SYSTEM
-                            printf("Warning-- No calls to system(3) supported on this platform.");
-                            printf("Warning-- Skipping execution of 'system(\"%s\")'.", c);
-#else
                             if (0 != system(c))
                             {
                                 gmx_fatal(FARGS, "Error executing command: %s", c);
                             }
-#endif
                         }
                         outframe++;
                     }
index 6b357e1b801515098dcaab03cdb253c60cc5cc86..a43ce10dbd49e80dcf737439b7a8b714a5397570 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "princ.h"
-#include "rmpbc.h"
-#include "txtdump.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gmx_ana.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     atom_id i;
@@ -151,7 +147,7 @@ int gmx_trjorder(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -378,7 +374,7 @@ int gmx_trjorder(int argc, char *argv[])
     }
     if (fp)
     {
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
     gmx_rmpbc_done(gpbc);
 
index a34c34cbb5d0ade2489b01b0b47e15527ec8bb59..7660bcf1604f4fa02e41e2598fa65cd625e742e7 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
+#include <stdlib.h>
 #include <time.h>
+
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 
 #include "gromacs/commandline/pargs.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "copyrite.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/utility/cstringutil.h"
-#include "readinp.h"
-#include "calcgrid.h"
-#include "checkpoint.h"
-#include "macros.h"
-#include "gmx_ana.h"
-#include "names.h"
-#include "perf_est.h"
-#include "inputrec.h"
-#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/calcgrid.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/inputrec.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/perf_est.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/math/utilities.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/baseversion.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* Enum for situations that can occur during log file parsing, the
  * corresponding string entries can be found in do_the_tests() in
  * const char* ParseLog[] */
+/* TODO clean up CamelCasing of these enum names */
 enum {
     eParselogOK,
     eParselogNotFound,
@@ -75,6 +77,8 @@ enum {
     eParselogTPXVersion,
     eParselogNotParallel,
     eParselogLargePrimeFactor,
+    eParselogMismatchOfNumberOfPPRanksAndAvailableGPUs,
+    eParselogGpuProblem,
     eParselogFatal,
     eParselogNr
 };
@@ -118,11 +122,7 @@ static void sep_line(FILE *fp)
 /* Wrapper for system calls */
 static int gmx_system_call(char *command)
 {
-#ifdef GMX_NO_SYSTEM
-    gmx_fatal(FARGS, "No calls to system(3) supported on this platform. Attempted to call:\n'%s'\n", command);
-#else
     return ( system(command) );
-#endif
 }
 
 
@@ -143,29 +143,6 @@ static void cleandata(t_perf *perfdata, int test_nr)
 }
 
 
-static gmx_bool is_equal(real a, real b)
-{
-    real diff, eps = 1.0e-7;
-
-
-    diff = a - b;
-
-    if (diff < 0.0)
-    {
-        diff = -diff;
-    }
-
-    if (diff < eps)
-    {
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
-}
-
-
 static void remove_if_exists(const char *fn)
 {
     if (gmx_fexist(fn))
@@ -313,13 +290,25 @@ static int parse_logfile(const char *logfile, const char *errfile,
                 }
                 break;
             case eFoundDDStr:
+                /* Even after the "Domain decomposition grid" string was found,
+                 * it could be that mdrun had to quit due to some error. */
+                if (str_starts(line, "Incorrect launch configuration: mismatching number of"))
+                {
+                    fclose(fp);
+                    return eParselogMismatchOfNumberOfPPRanksAndAvailableGPUs;
+                }
+                else if (str_starts(line, "Some of the requested GPUs do not exist"))
+                {
+                    fclose(fp);
+                    return eParselogGpuProblem;
+                }
                 /* Look for PME mesh/force balance (not necessarily present, though) */
-                if (str_starts(line, matchstrbal))
+                else if (str_starts(line, matchstrbal))
                 {
                     sscanf(&line[strlen(matchstrbal)], "%f", &(perfdata->PME_f_load[test_nr]));
                 }
                 /* Look for matchstring */
-                if (str_starts(line, matchstring))
+                else if (str_starts(line, matchstring))
                 {
                     iFound = eFoundAccountingStr;
                 }
@@ -553,8 +542,8 @@ static gmx_bool analyze_data(
     fprintf(fp, "\n");
 
     /* Only mention settings if they were modified: */
-    bRefinedCoul = !is_equal(info->rcoulomb[k_win], info->rcoulomb[0]);
-    bRefinedVdW  = !is_equal(info->rvdw[k_win], info->rvdw[0]    );
+    bRefinedCoul = !gmx_within_tol(info->rcoulomb[k_win], info->rcoulomb[0], GMX_REAL_EPS);
+    bRefinedVdW  = !gmx_within_tol(info->rvdw[k_win], info->rvdw[0], GMX_REAL_EPS);
     bRefinedGrid = !(info->nkx[k_win] == info->nkx[0] &&
                      info->nky[k_win] == info->nky[0] &&
                      info->nkz[k_win] == info->nkz[0]);
@@ -616,35 +605,39 @@ static void get_program_paths(gmx_bool bThreads, char *cmd_mpirun[], char *cmd_m
     {
         if ( (cp = getenv("MPIRUN")) != NULL)
         {
-            *cmd_mpirun = strdup(cp);
+            *cmd_mpirun = gmx_strdup(cp);
         }
         else
         {
-            *cmd_mpirun = strdup(def_mpirun);
+            *cmd_mpirun = gmx_strdup(def_mpirun);
         }
     }
     else
     {
-        *cmd_mpirun = strdup(empty_mpirun);
+        *cmd_mpirun = gmx_strdup(empty_mpirun);
     }
 
     if ( (cp = getenv("MDRUN" )) != NULL)
     {
-        *cmd_mdrun  = strdup(cp);
+        *cmd_mdrun  = gmx_strdup(cp);
     }
     else
     {
-        *cmd_mdrun  = strdup(def_mdrun);
+        *cmd_mdrun  = gmx_strdup(def_mdrun);
     }
 }
 
 /* Check that the commands will run mdrun (perhaps via mpirun) by
- * running a very quick test simulation. Requires MPI environment to
- * be available if applicable. */
+ * running a very quick test simulation. Requires MPI environment or
+ * GPU support to be available if applicable. */
+/* TODO implement feature to parse the log file to get the list of
+   compatible GPUs from mdrun, if the user of gmx tune-pme has not
+   given one. */
 static void check_mdrun_works(gmx_bool    bThreads,
                               const char *cmd_mpirun,
                               const char *cmd_np,
-                              const char *cmd_mdrun)
+                              const char *cmd_mdrun,
+                              gmx_bool    bNeedGpuSupport)
 {
     char      *command = NULL;
     char      *cp;
@@ -654,10 +647,12 @@ static void check_mdrun_works(gmx_bool    bThreads,
 
     /* This string should always be identical to the one in copyrite.c,
      * gmx_print_version_info() in the defined(GMX_MPI) section */
-    const char match_mpi[]    = "MPI library:        MPI";
-    const char match_mdrun[]  = "Executable: ";
-    gmx_bool   bMdrun         = FALSE;
-    gmx_bool   bMPI           = FALSE;
+    const char match_mpi[]     = "MPI library:        MPI";
+    const char match_mdrun[]   = "Executable: ";
+    const char match_gpu[]     = "GPU support:        enabled";
+    gmx_bool   bMdrun          = FALSE;
+    gmx_bool   bMPI            = FALSE;
+    gmx_bool   bHaveGpuSupport = FALSE;
 
     /* Run a small test to see whether mpirun + mdrun work  */
     fprintf(stdout, "Making sure that mdrun can be executed. ");
@@ -697,6 +692,10 @@ static void check_mdrun_works(gmx_bool    bThreads,
             {
                 bMPI = TRUE;
             }
+            if (str_starts(line, match_gpu) )
+            {
+                bHaveGpuSupport = TRUE;
+            }
         }
     }
     fclose(fp);
@@ -728,6 +727,11 @@ static void check_mdrun_works(gmx_bool    bThreads,
                   filename);
     }
 
+    if (bNeedGpuSupport && !bHaveGpuSupport)
+    {
+        gmx_fatal(FARGS, "The mdrun executable did not have the expected GPU support.");
+    }
+
     fprintf(stdout, "passed.\n");
 
     /* Clean up ... */
@@ -735,36 +739,102 @@ 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)
+{
+    char *command_line, *flag = "-gpu_id ", *ptr;
+    int   flag_length;
+
+    /* Reserve enough room for the option name, enough single-digit
+       GPU ids (since that is currently all that is possible to use
+       with mdrun), and a terminating NULL. */
+    flag_length = strlen(flag);
+    snew(command_line, flag_length + numRanks + 1);
+    ptr = command_line;
+
+    /* 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)
+    {
+        int   numPpRanks, max_num_ranks_for_each_GPU;
+        int   gpu_id, rank;
+
+        /* Write the option flag */
+        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)
+        {
+            /* Some GPUs will receive more work than others, which
+             * we choose to be those with the lowest indices */
+            max_num_ranks_for_each_GPU++;
+        }
+
+        /* Loop over all eligible GPU ids */
+        for (gpu_id = 0, rank = 0; gpu_id < gpu_ids->n; gpu_id++)
+        {
+            int 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++;
+            }
+        }
+    }
+    *ptr = '\0';
+
+    return command_line;
+}
 
 static void launch_simulation(
-        gmx_bool    bLaunch,        /* Should the simulation be launched? */
-        FILE       *fp,             /* General log file */
-        gmx_bool    bThreads,       /* whether to use threads */
-        char       *cmd_mpirun,     /* Command for mpirun */
-        char       *cmd_np,         /* Switch for -np or -ntmpi or empty */
-        char       *cmd_mdrun,      /* Command for mdrun */
-        char       *args_for_mdrun, /* Arguments for mdrun */
-        const char *simulation_tpr, /* This tpr will be simulated */
-        int         nPMEnodes)      /* Number of PME nodes to use */
+        gmx_bool                  bLaunch,        /* Should the simulation be launched? */
+        FILE                     *fp,             /* General log file */
+        gmx_bool                  bThreads,       /* whether to use threads */
+        char                     *cmd_mpirun,     /* Command for mpirun */
+        char                     *cmd_np,         /* Switch for -np or -ntmpi or empty */
+        char                     *cmd_mdrun,      /* Command for mdrun */
+        char                     *args_for_mdrun, /* Arguments for mdrun */
+        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
+                                                   * constructing mdrun command lines */
 {
-    char  *command;
+    char  *command, *cmd_gpu_ids;
 
 
     /* Make enough space for the system call command,
-     * (100 extra chars for -npme ... etc. options should suffice): */
-    snew(command, strlen(cmd_mpirun)+strlen(cmd_mdrun)+strlen(cmd_np)+strlen(args_for_mdrun)+strlen(simulation_tpr)+100);
+     * (200 extra chars for -npme ... etc. options should suffice): */
+    snew(command, strlen(cmd_mpirun)+strlen(cmd_mdrun)+strlen(cmd_np)+strlen(args_for_mdrun)+strlen(simulation_tpr)+200);
+
+    cmd_gpu_ids = make_gpu_id_command_line(nnodes, nPMEnodes, gpu_ids);
 
     /* Note that the -passall options requires args_for_mdrun to be at the end
      * of the command line string */
     if (bThreads)
     {
-        sprintf(command, "%s%s-npme %d -s %s %s",
-                cmd_mdrun, cmd_np, nPMEnodes, simulation_tpr, args_for_mdrun);
+        sprintf(command, "%s%s-npme %d -s %s %s %s",
+                cmd_mdrun, cmd_np, nPMEnodes, simulation_tpr, args_for_mdrun, cmd_gpu_ids);
     }
     else
     {
-        sprintf(command, "%s%s%s -npme %d -s %s %s",
-                cmd_mpirun, cmd_np, cmd_mdrun, nPMEnodes, simulation_tpr, args_for_mdrun);
+        sprintf(command, "%s%s%s -npme %d -s %s %s %s",
+                cmd_mpirun, cmd_np, cmd_mdrun, nPMEnodes, simulation_tpr, args_for_mdrun, cmd_gpu_ids);
     }
 
     fprintf(fp, "%s this command line to launch the simulation:\n\n%s", bLaunch ? "Using" : "Please use", command);
@@ -986,11 +1056,11 @@ static void make_benchmark_tprs(
         {
             /* Determine which Coulomb radii rc to use in the benchmarks */
             add = (rmax-rmin)/(*ntprs-1);
-            if (is_equal(rmin, info->rcoulomb[0]))
+            if (gmx_within_tol(rmin, info->rcoulomb[0], GMX_REAL_EPS))
             {
                 ir->rcoulomb = rmin + j*add;
             }
-            else if (is_equal(rmax, info->rcoulomb[0]))
+            else if (gmx_within_tol(rmax, info->rcoulomb[0], GMX_REAL_EPS))
             {
                 ir->rcoulomb = rmin + (j-1)*add;
             }
@@ -1090,8 +1160,8 @@ static void make_benchmark_tprs(
         fprintf(fp, "  %-14s\n", fn_bench_tprs[j]);
 
         /* Make it clear to the user that some additional settings were modified */
-        if (!is_equal(ir->rvdw, info->rvdw[0])
-            || !is_equal(ir->rlistlong, info->rlistlong[0]) )
+        if (!gmx_within_tol(ir->rvdw, info->rvdw[0], GMX_REAL_EPS)
+            || !gmx_within_tol(ir->rlistlong, info->rlistlong[0], GMX_REAL_EPS) )
         {
             bNote = TRUE;
         }
@@ -1357,30 +1427,31 @@ static void make_sure_it_runs(char *mdrun_cmd_line, int length, FILE *fp,
     sfree(msg    );
 }
 
-
 static void do_the_tests(
-        FILE           *fp,             /* General g_tune_pme output file         */
-        char          **tpr_names,      /* Filenames of the input files to test   */
-        int             maxPMEnodes,    /* Max fraction of nodes to use for PME   */
-        int             minPMEnodes,    /* Min fraction of nodes to use for PME   */
-        int             npme_fixed,     /* If >= -1, test fixed number of PME
-                                         * nodes only                             */
-        const char     *npmevalues_opt, /* Which -npme values should be tested    */
-        t_perf        **perfdata,       /* Here the performance data is stored    */
-        int            *pmeentries,     /* Entries in the nPMEnodes list          */
-        int             repeats,        /* Repeat each test this often            */
-        int             nnodes,         /* Total number of nodes = nPP + nPME     */
-        int             nr_tprs,        /* Total number of tpr files to test      */
-        gmx_bool        bThreads,       /* Threads or MPI?                        */
-        char           *cmd_mpirun,     /* mpirun command string                  */
-        char           *cmd_np,         /* "-np", "-n", whatever mpirun needs     */
-        char           *cmd_mdrun,      /* mdrun command string                   */
-        char           *cmd_args_bench, /* arguments for mdrun in a string        */
-        const t_filenm *fnm,            /* List of filenames from command line    */
-        int             nfile,          /* Number of files specified on the cmdl. */
-        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    */
+        FILE                     *fp,             /* General g_tune_pme output file         */
+        char                    **tpr_names,      /* Filenames of the input files to test   */
+        int                       maxPMEnodes,    /* Max fraction of nodes to use for PME   */
+        int                       minPMEnodes,    /* Min fraction of nodes to use for PME   */
+        int                       npme_fixed,     /* If >= -1, test fixed number of PME
+                                                   * nodes only                             */
+        const char               *npmevalues_opt, /* Which -npme values should be tested    */
+        t_perf                  **perfdata,       /* Here the performace data is stored     */
+        int                      *pmeentries,     /* Entries in the nPMEnodes list          */
+        int                       repeats,        /* Repeat each test this often            */
+        int                       nnodes,         /* Total number of nodes = nPP + nPME     */
+        int                       nr_tprs,        /* Total number of tpr files to test      */
+        gmx_bool                  bThreads,       /* Threads or MPI?                        */
+        char                     *cmd_mpirun,     /* mpirun command string                  */
+        char                     *cmd_np,         /* "-np", "-n", whatever mpirun needs     */
+        char                     *cmd_mdrun,      /* mdrun command string                   */
+        char                     *cmd_args_bench, /* arguments for mdrun in a string        */
+        const t_filenm           *fnm,            /* List of filenames from command line    */
+        int                       nfile,          /* Number of files specified on the cmdl. */
+        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
+                                                   * constructing mdrun command lines */
 {
     int      i, nr, k, ret, count = 0, totaltests;
     int     *nPMEnodes = NULL;
@@ -1390,7 +1461,7 @@ static void do_the_tests(
     char     buf[STRLEN];
     gmx_bool bResetProblem = FALSE;
     gmx_bool bFirst        = TRUE;
-
+    gmx_bool bUsingGpus    = 0 < gpu_ids->n;
 
     /* This string array corresponds to the eParselog enum type at the start
      * of this file */
@@ -1404,6 +1475,8 @@ static void do_the_tests(
         "TPX version conflict!",
         "mdrun was not started in parallel!",
         "Number of PP ranks has a prime factor that is too large.",
+        "The number of PP ranks did not suit the number of GPUs.",
+        "Some GPUs were not detected or are incompatible.",
         "An error occured."
     };
     char        str_PME_f_load[13];
@@ -1465,8 +1538,12 @@ static void do_the_tests(
         /* Loop over various numbers of PME nodes: */
         for (i = 0; i < *pmeentries; i++)
         {
+            char *cmd_gpu_ids = NULL;
+
             pd = &perfdata[k][i];
 
+            cmd_gpu_ids = make_gpu_id_command_line(nnodes, nPMEnodes[i], gpu_ids);
+
             /* Loop over the repeats for each scenario: */
             for (nr = 0; nr < repeats; nr++)
             {
@@ -1476,8 +1553,8 @@ static void do_the_tests(
                  * the -passall (if set) options requires cmd_args_bench to be
                  * at the end of the command line string */
                 snew(pd->mdrun_cmd_line, cmdline_length);
-                sprintf(pd->mdrun_cmd_line, "%s-npme %d -s %s %s",
-                        cmd_stub, pd->nPMEnodes, tpr_names[k], cmd_args_bench);
+                sprintf(pd->mdrun_cmd_line, "%s-npme %d -s %s %s %s",
+                        cmd_stub, pd->nPMEnodes, tpr_names[k], cmd_args_bench, cmd_gpu_ids);
 
                 /* To prevent that all benchmarks fail due to a show-stopper argument
                  * on the mdrun command line, we make a quick check first.
@@ -1486,7 +1563,25 @@ static void do_the_tests(
                  * decomposition can be found (e.g. for large prime numbers) */
                 if (bFirst && bCheck)
                 {
-                    make_sure_it_runs(pd->mdrun_cmd_line, cmdline_length, fp, fnm, nfile);
+                    /* TODO This check is really for a functional
+                     * .tpr, and if we need it, it should take place
+                     * for every .tpr, and the logic for it should be
+                     * immediately inside the loop over k, not in
+                     * this inner loop. */
+                    char *temporary_cmd_line;
+
+                    snew(temporary_cmd_line, cmdline_length);
+                    /* TODO -npme 0 is more likely to succeed at low
+                       parallelism than the default of -npme -1, but
+                       is more likely to fail at the scaling limit
+                       when the PP domains may be too small. "mpirun
+                       -np 1 mdrun" is probably a reasonable thing to
+                       do for this check, but it'll be easier to
+                       implement that after some refactoring of how
+                       the number of MPI ranks is managed. */
+                    sprintf(temporary_cmd_line, "%s-npme 0 -nb cpu -s %s %s",
+                            cmd_stub, tpr_names[k], cmd_args_bench);
+                    make_sure_it_runs(temporary_cmd_line, cmdline_length, fp, fnm, nfile);
                 }
                 bFirst = FALSE;
 
@@ -1557,6 +1652,7 @@ static void do_the_tests(
                     break;
                 }
             } /* end of repeats loop */
+            sfree(cmd_gpu_ids);
         }     /* end of -npme loop */
     }         /* end of tpr file loop */
 
@@ -1660,13 +1756,13 @@ static void check_input(
     /* Add test scenarios if rmin or rmax were set */
     if (*ntprs <= 2)
     {
-        if (!is_equal(*rmin, rcoulomb) && (*ntprs == 1) )
+        if (!gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) && (*ntprs == 1) )
         {
             (*ntprs)++;
             fprintf(stderr, "NOTE: Setting -rmin to %g changed -ntpr to %d\n",
                     *rmin, *ntprs);
         }
-        if (!is_equal(*rmax, rcoulomb) && (*ntprs == 1) )
+        if (!gmx_within_tol(*rmax, rcoulomb, GMX_REAL_EPS) && (*ntprs == 1) )
         {
             (*ntprs)++;
             fprintf(stderr, "NOTE: Setting -rmax to %g changed -ntpr to %d\n",
@@ -1675,13 +1771,13 @@ static void check_input(
     }
     old = *ntprs;
     /* If one of rmin, rmax is set, we need 2 tpr files at minimum */
-    if (!is_equal(*rmax, rcoulomb) || !is_equal(*rmin, rcoulomb) )
+    if (!gmx_within_tol(*rmax, rcoulomb, GMX_REAL_EPS) || !gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) )
     {
         *ntprs = max(*ntprs, 2);
     }
 
     /* If both rmin, rmax are set, we need 3 tpr files at minimum */
-    if (!is_equal(*rmax, rcoulomb) && !is_equal(*rmin, rcoulomb) )
+    if (!gmx_within_tol(*rmax, rcoulomb, GMX_REAL_EPS) && !gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) )
     {
         *ntprs = max(*ntprs, 3);
     }
@@ -1693,7 +1789,7 @@ static void check_input(
 
     if (*ntprs > 1)
     {
-        if (is_equal(*rmin, rcoulomb) && is_equal(rcoulomb, *rmax)) /* We have just a single rc */
+        if (gmx_within_tol(*rmin, rcoulomb, GMX_REAL_EPS) && gmx_within_tol(rcoulomb, *rmax, GMX_REAL_EPS)) /* We have just a single rc */
         {
             fprintf(stderr, "WARNING: Resetting -ntpr to 1 since no Coulomb radius scaling is requested.\n"
                     "Please set rmin < rmax to test Coulomb radii in the [rmin, rmax] interval\n"
@@ -2077,6 +2173,13 @@ int gmx_tune_pme(int argc, char *argv[])
         "(options [TT]-b[tt]*), these will be automatically deleted after each test.[PAR]",
         "If you want the simulation to be started automatically with the",
         "optimized parameters, use the command line option [TT]-launch[tt].[PAR]",
+        "Basic support for GPU-enabled [TT]mdrun[tt] exists. Give a string containing the IDs",
+        "of the GPUs that you wish to use in the optimization in the [TT]-gpu_id[tt]",
+        "command-line argument. Unlike [TT]mdrun -gpu_id[tt], this does not imply a mapping",
+        "but merely the eligible set. [TT]g_tune_pme[tt] will construct calls to",
+        "mdrun that use this set appropriately, assuming that PP ranks with low indices",
+        "should map to GPUs with low indices, and increasing both monotonically",
+        "over the respective sets.[PAR]",
     };
 
     int             nnodes         = 1;
@@ -2106,16 +2209,21 @@ int gmx_tune_pme(int argc, char *argv[])
     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_args_bench, *cmd_args_launch;
-    char         *cmd_np = NULL;
+    char               *cmd_mpirun = NULL, *cmd_mdrun = NULL;
+    char               *cmd_args_bench, *cmd_args_launch;
+    char               *cmd_np           = NULL;
+
+    /* IDs of GPUs that are eligible for computation */
+    char               *eligible_gpu_ids = NULL;
+    t_eligible_gpu_ids *gpu_ids          = NULL;
 
-    t_perf      **perfdata = NULL;
-    t_inputinfo  *info;
-    int           i;
-    FILE         *fp;
-    t_commrec    *cr;
+    t_perf            **perfdata = NULL;
+    t_inputinfo        *info;
+    int                 i;
+    FILE               *fp;
+    t_commrec          *cr;
 
     /* Print out how long the tuning took */
     double          seconds;
@@ -2124,9 +2232,9 @@ int gmx_tune_pme(int argc, char *argv[])
         /* g_tune_pme */
         { efOUT, "-p",      "perf",     ffWRITE },
         { efLOG, "-err",    "bencherr", ffWRITE },
-        { efTPX, "-so",     "tuned",    ffWRITE },
+        { efTPR, "-so",     "tuned",    ffWRITE },
         /* mdrun: */
-        { efTPX, NULL,      NULL,       ffREAD },
+        { efTPR, NULL,      NULL,       ffREAD },
         { efTRN, "-o",      NULL,       ffWRITE },
         { efCOMPRESSED, "-x", NULL,     ffOPTWR },
         { efCPT, "-cpi",    NULL,       ffOPTRD },
@@ -2240,6 +2348,8 @@ int gmx_tune_pme(int argc, char *argv[])
           "Run the benchmarks or just create the input [TT].tpr[tt] files?" },
         { "-check",    FALSE, etBOOL, {&bCheck},
           "Before the benchmark runs, check whether mdrun works in parallel" },
+        { "-gpu_id",   FALSE, etSTR,  {&eligible_gpu_ids},
+          "List of GPU device id-s that are eligible for use (unlike mdrun, does not imply any mapping)" },
         /******************/
         /* mdrun options: */
         /******************/
@@ -2346,6 +2456,9 @@ int gmx_tune_pme(int argc, char *argv[])
                 maxPMEfraction, minPMEfraction, npme_fixed,
                 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_plain_string(eligible_gpu_ids, &gpu_ids->n, &gpu_ids->ids);
 
     /* Determine the maximum and minimum number of PME nodes to test,
      * the actual list of settings is build in do_the_tests(). */
@@ -2392,14 +2505,15 @@ 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);
+        check_mdrun_works(bThreads, cmd_mpirun, cmd_np, cmd_mdrun, NULL != eligible_gpu_ids);
     }
 
     /* Print some header info to file */
     sep_line(fp);
     fprintf(fp, "\n      P E R F O R M A N C E   R E S U L T S\n");
     sep_line(fp);
-    fprintf(fp, "%s for Gromacs %s\n", ShortProgram(), GromacsVersion());
+    fprintf(fp, "%s for Gromacs %s\n", output_env_get_program_display_name(oenv),
+            gmx_version());
     if (!bThreads)
     {
         fprintf(fp, "Number of ranks         : %d\n", nnodes);
@@ -2491,7 +2605,7 @@ int gmx_tune_pme(int argc, char *argv[])
     {
         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);
+                     cmd_args_bench, fnm, NFILE, presteps, cpt_steps, bCheck, gpu_ids);
 
         fprintf(fp, "\nTuning took%8.1f minutes.\n", (gmx_gettime()-seconds)/60.0);
 
@@ -2520,7 +2634,7 @@ int gmx_tune_pme(int argc, char *argv[])
 
         /* Now start the real simulation if the user requested it ... */
         launch_simulation(bLaunch, fp, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
-                          cmd_args_launch, simulation_tpr, best_npme);
+                          cmd_args_launch, simulation_tpr, nnodes, best_npme, gpu_ids);
     }
     gmx_ffclose(fp);
 
index 71c5c0ec6955223e9a7a407621273ad7300f8a29..fa3567f02f62724442f08d8b0ec34c42d6fffad1 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <assert.h>
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/math/utilities.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "typedefs.h"
-#include "xvgr.h"
-#include "gstat.h"
+#include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "vec.h"
-#include "gromacs/fileio/matio.h"
-#include "gmx_ana.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 int gmx_vanhove(int argc, char *argv[])
@@ -147,7 +147,7 @@ int gmx_vanhove(int argc, char *argv[])
     FILE        *fp;
     t_rgb        rlo = {1, 1, 1}, rhi = {0, 0, 0};
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -199,6 +199,7 @@ int gmx_vanhove(int argc, char *argv[])
             srenew(sbox, nalloc);
             srenew(sx, nalloc);
         }
+        assert(time != NULL); assert(sbox != NULL);
 
         time[nfr] = t;
         copy_mat(box, sbox[nfr]);
@@ -442,7 +443,7 @@ int gmx_vanhove(int argc, char *argv[])
         for (fbin = 0; fbin < nr; fbin++)
         {
             sprintf(buf, "%g ps", (fbin + 1)*fshift*dt);
-            legend[fbin] = strdup(buf);
+            legend[fbin] = gmx_strdup(buf);
         }
         xvgr_legend(fp, nr, (const char**)legend, oenv);
         for (i = 0; i < nalloc; i++)
@@ -455,7 +456,7 @@ int gmx_vanhove(int argc, char *argv[])
             }
             fprintf(fp, "\n");
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     if (otfile)
@@ -470,7 +471,7 @@ int gmx_vanhove(int argc, char *argv[])
         {
             fprintf(fp, "%g %g\n", f*dt, (real)pt[f]/(tcount[f]*isize));
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     do_view(oenv, matfile, NULL);
index 77fe30fc3a0dad877bacc0708b4d3c7067f21b5b..c66255db2368fec7a28e1b26a481ad83da6b7462 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
+#include "gmxpre.h"
+
 #include <math.h>
+#include <stdio.h>
+#include <string.h>
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/correlationfunctions/autocorr.h"
+#include "gromacs/fft/fft.h"
 #include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "gstat.h"
-#include "macros.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "physics.h"
-#include "index.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "xvgr.h"
 #include "gmx_ana.h"
-#include "gromacs/fft/fft.h"
-#include "gromacs/fileio/trxio.h"
 
 static void index_atom2mol(int *n, atom_id *index, t_block *mols)
 {
@@ -236,7 +237,7 @@ 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 | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
index 2504bc180832ea0d8190cfa90461517612785234..6b82c5d5b38fa20020b044de425e3008e57aa13a 100644 (file)
@@ -3,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,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.
@@ -41,9 +41,9 @@
  *  \author Jochen Hub <jhub@gwdg.de>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <ctype.h>
 #include <stdio.h>
 #include <sstream>
 
 #include "gromacs/commandline/pargs.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "copyrite.h"
 #include "gromacs/fileio/tpxio.h"
-#include "names.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
-#include "gmx_ana.h"
-#include "macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "xvgr.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 //! longest file names allowed in input files
 #define WHAM_MAXFILELEN 2048
@@ -1255,7 +1254,7 @@ void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
             fprintf(fp, "\n");
         }
         printf("Wrote cumulative distribution functions to %s\n", fn);
-        gmx_ffclose(fp);
+        xvgrclose(fp);
         sfree(fn);
         sfree(buf);
     }
@@ -1481,7 +1480,7 @@ void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindow
         fprintf(fp, "\n");
     }
 
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     printf("Wrote %s\n", fn);
     if (bs_index >= 0)
     {
@@ -1725,7 +1724,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
         }
         fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(opt->oenv) ? "&" : "");
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
 
     /* write average and stddev */
     fp = xvgropen(fnres, "Average and stddev from bootstrapping", xlabel, ylabel, opt->oenv);
@@ -1741,7 +1740,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
         stddev             = (tmp >= 0.) ? sqrt(tmp) : 0.; /* Catch rouding errors */
         fprintf(fp, "%e\t%e\t%e\n", (i+0.5)*opt->dz+opt->min, bsProfiles_av [i], stddev);
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     printf("Wrote boot strap result to %s\n", fnres);
 }
 
@@ -2716,7 +2715,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
     printf(" done\n");
     if (fpcorr)
     {
-        gmx_ffclose(fpcorr);
+        xvgrclose(fpcorr);
     }
 
     /* plot IACT along reaction coordinate */
@@ -2762,7 +2761,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
             }
         }
     }
-    gmx_ffclose(fp);
+    xvgrclose(fp);
     printf("Wrote %s\n", fn);
 }
 
@@ -3001,7 +3000,7 @@ void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOpt
         {
             fprintf(fp, "%g  %g\n", (j+0.5)*dz+opt->min, pot[j]);
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
         printf("verbose mode: wrote %s with PMF from interated forces\n", "pmfintegrated.xvg");
     }
 
@@ -3386,7 +3385,7 @@ int gmx_wham(int argc, char *argv[])
     opt.stepchange            = 100;
     opt.stepUpdateContrib     = 100;
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, 0,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &opt.oenv))
     {
         return 0;
@@ -3520,7 +3519,7 @@ int gmx_wham(int argc, char *argv[])
         }
         fprintf(histout, "\n");
     }
-    gmx_ffclose(histout);
+    xvgrclose(histout);
     printf("Wrote %s\n", opt2fn("-hist", NFILE, fnm));
     if (opt.bHistOnly)
     {
@@ -3621,7 +3620,7 @@ int gmx_wham(int argc, char *argv[])
     {
         fprintf(profout, "%e\t%e\n", (double)(i+0.5)/opt.bins*(opt.max-opt.min)+opt.min, profile[i]);
     }
-    gmx_ffclose(profout);
+    xvgrclose(profout);
     printf("Wrote %s\n", opt2fn("-o", NFILE, fnm));
 
     /* Bootstrap Method */
index d33ebf1abb97f20850c8e1fe4ab65deb113729f3..457b1a17a03c6d8e29c6587815d14e933416e52a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "physics.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "pbc.h"
-#include "index.h"
-#include "gstat.h"
-#include "gmx_fatal.h"
-#include "gmx_ana.h"
-
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/strdb.h"
 #include "gromacs/fileio/writeps.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static gmx_bool *bPhobics(int nres, char *resnm[])
 {
@@ -252,7 +244,7 @@ int gmx_wheel(int argc, char *argv[])
     int    i, nres;
     char **resnm;
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
+    if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
                            asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -272,7 +264,7 @@ int gmx_wheel(int argc, char *argv[])
         }
         else if (strcmp(argv[i], "-T") == 0)
         {
-            title = strdup(argv[++i]);
+            title = gmx_strdup(argv[++i]);
             fprintf(stderr, "Title will be '%s'\n", title);
         }
         else if (strcmp(argv[i], "-nn") == 0)
index d8c5ebe56de890b9be68e5172beb32129307dc0a..53c67ac0160f18670642f0c97771c6dfc938a4af 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
-#include "typedefs.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
-#include "viewit.h"
-#include "gmx_ana.h"
 
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/matio.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/fileio/writeps.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define FUDGE 1.2
 #define DDD   2
@@ -400,7 +398,7 @@ static void draw_boxes(t_psdata ps, real x0, real y0, real w,
         for (j = 0; (j < ntx); j++)
         {
             sprintf(buf, "%g", mat[i].axis_x[j]);
-            xtick[j] = strdup(buf);
+            xtick[j] = gmx_strdup(buf);
         }
         ps_strfont(ps, psr->X.tickfont, psr->X.tickfontsize);
         for (x = 0; (x < ntx); x++)
@@ -437,7 +435,7 @@ static void draw_boxes(t_psdata ps, real x0, real y0, real w,
         for (j = 0; (j < nty); j++)
         {
             sprintf(buf, "%g", mat[i].axis_y[j]);
-            ytick[j] = strdup(buf);
+            ytick[j] = gmx_strdup(buf);
         }
 
         for (y = 0; (y < nty); y++)
@@ -711,11 +709,11 @@ void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
             sfree(mat[i].map);
             mat[i].nmap = nmap;
             mat[i].map  = map;
-            if (mat2 && (strcmp(mat[i].title, mat2[i].title) != 0))
+            if (strcmp(mat[i].title, mat2[i].title) != 0)
             {
                 sprintf(mat[i].title+strlen(mat[i].title), " / %s", mat2[i].title);
             }
-            if (mat2 && (strcmp(mat[i].legend, mat2[i].legend) != 0))
+            if (strcmp(mat[i].legend, mat2[i].legend) != 0)
             {
                 sprintf(mat[i].legend+strlen(mat[i].legend), " / %s", mat2[i].legend);
             }
index e12adf55d15acb32108a82b80e4f17ff14c796f5..ac08579eb501cb5640387cc00a67a3b0fba0a0f3 100644 (file)
 #ifndef GMX_GMXANA_GSTAT_H
 #define GMX_GMXANA_GSTAT_H
 
-#include "../legacyheaders/typedefs.h"
-#include "../commandline/pargs.h"
-#include "../legacyheaders/oenv.h"
-#include "../legacyheaders/mshift.h"
-#include "../legacyheaders/rmpbc.h"
-#include "../legacyheaders/index.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/topology/index.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/***********************************************
- *
- *     A U T O C O R R E L A T I O N
- *
- ***********************************************/
-
-real LegendreP(real x, unsigned long m);
-
-#define eacNormal (1<<0)
-#define eacCos    (1<<1)
-#define eacVector (1<<2)
-#define eacRcross (1<<3  | eacVector)
-#define eacP0     (1<<4  | eacVector)
-#define eacP1     (1<<5  | eacVector)
-#define eacP2     (1<<6  | eacVector)
-#define eacP3     (1<<7  | eacVector)
-#define eacP4     (1<<8  | eacVector)
-#define eacIden   (1<<9)
-
-enum {
-    effnNONE, effnEXP1, effnEXP2, effnEXP3,   effnVAC,
-    effnEXP5, effnEXP7, effnEXP9, effnERF, effnERREST, effnNR
-};
+struct gmx_residuetype_t;
 
 /* must correspond with 'leg' g_chi.c:727 */
 enum {
@@ -103,95 +79,6 @@ typedef struct {
 
 } t_dlist;
 
-extern const int   nfp_ffn[effnNR];
-
-extern const char *s_ffn[effnNR+2];
-
-extern const char *longs_ffn[effnNR];
-
-int sffn2effn(const char **sffn);
-/* Returns the ffn enum corresponding to the selected enum option in sffn */
-
-t_pargs *add_acf_pargs(int *npargs, t_pargs *pa);
-/* Add options for autocorr to the current set of options.
- * *npargs must be initialised to the number of elements in pa,
- * it will be incremented appropriately.
- */
-
-void cross_corr(int n, real f[], real g[], real corr[]);
-/* Simple minded cross correlation algorithm */
-
-real fit_acf(int ncorr, int fitfn, const output_env_t oenv, gmx_bool bVerbose,
-             real tbeginfit, real tendfit, real dt, real c1[], real *fit);
-/* Fit an ACF to a given function */
-
-void do_autocorr(const char *fn, const output_env_t oenv,
-                 const char *title,
-                 int nframes, int nitem, real **c1,
-                 real dt, unsigned long mode, gmx_bool bAver);
-/* Calls low_do_autocorr (see below). After calling add_acf_pargs */
-
-void low_do_autocorr(const char *fn, const output_env_t oenv,
-                     const char *title, int  nframes, int nitem,
-                     int nout, real **c1, real dt, unsigned long mode,
-                     int nrestart, gmx_bool bAver, gmx_bool bNormalize,
-                     gmx_bool bVerbose, real tbeginfit, real tendfit,
-                     int nfitparm);
-/*
- * do_autocorr calculates autocorrelation functions for many things.
- * It takes a 2 d array containing nitem arrays of length nframes
- * for each item the ACF is calculated.
- *
- * A number of "modes" exist for computation of the ACF
- *
- * if (mode == eacNormal) {
- *   C(t) = < X (tau) * X (tau+t) >
- * }
- * else if (mode == eacCos) {
- *   C(t) = < cos (X(tau) - X(tau+t)) >
- * }
- * else if (mode == eacIden) { **not fully supported yet**
- *   C(t) = < (X(tau) == X(tau+t)) >
- * }
- * else if (mode == eacVector) {
- *   C(t) = < X(tau) * X(tau+t)
- * }
- * else if (mode == eacP1) {
- *   C(t) = < cos (X(tau) * X(tau+t) >
- * }
- * else if (mode == eacP2) {
- *   C(t) = 1/2 * < 3 cos (X(tau) * X(tau+t) - 1 >
- * }
- * else if (mode == eacRcross) {
- *   C(t) = < ( X(tau) * X(tau+t) )^2 >
- * }
- *
- * For modes eacVector, eacP1, eacP2 and eacRcross the input should be
- * 3 x nframes long, where each triplet is taken as a 3D vector
- *
- * For mode eacCos inputdata must be in radians, not degrees!
- *
- * Other parameters are:
- *
- * fn is output filename (.xvg) where the correlation function(s) are printed
- * title is the title in the output file
- * nframes is the number of frames in the time series
- * nitem is the number of items
- * c1       is an array of dimension [ 0 .. nitem-1 ] [ 0 .. nframes-1 ]
- *          on output, this array is filled with the correlation function
- *          to reduce storage
- * nrestart     is the number of steps between restarts for direct ACFs
- *              (i.e. without FFT) When set to 1 all points are used as
- *              time origin for averaging
- * dt       is the time between frames
- * bAver    If set, all ndih C(t) functions are averaged into a single
- *          C(t)
- * (bFour       If set, will use fast fourier transform (FFT) for evaluating
- *              the ACF: removed option, now on the command line only)
- * bNormalize   If set, all ACFs will be normalized to start at 0
- * nskip        Determines whether steps a re skipped in the output
- */
-
 typedef struct {
     const char *name;    /* Description of the J coupling constant */
     real        A, B, C; /* Karplus coefficients */
@@ -226,25 +113,6 @@ void calc_distribution_props(int nh, int histo[],
  *
  */
 
-
-/***********************************************
- *
- *     F I T   R O U T I N E S
- *
- ***********************************************/
-void do_expfit(int ndata, real c1[], real dt,
-               real begintimefit, real endtimefit);
-
-void expfit(int n, real x[], real y[], real Dy[],
-            real *a, real *sa,
-            real *b, real *sb);
-/* This procedure fits y=exp(a+bx) for n (x,y) pairs to determine a and b.
- * The uncertainties in the y values must be in the vector Dy.
- * The standard deviations of a and b, sa and sb, are also calculated.
- *
- * Routine from Computers in physics, 7(3) (1993), p. 280-285.
- */
-
 void ana_dih_trans(const char *fn_trans, const char *fn_histo,
                    real **dih, int nframes, int nangles,
                    const char *grpname, real *time, gmx_bool bRb,
@@ -300,7 +168,6 @@ void read_ang_dih(const char *trj_fn,
  * Read a trajectory and calculate angles and dihedrals.
  *
  * trj_fn      file name of trajectory
- * tpb_fn      file name of tpb file
  * bAngles     do we have to read angles or dihedrals
  * bSaveAll    do we have to store all in the dih array
  * bRb         do we have Ryckaert-Bellemans dihedrals (trans = 0)
@@ -348,47 +215,6 @@ void normalize_histo(int npoints, int histo[], real dx, real normhisto[]);
  * normhisto  normalized output histogram
  */
 
-real fit_function(int eFitFn, real *parm, real x);
-/* Returns the value of fit function eFitFn at x */
-
-/* Use Levenberg-Marquardt method to fit to a nfitparm parameter exponential */
-/* or to a transverse current autocorrelation function */
-/* Or: "There is no KILL like OVERKILL", Dr. Ir. D. van der Spoel */
-real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x,
-              real begintimefit, real endtimefit, const output_env_t oenv,
-              gmx_bool bVerbose, int eFitFn, real fitparms[], int fix);
-/* Returns integral.
- * If x == NULL, the timestep dt will be used to create a time axis.
- * fix fixes fit parameter i at it's starting value, when the i'th bit
- * of fix is set.
- */
-
-real evaluate_integral(int n, real x[], real y[], real dy[],
-                       real aver_start, real *stddev);
-/* Integrate data in y, and, if given, use dy as weighting
- * aver_start should be set to a value where the function has
- * converged to 0.
- */
-
-real print_and_integrate(FILE *fp, int n, real dt,
-                         real c[], real *fit, int nskip);
-/* Integrate the data in c[] from 0 to n using trapezium rule.
- * If fp != NULL output is written to it
- * nskip determines whether all elements are written to the output file
- * (written when i % nskip == 0)
- * If fit != NULL the fit is also written.
- */
-
-int get_acfnout(void);
-/* Return the output length for the correlation function
- * Works only AFTER do_auto_corr has been called!
- */
-
-int get_acffitfn(void);
-/* Return the fit function type.
- * Works only AFTER do_auto_corr has been called!
- */
-
 /* Routines from pp2shift (anadih.c etc.) */
 
 void do_pp2shifts(FILE *fp, int nframes,
@@ -399,7 +225,7 @@ gmx_bool has_dihedral(int Dih, t_dlist *dl);
 t_dlist *mk_dlist(FILE *log,
                   t_atoms *atoms, int *nlist,
                   gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
-                  int maxchi, int r0, gmx_residuetype_t rt);
+                  int maxchi, int r0, struct gmx_residuetype_t *rt);
 
 void pr_dlist(FILE *fp, int nl, t_dlist dl[], real dt,  int printtype,
               gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bOmega, int maxchi);
index ee949e9c4db9ae5c2e7461181976ae7250e06882..5b1f6c70743eed9e2f75ce7bdbaa2322f18406b1 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "hxprops.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "macros.h"
-#include "physics.h"
-#include "vec.h"
-#include "index.h"
-#include "hxprops.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "bondf.h"
-
-#include "gmx_fatal.h"
 
 real ellipticity(int nres, t_bb bb[])
 {
index 08c705b027d1e533f5b5ea7b3b34d4009b0f6c8d..c6242d76b7aff725d19d8418ccf49c7485cc6345 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,8 @@
 #define _hxprops_h
 
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 #define PHI_AHX (-55.0)
 #define PSI_AHX (-45.0)
index d202af3d45a3dfbea20ae8380e952b6db4b33258..8ffe5446c87a1682de66db8d75a3ee47b8a6ea4a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,7 +36,7 @@
 #ifndef _interf_h
 #define _interf_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 typedef struct {
     real Z; /* Interface height-coordinate */
index bea1f8044d982c14e674751786b0602b0fb508b8..4af681f2f6064ac7ae873e68a4ac21641c83c683 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  */
 
+#include "gmxpre.h"
+
+#include "config.h"
+
 #include "gromacs/gmxana/gmx_ana.h"
-#include "testutils/integrationtests.h"
-#include "testutils/cmdlinetest.h"
 #include "gromacs/utility/arrayref.h"
 
-#include "config.h"
+#include "testutils/cmdlinetest.h"
+#include "testutils/integrationtests.h"
 
 namespace
 {
diff --git a/src/gromacs/gmxana/levenmar.c b/src/gromacs/gmxana/levenmar.c
deleted file mode 100644 (file)
index b1f6502..0000000
+++ /dev/null
@@ -1,765 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "types/simple.h"
-
-static void nrerror(const char error_text[], gmx_bool bExit)
-{
-    fprintf(stderr, "Numerical Recipes run-time error...\n");
-    fprintf(stderr, "%s\n", error_text);
-    if (bExit)
-    {
-        fprintf(stderr, "...now exiting to system...\n");
-        exit(1);
-    }
-}
-
-/* dont use the keyword vector - it will clash with the
- * altivec extensions used for powerpc processors.
- */
-
-static real *rvector(int nl, int nh)
-{
-    real *v;
-
-    v = (real *)malloc((unsigned) (nh-nl+1)*sizeof(real));
-    if (!v)
-    {
-        nrerror("allocation failure in rvector()", TRUE);
-    }
-    return v-nl;
-}
-
-static int *ivector(int nl, int nh)
-{
-    int *v;
-
-    v = (int *)malloc((unsigned) (nh-nl+1)*sizeof(int));
-    if (!v)
-    {
-        nrerror("allocation failure in ivector()", TRUE);
-    }
-    return v-nl;
-}
-
-
-static real **matrix1(int nrl, int nrh, int ncl, int nch)
-{
-    int    i;
-    real **m;
-
-    m = (real **) malloc((unsigned) (nrh-nrl+1)*sizeof(real*));
-    if (!m)
-    {
-        nrerror("allocation failure 1 in matrix1()", TRUE);
-    }
-    m -= nrl;
-
-    for (i = nrl; i <= nrh; i++)
-    {
-        m[i] = (real *) malloc((unsigned) (nch-ncl+1)*sizeof(real));
-        if (!m[i])
-        {
-            nrerror("allocation failure 2 in matrix1()", TRUE);
-        }
-        m[i] -= ncl;
-    }
-    return m;
-}
-
-static double **dmatrix(int nrl, int nrh, int ncl, int nch)
-{
-    int      i;
-    double **m;
-
-    m = (double **) malloc((unsigned) (nrh-nrl+1)*sizeof(double*));
-    if (!m)
-    {
-        nrerror("allocation failure 1 in dmatrix()", TRUE);
-    }
-    m -= nrl;
-
-    for (i = nrl; i <= nrh; i++)
-    {
-        m[i] = (double *) malloc((unsigned) (nch-ncl+1)*sizeof(double));
-        if (!m[i])
-        {
-            nrerror("allocation failure 2 in dmatrix()", TRUE);
-        }
-        m[i] -= ncl;
-    }
-    return m;
-}
-
-static int **imatrix1(int nrl, int nrh, int ncl, int nch)
-{
-    int i, **m;
-
-    m = (int **)malloc((unsigned) (nrh-nrl+1)*sizeof(int*));
-    if (!m)
-    {
-        nrerror("allocation failure 1 in imatrix1()", TRUE);
-    }
-    m -= nrl;
-
-    for (i = nrl; i <= nrh; i++)
-    {
-        m[i] = (int *)malloc((unsigned) (nch-ncl+1)*sizeof(int));
-        if (!m[i])
-        {
-            nrerror("allocation failure 2 in imatrix1()", TRUE);
-        }
-        m[i] -= ncl;
-    }
-    return m;
-}
-
-
-
-static real **submatrix(real **a, int oldrl, int oldrh, int oldcl,
-                        int newrl, int newcl)
-{
-    int    i, j;
-    real **m;
-
-    m = (real **) malloc((unsigned) (oldrh-oldrl+1)*sizeof(real*));
-    if (!m)
-    {
-        nrerror("allocation failure in submatrix()", TRUE);
-    }
-    m -= newrl;
-
-    for (i = oldrl, j = newrl; i <= oldrh; i++, j++)
-    {
-        m[j] = a[i]+oldcl-newcl;
-    }
-
-    return m;
-}
-
-
-
-static void free_vector(real *v, int nl)
-{
-    free((char*) (v+nl));
-}
-
-static void free_ivector(int *v, int nl)
-{
-    free((char*) (v+nl));
-}
-
-static void free_dvector(int *v, int nl)
-{
-    free((char*) (v+nl));
-}
-
-
-
-static void free_matrix(real **m, int nrl, int nrh, int ncl)
-{
-    int i;
-
-    for (i = nrh; i >= nrl; i--)
-    {
-        free((char*) (m[i]+ncl));
-    }
-    free((char*) (m+nrl));
-}
-
-static real **convert_matrix(real *a, int nrl, int nrh, int ncl, int nch)
-{
-    int    i, j, nrow, ncol;
-    real **m;
-
-    nrow = nrh-nrl+1;
-    ncol = nch-ncl+1;
-    m    = (real **) malloc((unsigned) (nrow)*sizeof(real*));
-    if (!m)
-    {
-        nrerror("allocation failure in convert_matrix()", TRUE);
-    }
-    m -= nrl;
-    for (i = 0, j = nrl; i <= nrow-1; i++, j++)
-    {
-        m[j] = a+ncol*i-ncl;
-    }
-    return m;
-}
-
-
-
-static void free_convert_matrix(real **b, int nrl)
-{
-    free((char*) (b+nrl));
-}
-
-#define SWAP(a, b) {real temp = (a); (a) = (b); (b) = temp; }
-
-static void dump_mat(int n, real **a)
-{
-    int i, j;
-
-    for (i = 1; (i <= n); i++)
-    {
-        for (j = 1; (j <= n); j++)
-        {
-            fprintf(stderr, "  %10.3f", a[i][j]);
-        }
-        fprintf(stderr, "\n");
-    }
-}
-
-gmx_bool gaussj(real **a, int n, real **b, int m)
-{
-    int *indxc, *indxr, *ipiv;
-    int  i, icol = 0, irow = 0, j, k, l, ll;
-    real big, dum, pivinv;
-
-    indxc = ivector(1, n);
-    indxr = ivector(1, n);
-    ipiv  = ivector(1, n);
-    for (j = 1; j <= n; j++)
-    {
-        ipiv[j] = 0;
-    }
-    for (i = 1; i <= n; i++)
-    {
-        big = 0.0;
-        for (j = 1; j <= n; j++)
-        {
-            if (ipiv[j] != 1)
-            {
-                for (k = 1; k <= n; k++)
-                {
-                    if (ipiv[k] == 0)
-                    {
-                        if (fabs(a[j][k]) >= big)
-                        {
-                            big  = fabs(a[j][k]);
-                            irow = j;
-                            icol = k;
-                        }
-                    }
-                    else if (ipiv[k] > 1)
-                    {
-                        nrerror("GAUSSJ: Singular Matrix-1", FALSE);
-                        return FALSE;
-                    }
-                }
-            }
-        }
-        ++(ipiv[icol]);
-        if (irow != icol)
-        {
-            for (l = 1; l <= n; l++)
-            {
-                SWAP(a[irow][l], a[icol][l]);
-            }
-            for (l = 1; l <= m; l++)
-            {
-                SWAP(b[irow][l], b[icol][l]);
-            }
-        }
-        indxr[i] = irow;
-        indxc[i] = icol;
-        if (a[icol][icol] == 0.0)
-        {
-            fprintf(stderr, "irow = %d, icol = %d\n", irow, icol);
-            dump_mat(n, a);
-            nrerror("GAUSSJ: Singular Matrix-2", FALSE);
-            return FALSE;
-        }
-        pivinv        = 1.0/a[icol][icol];
-        a[icol][icol] = 1.0;
-        for (l = 1; l <= n; l++)
-        {
-            a[icol][l] *= pivinv;
-        }
-        for (l = 1; l <= m; l++)
-        {
-            b[icol][l] *= pivinv;
-        }
-        for (ll = 1; ll <= n; ll++)
-        {
-            if (ll != icol)
-            {
-                dum         = a[ll][icol];
-                a[ll][icol] = 0.0;
-                for (l = 1; l <= n; l++)
-                {
-                    a[ll][l] -= a[icol][l]*dum;
-                }
-                for (l = 1; l <= m; l++)
-                {
-                    b[ll][l] -= b[icol][l]*dum;
-                }
-            }
-        }
-    }
-    for (l = n; l >= 1; l--)
-    {
-        if (indxr[l] != indxc[l])
-        {
-            for (k = 1; k <= n; k++)
-            {
-                SWAP(a[k][indxr[l]], a[k][indxc[l]]);
-            }
-        }
-    }
-    free_ivector(ipiv, 1);
-    free_ivector(indxr, 1);
-    free_ivector(indxc, 1);
-
-    return TRUE;
-}
-
-#undef SWAP
-
-
-static void covsrt(real **covar, int ma, int lista[], int mfit)
-{
-    int  i, j;
-    real swap;
-
-    for (j = 1; j < ma; j++)
-    {
-        for (i = j+1; i <= ma; i++)
-        {
-            covar[i][j] = 0.0;
-        }
-    }
-    for (i = 1; i < mfit; i++)
-    {
-        for (j = i+1; j <= mfit; j++)
-        {
-            if (lista[j] > lista[i])
-            {
-                covar[lista[j]][lista[i]] = covar[i][j];
-            }
-            else
-            {
-                covar[lista[i]][lista[j]] = covar[i][j];
-            }
-        }
-    }
-    swap = covar[1][1];
-    for (j = 1; j <= ma; j++)
-    {
-        covar[1][j] = covar[j][j];
-        covar[j][j] = 0.0;
-    }
-    covar[lista[1]][lista[1]] = swap;
-    for (j = 2; j <= mfit; j++)
-    {
-        covar[lista[j]][lista[j]] = covar[1][j];
-    }
-    for (j = 2; j <= ma; j++)
-    {
-        for (i = 1; i <= j-1; i++)
-        {
-            covar[i][j] = covar[j][i];
-        }
-    }
-}
-
-#define SWAP(a, b) {swap = (a); (a) = (b); (b) = swap; }
-
-static void covsrt_new(real **covar, int ma, int ia[], int mfit)
-/* Expand in storage the covariance matrix covar, so as to take
- * into account parameters that are being held fixed. (For the
- * latter, return zero covariances.)
- */
-{
-    int  i, j, k;
-    real swap;
-    for (i = mfit+1; i <= ma; i++)
-    {
-        for (j = 1; j <= i; j++)
-        {
-            covar[i][j] = covar[j][i] = 0.0;
-        }
-    }
-    k = mfit;
-    for (j = ma; j >= 1; j--)
-    {
-        if (ia[j])
-        {
-            for (i = 1; i <= ma; i++)
-            {
-                SWAP(covar[i][k], covar[i][j]);
-            }
-            for (i = 1; i <= ma; i++)
-            {
-                SWAP(covar[k][i], covar[j][i]);
-            }
-            k--;
-        }
-    }
-}
-#undef SWAP
-
-static void mrqcof(real x[], real y[], real sig[], int ndata, real a[],
-                   int ma, int lista[], int mfit,
-                   real **alpha, real beta[], real *chisq,
-                   void (*funcs)(real, real *, real *, real *))
-{
-    int  k, j, i;
-    real ymod, wt, sig2i, dy, *dyda;
-
-    dyda = rvector(1, ma);
-    for (j = 1; j <= mfit; j++)
-    {
-        for (k = 1; k <= j; k++)
-        {
-            alpha[j][k] = 0.0;
-        }
-        beta[j] = 0.0;
-    }
-    *chisq = 0.0;
-    for (i = 1; i <= ndata; i++)
-    {
-        (*funcs)(x[i], a, &ymod, dyda);
-        sig2i = 1.0/(sig[i]*sig[i]);
-        dy    = y[i]-ymod;
-        for (j = 1; j <= mfit; j++)
-        {
-            wt = dyda[lista[j]]*sig2i;
-            for (k = 1; k <= j; k++)
-            {
-                alpha[j][k] += wt*dyda[lista[k]];
-            }
-            beta[j] += dy*wt;
-        }
-        (*chisq) += dy*dy*sig2i;
-    }
-    for (j = 2; j <= mfit; j++)
-    {
-        for (k = 1; k <= j-1; k++)
-        {
-            alpha[k][j] = alpha[j][k];
-        }
-    }
-    free_vector(dyda, 1);
-}
-
-
-gmx_bool mrqmin(real x[], real y[], real sig[], int ndata, real a[],
-                int ma, int lista[], int mfit,
-                real **covar, real **alpha, real *chisq,
-                void (*funcs)(real, real *, real *, real *),
-                real *alamda)
-{
-    int          k, kk, j, ihit;
-    static real *da, *atry, **oneda, *beta, ochisq;
-
-    if (*alamda < 0.0)
-    {
-        oneda = matrix1(1, mfit, 1, 1);
-        atry  = rvector(1, ma);
-        da    = rvector(1, ma);
-        beta  = rvector(1, ma);
-        kk    = mfit+1;
-        for (j = 1; j <= ma; j++)
-        {
-            ihit = 0;
-            for (k = 1; k <= mfit; k++)
-            {
-                if (lista[k] == j)
-                {
-                    ihit++;
-                }
-            }
-            if (ihit == 0)
-            {
-                lista[kk++] = j;
-            }
-            else if (ihit > 1)
-            {
-                nrerror("Bad LISTA permutation in MRQMIN-1", FALSE);
-                return FALSE;
-            }
-        }
-        if (kk != ma+1)
-        {
-            nrerror("Bad LISTA permutation in MRQMIN-2", FALSE);
-            return FALSE;
-        }
-        *alamda = 0.001;
-        mrqcof(x, y, sig, ndata, a, ma, lista, mfit, alpha, beta, chisq, funcs);
-        ochisq = (*chisq);
-    }
-    for (j = 1; j <= mfit; j++)
-    {
-        for (k = 1; k <= mfit; k++)
-        {
-            covar[j][k] = alpha[j][k];
-        }
-        covar[j][j] = alpha[j][j]*(1.0+(*alamda));
-        oneda[j][1] = beta[j];
-    }
-    if (!gaussj(covar, mfit, oneda, 1))
-    {
-        return FALSE;
-    }
-    for (j = 1; j <= mfit; j++)
-    {
-        da[j] = oneda[j][1];
-    }
-    if (*alamda == 0.0)
-    {
-        covsrt(covar, ma, lista, mfit);
-        free_vector(beta, 1);
-        free_vector(da, 1);
-        free_vector(atry, 1);
-        free_matrix(oneda, 1, mfit, 1);
-        return TRUE;
-    }
-    for (j = 1; j <= ma; j++)
-    {
-        atry[j] = a[j];
-    }
-    for (j = 1; j <= mfit; j++)
-    {
-        atry[lista[j]] = a[lista[j]]+da[j];
-    }
-    mrqcof(x, y, sig, ndata, atry, ma, lista, mfit, covar, da, chisq, funcs);
-    if (*chisq < ochisq)
-    {
-        *alamda *= 0.1;
-        ochisq   = (*chisq);
-        for (j = 1; j <= mfit; j++)
-        {
-            for (k = 1; k <= mfit; k++)
-            {
-                alpha[j][k] = covar[j][k];
-            }
-            beta[j]     = da[j];
-            a[lista[j]] = atry[lista[j]];
-        }
-    }
-    else
-    {
-        *alamda *= 10.0;
-        *chisq   = ochisq;
-    }
-    return TRUE;
-}
-
-
-gmx_bool mrqmin_new(real x[], real y[], real sig[], int ndata, real a[],
-                    int ia[], int ma, real **covar, real **alpha, real *chisq,
-                    void (*funcs)(real, real [], real *, real []),
-                    real *alamda)
-/* Levenberg-Marquardt method, attempting to reduce the value Chi^2
- * of a fit between a set of data points x[1..ndata], y[1..ndata]
- * with individual standard deviations sig[1..ndata], and a nonlinear
- * function dependent on ma coefficients a[1..ma]. The input array
- * ia[1..ma] indicates by nonzero entries those components of a that
- * should be fitted for, and by zero entries those components that
- * should be held fixed at their input values. The program returns
- * current best-fit values for the parameters a[1..ma], and
- * Chi^2 = chisq. The arrays covar[1..ma][1..ma], alpha[1..ma][1..ma]
- * are used as working space during most iterations. Supply a routine
- * funcs(x,a,yfit,dyda,ma) that evaluates the fitting function yfit,
- * and its derivatives dyda[1..ma] with respect to the fitting
- * parameters a at x. On the first call provide an initial guess for
- * the parameters a, and set alamda < 0 for initialization (which then
- * sets alamda=.001). If a step succeeds chisq becomes smaller and
- * alamda de-creases by a factor of 10. If a step fails alamda grows by
- * a factor of 10. You must call this routine repeatedly until
- * convergence is achieved. Then, make one final call with alamda=0,
- * so that covar[1..ma][1..ma] returns the covariance matrix, and alpha
- * the curvature matrix.
- * (Parameters held fixed will return zero covariances.)
- */
-{
-    void covsrt(real **covar, int ma, int ia[], int mfit);
-    gmx_bool gaussj(real **a, int n, real **b, int m);
-    void mrqcof_new(real x[], real y[], real sig[], int ndata, real a[],
-                    int ia[], int ma, real **alpha, real beta[], real *chisq,
-                    void (*funcs)(real, real [], real *, real []));
-    int         j, k, l;
-    static int  mfit;
-    static real ochisq, *atry, *beta, *da, **oneda;
-
-    if (*alamda < 0.0)                    /* Initialization. */
-    {
-        atry = rvector(1, ma);
-        beta = rvector(1, ma);
-        da   = rvector(1, ma);
-        for (mfit = 0, j = 1; j <= ma; j++)
-        {
-            if (ia[j])
-            {
-                mfit++;
-            }
-        }
-        oneda   = matrix1(1, mfit, 1, 1);
-        *alamda = 0.001;
-        mrqcof_new(x, y, sig, ndata, a, ia, ma, alpha, beta, chisq, funcs);
-        ochisq = (*chisq);
-        for (j = 1; j <= ma; j++)
-        {
-            atry[j] = a[j];
-        }
-    }
-    for (j = 1; j <= mfit; j++) /* Alter linearized fitting matrix, by augmenting. */
-    {
-        for (k = 1; k <= mfit; k++)
-        {
-            covar[j][k] = alpha[j][k]; /* diagonal elements. */
-        }
-        covar[j][j] = alpha[j][j]*(1.0+(*alamda));
-        oneda[j][1] = beta[j];
-    }
-    if (!gaussj(covar, mfit, oneda, 1)) /* Matrix solution. */
-    {
-        return FALSE;
-    }
-    for (j = 1; j <= mfit; j++)
-    {
-        da[j] = oneda[j][1];
-    }
-    if (*alamda == 0.0) /* Once converged, evaluate covariance matrix. */
-    {
-        covsrt_new(covar, ma, ia, mfit);
-        free_matrix(oneda, 1, mfit, 1);
-        free_vector(da, 1);
-        free_vector(beta, 1);
-        free_vector(atry, 1);
-        return TRUE;
-    }
-    for (j = 0, l = 1; l <= ma; l++) /* Did the trial succeed? */
-    {
-        if (ia[l])
-        {
-            atry[l] = a[l]+da[++j];
-        }
-    }
-    mrqcof_new(x, y, sig, ndata, atry, ia, ma, covar, da, chisq, funcs);
-    if (*chisq < ochisq)
-    {
-        /* Success, accept the new solution. */
-        *alamda *= 0.1;
-        ochisq   = (*chisq);
-        for (j = 1; j <= mfit; j++)
-        {
-            for (k = 1; k <= mfit; k++)
-            {
-                alpha[j][k] = covar[j][k];
-            }
-            beta[j] = da[j];
-        }
-        for (l = 1; l <= ma; l++)
-        {
-            a[l] = atry[l];
-        }
-    }
-    else                 /* Failure, increase alamda and return. */
-    {
-        *alamda *= 10.0;
-        *chisq   = ochisq;
-    }
-    return TRUE;
-}
-
-void mrqcof_new(real x[], real y[], real sig[], int ndata, real a[],
-                int ia[], int ma, real **alpha, real beta[], real *chisq,
-                void (*funcs)(real, real [], real *, real[]))
-/* Used by mrqmin to evaluate the linearized fitting matrix alpha, and
- * vector beta as in (15.5.8), and calculate Chi^2.
- */
-{
-    int  i, j, k, l, m, mfit = 0;
-    real ymod, wt, sig2i, dy, *dyda;
-
-    dyda = rvector(1, ma);
-    for (j = 1; j <= ma; j++)
-    {
-        if (ia[j])
-        {
-            mfit++;
-        }
-    }
-    for (j = 1; j <= mfit; j++) /* Initialize (symmetric) alpha), beta. */
-    {
-        for (k = 1; k <= j; k++)
-        {
-            alpha[j][k] = 0.0;
-        }
-        beta[j] = 0.0;
-    }
-    *chisq = 0.0;
-    for (i = 1; i <= ndata; i++) /* Summation loop over all data. */
-    {
-        (*funcs)(x[i], a, &ymod, dyda);
-        sig2i = 1.0/(sig[i]*sig[i]);
-        dy    = y[i]-ymod;
-        for (j = 0, l = 1; l <= ma; l++)
-        {
-            if (ia[l])
-            {
-                wt = dyda[l]*sig2i;
-                for (j++, k = 0, m = 1; m <= l; m++)
-                {
-                    if (ia[m])
-                    {
-                        alpha[j][++k] += wt*dyda[m];
-                    }
-                }
-                beta[j] += dy*wt;
-            }
-        }
-        *chisq += dy*dy*sig2i;  /* And find Chi^2. */
-    }
-    for (j = 2; j <= mfit; j++) /* Fill in the symmetric side. */
-    {
-        for (k = 1; k < j; k++)
-        {
-            alpha[k][j] = alpha[j][k];
-        }
-    }
-    free_vector(dyda, 1);
-}
index e20501f7df862fff4bd2ab67b033f9be9cadede3..5c40c6755958a681e8150f16ce0e92d62251655b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "nrama.h"
+
 #include <math.h>
-#include "sysstuff.h"
+#include <stdlib.h>
+
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "bondf.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
-#include "rmpbc.h"
 
 static const char *pp_pat[] = { "C", "N", "CA", "C", "N" };
 #define NPP (sizeof(pp_pat)/sizeof(pp_pat[0]))
@@ -143,7 +142,7 @@ static void add_xr(t_xrama *xr, int ff[5], t_atoms *atoms)
     xr->pp[xr->npp].bShow = FALSE;
     sprintf(buf, "%s-%d", *atoms->resinfo[atoms->atom[ff[1]].resind].name,
             atoms->resinfo[atoms->atom[ff[1]].resind].nr);
-    xr->pp[xr->npp].label = strdup(buf);
+    xr->pp[xr->npp].label = gmx_strdup(buf);
     xr->npp++;
 }
 
index aae2f36a14c920ae862c8501e5ae5132efc23bcf..03ee81418128f796dd0bdf9d979df40003589b58 100644 (file)
 #ifndef GMX_GMXANA_NRAMA_H
 #define GMX_GMXANA_NRAMA_H
 
-#include "typedefs.h"
-#include "oenv.h"
-#include "mshift.h"
-#include "../fileio/trxio.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 4b15a573c91f7ef6cec75ec8e0b59e7b66294e90..5525de64df0ab07d8de18f05cbaa56e1cc2a95b6 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
+#include "gmxpre.h"
 
-#include "gromacs/random/random.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "vec.h"
 #include "nsfactor.h"
 
-#include "gromacs/fileio/futil.h"
+#include "config.h"
+
+#include <string.h>
+
 #include "gromacs/fileio/strdb.h"
-#include "gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/random/random.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 void check_binwidth(real binwidth)
 {
@@ -116,7 +117,7 @@ gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const ch
         i = line_no;
         if (sscanf(line, "%s %d %d %lf", atomnm, &p, &n, &slength) == 4)
         {
-            gnsf->atomnm[i]  = strdup(atomnm);
+            gnsf->atomnm[i]  = gmx_strdup(atomnm);
             gnsf->n[i]       = n;
             gnsf->p[i]       = p;
             gnsf->slength[i] = slength;
index 8d3a388cf1226f23a754d422e5973912d7aa6577..c833a5521de8467d88d903b7d09d374d3e85c1c5 100644 (file)
 #ifndef _nsfactor_h
 #define _nsfactor_h
 
-#include "index.h"
-#include "types/simple.h"
-#include "oenv.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_topology;
+
 typedef struct gmx_neutron_atomic_structurefactors_t {
     int       nratoms;
     int      *p;       /* proton number */
@@ -53,8 +54,8 @@ typedef struct gmx_neutron_atomic_structurefactors_t {
 } gmx_neutron_atomic_structurefactors_t;
 
 typedef struct gmx_sans_t {
-    t_topology *top;     /* topology */
-    double     *slength; /* scattering length for this topology */
+    struct t_topology *top;     /* topology */
+    double            *slength; /* scattering length for this topology */
 } gmx_sans_t;
 
 typedef struct gmx_radial_distribution_histogram_t {
@@ -79,7 +80,7 @@ void normalize_probability(int n, double *a);
 
 gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const char *datfn);
 
-gmx_sans_t *gmx_sans_init(t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
+gmx_sans_t *gmx_sans_init(struct t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
 
 gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram  (gmx_sans_t  *gsans,
                                                                           rvec        *x,
index 06e7d94caec5060d51609446ea6d4de20e574489..67674959c7cceb5f39b903cf11dc70e86f3c5eb8 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "interf.h"
 #include "powerspect.h"
 
+#include "gromacs/fft/fft.h"
+#include "gromacs/gmxana/interf.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+
 void addtoavgenergy(t_complex *list, real *result, int size, int tsteps)
 {
     int i;
@@ -73,7 +72,6 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
 /*Prepare data structures for FFT, with time averaging of power spectrum*/
     if ( (status = gmx_fft_init_2d_real(&fftp, xbins, ybins, GMX_FFT_FLAG_NONE) ) != 0)
     {
-        free(fftp);
         gmx_fatal(status, __FILE__, __LINE__, "Error allocating FFT");
     }
 
@@ -113,8 +111,8 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
     gmx_ffclose(datfile1);
     gmx_ffclose(datfile2);
 
-    free(ftspect1);
-    free(ftspect2);
+    sfree(ftspect1);
+    sfree(ftspect2);
 
 }
 
index 53b6643b405608e71c0f7e1bfcd8e783b710c6c6..5f9bbc324146a6f259cb324f8f6691371c32c5fc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,8 +36,8 @@
 #ifndef _powerspect_h
 #define _powerspect_h
 
-#include "typedefs.h"
-#include "interf.h"
+#include "gromacs/gmxana/interf.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C"
index 85e29ac4eb8f10c3d4c00e5f63ba1b0d9e6afc7c..fa12f6d0b6afed5d822f886780f87ceb6719b0ea 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <stdlib.h>
 #include <math.h>
-#include "typedefs.h"
-#include "gromacs/fileio/futil.h"
-#include "macros.h"
-#include "physics.h"
-#include "gromacs/utility/smalloc.h"
-#include "gstat.h"
+#include <stdlib.h>
+
 #include "gromacs/fileio/matio.h"
-#include "copyrite.h"
-#include "gmx_fatal.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int    nx, ny;
similarity index 98%
rename from src/gromacs/gmxlib/princ.c
rename to src/gromacs/gmxana/princ.c
index 19cc04844d313ee73cc81564c0019ea9419425d3..fb7dcad1d7002380832aabf44ff4d2ea75d01f7a 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "txtdump.h"
 #include "princ.h"
 
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/linearalgebra/nrjac.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/smalloc.h"
 
 static void m_op(matrix mat, rvec x)
 {
similarity index 94%
rename from src/gromacs/legacyheaders/princ.h
rename to src/gromacs/gmxana/princ.h
index 78c639a30f4a6ef6aa89bf8e6cf0728d9b685855..af9caf399625f3e9e19def0cf156b2c428a97cd7 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_GMXANA_PRINC_H
+#define GMX_GMXANA_PRINC_H
 
-#ifndef _princ_h
-#define _princ_h
-
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 95%
rename from src/gromacs/gmxlib/sfactor.c
rename to src/gromacs/gmxana/sfactor.c
index 1684a5490b16f91b920c60cba5c0e5fa688bee5b..f5cf0eb7878e27e1e60371d08ce30f72ae49a36c 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/math/utilities.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "macros.h"
-#include "index.h"
+#include "sfactor.h"
+
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/strdb.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "typedefs.h"
-#include "oenv.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "xvgr.h"
-#include "gromacs/fileio/matio.h"
-#include "names.h"
-#include "sfactor.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 
 typedef struct gmx_structurefactors {
@@ -135,21 +132,9 @@ extern t_complex *** rc_tensor_allocation(int x, int y, int z)
     t_complex ***t;
     int          i, j;
 
-    t = (t_complex ***)calloc(x, sizeof(t_complex**));
-    if (!t)
-    {
-        exit(fprintf(stderr, "\nallocation error"));
-    }
-    t[0] = (t_complex **)calloc(x*y, sizeof(t_complex*));
-    if (!t[0])
-    {
-        exit(fprintf(stderr, "\nallocation error"));
-    }
-    t[0][0] = (t_complex *)calloc(x*y*z, sizeof(t_complex));
-    if (!t[0][0])
-    {
-        exit(fprintf(stderr, "\nallocation error"));
-    }
+    snew(t, x);
+    snew(t[0], x*y);
+    snew(t[0][0], x*y*z);
 
     for (j = 1; j < y; j++)
     {
@@ -260,7 +245,10 @@ extern void compute_structure_factor (structure_factor_t * sft, matrix box,
             }
         }
     }
-    sfree (counter); free(tmpSF[0][0]); free(tmpSF[0]); free(tmpSF);
+    sfree(counter);
+    sfree(tmpSF[0][0]);
+    sfree(tmpSF[0]);
+    sfree(tmpSF);
 }
 
 
@@ -295,7 +283,7 @@ extern gmx_structurefactors_t *gmx_structurefactors_init(const char *datfn)
         if (sscanf(line, "%s %d %lf %lf %lf %lf %lf %lf %lf %lf %lf",
                    atomn, &p, &a1, &a2, &a3, &a4, &b1, &b2, &b3, &b4, &c) == 11)
         {
-            gsf->atomnm[i] = strdup(atomn);
+            gsf->atomnm[i] = gmx_strdup(atomn);
             gsf->p[i]      = p;
             snew(gsf->a[i], 4);
             snew(gsf->b[i], 4);
@@ -360,8 +348,6 @@ extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, atom_id
     {
         copy_rvec (fr->x[index[i]], pos[i].x);
     }
-
-    positions = (reduced_atom_t *)pos;
 }
 
 
@@ -608,7 +594,7 @@ extern void save_data (structure_factor_t *sft, const char *file, int ngrps,
         }
     }
 
-    gmx_ffclose (fp);
+    xvgrclose (fp);
 }
 
 
similarity index 90%
rename from src/gromacs/legacyheaders/sfactor.h
rename to src/gromacs/gmxana/sfactor.h
index 8bdb91fa9304ee3ff40655c63abf27b099aaed56..0550909596862023457d8225edc28e48763f249f 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 _sfactor_h
 #define _sfactor_h
 
-
-#include "index.h"
-#include "types/simple.h"
-#include "../math/gmxcomplex.h"
-#include "oenv.h"
-
-
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/gmxcomplex.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_topology;
+struct t_trxframe;
 
 typedef struct gmx_structurefactors gmx_structurefactors_t;
 
@@ -79,8 +76,8 @@ double CMSF (gmx_structurefactors_t *gsf, int type, int nh, double lambda, doubl
 
 int return_atom_type (const char *name, gmx_structurefactors_t *gsf);
 
-void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, atom_id * index,
-                      int isize, t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
+void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, atom_id * index,
+                      int isize, struct t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
 
 int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
                              const char* fnXVG, const char *fnTRX,
index 4710367b3543eb3588476efcae41506c923f1587..991123e37ed23c81c62a8847223cf94bde7c908d 100644 (file)
@@ -40,17 +40,11 @@ add_subdirectory(nonbonded)
 # conditionally built, so we cannot use a GLOB_RECURSE here.
 file(GLOB GMXLIB_SOURCES *.c *.cpp)
 
-# Files called xxx_test.c are test drivers with a main() function for module xxx.c,
-# so they should not be included in the library
-file(GLOB_RECURSE NOT_GMXLIB_SOURCES *_test.c *\#*)
-list(REMOVE_ITEM GMXLIB_SOURCES ${NOT_GMXLIB_SOURCES})
-
 # gpu utils + cuda tools module
 if(GMX_GPU)
     # The log file output queries Cuda if GPU support is enabled
     add_subdirectory(cuda_tools)
-    add_subdirectory(gpu_utils)   
-    set(GMX_GPU_LIBRARIES ${GMX_GPU_LIBRARIES} gpu_utils cuda_tools PARENT_SCOPE)
+    add_subdirectory(gpu_utils)
 endif()
 
 set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${NONBONDED_SOURCES} PARENT_SCOPE)
index 81856d489c877e5d0e97fad3423a90fecc815b77..7bbee76f1260ad0a81493ba9ee3ed1e0f5bf7eb9 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/calcgrid.h"
 
 #include <math.h>
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "calcgrid.h"
 
 /* The grid sizes below are based on timing of a 3D cubic grid in fftw
  * compiled with SSE using 4 threads in fft5d.c.
index 93df8e1a1d9587037fa45c8f4ed4f10f8f3ac9df..41e152518dda92a4a98f119b3f0cf06aa6256170 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/chargegroup.h"
 
 #include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "pbc.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "chargegroup.h"
 
 
 void calc_chargegroup_radii(const gmx_mtop_t *mtop, rvec *x,
similarity index 97%
rename from src/gromacs/gmxlib/checkpoint.c
rename to src/gromacs/gmxlib/checkpoint.cpp
index 5f93ff28e57262ae3452529eb9b5c91a82af36c6..f53a55d2ae49a1ea664c5ac1ef88c1ca6e114cfb 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, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,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.
 
 /* The source code in this file should be thread-safe.
    Please keep it that way. */
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/checkpoint.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
-#include <time.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 
+#include <fcntl.h>
 #ifdef GMX_NATIVE_WINDOWS
-/* _chsize_s */
 #include <io.h>
 #include <sys/locking.h>
 #endif
 
-#include "copyrite.h"
-#include "names.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "txtdump.h"
-#include "vec.h"
-#include "network.h"
-#include "checkpoint.h"
-#include "main.h"
-#include "gromacs/utility/cstringutil.h"
-#include <fcntl.h>
-
+#include "buildinfo.h"
 #include "gromacs/fileio/filenm.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/xdrf.h"
 #include "gromacs/fileio/xdr_datatype.h"
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/baseversion.h"
-#include "gmx_fatal.h"
-
-#include "buildinfo.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/sysinfo.h"
 
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
@@ -159,34 +148,6 @@ const char *edfh_names[edfhNR] =
     "accumulated_plus", "accumulated_minus", "accumulated_plus_2",  "accumulated_minus_2", "Tij", "Tij_empirical"
 };
 
-#ifdef GMX_NATIVE_WINDOWS
-static int
-gmx_wintruncate(const char *filename, __int64 size)
-{
-#ifdef GMX_FAHCORE
-    /*we do this elsewhere*/
-    return 0;
-#else
-    FILE *fp;
-    int   rc;
-
-    fp = fopen(filename, "rb+");
-
-    if (fp == NULL)
-    {
-        return -1;
-    }
-
-#ifdef _MSC_VER
-    return _chsize_s( fileno(fp), size);
-#else
-    return _chsize( fileno(fp), size);
-#endif
-#endif
-}
-#endif
-
-
 enum {
     ecprREAL, ecprRVEC, ecprMATRIX
 };
@@ -467,6 +428,8 @@ static int do_cpte_reals_low(XDR *xd, int cptp, int ecpt, int sflags,
     {
         if (dtc == xdr_datatype_double)
         {
+            /* cppcheck-suppress invalidPointerCast
+             * Only executed if real is anyhow double */
             vd = (double *)vp;
         }
         else
@@ -535,8 +498,6 @@ static int do_cpte_n_reals(XDR *xd, int cptp, int ecpt, int sflags,
 static int do_cpte_real(XDR *xd, int cptp, int ecpt, int sflags,
                         real *r, FILE *list)
 {
-    int n;
-
     return do_cpte_reals_low(xd, cptp, ecpt, sflags, 1, NULL, &r, list, ecprREAL);
 }
 
@@ -546,7 +507,7 @@ static int do_cpte_ints(XDR *xd, int cptp, int ecpt, int sflags,
     bool_t res = 0;
     int    dtc = xdr_datatype_int;
     int   *vp, *va = NULL;
-    int    nf, dt, i;
+    int    nf, dt;
 
     nf  = n;
     res = xdr_int(xd, &nf);
@@ -613,7 +574,7 @@ static int do_cpte_doubles(XDR *xd, int cptp, int ecpt, int sflags,
     bool_t  res = 0;
     int     dtc = xdr_datatype_double;
     double *vp, *va = NULL;
-    int     nf, dt, i;
+    int     nf, dt;
 
     nf  = n;
     res = xdr_int(xd, &nf);
@@ -678,8 +639,6 @@ static int do_cpte_double(XDR *xd, int cptp, int ecpt, int sflags,
 static int do_cpte_rvecs(XDR *xd, int cptp, int ecpt, int sflags,
                          int n, rvec **v, FILE *list)
 {
-    int n3;
-
     return do_cpte_reals_low(xd, cptp, ecpt, sflags,
                              n*DIM, NULL, (real **)v, list, ecprRVEC);
 }
@@ -688,7 +647,7 @@ static int do_cpte_matrix(XDR *xd, int cptp, int ecpt, int sflags,
                           matrix v, FILE *list)
 {
     real *vr;
-    real  ret;
+    int   ret;
 
     vr  = (real *)&(v[0][0]);
     ret = do_cpte_reals_low(xd, cptp, ecpt, sflags,
@@ -707,8 +666,7 @@ static int do_cpte_nmatrix(XDR *xd, int cptp, int ecpt, int sflags,
                            int n, real **v, FILE *list)
 {
     int   i;
-    real *vr;
-    real  ret, reti;
+    int   ret, reti;
     char  name[CPTSTRLEN];
 
     ret = 0;
@@ -718,17 +676,15 @@ static int do_cpte_nmatrix(XDR *xd, int cptp, int ecpt, int sflags,
     }
     for (i = 0; i < n; i++)
     {
-        reti = 0;
-        vr   = v[i];
         reti = do_cpte_reals_low(xd, cptp, ecpt, sflags, n, NULL, &(v[i]), NULL, ecprREAL);
         if (list && reti == 0)
         {
             sprintf(name, "%s[%d]", st_names(cptp, ecpt), i);
             pr_reals(list, 0, name, v[i], n);
         }
-        if (reti == 0)
+        if (reti != 0)
         {
-            ret = 0;
+            ret = reti;
         }
     }
     return ret;
@@ -822,7 +778,6 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version,
     bool_t res = 0;
     int    magic;
     int    idum = 0;
-    int    i;
     char  *fhost;
 
     if (bRead)
@@ -1283,7 +1238,6 @@ static int do_cpt_enerhist(XDR *xd, gmx_bool bRead,
         {
             enerhist->ener_sum_sim[i] = enerhist->ener_sum[i];
         }
-        fflags |= (1<<eenhENERGY_SUM_SIM);
     }
 
     if ( (fflags & (1<<eenhENERGY_NSUM)) &&
@@ -1291,14 +1245,12 @@ static int do_cpt_enerhist(XDR *xd, gmx_bool bRead,
     {
         /* Assume we have an old file format and copy nsum to nsteps */
         enerhist->nsteps = enerhist->nsum;
-        fflags          |= (1<<eenhENERGY_NSTEPS);
     }
     if ( (fflags & (1<<eenhENERGY_NSUM_SIM)) &&
          !(fflags & (1<<eenhENERGY_NSTEPS_SIM)))
     {
         /* Assume we have an old file format and copy nsum to nsteps */
         enerhist->nsteps_sim = enerhist->nsum_sim;
-        fflags              |= (1<<eenhENERGY_NSTEPS_SIM);
     }
 
     return ret;
@@ -1350,7 +1302,7 @@ static int do_cpt_df_hist(XDR *xd, int fflags, df_history_t *dfhist, FILE *list)
 static int do_cpt_EDstate(XDR *xd, gmx_bool bRead,
                           edsamstate_t *EDstate, FILE *list)
 {
-    int  i, j;
+    int  i;
     int  ret = 0;
     char buf[STRLEN];
 
@@ -1412,7 +1364,7 @@ static int do_cpt_files(XDR *xd, gmx_bool bRead,
                         gmx_file_position_t **p_outputfiles, int *nfiles,
                         FILE *list, int file_version)
 {
-    int                  i, j;
+    int                  i;
     gmx_off_t            offset;
     gmx_off_t            mask = 0xFFFFFFFFL;
     int                  offset_high, offset_low;
@@ -1514,14 +1466,13 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     int                  double_prec;
     char                *fprog;
     char                *fntemp; /* the temporary checkpoint file name */
-    time_t               now;
     char                 timebuf[STRLEN];
-    int                  nppnodes, npmenodes, flag_64bit;
+    int                  nppnodes, npmenodes;
     char                 buf[1024], suffix[5+STEPSTRSIZE], sbuf[STEPSTRSIZE];
     gmx_file_position_t *outputfiles;
     int                  noutputfiles;
     char                *ftime;
-    int                  flags_eks, flags_enh, flags_dfh, i;
+    int                  flags_eks, flags_enh, flags_dfh;
     t_fileio            *ret;
 
     if (DOMAINDECOMP(cr))
@@ -1550,8 +1501,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     snew(fntemp, strlen(fn));
     strcpy(fntemp, fn);
 #endif
-    time(&now);
-    gmx_ctime_r(&now, timebuf, STRLEN);
+    gmx_format_current_time(timebuf, STRLEN);
 
     if (fplog)
     {
@@ -1808,9 +1758,10 @@ static void check_match(FILE *fplog,
          */
         int   gmx_major, gmx_minor;
         int   cpt_major, cpt_minor;
-        sscanf(gmx_version(), "VERSION %d.%d", &gmx_major, &gmx_minor);
-        sscanf(version, "VERSION %d.%d", &cpt_major, &cpt_minor);
-        version_differs = (gmx_major != cpt_major || gmx_minor != cpt_minor);
+        sscanf(gmx_version(), "VERSION %5d.%5d", &gmx_major, &gmx_minor);
+        int   ret = sscanf(version, "VERSION %5d.%5d", &cpt_major, &cpt_minor);
+        version_differs = (ret < 2 || gmx_major != cpt_major ||
+                           gmx_minor != cpt_minor);
     }
 
     check_string(fplog, "Build time", BUILD_TIME, btime, &mm);
@@ -1888,8 +1839,8 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
     int                  file_version;
     char                *version, *btime, *buser, *bhost, *fprog, *ftime;
     int                  double_prec;
-    char                 filename[STRLEN], buf[STEPSTRSIZE];
-    int                  nppnodes, eIntegrator_f, nppnodes_f, npmenodes_f;
+    char                 buf[STEPSTRSIZE];
+    int                  eIntegrator_f, nppnodes_f, npmenodes_f;
     ivec                 dd_nc_f;
     int                  natoms, ngtc, nnhpres, nhchainlength, nlambda, fflags, flags_eks, flags_enh, flags_dfh;
     int                  d;
@@ -1996,7 +1947,6 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
 
     if (!PAR(cr))
     {
-        nppnodes      = 1;
         cr->npmenodes = 0;
     }
     else if (cr->nnodes == nppnodes_f + npmenodes_f)
@@ -2005,7 +1955,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         {
             cr->npmenodes = npmenodes_f;
         }
-        nppnodes = cr->nnodes - cr->npmenodes;
+        int nppnodes = cr->nnodes - cr->npmenodes;
         if (nppnodes == nppnodes_f)
         {
             for (d = 0; d < DIM; d++)
@@ -2017,11 +1967,6 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
             }
         }
     }
-    else
-    {
-        /* The number of PP nodes has not been set yet */
-        nppnodes = -1;
-    }
 
     if (fflags != state->flags)
     {
@@ -2264,15 +2209,14 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
 
             if (i != 0) /*log file is already seeked to correct position */
             {
-#ifdef GMX_NATIVE_WINDOWS
-                rc = gmx_wintruncate(outputfiles[i].filename, outputfiles[i].offset);
-#else
-                rc = truncate(outputfiles[i].filename, outputfiles[i].offset);
-#endif
+#if !defined(GMX_NATIVE_WINDOWS) || !defined(GMX_FAHCORE)
+                /* For FAHCORE, we do this elsewhere*/
+                rc = gmx_truncate(outputfiles[i].filename, outputfiles[i].offset);
                 if (rc != 0)
                 {
                     gmx_fatal(FARGS, "Truncation of file %s failed. Cannot do appending because of this failure.", outputfiles[i].filename);
                 }
+#endif
             }
         }
     }
@@ -2470,8 +2414,6 @@ void list_checkpoint(const char *fn, FILE *out)
     ivec                 dd_nc;
     t_state              state;
     int                  flags_eks, flags_enh, flags_dfh;
-    int                  indent;
-    int                  i, j;
     int                  ret;
     gmx_file_position_t *outputfiles;
     int                  nfiles;
diff --git a/src/gromacs/gmxlib/cinvsqrtdata.c b/src/gromacs/gmxlib/cinvsqrtdata.c
deleted file mode 100644 (file)
index 77ca8d3..0000000
+++ /dev/null
@@ -1,647 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-struct gmx_invsqrtdata
-{
-    unsigned int    exptab[256];    /*!< Exponential lookup table */
-    unsigned int    fracttab[4096]; /*!< Mantissa lookup table    */
-};
-
-
-struct gmx_invsqrtdata
-F77_FUNC(gmxinvsqrtdata, GMXINVSQRTDATA) =
-{
-    /* data for exponent table - 256 floats */
-    {
-        0x5f000000, 0x5e800000, 0x5e800000, 0x5e000000,
-        0x5e000000, 0x5d800000, 0x5d800000, 0x5d000000,
-        0x5d000000, 0x5c800000, 0x5c800000, 0x5c000000,
-        0x5c000000, 0x5b800000, 0x5b800000, 0x5b000000,
-        0x5b000000, 0x5a800000, 0x5a800000, 0x5a000000,
-        0x5a000000, 0x59800000, 0x59800000, 0x59000000,
-        0x59000000, 0x58800000, 0x58800000, 0x58000000,
-        0x58000000, 0x57800000, 0x57800000, 0x57000000,
-        0x57000000, 0x56800000, 0x56800000, 0x56000000,
-        0x56000000, 0x55800000, 0x55800000, 0x55000000,
-        0x55000000, 0x54800000, 0x54800000, 0x54000000,
-        0x54000000, 0x53800000, 0x53800000, 0x53000000,
-        0x53000000, 0x52800000, 0x52800000, 0x52000000,
-        0x52000000, 0x51800000, 0x51800000, 0x51000000,
-        0x51000000, 0x50800000, 0x50800000, 0x50000000,
-        0x50000000, 0x4f800000, 0x4f800000, 0x4f000000,
-        0x4f000000, 0x4e800000, 0x4e800000, 0x4e000000,
-        0x4e000000, 0x4d800000, 0x4d800000, 0x4d000000,
-        0x4d000000, 0x4c800000, 0x4c800000, 0x4c000000,
-        0x4c000000, 0x4b800000, 0x4b800000, 0x4b000000,
-        0x4b000000, 0x4a800000, 0x4a800000, 0x4a000000,
-        0x4a000000, 0x49800000, 0x49800000, 0x49000000,
-        0x49000000, 0x48800000, 0x48800000, 0x48000000,
-        0x48000000, 0x47800000, 0x47800000, 0x47000000,
-        0x47000000, 0x46800000, 0x46800000, 0x46000000,
-        0x46000000, 0x45800000, 0x45800000, 0x45000000,
-        0x45000000, 0x44800000, 0x44800000, 0x44000000,
-        0x44000000, 0x43800000, 0x43800000, 0x43000000,
-        0x43000000, 0x42800000, 0x42800000, 0x42000000,
-        0x42000000, 0x41800000, 0x41800000, 0x41000000,
-        0x41000000, 0x40800000, 0x40800000, 0x40000000,
-        0x40000000, 0x3f800000, 0x3f800000, 0x3f000000,
-        0x3f000000, 0x3e800000, 0x3e800000, 0x3e000000,
-        0x3e000000, 0x3d800000, 0x3d800000, 0x3d000000,
-        0x3d000000, 0x3c800000, 0x3c800000, 0x3c000000,
-        0x3c000000, 0x3b800000, 0x3b800000, 0x3b000000,
-        0x3b000000, 0x3a800000, 0x3a800000, 0x3a000000,
-        0x3a000000, 0x39800000, 0x39800000, 0x39000000,
-        0x39000000, 0x38800000, 0x38800000, 0x38000000,
-        0x38000000, 0x37800000, 0x37800000, 0x37000000,
-        0x37000000, 0x36800000, 0x36800000, 0x36000000,
-        0x36000000, 0x35800000, 0x35800000, 0x35000000,
-        0x35000000, 0x34800000, 0x34800000, 0x34000000,
-        0x34000000, 0x33800000, 0x33800000, 0x33000000,
-        0x33000000, 0x32800000, 0x32800000, 0x32000000,
-        0x32000000, 0x31800000, 0x31800000, 0x31000000,
-        0x31000000, 0x30800000, 0x30800000, 0x30000000,
-        0x30000000, 0x2f800000, 0x2f800000, 0x2f000000,
-        0x2f000000, 0x2e800000, 0x2e800000, 0x2e000000,
-        0x2e000000, 0x2d800000, 0x2d800000, 0x2d000000,
-        0x2d000000, 0x2c800000, 0x2c800000, 0x2c000000,
-        0x2c000000, 0x2b800000, 0x2b800000, 0x2b000000,
-        0x2b000000, 0x2a800000, 0x2a800000, 0x2a000000,
-        0x2a000000, 0x29800000, 0x29800000, 0x29000000,
-        0x29000000, 0x28800000, 0x28800000, 0x28000000,
-        0x28000000, 0x27800000, 0x27800000, 0x27000000,
-        0x27000000, 0x26800000, 0x26800000, 0x26000000,
-        0x26000000, 0x25800000, 0x25800000, 0x25000000,
-        0x25000000, 0x24800000, 0x24800000, 0x24000000,
-        0x24000000, 0x23800000, 0x23800000, 0x23000000,
-        0x23000000, 0x22800000, 0x22800000, 0x22000000,
-        0x22000000, 0x21800000, 0x21800000, 0x21000000,
-        0x21000000, 0x20800000, 0x20800000, 0x20000000,
-        0x20000000, 0x1f800000, 0x1f800000, 0x1f000000
-    },
-    /* data for fraction table - 4096 floats */
-    {
-        0x3504f3, 0x34f9a4, 0x34ee57, 0x34e30c, 0x34d7c3, 0x34cc7c, 0x34c137, 0x34b5f5,
-        0x34aab4, 0x349f76, 0x34943a, 0x348900, 0x347dc7, 0x347291, 0x34675e, 0x345c2c,
-        0x3450fc, 0x3445ce, 0x343aa3, 0x342f79, 0x342452, 0x34192c, 0x340e09, 0x3402e8,
-        0x33f7c9, 0x33ecac, 0x33e191, 0x33d678, 0x33cb61, 0x33c04c, 0x33b539, 0x33aa28,
-        0x339f19, 0x33940d, 0x338902, 0x337df9, 0x3372f3, 0x3367ee, 0x335cec, 0x3351eb,
-        0x3346ed, 0x333bf0, 0x3330f6, 0x3325fd, 0x331b07, 0x331013, 0x330520, 0x32fa30,
-        0x32ef41, 0x32e455, 0x32d96b, 0x32ce82, 0x32c39c, 0x32b8b7, 0x32add5, 0x32a2f5,
-        0x329816, 0x328d3a, 0x32825f, 0x327787, 0x326cb0, 0x3261dc, 0x325709, 0x324c38,
-        0x32416a, 0x32369d, 0x322bd2, 0x32210a, 0x321643, 0x320b7e, 0x3200bb, 0x31f5fa,
-        0x31eb3b, 0x31e07e, 0x31d5c3, 0x31cb0a, 0x31c053, 0x31b59d, 0x31aaea, 0x31a038,
-        0x319589, 0x318adb, 0x318030, 0x317586, 0x316ade, 0x316038, 0x315594, 0x314af2,
-        0x314052, 0x3135b4, 0x312b18, 0x31207d, 0x3115e5, 0x310b4e, 0x3100b9, 0x30f627,
-        0x30eb96, 0x30e107, 0x30d67a, 0x30cbee, 0x30c165, 0x30b6dd, 0x30ac58, 0x30a1d4,
-        0x309752, 0x308cd2, 0x308254, 0x3077d8, 0x306d5e, 0x3062e5, 0x30586e, 0x304dfa,
-        0x304387, 0x303916, 0x302ea7, 0x302439, 0x3019ce, 0x300f64, 0x3004fc, 0x2ffa96,
-        0x2ff032, 0x2fe5d0, 0x2fdb6f, 0x2fd111, 0x2fc6b4, 0x2fbc59, 0x2fb200, 0x2fa7a9,
-        0x2f9d53, 0x2f9300, 0x2f88ae, 0x2f7e5e, 0x2f7410, 0x2f69c3, 0x2f5f79, 0x2f5530,
-        0x2f4ae9, 0x2f40a4, 0x2f3661, 0x2f2c1f, 0x2f21df, 0x2f17a1, 0x2f0d65, 0x2f032b,
-        0x2ef8f2, 0x2eeebc, 0x2ee487, 0x2eda53, 0x2ed022, 0x2ec5f2, 0x2ebbc5, 0x2eb199,
-        0x2ea76e, 0x2e9d46, 0x2e931f, 0x2e88fa, 0x2e7ed7, 0x2e74b5, 0x2e6a96, 0x2e6078,
-        0x2e565c, 0x2e4c41, 0x2e4229, 0x2e3812, 0x2e2dfd, 0x2e23e9, 0x2e19d8, 0x2e0fc8,
-        0x2e05ba, 0x2dfbad, 0x2df1a3, 0x2de79a, 0x2ddd93, 0x2dd38d, 0x2dc989, 0x2dbf87,
-        0x2db587, 0x2dab89, 0x2da18c, 0x2d9791, 0x2d8d97, 0x2d83a0, 0x2d79aa, 0x2d6fb6,
-        0x2d65c3, 0x2d5bd2, 0x2d51e3, 0x2d47f6, 0x2d3e0a, 0x2d3420, 0x2d2a38, 0x2d2051,
-        0x2d166c, 0x2d0c89, 0x2d02a8, 0x2cf8c8, 0x2ceeea, 0x2ce50d, 0x2cdb33, 0x2cd15a,
-        0x2cc782, 0x2cbdad, 0x2cb3d9, 0x2caa06, 0x2ca036, 0x2c9667, 0x2c8c99, 0x2c82ce,
-        0x2c7904, 0x2c6f3b, 0x2c6575, 0x2c5bb0, 0x2c51ed, 0x2c482b, 0x2c3e6b, 0x2c34ad,
-        0x2c2af0, 0x2c2135, 0x2c177b, 0x2c0dc4, 0x2c040e, 0x2bfa59, 0x2bf0a6, 0x2be6f5,
-        0x2bdd46, 0x2bd398, 0x2bc9eb, 0x2bc041, 0x2bb698, 0x2bacf0, 0x2ba34b, 0x2b99a6,
-        0x2b9004, 0x2b8663, 0x2b7cc4, 0x2b7326, 0x2b698a, 0x2b5ff0, 0x2b5657, 0x2b4cc0,
-        0x2b432a, 0x2b3996, 0x2b3004, 0x2b2673, 0x2b1ce4, 0x2b1357, 0x2b09cb, 0x2b0040,
-        0x2af6b7, 0x2aed30, 0x2ae3ab, 0x2ada27, 0x2ad0a4, 0x2ac724, 0x2abda4, 0x2ab427,
-        0x2aaaab, 0x2aa130, 0x2a97b7, 0x2a8e40, 0x2a84ca, 0x2a7b56, 0x2a71e3, 0x2a6872,
-        0x2a5f03, 0x2a5595, 0x2a4c29, 0x2a42be, 0x2a3955, 0x2a2fed, 0x2a2687, 0x2a1d23,
-        0x2a13c0, 0x2a0a5e, 0x2a00fe, 0x29f7a0, 0x29ee43, 0x29e4e8, 0x29db8e, 0x29d236,
-        0x29c8e0, 0x29bf8b, 0x29b637, 0x29ace5, 0x29a395, 0x299a46, 0x2990f8, 0x2987ad,
-        0x297e62, 0x297519, 0x296bd2, 0x29628c, 0x295948, 0x295005, 0x2946c4, 0x293d85,
-        0x293446, 0x292b0a, 0x2921cf, 0x291895, 0x290f5d, 0x290626, 0x28fcf1, 0x28f3be,
-        0x28ea8c, 0x28e15b, 0x28d82c, 0x28cefe, 0x28c5d2, 0x28bca8, 0x28b37f, 0x28aa57,
-        0x28a131, 0x28980c, 0x288ee9, 0x2885c7, 0x287ca7, 0x287389, 0x286a6b, 0x286150,
-        0x285835, 0x284f1c, 0x284605, 0x283cef, 0x2833db, 0x282ac8, 0x2821b7, 0x2818a7,
-        0x280f98, 0x28068b, 0x27fd80, 0x27f475, 0x27eb6d, 0x27e266, 0x27d960, 0x27d05c,
-        0x27c759, 0x27be57, 0x27b557, 0x27ac59, 0x27a35c, 0x279a60, 0x279166, 0x27886d,
-        0x277f76, 0x277680, 0x276d8c, 0x276499, 0x275ba7, 0x2752b7, 0x2749c9, 0x2740db,
-        0x2737f0, 0x272f05, 0x27261c, 0x271d35, 0x27144f, 0x270b6a, 0x270287, 0x26f9a5,
-        0x26f0c4, 0x26e7e5, 0x26df08, 0x26d62c, 0x26cd51, 0x26c477, 0x26bba0, 0x26b2c9,
-        0x26a9f4, 0x26a120, 0x26984e, 0x268f7d, 0x2686ad, 0x267ddf, 0x267512, 0x266c47,
-        0x26637d, 0x265ab4, 0x2651ed, 0x264927, 0x264063, 0x2637a0, 0x262ede, 0x26261e,
-        0x261d5f, 0x2614a2, 0x260be6, 0x26032b, 0x25fa72, 0x25f1ba, 0x25e903, 0x25e04e,
-        0x25d79a, 0x25cee7, 0x25c636, 0x25bd87, 0x25b4d8, 0x25ac2b, 0x25a37f, 0x259ad5,
-        0x25922c, 0x258985, 0x2580de, 0x257839, 0x256f96, 0x2566f4, 0x255e53, 0x2555b3,
-        0x254d15, 0x254479, 0x253bdd, 0x253343, 0x252aaa, 0x252213, 0x25197d, 0x2510e8,
-        0x250855, 0x24ffc3, 0x24f732, 0x24eea3, 0x24e615, 0x24dd88, 0x24d4fc, 0x24cc72,
-        0x24c3ea, 0x24bb62, 0x24b2dc, 0x24aa57, 0x24a1d4, 0x249952, 0x2490d1, 0x248852,
-        0x247fd3, 0x247756, 0x246edb, 0x246661, 0x245de8, 0x245570, 0x244cfa, 0x244485,
-        0x243c11, 0x24339f, 0x242b2e, 0x2422be, 0x241a4f, 0x2411e2, 0x240976, 0x24010c,
-        0x23f8a2, 0x23f03a, 0x23e7d4, 0x23df6e, 0x23d70a, 0x23cea7, 0x23c646, 0x23bde6,
-        0x23b587, 0x23ad29, 0x23a4cc, 0x239c71, 0x239417, 0x238bbf, 0x238368, 0x237b12,
-        0x2372bd, 0x236a69, 0x236217, 0x2359c6, 0x235177, 0x234928, 0x2340db, 0x23388f,
-        0x233045, 0x2327fb, 0x231fb3, 0x23176c, 0x230f27, 0x2306e2, 0x22fe9f, 0x22f65e,
-        0x22ee1d, 0x22e5de, 0x22dda0, 0x22d563, 0x22cd28, 0x22c4ed, 0x22bcb4, 0x22b47c,
-        0x22ac46, 0x22a411, 0x229bdd, 0x2293aa, 0x228b78, 0x228348, 0x227b19, 0x2272eb,
-        0x226abe, 0x226293, 0x225a69, 0x225240, 0x224a18, 0x2241f2, 0x2239cc, 0x2231a8,
-        0x222985, 0x222164, 0x221944, 0x221124, 0x220907, 0x2200ea, 0x21f8ce, 0x21f0b4,
-        0x21e89b, 0x21e083, 0x21d86d, 0x21d057, 0x21c843, 0x21c030, 0x21b81e, 0x21b00e,
-        0x21a7fe, 0x219ff0, 0x2197e3, 0x218fd8, 0x2187cd, 0x217fc4, 0x2177bc, 0x216fb5,
-        0x2167af, 0x215faa, 0x2157a7, 0x214fa5, 0x2147a4, 0x213fa4, 0x2137a5, 0x212fa8,
-        0x2127ac, 0x211fb1, 0x2117b7, 0x210fbe, 0x2107c7, 0x20ffd0, 0x20f7db, 0x20efe7,
-        0x20e7f5, 0x20e003, 0x20d813, 0x20d023, 0x20c835, 0x20c048, 0x20b85d, 0x20b072,
-        0x20a889, 0x20a0a1, 0x2098ba, 0x2090d4, 0x2088ef, 0x20810b, 0x207929, 0x207148,
-        0x206968, 0x206189, 0x2059ab, 0x2051cf, 0x2049f3, 0x204219, 0x203a40, 0x203268,
-        0x202a91, 0x2022bb, 0x201ae7, 0x201313, 0x200b41, 0x200370, 0x1ffba0, 0x1ff3d1,
-        0x1fec04, 0x1fe437, 0x1fdc6c, 0x1fd4a2, 0x1fccd9, 0x1fc511, 0x1fbd4a, 0x1fb584,
-        0x1fadc0, 0x1fa5fc, 0x1f9e3a, 0x1f9679, 0x1f8eb9, 0x1f86fa, 0x1f7f3c, 0x1f777f,
-        0x1f6fc4, 0x1f680a, 0x1f6050, 0x1f5898, 0x1f50e1, 0x1f492b, 0x1f4176, 0x1f39c3,
-        0x1f3210, 0x1f2a5f, 0x1f22af, 0x1f1aff, 0x1f1351, 0x1f0ba4, 0x1f03f8, 0x1efc4e,
-        0x1ef4a4, 0x1eecfb, 0x1ee554, 0x1eddae, 0x1ed608, 0x1ece64, 0x1ec6c1, 0x1ebf1f,
-        0x1eb77f, 0x1eafdf, 0x1ea840, 0x1ea0a3, 0x1e9906, 0x1e916b, 0x1e89d1, 0x1e8238,
-        0x1e7aa0, 0x1e7309, 0x1e6b73, 0x1e63de, 0x1e5c4a, 0x1e54b8, 0x1e4d26, 0x1e4596,
-        0x1e3e06, 0x1e3678, 0x1e2eeb, 0x1e275f, 0x1e1fd4, 0x1e184a, 0x1e10c1, 0x1e0939,
-        0x1e01b3, 0x1dfa2d, 0x1df2a8, 0x1deb25, 0x1de3a2, 0x1ddc21, 0x1dd4a1, 0x1dcd22,
-        0x1dc5a3, 0x1dbe26, 0x1db6aa, 0x1daf2f, 0x1da7b6, 0x1da03d, 0x1d98c5, 0x1d914e,
-        0x1d89d9, 0x1d8264, 0x1d7af1, 0x1d737e, 0x1d6c0d, 0x1d649c, 0x1d5d2d, 0x1d55bf,
-        0x1d4e52, 0x1d46e5, 0x1d3f7a, 0x1d3810, 0x1d30a7, 0x1d293f, 0x1d21d8, 0x1d1a73,
-        0x1d130e, 0x1d0baa, 0x1d0447, 0x1cfce6, 0x1cf585, 0x1cee25, 0x1ce6c7, 0x1cdf69,
-        0x1cd80d, 0x1cd0b1, 0x1cc957, 0x1cc1fe, 0x1cbaa5, 0x1cb34e, 0x1cabf8, 0x1ca4a2,
-        0x1c9d4e, 0x1c95fb, 0x1c8ea9, 0x1c8758, 0x1c8008, 0x1c78b8, 0x1c716a, 0x1c6a1d,
-        0x1c62d1, 0x1c5b86, 0x1c543c, 0x1c4cf3, 0x1c45ab, 0x1c3e65, 0x1c371f, 0x1c2fda,
-        0x1c2896, 0x1c2153, 0x1c1a11, 0x1c12d0, 0x1c0b90, 0x1c0452, 0x1bfd14, 0x1bf5d7,
-        0x1bee9b, 0x1be760, 0x1be027, 0x1bd8ee, 0x1bd1b6, 0x1bca7f, 0x1bc349, 0x1bbc15,
-        0x1bb4e1, 0x1badae, 0x1ba67c, 0x1b9f4c, 0x1b981c, 0x1b90ed, 0x1b89bf, 0x1b8292,
-        0x1b7b67, 0x1b743c, 0x1b6d12, 0x1b65e9, 0x1b5ec1, 0x1b579a, 0x1b5074, 0x1b4950,
-        0x1b422c, 0x1b3b09, 0x1b33e7, 0x1b2cc6, 0x1b25a6, 0x1b1e87, 0x1b1769, 0x1b104c,
-        0x1b0930, 0x1b0215, 0x1afafb, 0x1af3e2, 0x1aecc9, 0x1ae5b2, 0x1ade9c, 0x1ad787,
-        0x1ad073, 0x1ac95f, 0x1ac24d, 0x1abb3c, 0x1ab42b, 0x1aad1c, 0x1aa60d, 0x1a9f00,
-        0x1a97f3, 0x1a90e8, 0x1a89dd, 0x1a82d4, 0x1a7bcb, 0x1a74c3, 0x1a6dbd, 0x1a66b7,
-        0x1a5fb2, 0x1a58ae, 0x1a51ab, 0x1a4aa9, 0x1a43a8, 0x1a3ca8, 0x1a35a9, 0x1a2eab,
-        0x1a27ae, 0x1a20b1, 0x1a19b6, 0x1a12bc, 0x1a0bc2, 0x1a04ca, 0x19fdd2, 0x19f6dc,
-        0x19efe6, 0x19e8f2, 0x19e1fe, 0x19db0b, 0x19d419, 0x19cd28, 0x19c638, 0x19bf49,
-        0x19b85b, 0x19b16e, 0x19aa82, 0x19a396, 0x199cac, 0x1995c3, 0x198eda, 0x1987f3,
-        0x19810c, 0x197a26, 0x197342, 0x196c5e, 0x19657b, 0x195e99, 0x1957b8, 0x1950d8,
-        0x1949f8, 0x19431a, 0x193c3d, 0x193560, 0x192e85, 0x1927aa, 0x1920d1, 0x1919f8,
-        0x191320, 0x190c49, 0x190573, 0x18fe9e, 0x18f7ca, 0x18f0f7, 0x18ea24, 0x18e353,
-        0x18dc82, 0x18d5b3, 0x18cee4, 0x18c816, 0x18c149, 0x18ba7d, 0x18b3b2, 0x18ace8,
-        0x18a61f, 0x189f56, 0x18988f, 0x1891c8, 0x188b03, 0x18843e, 0x187d7a, 0x1876b7,
-        0x186ff5, 0x186934, 0x186274, 0x185bb4, 0x1854f6, 0x184e38, 0x18477c, 0x1840c0,
-        0x183a05, 0x18334b, 0x182c92, 0x1825da, 0x181f23, 0x18186c, 0x1811b7, 0x180b02,
-        0x18044e, 0x17fd9b, 0x17f6e9, 0x17f038, 0x17e988, 0x17e2d9, 0x17dc2a, 0x17d57d,
-        0x17ced0, 0x17c824, 0x17c179, 0x17bacf, 0x17b426, 0x17ad7e, 0x17a6d6, 0x17a030,
-        0x17998a, 0x1792e5, 0x178c41, 0x17859e, 0x177efc, 0x17785b, 0x1771ba, 0x176b1b,
-        0x17647c, 0x175dde, 0x175741, 0x1750a5, 0x174a0a, 0x17436f, 0x173cd6, 0x17363d,
-        0x172fa5, 0x17290f, 0x172278, 0x171be3, 0x17154f, 0x170ebb, 0x170829, 0x170197,
-        0x16fb06, 0x16f476, 0x16ede7, 0x16e759, 0x16e0cb, 0x16da3e, 0x16d3b3, 0x16cd28,
-        0x16c69e, 0x16c014, 0x16b98c, 0x16b305, 0x16ac7e, 0x16a5f8, 0x169f73, 0x1698ef,
-        0x16926c, 0x168be9, 0x168568, 0x167ee7, 0x167867, 0x1671e8, 0x166b6a, 0x1664ec,
-        0x165e70, 0x1657f4, 0x165179, 0x164aff, 0x164486, 0x163e0d, 0x163796, 0x16311f,
-        0x162aa9, 0x162434, 0x161dc0, 0x16174d, 0x1610da, 0x160a68, 0x1603f8, 0x15fd88,
-        0x15f718, 0x15f0aa, 0x15ea3c, 0x15e3d0, 0x15dd64, 0x15d6f9, 0x15d08e, 0x15ca25,
-        0x15c3bc, 0x15bd55, 0x15b6ee, 0x15b087, 0x15aa22, 0x15a3be, 0x159d5a, 0x1596f7,
-        0x159095, 0x158a34, 0x1583d3, 0x157d74, 0x157715, 0x1570b7, 0x156a5a, 0x1563fd,
-        0x155da2, 0x155747, 0x1550ed, 0x154a94, 0x15443c, 0x153de4, 0x15378e, 0x153138,
-        0x152ae3, 0x15248e, 0x151e3b, 0x1517e8, 0x151197, 0x150b45, 0x1504f5, 0x14fea6,
-        0x14f857, 0x14f209, 0x14ebbc, 0x14e570, 0x14df25, 0x14d8da, 0x14d290, 0x14cc47,
-        0x14c5ff, 0x14bfb7, 0x14b971, 0x14b32b, 0x14ace6, 0x14a6a1, 0x14a05e, 0x149a1b,
-        0x1493d9, 0x148d98, 0x148758, 0x148118, 0x147ada, 0x14749c, 0x146e5f, 0x146822,
-        0x1461e7, 0x145bac, 0x145572, 0x144f38, 0x144900, 0x1442c8, 0x143c91, 0x14365b,
-        0x143026, 0x1429f1, 0x1423be, 0x141d8b, 0x141758, 0x141127, 0x140af6, 0x1404c6,
-        0x13fe97, 0x13f869, 0x13f23b, 0x13ec0f, 0x13e5e3, 0x13dfb7, 0x13d98d, 0x13d363,
-        0x13cd3a, 0x13c712, 0x13c0eb, 0x13bac4, 0x13b49e, 0x13ae79, 0x13a855, 0x13a231,
-        0x139c0e, 0x1395ec, 0x138fcb, 0x1389ab, 0x13838b, 0x137d6c, 0x13774e, 0x137130,
-        0x136b13, 0x1364f8, 0x135edc, 0x1358c2, 0x1352a8, 0x134c8f, 0x134677, 0x134060,
-        0x133a49, 0x133433, 0x132e1e, 0x13280a, 0x1321f6, 0x131be3, 0x1315d1, 0x130fc0,
-        0x1309af, 0x13039f, 0x12fd90, 0x12f782, 0x12f174, 0x12eb67, 0x12e55b, 0x12df50,
-        0x12d945, 0x12d33b, 0x12cd32, 0x12c72a, 0x12c122, 0x12bb1b, 0x12b515, 0x12af10,
-        0x12a90b, 0x12a307, 0x129d04, 0x129702, 0x129100, 0x128aff, 0x1284ff, 0x127eff,
-        0x127900, 0x127302, 0x126d05, 0x126708, 0x12610d, 0x125b11, 0x125517, 0x124f1d,
-        0x124925, 0x12432c, 0x123d35, 0x12373e, 0x123148, 0x122b53, 0x12255e, 0x121f6b,
-        0x121978, 0x121385, 0x120d94, 0x1207a3, 0x1201b3, 0x11fbc3, 0x11f5d4, 0x11efe6,
-        0x11e9f9, 0x11e40d, 0x11de21, 0x11d836, 0x11d24b, 0x11cc62, 0x11c679, 0x11c090,
-        0x11baa9, 0x11b4c2, 0x11aedc, 0x11a8f7, 0x11a312, 0x119d2e, 0x11974b, 0x119168,
-        0x118b87, 0x1185a6, 0x117fc5, 0x1179e5, 0x117407, 0x116e28, 0x11684b, 0x11626e,
-        0x115c92, 0x1156b6, 0x1150dc, 0x114b02, 0x114529, 0x113f50, 0x113978, 0x1133a1,
-        0x112dca, 0x1127f5, 0x112220, 0x111c4b, 0x111678, 0x1110a5, 0x110ad3, 0x110501,
-        0x10ff30, 0x10f960, 0x10f391, 0x10edc2, 0x10e7f4, 0x10e226, 0x10dc5a, 0x10d68e,
-        0x10d0c3, 0x10caf8, 0x10c52e, 0x10bf65, 0x10b99c, 0x10b3d5, 0x10ae0e, 0x10a847,
-        0x10a281, 0x109cbc, 0x1096f8, 0x109134, 0x108b72, 0x1085af, 0x107fee, 0x107a2d,
-        0x10746d, 0x106ead, 0x1068ee, 0x106330, 0x105d73, 0x1057b6, 0x1051fa, 0x104c3e,
-        0x104684, 0x1040ca, 0x103b10, 0x103558, 0x102fa0, 0x1029e8, 0x102432, 0x101e7c,
-        0x1018c6, 0x101312, 0x100d5e, 0x1007ab, 0x1001f8, 0xffc46, 0xff695, 0xff0e4,
-        0xfeb35, 0xfe585, 0xfdfd7, 0xfda29, 0xfd47c, 0xfcecf, 0xfc923, 0xfc378,
-        0xfbdce, 0xfb824, 0xfb27b, 0xfacd2, 0xfa72a, 0xfa183, 0xf9bdd, 0xf9637,
-        0xf9092, 0xf8aed, 0xf854a, 0xf7fa6, 0xf7a04, 0xf7462, 0xf6ec1, 0xf6920,
-        0xf6381, 0xf5de1, 0xf5843, 0xf52a5, 0xf4d08, 0xf476b, 0xf41cf, 0xf3c34,
-        0xf369a, 0xf3100, 0xf2b66, 0xf25ce, 0xf2036, 0xf1a9f, 0xf1508, 0xf0f72,
-        0xf09dd, 0xf0448, 0xefeb4, 0xef921, 0xef38e, 0xeedfc, 0xee86b, 0xee2da,
-        0xedd4a, 0xed7ba, 0xed22b, 0xecc9d, 0xec710, 0xec183, 0xebbf7, 0xeb66b,
-        0xeb0e0, 0xeab56, 0xea5cc, 0xea043, 0xe9abb, 0xe9533, 0xe8fac, 0xe8a26,
-        0xe84a0, 0xe7f1b, 0xe7996, 0xe7413, 0xe6e8f, 0xe690d, 0xe638b, 0xe5e0a,
-        0xe5889, 0xe5309, 0xe4d8a, 0xe480b, 0xe428d, 0xe3d0f, 0xe3792, 0xe3216,
-        0xe2c9b, 0xe2720, 0xe21a5, 0xe1c2c, 0xe16b3, 0xe113a, 0xe0bc3, 0xe064c,
-        0xe00d5, 0xdfb5f, 0xdf5ea, 0xdf075, 0xdeb01, 0xde58e, 0xde01b, 0xddaa9,
-        0xdd538, 0xdcfc7, 0xdca57, 0xdc4e7, 0xdbf78, 0xdba0a, 0xdb49c, 0xdaf2f,
-        0xda9c2, 0xda457, 0xd9eeb, 0xd9981, 0xd9417, 0xd8ead, 0xd8945, 0xd83dc,
-        0xd7e75, 0xd790e, 0xd73a8, 0xd6e42, 0xd68dd, 0xd6379, 0xd5e15, 0xd58b2,
-        0xd534f, 0xd4ded, 0xd488c, 0xd432b, 0xd3dcb, 0xd386c, 0xd330d, 0xd2dae,
-        0xd2851, 0xd22f4, 0xd1d97, 0xd183b, 0xd12e0, 0xd0d86, 0xd082c, 0xd02d2,
-        0xcfd79, 0xcf821, 0xcf2ca, 0xced73, 0xce81c, 0xce2c7, 0xcdd72, 0xcd81d,
-        0xcd2c9, 0xccd76, 0xcc823, 0xcc2d1, 0xcbd7f, 0xcb82f, 0xcb2de, 0xcad8f,
-        0xca83f, 0xca2f1, 0xc9da3, 0xc9856, 0xc9309, 0xc8dbd, 0xc8871, 0xc8326,
-        0xc7ddc, 0xc7892, 0xc7349, 0xc6e01, 0xc68b9, 0xc6372, 0xc5e2b, 0xc58e5,
-        0xc539f, 0xc4e5a, 0xc4916, 0xc43d2, 0xc3e8f, 0xc394c, 0xc340a, 0xc2ec9,
-        0xc2988, 0xc2448, 0xc1f08, 0xc19c9, 0xc148b, 0xc0f4d, 0xc0a10, 0xc04d3,
-        0xbff97, 0xbfa5b, 0xbf521, 0xbefe6, 0xbeaad, 0xbe573, 0xbe03b, 0xbdb03,
-        0xbd5cb, 0xbd095, 0xbcb5e, 0xbc629, 0xbc0f4, 0xbbbbf, 0xbb68b, 0xbb158,
-        0xbac25, 0xba6f3, 0xba1c1, 0xb9c90, 0xb9760, 0xb9230, 0xb8d01, 0xb87d2,
-        0xb82a4, 0xb7d76, 0xb7849, 0xb731d, 0xb6df1, 0xb68c6, 0xb639b, 0xb5e71,
-        0xb5948, 0xb541f, 0xb4ef6, 0xb49cf, 0xb44a7, 0xb3f81, 0xb3a5b, 0xb3535,
-        0xb3010, 0xb2aec, 0xb25c8, 0xb20a5, 0xb1b82, 0xb1660, 0xb113e, 0xb0c1d,
-        0xb06fd, 0xb01dd, 0xafcbe, 0xaf79f, 0xaf281, 0xaed64, 0xae847, 0xae32a,
-        0xade0e, 0xad8f3, 0xad3d8, 0xacebe, 0xac9a4, 0xac48b, 0xabf73, 0xaba5b,
-        0xab544, 0xab02d, 0xaab17, 0xaa601, 0xaa0ec, 0xa9bd7, 0xa96c3, 0xa91b0,
-        0xa8c9d, 0xa878a, 0xa8279, 0xa7d67, 0xa7857, 0xa7347, 0xa6e37, 0xa6928,
-        0xa641a, 0xa5f0c, 0xa59fe, 0xa54f2, 0xa4fe5, 0xa4ada, 0xa45ce, 0xa40c4,
-        0xa3bba, 0xa36b0, 0xa31a7, 0xa2c9f, 0xa2797, 0xa2290, 0xa1d89, 0xa1883,
-        0xa137d, 0xa0e78, 0xa0974, 0xa0470, 0x9ff6c, 0x9fa69, 0x9f567, 0x9f065,
-        0x9eb64, 0x9e663, 0x9e163, 0x9dc63, 0x9d764, 0x9d266, 0x9cd68, 0x9c86a,
-        0x9c36d, 0x9be71, 0x9b975, 0x9b47a, 0x9af7f, 0x9aa85, 0x9a58b, 0x9a092,
-        0x99b9a, 0x996a1, 0x991aa, 0x98cb3, 0x987bd, 0x982c7, 0x97dd1, 0x978dc,
-        0x973e8, 0x96ef4, 0x96a01, 0x9650e, 0x9601c, 0x95b2b, 0x9563a, 0x95149,
-        0x94c59, 0x94769, 0x9427a, 0x93d8c, 0x9389e, 0x933b1, 0x92ec4, 0x929d8,
-        0x924ec, 0x92001, 0x91b16, 0x9162c, 0x91142, 0x90c59, 0x90770, 0x90288,
-        0x8fda1, 0x8f8ba, 0x8f3d3, 0x8eeed, 0x8ea08, 0x8e523, 0x8e03e, 0x8db5b,
-        0x8d677, 0x8d194, 0x8ccb2, 0x8c7d0, 0x8c2ef, 0x8be0e, 0x8b92e, 0x8b44e,
-        0x8af6f, 0x8aa91, 0x8a5b2, 0x8a0d5, 0x89bf8, 0x8971b, 0x8923f, 0x88d64,
-        0x88889, 0x883ae, 0x87ed4, 0x879fb, 0x87522, 0x87049, 0x86b71, 0x8669a,
-        0x861c3, 0x85ced, 0x85817, 0x85341, 0x84e6d, 0x84998, 0x844c5, 0x83ff1,
-        0x83b1e, 0x8364c, 0x8317a, 0x82ca9, 0x827d8, 0x82308, 0x81e39, 0x81969,
-        0x8149b, 0x80fcd, 0x80aff, 0x80632, 0x80165, 0x7fc99, 0x7f7cd, 0x7f302,
-        0x7ee37, 0x7e96d, 0x7e4a4, 0x7dfdb, 0x7db12, 0x7d64a, 0x7d182, 0x7ccbb,
-        0x7c7f5, 0x7c32f, 0x7be69, 0x7b9a4, 0x7b4df, 0x7b01b, 0x7ab58, 0x7a695,
-        0x7a1d2, 0x79d10, 0x7984f, 0x7938e, 0x78ecd, 0x78a0d, 0x7854d, 0x7808e,
-        0x77bd0, 0x77712, 0x77254, 0x76d97, 0x768da, 0x7641e, 0x75f63, 0x75aa8,
-        0x755ed, 0x75133, 0x74c79, 0x747c0, 0x74308, 0x73e50, 0x73998, 0x734e1,
-        0x7302a, 0x72b74, 0x726be, 0x72209, 0x71d55, 0x718a0, 0x713ed, 0x70f3a,
-        0x70a87, 0x705d5, 0x70123, 0x6fc72, 0x6f7c1, 0x6f311, 0x6ee61, 0x6e9b2,
-        0x6e503, 0x6e055, 0x6dba7, 0x6d6f9, 0x6d24d, 0x6cda0, 0x6c8f4, 0x6c449,
-        0x6bf9e, 0x6baf4, 0x6b64a, 0x6b1a0, 0x6acf7, 0x6a84f, 0x6a3a7, 0x69eff,
-        0x69a58, 0x695b2, 0x6910c, 0x68c66, 0x687c1, 0x6831d, 0x67e78, 0x679d5,
-        0x67532, 0x6708f, 0x66bed, 0x6674b, 0x662aa, 0x65e09, 0x65969, 0x654c9,
-        0x65029, 0x64b8a, 0x646ec, 0x6424e, 0x63db1, 0x63914, 0x63477, 0x62fdb,
-        0x62b40, 0x626a5, 0x6220a, 0x61d70, 0x618d6, 0x6143d, 0x60fa4, 0x60b0c,
-        0x60674, 0x601dd, 0x5fd46, 0x5f8b0, 0x5f41a, 0x5ef85, 0x5eaf0, 0x5e65b,
-        0x5e1c7, 0x5dd34, 0x5d8a1, 0x5d40e, 0x5cf7c, 0x5caea, 0x5c659, 0x5c1c9,
-        0x5bd38, 0x5b8a9, 0x5b419, 0x5af8a, 0x5aafc, 0x5a66e, 0x5a1e1, 0x59d54,
-        0x598c7, 0x5943b, 0x58fb0, 0x58b24, 0x5869a, 0x58210, 0x57d86, 0x578fd,
-        0x57474, 0x56feb, 0x56b64, 0x566dc, 0x56255, 0x55dcf, 0x55949, 0x554c3,
-        0x5503e, 0x54bb9, 0x54735, 0x542b1, 0x53e2e, 0x539ab, 0x53529, 0x530a7,
-        0x52c25, 0x527a4, 0x52324, 0x51ea4, 0x51a24, 0x515a5, 0x51126, 0x50ca8,
-        0x5082a, 0x503ad, 0x4ff30, 0x4fab4, 0x4f638, 0x4f1bc, 0x4ed41, 0x4e8c6,
-        0x4e44c, 0x4dfd3, 0x4db59, 0x4d6e0, 0x4d268, 0x4cdf0, 0x4c979, 0x4c502,
-        0x4c08b, 0x4bc15, 0x4b79f, 0x4b32a, 0x4aeb5, 0x4aa41, 0x4a5cd, 0x4a15a,
-        0x49ce7, 0x49874, 0x49402, 0x48f91, 0x48b1f, 0x486af, 0x4823e, 0x47dce,
-        0x4795f, 0x474f0, 0x47082, 0x46c14, 0x467a6, 0x46339, 0x45ecc, 0x45a60,
-        0x455f4, 0x45189, 0x44d1e, 0x448b3, 0x44449, 0x43fdf, 0x43b76, 0x4370d,
-        0x432a5, 0x42e3d, 0x429d6, 0x4256f, 0x42108, 0x41ca2, 0x4183c, 0x413d7,
-        0x40f72, 0x40b0e, 0x406aa, 0x40247, 0x3fde4, 0x3f981, 0x3f51f, 0x3f0bd,
-        0x3ec5c, 0x3e7fb, 0x3e39b, 0x3df3b, 0x3dadb, 0x3d67c, 0x3d21d, 0x3cdbf,
-        0x3c961, 0x3c504, 0x3c0a7, 0x3bc4a, 0x3b7ee, 0x3b393, 0x3af37, 0x3aadd,
-        0x3a682, 0x3a228, 0x39dcf, 0x39976, 0x3951d, 0x390c5, 0x38c6d, 0x38816,
-        0x383bf, 0x37f69, 0x37b13, 0x376bd, 0x37268, 0x36e13, 0x369bf, 0x3656b,
-        0x36117, 0x35cc4, 0x35872, 0x3541f, 0x34fce, 0x34b7c, 0x3472b, 0x342db,
-        0x33e8b, 0x33a3b, 0x335ec, 0x3319d, 0x32d4f, 0x32901, 0x324b3, 0x32066,
-        0x31c1a, 0x317cd, 0x31381, 0x30f36, 0x30aeb, 0x306a1, 0x30256, 0x2fe0d,
-        0x2f9c3, 0x2f57a, 0x2f132, 0x2ecea, 0x2e8a2, 0x2e45b, 0x2e014, 0x2dbce,
-        0x2d788, 0x2d343, 0x2cefd, 0x2cab9, 0x2c675, 0x2c231, 0x2bded, 0x2b9aa,
-        0x2b568, 0x2b125, 0x2ace4, 0x2a8a2, 0x2a461, 0x2a021, 0x29be1, 0x297a1,
-        0x29362, 0x28f23, 0x28ae4, 0x286a6, 0x28269, 0x27e2c, 0x279ef, 0x275b2,
-        0x27176, 0x26d3b, 0x26900, 0x264c5, 0x2608b, 0x25c51, 0x25817, 0x253de,
-        0x24fa6, 0x24b6d, 0x24735, 0x242fe, 0x23ec7, 0x23a90, 0x2365a, 0x23224,
-        0x22def, 0x229ba, 0x22585, 0x22151, 0x21d1d, 0x218ea, 0x214b7, 0x21084,
-        0x20c52, 0x20821, 0x203ef, 0x1ffbe, 0x1fb8e, 0x1f75e, 0x1f32e, 0x1eeff,
-        0x1ead0, 0x1e6a1, 0x1e273, 0x1de45, 0x1da18, 0x1d5eb, 0x1d1bf, 0x1cd93,
-        0x1c967, 0x1c53c, 0x1c111, 0x1bce6, 0x1b8bc, 0x1b493, 0x1b069, 0x1ac40,
-        0x1a818, 0x1a3f0, 0x19fc8, 0x19ba1, 0x1977a, 0x19354, 0x18f2d, 0x18b08,
-        0x186e2, 0x182be, 0x17e99, 0x17a75, 0x17651, 0x1722e, 0x16e0b, 0x169e9,
-        0x165c6, 0x161a5, 0x15d83, 0x15963, 0x15542, 0x15122, 0x14d02, 0x148e3,
-        0x144c4, 0x140a5, 0x13c87, 0x13869, 0x1344c, 0x1302f, 0x12c12, 0x127f6,
-        0x123da, 0x11fbf, 0x11ba4, 0x11789, 0x1136f, 0x10f55, 0x10b3c, 0x10723,
-        0x1030a, 0xfef2, 0xfada, 0xf6c2, 0xf2ab, 0xee95, 0xea7e, 0xe668,
-        0xe253, 0xde3e, 0xda29, 0xd614, 0xd200, 0xcded, 0xc9da, 0xc5c7,
-        0xc1b4, 0xbda2, 0xb990, 0xb57f, 0xb16e, 0xad5e, 0xa94e, 0xa53e,
-        0xa12e, 0x9d1f, 0x9911, 0x9503, 0x90f5, 0x8ce7, 0x88da, 0x84ce,
-        0x80c1, 0x7cb5, 0x78aa, 0x749f, 0x7094, 0x6c89, 0x687f, 0x6476,
-        0x606d, 0x5c64, 0x585b, 0x5453, 0x504b, 0x4c44, 0x483d, 0x4436,
-        0x4030, 0x3c2a, 0x3825, 0x3420, 0x301b, 0x2c17, 0x2813, 0x240f,
-        0x200c, 0x1c09, 0x1807, 0x1405, 0x1003, 0xc02, 0x801, 0x400,
-        0x7fffff, 0x7ff001, 0x7fe006, 0x7fd00d, 0x7fc018, 0x7fb025, 0x7fa036, 0x7f9049,
-        0x7f8060, 0x7f7079, 0x7f6095, 0x7f50b5, 0x7f40d7, 0x7f30fc, 0x7f2124, 0x7f114f,
-        0x7f017e, 0x7ef1af, 0x7ee1e2, 0x7ed219, 0x7ec253, 0x7eb290, 0x7ea2d0, 0x7e9312,
-        0x7e8358, 0x7e73a0, 0x7e63eb, 0x7e543a, 0x7e448b, 0x7e34df, 0x7e2536, 0x7e1590,
-        0x7e05ec, 0x7df64c, 0x7de6ae, 0x7dd714, 0x7dc77c, 0x7db7e7, 0x7da855, 0x7d98c6,
-        0x7d893a, 0x7d79b0, 0x7d6a2a, 0x7d5aa6, 0x7d4b25, 0x7d3ba7, 0x7d2c2c, 0x7d1cb3,
-        0x7d0d3e, 0x7cfdcb, 0x7cee5b, 0x7cdeee, 0x7ccf84, 0x7cc01d, 0x7cb0b8, 0x7ca156,
-        0x7c91f7, 0x7c829b, 0x7c7342, 0x7c63eb, 0x7c5497, 0x7c4546, 0x7c35f8, 0x7c26ad,
-        0x7c1764, 0x7c081e, 0x7bf8db, 0x7be99b, 0x7bda5d, 0x7bcb23, 0x7bbbeb, 0x7bacb5,
-        0x7b9d83, 0x7b8e53, 0x7b7f26, 0x7b6ffc, 0x7b60d4, 0x7b51b0, 0x7b428e, 0x7b336e,
-        0x7b2452, 0x7b1538, 0x7b0621, 0x7af70c, 0x7ae7fb, 0x7ad8ec, 0x7ac9e0, 0x7abad6,
-        0x7aabcf, 0x7a9ccb, 0x7a8dca, 0x7a7ecb, 0x7a6fcf, 0x7a60d5, 0x7a51df, 0x7a42eb,
-        0x7a33f9, 0x7a250b, 0x7a161f, 0x7a0735, 0x79f84f, 0x79e96b, 0x79da89, 0x79cbab,
-        0x79bccf, 0x79adf5, 0x799f1f, 0x79904a, 0x798179, 0x7972aa, 0x7963de, 0x795515,
-        0x79464e, 0x793789, 0x7928c8, 0x791a09, 0x790b4c, 0x78fc92, 0x78eddb, 0x78df27,
-        0x78d075, 0x78c1c5, 0x78b319, 0x78a46e, 0x7895c7, 0x788722, 0x78787f, 0x7869e0,
-        0x785b42, 0x784ca8, 0x783e10, 0x782f7a, 0x7820e7, 0x781257, 0x7803c9, 0x77f53e,
-        0x77e6b5, 0x77d82f, 0x77c9ab, 0x77bb2a, 0x77acac, 0x779e30, 0x778fb6, 0x77813f,
-        0x7772cb, 0x776459, 0x7755ea, 0x77477d, 0x773913, 0x772aab, 0x771c46, 0x770de3,
-        0x76ff83, 0x76f125, 0x76e2ca, 0x76d472, 0x76c61b, 0x76b7c8, 0x76a977, 0x769b28,
-        0x768cdc, 0x767e92, 0x76704b, 0x766206, 0x7653c4, 0x764584, 0x763747, 0x76290c,
-        0x761ad3, 0x760c9d, 0x75fe6a, 0x75f039, 0x75e20a, 0x75d3de, 0x75c5b5, 0x75b78e,
-        0x75a969, 0x759b46, 0x758d27, 0x757f09, 0x7570ee, 0x7562d6, 0x7554bf, 0x7546ac,
-        0x75389a, 0x752a8c, 0x751c7f, 0x750e75, 0x75006d, 0x74f268, 0x74e465, 0x74d665,
-        0x74c867, 0x74ba6b, 0x74ac72, 0x749e7b, 0x749087, 0x748295, 0x7474a5, 0x7466b8,
-        0x7458cd, 0x744ae4, 0x743cfe, 0x742f1a, 0x742139, 0x74135a, 0x74057d, 0x73f7a3,
-        0x73e9cb, 0x73dbf5, 0x73ce22, 0x73c051, 0x73b282, 0x73a4b6, 0x7396ec, 0x738925,
-        0x737b60, 0x736d9d, 0x735fdc, 0x73521e, 0x734462, 0x7336a9, 0x7328f1, 0x731b3c,
-        0x730d8a, 0x72ffd9, 0x72f22c, 0x72e480, 0x72d6d7, 0x72c92f, 0x72bb8b, 0x72ade8,
-        0x72a048, 0x7292aa, 0x72850f, 0x727775, 0x7269de, 0x725c4a, 0x724eb7, 0x724127,
-        0x723399, 0x72260e, 0x721884, 0x720afd, 0x71fd79, 0x71eff6, 0x71e276, 0x71d4f8,
-        0x71c77c, 0x71ba02, 0x71ac8b, 0x719f16, 0x7191a3, 0x718433, 0x7176c5, 0x716959,
-        0x715bef, 0x714e87, 0x714122, 0x7133bf, 0x71265e, 0x711900, 0x710ba3, 0x70fe49,
-        0x70f0f1, 0x70e39b, 0x70d648, 0x70c8f6, 0x70bba7, 0x70ae5a, 0x70a110, 0x7093c7,
-        0x708681, 0x70793d, 0x706bfb, 0x705ebb, 0x70517d, 0x704442, 0x703709, 0x7029d2,
-        0x701c9d, 0x700f6a, 0x70023a, 0x6ff50c, 0x6fe7e0, 0x6fdab6, 0x6fcd8e, 0x6fc068,
-        0x6fb345, 0x6fa624, 0x6f9904, 0x6f8be7, 0x6f7ecd, 0x6f71b4, 0x6f649d, 0x6f5789,
-        0x6f4a77, 0x6f3d67, 0x6f3059, 0x6f234d, 0x6f1643, 0x6f093c, 0x6efc36, 0x6eef33,
-        0x6ee232, 0x6ed533, 0x6ec836, 0x6ebb3b, 0x6eae42, 0x6ea14c, 0x6e9457, 0x6e8765,
-        0x6e7a74, 0x6e6d86, 0x6e609a, 0x6e53b0, 0x6e46c8, 0x6e39e3, 0x6e2cff, 0x6e201d,
-        0x6e133e, 0x6e0661, 0x6df985, 0x6decac, 0x6ddfd5, 0x6dd300, 0x6dc62d, 0x6db95c,
-        0x6dac8d, 0x6d9fc0, 0x6d92f5, 0x6d862d, 0x6d7966, 0x6d6ca2, 0x6d5fdf, 0x6d531f,
-        0x6d4660, 0x6d39a4, 0x6d2cea, 0x6d2032, 0x6d137c, 0x6d06c7, 0x6cfa15, 0x6ced65,
-        0x6ce0b7, 0x6cd40b, 0x6cc761, 0x6cbab9, 0x6cae14, 0x6ca170, 0x6c94ce, 0x6c882e,
-        0x6c7b90, 0x6c6ef5, 0x6c625b, 0x6c55c3, 0x6c492d, 0x6c3c9a, 0x6c3008, 0x6c2378,
-        0x6c16ea, 0x6c0a5f, 0x6bfdd5, 0x6bf14d, 0x6be4c8, 0x6bd844, 0x6bcbc2, 0x6bbf42,
-        0x6bb2c5, 0x6ba649, 0x6b99cf, 0x6b8d57, 0x6b80e2, 0x6b746e, 0x6b67fc, 0x6b5b8c,
-        0x6b4f1e, 0x6b42b2, 0x6b3648, 0x6b29e0, 0x6b1d7a, 0x6b1116, 0x6b04b4, 0x6af854,
-        0x6aebf5, 0x6adf99, 0x6ad33f, 0x6ac6e6, 0x6aba90, 0x6aae3b, 0x6aa1e9, 0x6a9598,
-        0x6a8949, 0x6a7cfd, 0x6a70b2, 0x6a6469, 0x6a5822, 0x6a4bdd, 0x6a3f9a, 0x6a3359,
-        0x6a271a, 0x6a1adc, 0x6a0ea1, 0x6a0267, 0x69f630, 0x69e9fa, 0x69ddc6, 0x69d195,
-        0x69c565, 0x69b937, 0x69ad0b, 0x69a0e0, 0x6994b8, 0x698892, 0x697c6d, 0x69704a,
-        0x69642a, 0x69580b, 0x694bee, 0x693fd3, 0x6933ba, 0x6927a2, 0x691b8d, 0x690f79,
-        0x690368, 0x68f758, 0x68eb4a, 0x68df3e, 0x68d334, 0x68c72b, 0x68bb25, 0x68af20,
-        0x68a31d, 0x68971d, 0x688b1d, 0x687f20, 0x687325, 0x68672c, 0x685b34, 0x684f3e,
-        0x68434a, 0x683758, 0x682b68, 0x681f7a, 0x68138d, 0x6807a2, 0x67fbb9, 0x67efd2,
-        0x67e3ed, 0x67d80a, 0x67cc28, 0x67c048, 0x67b46a, 0x67a88e, 0x679cb4, 0x6790dc,
-        0x678505, 0x677930, 0x676d5d, 0x67618c, 0x6755bd, 0x6749ef, 0x673e23, 0x673259,
-        0x672691, 0x671acb, 0x670f06, 0x670343, 0x66f782, 0x66ebc3, 0x66e006, 0x66d44a,
-        0x66c891, 0x66bcd8, 0x66b122, 0x66a56e, 0x6699bb, 0x668e0a, 0x66825b, 0x6676ae,
-        0x666b02, 0x665f58, 0x6653b0, 0x66480a, 0x663c66, 0x6630c3, 0x662522, 0x661983,
-        0x660de5, 0x66024a, 0x65f6b0, 0x65eb17, 0x65df81, 0x65d3ec, 0x65c859, 0x65bcc8,
-        0x65b139, 0x65a5ab, 0x659a1f, 0x658e95, 0x65830d, 0x657786, 0x656c01, 0x65607e,
-        0x6554fc, 0x65497c, 0x653dfe, 0x653282, 0x652707, 0x651b8e, 0x651017, 0x6504a2,
-        0x64f92e, 0x64edbc, 0x64e24c, 0x64d6dd, 0x64cb70, 0x64c005, 0x64b49c, 0x64a934,
-        0x649dce, 0x64926a, 0x648707, 0x647ba6, 0x647047, 0x6464ea, 0x64598e, 0x644e34,
-        0x6442db, 0x643784, 0x642c2f, 0x6420dc, 0x64158a, 0x640a3a, 0x63feec, 0x63f39f,
-        0x63e854, 0x63dd0b, 0x63d1c3, 0x63c67d, 0x63bb39, 0x63aff7, 0x63a4b6, 0x639976,
-        0x638e39, 0x6382fd, 0x6377c3, 0x636c8a, 0x636153, 0x63561e, 0x634aea, 0x633fb8,
-        0x633488, 0x632959, 0x631e2c, 0x631301, 0x6307d7, 0x62fcaf, 0x62f189, 0x62e664,
-        0x62db41, 0x62d01f, 0x62c500, 0x62b9e1, 0x62aec5, 0x62a3aa, 0x629890, 0x628d79,
-        0x628263, 0x62774e, 0x626c3b, 0x62612a, 0x62561b, 0x624b0d, 0x624000, 0x6234f6,
-        0x6229ed, 0x621ee5, 0x6213df, 0x6208db, 0x61fdd8, 0x61f2d7, 0x61e7d8, 0x61dcda,
-        0x61d1de, 0x61c6e3, 0x61bbea, 0x61b0f3, 0x61a5fd, 0x619b09, 0x619016, 0x618525,
-        0x617a36, 0x616f48, 0x61645b, 0x615971, 0x614e88, 0x6143a0, 0x6138ba, 0x612dd6,
-        0x6122f3, 0x611812, 0x610d32, 0x610254, 0x60f778, 0x60ec9d, 0x60e1c4, 0x60d6ec,
-        0x60cc16, 0x60c141, 0x60b66e, 0x60ab9c, 0x60a0cc, 0x6095fe, 0x608b31, 0x608066,
-        0x60759c, 0x606ad4, 0x60600e, 0x605549, 0x604a85, 0x603fc3, 0x603503, 0x602a44,
-        0x601f87, 0x6014cb, 0x600a11, 0x5fff58, 0x5ff4a1, 0x5fe9eb, 0x5fdf37, 0x5fd485,
-        0x5fc9d4, 0x5fbf24, 0x5fb476, 0x5fa9ca, 0x5f9f1f, 0x5f9476, 0x5f89ce, 0x5f7f28,
-        0x5f7483, 0x5f69df, 0x5f5f3e, 0x5f549d, 0x5f49ff, 0x5f3f62, 0x5f34c6, 0x5f2a2c,
-        0x5f1f93, 0x5f14fc, 0x5f0a66, 0x5effd2, 0x5ef53f, 0x5eeaae, 0x5ee01f, 0x5ed591,
-        0x5ecb04, 0x5ec079, 0x5eb5ef, 0x5eab67, 0x5ea0e0, 0x5e965b, 0x5e8bd8, 0x5e8155,
-        0x5e76d5, 0x5e6c55, 0x5e61d8, 0x5e575c, 0x5e4ce1, 0x5e4268, 0x5e37f0, 0x5e2d79,
-        0x5e2305, 0x5e1891, 0x5e0e1f, 0x5e03af, 0x5df940, 0x5deed3, 0x5de467, 0x5dd9fc,
-        0x5dcf93, 0x5dc52b, 0x5dbac5, 0x5db061, 0x5da5fd, 0x5d9b9c, 0x5d913b, 0x5d86dc,
-        0x5d7c7f, 0x5d7223, 0x5d67c9, 0x5d5d70, 0x5d5318, 0x5d48c2, 0x5d3e6d, 0x5d341a,
-        0x5d29c8, 0x5d1f78, 0x5d1529, 0x5d0adc, 0x5d0090, 0x5cf645, 0x5cebfc, 0x5ce1b4,
-        0x5cd76e, 0x5ccd29, 0x5cc2e6, 0x5cb8a4, 0x5cae63, 0x5ca424, 0x5c99e6, 0x5c8faa,
-        0x5c856f, 0x5c7b36, 0x5c70fe, 0x5c66c7, 0x5c5c92, 0x5c525e, 0x5c482c, 0x5c3dfb,
-        0x5c33cc, 0x5c299d, 0x5c1f71, 0x5c1546, 0x5c0b1c, 0x5c00f3, 0x5bf6cc, 0x5beca7,
-        0x5be282, 0x5bd85f, 0x5bce3e, 0x5bc41e, 0x5bb9ff, 0x5bafe2, 0x5ba5c6, 0x5b9bac,
-        0x5b9193, 0x5b877b, 0x5b7d65, 0x5b7350, 0x5b693d, 0x5b5f2a, 0x5b551a, 0x5b4b0a,
-        0x5b40fd, 0x5b36f0, 0x5b2ce5, 0x5b22db, 0x5b18d3, 0x5b0ecc, 0x5b04c6, 0x5afac2,
-        0x5af0bf, 0x5ae6bd, 0x5adcbd, 0x5ad2be, 0x5ac8c1, 0x5abec5, 0x5ab4ca, 0x5aaad1,
-        0x5aa0d9, 0x5a96e2, 0x5a8ced, 0x5a82f9, 0x5a7906, 0x5a6f15, 0x5a6525, 0x5a5b37,
-        0x5a514a, 0x5a475e, 0x5a3d74, 0x5a338b, 0x5a29a3, 0x5a1fbd, 0x5a15d8, 0x5a0bf4,
-        0x5a0212, 0x59f831, 0x59ee51, 0x59e473, 0x59da96, 0x59d0ba, 0x59c6e0, 0x59bd07,
-        0x59b330, 0x59a959, 0x599f84, 0x5995b1, 0x598bde, 0x59820e, 0x59783e, 0x596e70,
-        0x5964a3, 0x595ad7, 0x59510d, 0x594744, 0x593d7c, 0x5933b6, 0x5929f1, 0x59202d,
-        0x59166b, 0x590caa, 0x5902ea, 0x58f92b, 0x58ef6e, 0x58e5b3, 0x58dbf8, 0x58d23f,
-        0x58c887, 0x58bed0, 0x58b51b, 0x58ab67, 0x58a1b4, 0x589803, 0x588e53, 0x5884a4,
-        0x587af7, 0x58714b, 0x5867a0, 0x585df6, 0x58544e, 0x584aa7, 0x584101, 0x58375d,
-        0x582dba, 0x582418, 0x581a77, 0x5810d8, 0x58073a, 0x57fd9d, 0x57f402, 0x57ea68,
-        0x57e0cf, 0x57d737, 0x57cda1, 0x57c40c, 0x57ba78, 0x57b0e6, 0x57a754, 0x579dc5,
-        0x579436, 0x578aa9, 0x57811c, 0x577792, 0x576e08, 0x576480, 0x575af9, 0x575173,
-        0x5747ee, 0x573e6b, 0x5734e9, 0x572b68, 0x5721e9, 0x57186b, 0x570eee, 0x570572,
-        0x56fbf8, 0x56f27e, 0x56e906, 0x56df90, 0x56d61a, 0x56cca6, 0x56c333, 0x56b9c1,
-        0x56b051, 0x56a6e2, 0x569d74, 0x569407, 0x568a9b, 0x568131, 0x5677c8, 0x566e60,
-        0x5664fa, 0x565b95, 0x565231, 0x5648ce, 0x563f6c, 0x56360c, 0x562cad, 0x56234f,
-        0x5619f2, 0x561097, 0x56073c, 0x55fde3, 0x55f48c, 0x55eb35, 0x55e1e0, 0x55d88c,
-        0x55cf39, 0x55c5e7, 0x55bc97, 0x55b347, 0x55a9f9, 0x55a0ad, 0x559761, 0x558e17,
-        0x5584cd, 0x557b86, 0x55723f, 0x5568f9, 0x555fb5, 0x555672, 0x554d30, 0x5543ef,
-        0x553ab0, 0x553171, 0x552834, 0x551ef8, 0x5515be, 0x550c84, 0x55034c, 0x54fa15,
-        0x54f0df, 0x54e7aa, 0x54de77, 0x54d544, 0x54cc13, 0x54c2e3, 0x54b9b4, 0x54b087,
-        0x54a75a, 0x549e2f, 0x549505, 0x548bdc, 0x5482b5, 0x54798e, 0x547069, 0x546745,
-        0x545e22, 0x545500, 0x544be0, 0x5442c0, 0x5439a2, 0x543085, 0x542769, 0x541e4f,
-        0x541535, 0x540c1d, 0x540306, 0x53f9f0, 0x53f0db, 0x53e7c7, 0x53deb5, 0x53d5a3,
-        0x53cc93, 0x53c384, 0x53ba76, 0x53b169, 0x53a85e, 0x539f54, 0x53964a, 0x538d42,
-        0x53843b, 0x537b36, 0x537231, 0x53692e, 0x53602b, 0x53572a, 0x534e2a, 0x53452b,
-        0x533c2e, 0x533331, 0x532a36, 0x53213b, 0x531842, 0x530f4a, 0x530654, 0x52fd5e,
-        0x52f469, 0x52eb76, 0x52e284, 0x52d993, 0x52d0a3, 0x52c7b4, 0x52bec6, 0x52b5d9,
-        0x52acee, 0x52a404, 0x529b1b, 0x529233, 0x52894c, 0x528066, 0x527781, 0x526e9e,
-        0x5265bb, 0x525cda, 0x5253fa, 0x524b1b, 0x52423d, 0x523960, 0x523084, 0x5227aa,
-        0x521ed0, 0x5215f8, 0x520d21, 0x52044b, 0x51fb76, 0x51f2a2, 0x51e9cf, 0x51e0fe,
-        0x51d82d, 0x51cf5e, 0x51c68f, 0x51bdc2, 0x51b4f6, 0x51ac2b, 0x51a361, 0x519a98,
-        0x5191d1, 0x51890a, 0x518045, 0x517780, 0x516ebd, 0x5165fb, 0x515d3a, 0x51547a,
-        0x514bbb, 0x5142fd, 0x513a41, 0x513185, 0x5128cb, 0x512011, 0x511759, 0x510ea2,
-        0x5105ec, 0x50fd36, 0x50f483, 0x50ebd0, 0x50e31e, 0x50da6d, 0x50d1be, 0x50c90f,
-        0x50c062, 0x50b7b5, 0x50af0a, 0x50a660, 0x509db7, 0x50950f, 0x508c68, 0x5083c2,
-        0x507b1d, 0x507279, 0x5069d7, 0x506135, 0x505894, 0x504ff5, 0x504757, 0x503eb9,
-        0x50361d, 0x502d82, 0x5024e8, 0x501c4f, 0x5013b7, 0x500b20, 0x50028a, 0x4ff9f5,
-        0x4ff162, 0x4fe8cf, 0x4fe03d, 0x4fd7ad, 0x4fcf1d, 0x4fc68f, 0x4fbe01, 0x4fb575,
-        0x4facea, 0x4fa460, 0x4f9bd7, 0x4f934e, 0x4f8ac7, 0x4f8241, 0x4f79bc, 0x4f7139,
-        0x4f68b6, 0x4f6034, 0x4f57b3, 0x4f4f33, 0x4f46b5, 0x4f3e37, 0x4f35bb, 0x4f2d3f,
-        0x4f24c5, 0x4f1c4b, 0x4f13d3, 0x4f0b5b, 0x4f02e5, 0x4efa70, 0x4ef1fb, 0x4ee988,
-        0x4ee116, 0x4ed8a5, 0x4ed035, 0x4ec7c6, 0x4ebf58, 0x4eb6ea, 0x4eae7e, 0x4ea613,
-        0x4e9daa, 0x4e9541, 0x4e8cd9, 0x4e8472, 0x4e7c0c, 0x4e73a7, 0x4e6b43, 0x4e62e1,
-        0x4e5a7f, 0x4e521e, 0x4e49be, 0x4e4160, 0x4e3902, 0x4e30a5, 0x4e284a, 0x4e1fef,
-        0x4e1796, 0x4e0f3d, 0x4e06e5, 0x4dfe8f, 0x4df639, 0x4dede5, 0x4de591, 0x4ddd3f,
-        0x4dd4ed, 0x4dcc9d, 0x4dc44d, 0x4dbbff, 0x4db3b1, 0x4dab65, 0x4da319, 0x4d9acf,
-        0x4d9285, 0x4d8a3d, 0x4d81f5, 0x4d79af, 0x4d7169, 0x4d6925, 0x4d60e2, 0x4d589f,
-        0x4d505e, 0x4d481d, 0x4d3fde, 0x4d379f, 0x4d2f62, 0x4d2725, 0x4d1eea, 0x4d16af,
-        0x4d0e76, 0x4d063d, 0x4cfe05, 0x4cf5cf, 0x4ced99, 0x4ce565, 0x4cdd31, 0x4cd4fe,
-        0x4ccccd, 0x4cc49c, 0x4cbc6c, 0x4cb43e, 0x4cac10, 0x4ca3e3, 0x4c9bb8, 0x4c938d,
-        0x4c8b63, 0x4c833a, 0x4c7b12, 0x4c72eb, 0x4c6ac6, 0x4c62a1, 0x4c5a7d, 0x4c525a,
-        0x4c4a38, 0x4c4217, 0x4c39f7, 0x4c31d7, 0x4c29b9, 0x4c219c, 0x4c1980, 0x4c1165,
-        0x4c094b, 0x4c0131, 0x4bf919, 0x4bf102, 0x4be8eb, 0x4be0d6, 0x4bd8c1, 0x4bd0ae,
-        0x4bc89b, 0x4bc089, 0x4bb879, 0x4bb069, 0x4ba85a, 0x4ba04d, 0x4b9840, 0x4b9034,
-        0x4b8829, 0x4b801f, 0x4b7816, 0x4b700e, 0x4b6807, 0x4b6001, 0x4b57fc, 0x4b4ff7,
-        0x4b47f4, 0x4b3ff2, 0x4b37f0, 0x4b2ff0, 0x4b27f0, 0x4b1ff2, 0x4b17f4, 0x4b0ff7,
-        0x4b07fc, 0x4b0001, 0x4af807, 0x4af00e, 0x4ae816, 0x4ae01f, 0x4ad829, 0x4ad034,
-        0x4ac83f, 0x4ac04c, 0x4ab85a, 0x4ab068, 0x4aa878, 0x4aa088, 0x4a989a, 0x4a90ac,
-        0x4a88bf, 0x4a80d3, 0x4a78e8, 0x4a70fe, 0x4a6915, 0x4a612d, 0x4a5946, 0x4a5160,
-        0x4a497a, 0x4a4196, 0x4a39b2, 0x4a31d0, 0x4a29ee, 0x4a220d, 0x4a1a2d, 0x4a124f,
-        0x4a0a71, 0x4a0294, 0x49fab7, 0x49f2dc, 0x49eb02, 0x49e328, 0x49db50, 0x49d378,
-        0x49cba2, 0x49c3cc, 0x49bbf7, 0x49b423, 0x49ac50, 0x49a47e, 0x499cad, 0x4994dd,
-        0x498d0d, 0x49853f, 0x497d71, 0x4975a5, 0x496dd9, 0x49660e, 0x495e44, 0x49567b,
-        0x494eb3, 0x4946ec, 0x493f25, 0x493760, 0x492f9b, 0x4927d8, 0x492015, 0x491853,
-        0x491092, 0x4908d2, 0x490113, 0x48f955, 0x48f198, 0x48e9db, 0x48e21f, 0x48da65,
-        0x48d2ab, 0x48caf2, 0x48c33a, 0x48bb83, 0x48b3cd, 0x48ac18, 0x48a463, 0x489cb0,
-        0x4894fd, 0x488d4b, 0x48859a, 0x487dea, 0x48763b, 0x486e8d, 0x4866df, 0x485f33,
-        0x485787, 0x484fdd, 0x484833, 0x48408a, 0x4838e2, 0x48313b, 0x482994, 0x4821ef,
-        0x481a4a, 0x4812a6, 0x480b04, 0x480362, 0x47fbc1, 0x47f420, 0x47ec81, 0x47e4e3,
-        0x47dd45, 0x47d5a8, 0x47ce0c, 0x47c672, 0x47bed7, 0x47b73e, 0x47afa6, 0x47a80e,
-        0x47a078, 0x4798e2, 0x47914d, 0x4789b9, 0x478226, 0x477a93, 0x477302, 0x476b71,
-        0x4763e2, 0x475c53, 0x4754c5, 0x474d37, 0x4745ab, 0x473e20, 0x473695, 0x472f0b,
-        0x472783, 0x471ffa, 0x471873, 0x4710ed, 0x470968, 0x4701e3, 0x46fa5f, 0x46f2dc,
-        0x46eb5a, 0x46e3d9, 0x46dc59, 0x46d4d9, 0x46cd5a, 0x46c5dd, 0x46be60, 0x46b6e4,
-        0x46af68, 0x46a7ee, 0x46a074, 0x4698fb, 0x469184, 0x468a0c, 0x468296, 0x467b21,
-        0x4673ac, 0x466c39, 0x4664c6, 0x465d54, 0x4655e3, 0x464e72, 0x464703, 0x463f94,
-        0x463826, 0x4630b9, 0x46294d, 0x4621e2, 0x461a77, 0x46130e, 0x460ba5, 0x46043d,
-        0x45fcd6, 0x45f56f, 0x45ee0a, 0x45e6a5, 0x45df41, 0x45d7de, 0x45d07c, 0x45c91a,
-        0x45c1ba, 0x45ba5a, 0x45b2fb, 0x45ab9d, 0x45a440, 0x459ce4, 0x459588, 0x458e2d,
-        0x4586d3, 0x457f7a, 0x457822, 0x4570ca, 0x456974, 0x45621e, 0x455ac9, 0x455374,
-        0x454c21, 0x4544ce, 0x453d7d, 0x45362c, 0x452edb, 0x45278c, 0x45203e, 0x4518f0,
-        0x4511a3, 0x450a57, 0x45030c, 0x44fbc1, 0x44f477, 0x44ed2e, 0x44e5e6, 0x44de9f,
-        0x44d759, 0x44d013, 0x44c8ce, 0x44c18a, 0x44ba47, 0x44b305, 0x44abc3, 0x44a482,
-        0x449d42, 0x449603, 0x448ec5, 0x448787, 0x44804a, 0x44790e, 0x4471d3, 0x446a99,
-        0x44635f, 0x445c26, 0x4454ee, 0x444db7, 0x444681, 0x443f4b, 0x443816, 0x4430e2,
-        0x4429af, 0x44227c, 0x441b4b, 0x44141a, 0x440cea, 0x4405ba, 0x43fe8c, 0x43f75e,
-        0x43f031, 0x43e905, 0x43e1da, 0x43daaf, 0x43d385, 0x43cc5c, 0x43c534, 0x43be0d,
-        0x43b6e6, 0x43afc0, 0x43a89b, 0x43a177, 0x439a54, 0x439331, 0x438c0f, 0x4384ee,
-        0x437dcd, 0x4376ae, 0x436f8f, 0x436871, 0x436154, 0x435a37, 0x43531b, 0x434c00,
-        0x4344e6, 0x433dcd, 0x4336b4, 0x432f9c, 0x432885, 0x43216f, 0x431a5a, 0x431345,
-        0x430c31, 0x43051e, 0x42fe0b, 0x42f6f9, 0x42efe9, 0x42e8d8, 0x42e1c9, 0x42daba,
-        0x42d3ad, 0x42cca0, 0x42c593, 0x42be88, 0x42b77d, 0x42b073, 0x42a96a, 0x42a261,
-        0x429b59, 0x429452, 0x428d4c, 0x428647, 0x427f42, 0x42783e, 0x42713b, 0x426a39,
-        0x426337, 0x425c36, 0x425536, 0x424e37, 0x424738, 0x42403a, 0x42393d, 0x423241,
-        0x422b45, 0x42244a, 0x421d50, 0x421657, 0x420f5e, 0x420866, 0x42016f, 0x41fa79,
-        0x41f383, 0x41ec8e, 0x41e59a, 0x41dea7, 0x41d7b4, 0x41d0c2, 0x41c9d1, 0x41c2e1,
-        0x41bbf1, 0x41b503, 0x41ae14, 0x41a727, 0x41a03a, 0x41994e, 0x419263, 0x418b79,
-        0x41848f, 0x417da6, 0x4176be, 0x416fd7, 0x4168f0, 0x41620a, 0x415b25, 0x415440,
-        0x414d5c, 0x414679, 0x413f97, 0x4138b6, 0x4131d5, 0x412af5, 0x412415, 0x411d37,
-        0x411659, 0x410f7c, 0x41089f, 0x4101c3, 0x40fae9, 0x40f40e, 0x40ed35, 0x40e65c,
-        0x40df84, 0x40d8ad, 0x40d1d6, 0x40cb00, 0x40c42b, 0x40bd57, 0x40b683, 0x40afb0,
-        0x40a8de, 0x40a20c, 0x409b3b, 0x40946b, 0x408d9c, 0x4086cd, 0x408000, 0x407932,
-        0x407266, 0x406b9a, 0x4064cf, 0x405e05, 0x40573b, 0x405072, 0x4049aa, 0x4042e3,
-        0x403c1c, 0x403556, 0x402e91, 0x4027cc, 0x402109, 0x401a45, 0x401383, 0x400cc1,
-        0x400600, 0x3fff40, 0x3ff880, 0x3ff1c2, 0x3feb03, 0x3fe446, 0x3fdd89, 0x3fd6cd,
-        0x3fd012, 0x3fc957, 0x3fc29d, 0x3fbbe4, 0x3fb52c, 0x3fae74, 0x3fa7bd, 0x3fa107,
-        0x3f9a51, 0x3f939c, 0x3f8ce8, 0x3f8634, 0x3f7f81, 0x3f78cf, 0x3f721e, 0x3f6b6d,
-        0x3f64bd, 0x3f5e0e, 0x3f575f, 0x3f50b1, 0x3f4a04, 0x3f4357, 0x3f3cac, 0x3f3601,
-        0x3f2f56, 0x3f28ac, 0x3f2203, 0x3f1b5b, 0x3f14b3, 0x3f0e0c, 0x3f0766, 0x3f00c1,
-        0x3efa1c, 0x3ef377, 0x3eecd4, 0x3ee631, 0x3edf8f, 0x3ed8ee, 0x3ed24d, 0x3ecbad,
-        0x3ec50e, 0x3ebe6f, 0x3eb7d1, 0x3eb134, 0x3eaa97, 0x3ea3fb, 0x3e9d60, 0x3e96c6,
-        0x3e902c, 0x3e8993, 0x3e82fa, 0x3e7c62, 0x3e75cb, 0x3e6f35, 0x3e689f, 0x3e620a,
-        0x3e5b76, 0x3e54e2, 0x3e4e4f, 0x3e47bd, 0x3e412b, 0x3e3a9a, 0x3e340a, 0x3e2d7a,
-        0x3e26eb, 0x3e205d, 0x3e19cf, 0x3e1342, 0x3e0cb6, 0x3e062b, 0x3dffa0, 0x3df916,
-        0x3df28c, 0x3dec03, 0x3de57b, 0x3ddef4, 0x3dd86d, 0x3dd1e7, 0x3dcb61, 0x3dc4dc,
-        0x3dbe58, 0x3db7d5, 0x3db152, 0x3daad0, 0x3da44f, 0x3d9dce, 0x3d974e, 0x3d90ce,
-        0x3d8a4f, 0x3d83d1, 0x3d7d54, 0x3d76d7, 0x3d705b, 0x3d69e0, 0x3d6365, 0x3d5ceb,
-        0x3d5671, 0x3d4ff9, 0x3d4980, 0x3d4309, 0x3d3c92, 0x3d361c, 0x3d2fa7, 0x3d2932,
-        0x3d22be, 0x3d1c4a, 0x3d15d7, 0x3d0f65, 0x3d08f4, 0x3d0283, 0x3cfc13, 0x3cf5a3,
-        0x3cef34, 0x3ce8c6, 0x3ce259, 0x3cdbec, 0x3cd57f, 0x3ccf14, 0x3cc8a9, 0x3cc23f,
-        0x3cbbd5, 0x3cb56c, 0x3caf04, 0x3ca89c, 0x3ca235, 0x3c9bcf, 0x3c9569, 0x3c8f04,
-        0x3c889f, 0x3c823c, 0x3c7bd8, 0x3c7576, 0x3c6f14, 0x3c68b3, 0x3c6253, 0x3c5bf3,
-        0x3c5593, 0x3c4f35, 0x3c48d7, 0x3c427a, 0x3c3c1d, 0x3c35c1, 0x3c2f66, 0x3c290b,
-        0x3c22b1, 0x3c1c57, 0x3c15ff, 0x3c0fa7, 0x3c094f, 0x3c02f8, 0x3bfca2, 0x3bf64c,
-        0x3beff7, 0x3be9a3, 0x3be34f, 0x3bdcfc, 0x3bd6aa, 0x3bd058, 0x3bca07, 0x3bc3b7,
-        0x3bbd67, 0x3bb718, 0x3bb0c9, 0x3baa7b, 0x3ba42e, 0x3b9de1, 0x3b9795, 0x3b914a,
-        0x3b8aff, 0x3b84b5, 0x3b7e6c, 0x3b7823, 0x3b71db, 0x3b6b93, 0x3b654c, 0x3b5f06,
-        0x3b58c0, 0x3b527b, 0x3b4c36, 0x3b45f3, 0x3b3faf, 0x3b396d, 0x3b332b, 0x3b2cea,
-        0x3b26a9, 0x3b2069, 0x3b1a2a, 0x3b13eb, 0x3b0dad, 0x3b076f, 0x3b0132, 0x3afaf6,
-        0x3af4ba, 0x3aee7f, 0x3ae845, 0x3ae20b, 0x3adbd2, 0x3ad599, 0x3acf61, 0x3ac92a,
-        0x3ac2f3, 0x3abcbd, 0x3ab688, 0x3ab053, 0x3aaa1f, 0x3aa3eb, 0x3a9db8, 0x3a9786,
-        0x3a9154, 0x3a8b23, 0x3a84f2, 0x3a7ec2, 0x3a7893, 0x3a7264, 0x3a6c36, 0x3a6609,
-        0x3a5fdc, 0x3a59b0, 0x3a5384, 0x3a4d59, 0x3a472f, 0x3a4105, 0x3a3adc, 0x3a34b4,
-        0x3a2e8c, 0x3a2864, 0x3a223e, 0x3a1c18, 0x3a15f2, 0x3a0fcd, 0x3a09a9, 0x3a0385,
-        0x39fd62, 0x39f740, 0x39f11e, 0x39eafd, 0x39e4dc, 0x39debc, 0x39d89d, 0x39d27e,
-        0x39cc60, 0x39c642, 0x39c025, 0x39ba09, 0x39b3ed, 0x39add2, 0x39a7b7, 0x39a19d,
-        0x399b84, 0x39956b, 0x398f53, 0x39893b, 0x398324, 0x397d0e, 0x3976f8, 0x3970e3,
-        0x396ace, 0x3964ba, 0x395ea7, 0x395894, 0x395282, 0x394c70, 0x39465f, 0x39404f,
-        0x393a3f, 0x393430, 0x392e21, 0x392813, 0x392206, 0x391bf9, 0x3915ed, 0x390fe1,
-        0x3909d6, 0x3903cb, 0x38fdc1, 0x38f7b8, 0x38f1af, 0x38eba7, 0x38e5a0, 0x38df99,
-        0x38d993, 0x38d38d, 0x38cd88, 0x38c783, 0x38c17f, 0x38bb7c, 0x38b579, 0x38af77,
-        0x38a975, 0x38a374, 0x389d73, 0x389774, 0x389174, 0x388b76, 0x388577, 0x387f7a,
-        0x38797d, 0x387381, 0x386d85, 0x38678a, 0x38618f, 0x385b95, 0x38559b, 0x384fa2,
-        0x3849aa, 0x3843b2, 0x383dbb, 0x3837c5, 0x3831cf, 0x382bd9, 0x3825e4, 0x381ff0,
-        0x3819fd, 0x381409, 0x380e17, 0x380825, 0x380234, 0x37fc43, 0x37f653, 0x37f063,
-        0x37ea74, 0x37e485, 0x37de97, 0x37d8aa, 0x37d2bd, 0x37ccd1, 0x37c6e5, 0x37c0fa,
-        0x37bb10, 0x37b526, 0x37af3d, 0x37a954, 0x37a36c, 0x379d84, 0x37979d, 0x3791b6,
-        0x378bd0, 0x3785eb, 0x378006, 0x377a22, 0x37743e, 0x376e5b, 0x376879, 0x376297,
-        0x375cb5, 0x3756d5, 0x3750f4, 0x374b15, 0x374535, 0x373f57, 0x373979, 0x37339b,
-        0x372dbf, 0x3727e2, 0x372206, 0x371c2b, 0x371651, 0x371077, 0x370a9d, 0x3704c4,
-        0x36feec, 0x36f914, 0x36f33d, 0x36ed66, 0x36e790, 0x36e1ba, 0x36dbe5, 0x36d611,
-        0x36d03d, 0x36ca69, 0x36c497, 0x36bec4, 0x36b8f3, 0x36b321, 0x36ad51, 0x36a781,
-        0x36a1b1, 0x369be2, 0x369614, 0x369046, 0x368a79, 0x3684ac, 0x367ee0, 0x367915,
-        0x36734a, 0x366d7f, 0x3667b5, 0x3661ec, 0x365c23, 0x36565b, 0x365093, 0x364acc,
-        0x364505, 0x363f3f, 0x363979, 0x3633b4, 0x362df0, 0x36282c, 0x362269, 0x361ca6,
-        0x3616e4, 0x361122, 0x360b61, 0x3605a0, 0x35ffe0, 0x35fa20, 0x35f461, 0x35eea3,
-        0x35e8e5, 0x35e328, 0x35dd6b, 0x35d7af, 0x35d1f3, 0x35cc38, 0x35c67d, 0x35c0c3,
-        0x35bb09, 0x35b550, 0x35af98, 0x35a9e0, 0x35a429, 0x359e72, 0x3598bb, 0x359306,
-        0x358d50, 0x35879c, 0x3581e8, 0x357c34, 0x357681, 0x3570ce, 0x356b1c, 0x35656b,
-        0x355fba, 0x355a09, 0x355459, 0x354eaa, 0x3548fb, 0x35434d, 0x353d9f, 0x3537f2,
-        0x353245, 0x352c99, 0x3526ee, 0x352143, 0x351b98, 0x3515ee, 0x351045, 0x350a9c
-    }
-};
-
-
-
-/* Shortcuts so we dont have to bother with the structure in C */
-
-/* Pointer to exponential table */
-const unsigned int *
-gmx_invsqrt_exptab   = F77_FUNC(gmxinvsqrtdata, GMXINVSQRTDATA).exptab;
-
-/* Pointer to fraction table */
-const unsigned int *
-gmx_invsqrt_fracttab = F77_FUNC(gmxinvsqrtdata, GMXINVSQRTDATA).fracttab;
index b1e318522f945259161e46e04eed149e52643a75..d21efa4cde0a00dae3f51dd55e597715e35e5cd4 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#include "conformation-utilities.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "conformation-utilities.h"
 
 #include <math.h>
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 
 static real dist2(t_pbc *pbc, rvec x, rvec y)
 {
index 38024be62af72d851961d3c3534fc4d29fd2a58c..0fbe271f04714d0cc2eb649bf2c689d1d2f3d0de 100644 (file)
@@ -37,7 +37,9 @@
 #ifndef GMX_CONFORMATION_UTILITIES_H
 #define GMX_CONFORMATION_UTILITIES_H
 
-#include "typedefs.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 784caa2efb42e0e1d8989e6dc112f00d353442b9..ab622947ca6c38d168f1c639875e0a1680577900 100644 (file)
@@ -3,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,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.
  * 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 "copyrite.h"
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/copyrite.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef HAVE_LIBMKL
 #include <mkl.h>
 #endif
-
 #ifdef HAVE_EXTRAE
- #include "extrae_user_events.h"
+#include <extrae_user_events.h>
 #endif
-
 #include <boost/version.hpp>
 
 /* This file is completely threadsafe - keep it that way! */
 
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/vec.h"
-
+#include "buildinfo.h"
 #include "gromacs/fft/fft.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/strdb.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
-
-#include "buildinfo.h"
+#include "gromacs/utility/stringutil.h"
 
 static gmx_bool be_cool(void)
 {
@@ -196,7 +193,7 @@ static void printCopyright(FILE *fp)
     };
     static const char * const CopyrightText[] = {
         "Copyright (c) 1991-2000, University of Groningen, The Netherlands.",
-        "Copyright (c) 2001-2014, The GROMACS development team at",
+        "Copyright (c) 2001-2015, The GROMACS development team at",
         "Uppsala University, Stockholm University and",
         "the Royal Institute of Technology, Sweden.",
         "check out http://www.gromacs.org for more information."
@@ -675,7 +672,7 @@ static void gmx_print_version_info(FILE *fp)
     fprintf(fp, "MPI library:        none\n");
 #endif
 #ifdef GMX_OPENMP
-    fprintf(fp, "OpenMP support:     enabled\n");
+    fprintf(fp, "OpenMP support:     enabled (GMX_OPENMP_MAX_THREADS = %d)\n", GMX_OPENMP_MAX_THREADS);
 #else
     fprintf(fp, "OpenMP support:     disabled\n");
 #endif
@@ -688,12 +685,7 @@ static void gmx_print_version_info(FILE *fp)
 #define gmx_stringify2(x) #x
 #define gmx_stringify(x) gmx_stringify2(x)
     fprintf(fp, "invsqrt routine:    %s\n", gmx_stringify(gmx_invsqrt(x)));
-#ifndef __MIC__
     fprintf(fp, "SIMD instructions:  %s\n", GMX_SIMD_STRING);
-#else
-    fprintf(fp, "SIMD instructions:  %s\n", "Intel MIC");
-#endif
-
     fprintf(fp, "FFT library:        %s\n", gmx_fft_get_version_info());
 #ifdef HAVE_RDTSCP
     fprintf(fp, "RDTSCP usage:       enabled\n");
@@ -815,17 +807,18 @@ void printBinaryInformation(FILE                            *fp,
     fprintf(fp, "%sGROMACS:      %s, %s%s%s\n", prefix, name,
             gmx_version(), precisionString, suffix);
     const char *const binaryPath = programContext.fullBinaryPath();
-    if (binaryPath != NULL && binaryPath[0] != '\0')
+    if (!gmx::isNullOrEmpty(binaryPath))
     {
         fprintf(fp, "%sExecutable:   %s%s\n", prefix, binaryPath, suffix);
     }
-    const char *const libraryPath = programContext.defaultLibraryDataPath();
-    if (libraryPath != NULL && libraryPath[0] != '\0')
+    const gmx::InstallationPrefixInfo installPrefix = programContext.installationPrefix();
+    if (!gmx::isNullOrEmpty(installPrefix.path))
     {
-        fprintf(fp, "%sLibrary dir:  %s%s\n", prefix, libraryPath, suffix);
+        fprintf(fp, "%sData prefix:  %s%s%s\n", prefix, installPrefix.path,
+                installPrefix.bSourceLayout ? " (source tree)" : "", suffix);
     }
     const char *const commandLine = programContext.commandLine();
-    if (commandLine != NULL && commandLine[0] != '\0')
+    if (!gmx::isNullOrEmpty(commandLine))
     {
         fprintf(fp, "%sCommand line:%s\n%s  %s%s\n",
                 prefix, suffix, prefix, commandLine, suffix);
index 8bbc24d10ea84b86ee0eee5fff586cf62e4cfeaa..67d2cbe8650e4d9a09a49c2c1107540e051eabe1 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012, by the GROMACS development team, led by
+# Copyright (c) 2012,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -34,8 +34,5 @@
 
 if(GMX_GPU)
     file(GLOB CUDA_TOOLS_SOURCES *.cu)
-    CUDA_ADD_LIBRARY(cuda_tools STATIC ${CUDA_TOOLS_SOURCES}
-            OPTIONS
-            RELWITHDEBINFO -g
-            DEBUG -g -D_DEBUG_=1)
+    set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${CUDA_TOOLS_SOURCES} PARENT_SCOPE)
 endif()
index aa204263febfb1a4bebf6b2b9331e5793d3831ce..4b5bca9d6f42c2b4812e5b0dfb15210e2065a944 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdio.h>
+
 #include <cuda.h>
 #include <cuda_runtime_api.h>
 
index 57a0e425e80144fadc8bd58767a8503514ed36ba..44a18eaec48ca2bf09ef6900aa3b95c44f7a9657 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#include "gmxpre.h"
+
+#include "cudautils.cuh"
+
 #include <stdlib.h>
 
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "cudautils.cuh"
 
 /*** Generic CUDA data operation wrappers ***/
 
index 2cccc16c6714da4ead8366567f5d4089529decc3..dbb9f27c1bba4b07f8e3f9fa531a93222e117c51 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef CUDAUTILS_CUH
 #define CUDAUTILS_CUH
 
+#include "config.h"
+
 #include <stdio.h>
+#ifdef HAVE_NVML
+#include <nvml.h>
+#endif /* HAVE_NVML */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* CUDA library and hardware related defines */
 /* TODO list some constants instead that can be used for consistency checks to
         } \
     } while (0)
 
+/*! Check for NVML error on the return status of a NVML API call. */
+#ifdef HAVE_NVML
+#define HANDLE_NVML_RET_ERR(status, msg) \
+    do { \
+        if (status != NVML_SUCCESS) \
+        { \
+            gmx_warning("%s: %s\n", msg, nvmlErrorString(status)); \
+        } \
+    } while (0)
+#endif /* HAVE_NVML */
 #else
 
 #define CU_RET_ERR(status, msg) do { } while (0)
 #define CU_CHECK_PREV_ERR()     do { } while (0)
 #define CU_LAUNCH_ERR(msg)      do { } while (0)
 #define CU_LAUNCH_ERR_SYNC(msg) do { } while (0)
+#define HANDLE_NVML_RET_ERR(status, msg) do { } while (0)
 
 #endif /* CHECK_CUDA_ERRORS */
 
@@ -116,9 +132,15 @@ extern "C" {
 typedef struct cuda_dev_info cuda_dev_info_t;
 struct cuda_dev_info
 {
-    int             id;      /* id of the CUDA device */
-    cudaDeviceProp  prop;    /* CUDA device properties */
-    int             stat;    /* result of the device check */
+    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 */
+    gmx_bool            nvml_ap_clocks_changed; /* If application clocks have been changed */
+#ifdef HAVE_NVML
+    nvmlDevice_t        nvml_device_id;         /* NVML device id */
+    nvmlEnableState_t   nvml_is_restricted;     /* Status of application clocks permission */
+#endif                                          /* HAVE_NVML */
 };
 
 
index 8c6b2cb8d438f3d0a90d2b92a90c0342424866c1..cfcc620c19372e0740893214cb81397ab7afdf6f 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include <stdlib.h>
+#include "gmxpre.h"
 
-#include "cudautils.cuh"
 #include "pmalloc_cuda.h"
 
+#include <stdlib.h>
+
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/utility/cstringutil.h"
+
 /*! Allocates nbytes of page-locked memory.
  *  This memory should always be freed using pfree (or with the page-locked
  *  free functions provied by the CUDA library).
similarity index 89%
rename from src/gromacs/legacyheaders/pmalloc_cuda.h
rename to src/gromacs/gmxlib/cuda_tools/pmalloc_cuda.h
index d00179a4ad11f46e552df6ab96084e639c8d1906..d45890802c8bc1ec013649385aee67288af57ca4 100644 (file)
 #ifndef PMALLOC_CUDA_H
 #define PMALLOC_CUDA_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <stdlib.h>
-#include "types/simple.h"
+
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef GMX_GPU
 #define FUNC_TERM ;
 extern "C" {
 #endif
 
-/*! Allocates nbytes of page-locked memory. */
+/** Allocates nbytes of page-locked memory. */
 void pmalloc(void gmx_unused **h_ptr, size_t gmx_unused nbytes) FUNC_TERM
 
-/*! Allocates nbytes of page-locked memory with write-combining. */
+/** Allocates nbytes of page-locked memory with write-combining. */
 void pmalloc_wc(void gmx_unused **h_ptr, size_t gmx_unused nbytes) FUNC_TERM
 
-/*! Frees page locked memory allocated with pmalloc. */
+/** Frees page locked memory allocated with pmalloc. */
 void pfree(void gmx_unused *h_ptr) FUNC_TERM
 
 #ifdef __cplusplus
index 061521d9f218c6ed4c6766fcf01866ec7001ec42..8e2fefd24f61135c711984d5bee998eadba38eb0 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/disre.h"
+
+#include "config.h"
 
 #include <math.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "sysstuff.h"
+#include <stdlib.h>
+
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "xvgr.h"
-#include "gmx_fatal.h"
-#include "bondf.h"
-#include "copyrite.h"
-#include "disre.h"
-#include "main.h"
-#include "mtop_util.h"
 
 void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
                  t_inputrec *ir, const t_commrec *cr,
index 020e37aa55f41544d69724a70708f5113ecd4941..183be905fed5065923bc7d5da9f9347dc6a26200 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#ifdef HAVE_SCHED_H
-#  ifndef _GNU_SOURCE
-#    define _GNU_SOURCE 1
-#  endif
-#  include <sched.h>
+/*! \cond */
+#include "gromacs/legacyheaders/gmx_cpuid.h"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
+
 #ifdef GMX_NATIVE_WINDOWS
 /* MSVC definition for __cpuid() */
     #ifdef _MSC_VER
 /* sysinfo functions */
     #include <windows.h>
 #endif
+#ifdef HAVE_SCHED_H
+    #include <sched.h>
+#endif
 #ifdef HAVE_UNISTD_H
 /* sysconf() definition */
     #include <unistd.h>
 #endif
 
-#include "gmx_cpuid.h"
-
-
 
 /* For convenience, and to enable configure-time invocation, we keep all architectures
  * in a single file, but to avoid repeated ifdefs we set the overall architecture here.
@@ -83,7 +82,8 @@ gmx_cpuid_vendor_string[GMX_CPUID_NVENDORS] =
     "GenuineIntel",
     "AuthenticAMD",
     "Fujitsu",
-    "IBM"
+    "IBM", /* Used on Power and BlueGene/Q */
+    "ARM"
 };
 
 const char *
@@ -94,7 +94,8 @@ gmx_cpuid_vendor_string_alternative[GMX_CPUID_NVENDORS] =
     "GenuineIntel",
     "AuthenticAMD",
     "Fujitsu",
-    "ibm" /* Used on BlueGene/Q */
+    "ibm", /* Used on Power and BlueGene/Q */
+    "AArch64"
 };
 
 const char *
@@ -134,7 +135,12 @@ gmx_cpuid_feature_string[GMX_CPUID_NFEATURES] =
     "ssse3",
     "tdt",
     "x2apic",
-    "xop"
+    "xop",
+    "arm_neon",
+    "arm_neon_asimd",
+    "QPX",
+    "VMX",
+    "VSX"
 };
 
 const char *
@@ -149,18 +155,22 @@ gmx_cpuid_simd_string[GMX_CPUID_NSIMD] =
     "AVX_256",
     "AVX2_256",
     "Sparc64 HPC-ACE",
-    "IBM_QPX"
+    "IBM_QPX",
+    "IBM_VMX",
+    "IBM_VSX",
+    "ARM_NEON",
+    "ARM_NEON_ASIMD"
 };
 
 /* Max length of brand string */
-#define GMX_CPUID_BRAND_MAXLEN 256
+#define GMX_CPUID_STRLEN 256
 
 
 /* Contents of the abstract datatype */
 struct gmx_cpuid
 {
     enum gmx_cpuid_vendor      vendor;
-    char                       brand[GMX_CPUID_BRAND_MAXLEN];
+    char                       brand[GMX_CPUID_STRLEN];
     int                        family;
     int                        model;
     int                        stepping;
@@ -238,10 +248,18 @@ static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_X86_AVX_128_FMA;
 static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_X86_SSE4_1;
 #elif defined GMX_SIMD_X86_SSE2
 static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_X86_SSE2;
+#elif defined GMX_SIMD_ARM_NEON
+static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_ARM_NEON;
+#elif defined GMX_SIMD_ARM_NEON_ASIMD
+static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_ARM_NEON_ASIMD;
 #elif defined GMX_SIMD_SPARC64_HPC_ACE
 static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_SPARC64_HPC_ACE;
 #elif defined GMX_SIMD_IBM_QPX
 static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_IBM_QPX;
+#elif defined GMX_SIMD_IBM_VMX
+static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_IBM_VMX;
+#elif defined GMX_SIMD_IBM_VSX
+static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_IBM_VSX;
 #elif defined GMX_SIMD_REFERENCE
 static const enum gmx_cpuid_simd compiled_simd = GMX_CPUID_SIMD_REFERENCE;
 #else
@@ -334,7 +352,7 @@ cpuid_check_common_x86(gmx_cpuid_t                cpuid)
 {
     int                       fn, max_stdfn, max_extfn;
     unsigned int              eax, ebx, ecx, edx;
-    char                      str[GMX_CPUID_BRAND_MAXLEN];
+    char                      str[GMX_CPUID_STRLEN];
     char *                    p;
 
     /* Find largest standard/extended function input value */
@@ -364,11 +382,11 @@ cpuid_check_common_x86(gmx_cpuid_t                cpuid)
         {
             p++;
         }
-        strncpy(cpuid->brand, p, GMX_CPUID_BRAND_MAXLEN);
+        strncpy(cpuid->brand, p, GMX_CPUID_STRLEN);
     }
     else
     {
-        strncpy(cpuid->brand, "Unknown CPU brand", GMX_CPUID_BRAND_MAXLEN);
+        strncpy(cpuid->brand, "Unknown CPU brand", GMX_CPUID_STRLEN);
     }
 
     /* Find basic CPU properties */
@@ -469,6 +487,7 @@ cpuid_renumber_elements(int *data, int n)
             }
         }
     }
+    free(unique);
     return nunique;
 }
 
@@ -729,7 +748,6 @@ cpuid_check_intel_x86(gmx_cpuid_t                cpuid)
 
 
 
-
 static void
 chomp_substring_before_colon(const char *in, char *s, int maxlength)
 {
@@ -774,6 +792,119 @@ chomp_substring_after_colon(const char *in, char *s, int maxlength)
     }
 }
 
+static int
+cpuid_check_arm(gmx_cpuid_t                cpuid)
+{
+#if defined(__linux__) || defined(__linux)
+    FILE *fp;
+    char  buffer[GMX_CPUID_STRLEN], buffer2[GMX_CPUID_STRLEN], buffer3[GMX_CPUID_STRLEN];
+
+    if ( (fp = fopen("/proc/cpuinfo", "r")) != NULL)
+    {
+        while ( (fgets(buffer, sizeof(buffer), fp) != NULL))
+        {
+            chomp_substring_before_colon(buffer, buffer2, GMX_CPUID_STRLEN);
+            chomp_substring_after_colon(buffer, buffer3, GMX_CPUID_STRLEN);
+
+            if (!strcmp(buffer2, "Processor"))
+            {
+                strncpy(cpuid->brand, buffer3, GMX_CPUID_STRLEN);
+            }
+            else if (!strcmp(buffer2, "CPU architecture"))
+            {
+                cpuid->family = strtol(buffer3, NULL, 10);
+                if (!strcmp(buffer3, "AArch64"))
+                {
+                    cpuid->family = 8;
+                }
+            }
+            else if (!strcmp(buffer2, "CPU part"))
+            {
+                cpuid->model = strtol(buffer3, NULL, 16);
+            }
+            else if (!strcmp(buffer2, "CPU revision"))
+            {
+                cpuid->stepping = strtol(buffer3, NULL, 10);
+            }
+            else if (!strcmp(buffer2, "Features") && strstr(buffer3, "neon"))
+            {
+                cpuid->feature[GMX_CPUID_FEATURE_ARM_NEON] = 1;
+            }
+            else if (!strcmp(buffer2, "Features") && strstr(buffer3, "asimd"))
+            {
+                cpuid->feature[GMX_CPUID_FEATURE_ARM_NEON_ASIMD] = 1;
+            }
+        }
+    }
+    fclose(fp);
+#else
+#    ifdef __aarch64__
+    /* Strange 64-bit non-linux platform. However, since NEON ASIMD is present on all
+     * implementations of AArch64 this far, we assume it is present for now.
+     */
+    cpuid->feature[GMX_CPUID_FEATURE_ARM_NEON_ASIMD] = 1;
+#    else
+    /* Strange 32-bit non-linux platform. We cannot assume that neon is present. */
+    cpuid->feature[GMX_CPUID_FEATURE_ARM_NEON] = 0;
+#    endif
+#endif
+    return 0;
+}
+
+
+static int
+cpuid_check_ibm(gmx_cpuid_t                cpuid)
+{
+#if defined(__linux__) || defined(__linux)
+    FILE *fp;
+    char  buffer[GMX_CPUID_STRLEN], before_colon[GMX_CPUID_STRLEN], after_colon[GMX_CPUID_STRLEN];
+
+    if ( (fp = fopen("/proc/cpuinfo", "r")) != NULL)
+    {
+        while ( (fgets(buffer, sizeof(buffer), fp) != NULL))
+        {
+            chomp_substring_before_colon(buffer, before_colon, GMX_CPUID_STRLEN);
+            chomp_substring_after_colon(buffer, after_colon, GMX_CPUID_STRLEN);
+
+            if (!strcmp(before_colon, "cpu") || !strcmp(before_colon, "Processor"))
+            {
+                strncpy(cpuid->brand, after_colon, GMX_CPUID_STRLEN);
+            }
+            if (!strcmp(before_colon, "model name") ||
+                !strcmp(before_colon, "model") ||
+                !strcmp(before_colon, "Processor") ||
+                !strcmp(before_colon, "cpu"))
+            {
+                if (strstr(after_colon, "altivec"))
+                {
+                    cpuid->feature[GMX_CPUID_FEATURE_IBM_VMX] = 1;
+
+                    if (!strstr(after_colon, "POWER6") && !strstr(after_colon, "Power6") &&
+                        !strstr(after_colon, "power6"))
+                    {
+                        cpuid->feature[GMX_CPUID_FEATURE_IBM_VSX] = 1;
+                    }
+                }
+            }
+        }
+    }
+    fclose(fp);
+
+    if (strstr(cpuid->brand, "A2"))
+    {
+        /* BlueGene/Q */
+        cpuid->feature[GMX_CPUID_FEATURE_IBM_QPX] = 1;
+    }
+#else
+    strncpy(cpuid->brand, "Unknown CPU brand", GMX_CPUID_STRLEN);
+    cpuid->feature[GMX_CPUID_FEATURE_IBM_QPX] = 0;
+    cpuid->feature[GMX_CPUID_FEATURE_IBM_VMX] = 0;
+    cpuid->feature[GMX_CPUID_FEATURE_IBM_VSX] = 0;
+#endif
+    return 0;
+}
+
+
 /* Try to find the vendor of the current CPU, so we know what specific
  * detection routine to call.
  */
@@ -785,7 +916,9 @@ cpuid_check_vendor(void)
     unsigned int               eax, ebx, ecx, edx;
     char                       vendorstring[13];
     FILE *                     fp;
-    char                       buffer[255], before_colon[255], after_colon[255];
+    char                       buffer[GMX_CPUID_STRLEN];
+    char                       before_colon[GMX_CPUID_STRLEN];
+    char                       after_colon[GMX_CPUID_STRLEN];
 
     /* Set default first */
     vendor = GMX_CPUID_VENDOR_UNKNOWN;
@@ -813,11 +946,16 @@ cpuid_check_vendor(void)
         while ( (vendor == GMX_CPUID_VENDOR_UNKNOWN) && (fgets(buffer, sizeof(buffer), fp) != NULL))
         {
             chomp_substring_before_colon(buffer, before_colon, sizeof(before_colon));
-            /* Intel/AMD use "vendor_id", IBM "vendor"(?) or "model". Fujitsu "manufacture". Add others if you have them! */
+            /* Intel/AMD use "vendor_id", IBM "vendor", "model", or "cpu". Fujitsu "manufacture".
+             * On ARM there does not seem to be a vendor, but ARM or AArch64 is listed in the Processor string.
+             * Add others if you have them!
+             */
             if (!strcmp(before_colon, "vendor_id")
                 || !strcmp(before_colon, "vendor")
                 || !strcmp(before_colon, "manufacture")
-                || !strcmp(before_colon, "model"))
+                || !strcmp(before_colon, "model")
+                || !strcmp(before_colon, "Processor")
+                || !strcmp(before_colon, "cpu"))
             {
                 chomp_substring_after_colon(buffer, after_colon, sizeof(after_colon));
                 for (i = GMX_CPUID_VENDOR_UNKNOWN; i < GMX_CPUID_NVENDORS; i++)
@@ -831,12 +969,25 @@ cpuid_check_vendor(void)
                         vendor = i;
                     }
                 }
+                /* If we did not find vendor yet, check if it is IBM:
+                 * On some Power/PowerPC systems it only says power, not IBM.
+                 */
+                if (vendor == GMX_CPUID_VENDOR_UNKNOWN &&
+                    ((strstr(after_colon, "POWER") || strstr(after_colon, "Power") ||
+                      strstr(after_colon, "power"))))
+                {
+                    vendor = GMX_CPUID_VENDOR_IBM;
+                }
             }
         }
     }
     fclose(fp);
+#elif defined(__arm__) || defined (__arm) || defined(__aarch64__)
+    /* If we are using ARM on something that is not linux we have to trust the compiler,
+     * and we cannot get the extra info that might be present in /proc/cpuinfo.
+     */
+    vendor = GMX_CPUID_VENDOR_ARM;
 #endif
-
     return vendor;
 }
 
@@ -902,7 +1053,7 @@ gmx_cpuid_init               (gmx_cpuid_t *              pcpuid)
     gmx_cpuid_t cpuid;
     int         i;
     FILE *      fp;
-    char        buffer[255], buffer2[255];
+    char        buffer[GMX_CPUID_STRLEN], buffer2[GMX_CPUID_STRLEN];
     int         found_brand;
 
     cpuid = malloc(sizeof(*cpuid));
@@ -936,9 +1087,15 @@ gmx_cpuid_init               (gmx_cpuid_t *              pcpuid)
             cpuid_check_amd_x86(cpuid);
             break;
 #endif
+        case GMX_CPUID_VENDOR_ARM:
+            cpuid_check_arm(cpuid);
+            break;
+        case GMX_CPUID_VENDOR_IBM:
+            cpuid_check_ibm(cpuid);
+            break;
         default:
             /* Default value */
-            strncpy(cpuid->brand, "Unknown CPU brand", GMX_CPUID_BRAND_MAXLEN);
+            strncpy(cpuid->brand, "Unknown CPU brand", GMX_CPUID_STRLEN);
 #if defined(__linux__) || defined(__linux)
             /* General Linux. Try to get CPU type from /proc/cpuinfo */
             if ( (fp = fopen("/proc/cpuinfo", "r")) != NULL)
@@ -950,7 +1107,7 @@ gmx_cpuid_init               (gmx_cpuid_t *              pcpuid)
                     /* Intel uses "model name", Fujitsu and IBM "cpu". */
                     if (!strcmp(buffer2, "model name") || !strcmp(buffer2, "cpu"))
                     {
-                        chomp_substring_after_colon(buffer, cpuid->brand, GMX_CPUID_BRAND_MAXLEN);
+                        chomp_substring_after_colon(buffer, cpuid->brand, GMX_CPUID_STRLEN);
                         found_brand = 1;
                     }
                 }
@@ -1091,10 +1248,30 @@ gmx_cpuid_simd_suggest  (gmx_cpuid_t                 cpuid)
     }
     else if (gmx_cpuid_vendor(cpuid) == GMX_CPUID_VENDOR_IBM)
     {
-        if (strstr(gmx_cpuid_brand(cpuid), "A2"))
+        if (gmx_cpuid_feature(cpuid, GMX_CPUID_FEATURE_IBM_QPX))
         {
             tmpsimd = GMX_CPUID_SIMD_IBM_QPX;
         }
+        else if (gmx_cpuid_feature(cpuid, GMX_CPUID_FEATURE_IBM_VSX))
+        {
+            /* VSX is better than VMX, so we check it first */
+            tmpsimd = GMX_CPUID_SIMD_IBM_VSX;
+        }
+        else if (gmx_cpuid_feature(cpuid, GMX_CPUID_FEATURE_IBM_VMX))
+        {
+            tmpsimd = GMX_CPUID_SIMD_IBM_VMX;
+        }
+    }
+    else if (gmx_cpuid_vendor(cpuid) == GMX_CPUID_VENDOR_ARM)
+    {
+        if (gmx_cpuid_feature(cpuid, GMX_CPUID_FEATURE_ARM_NEON_ASIMD))
+        {
+            tmpsimd = GMX_CPUID_SIMD_ARM_NEON_ASIMD;
+        }
+        else if (gmx_cpuid_feature(cpuid, GMX_CPUID_FEATURE_ARM_NEON))
+        {
+            tmpsimd = GMX_CPUID_SIMD_ARM_NEON;
+        }
     }
     return tmpsimd;
 }
@@ -1229,3 +1406,5 @@ main(int argc, char **argv)
 }
 
 #endif
+
+/*! \endcond */
similarity index 82%
rename from src/gromacs/gmxlib/gmx_detect_hardware.c
rename to src/gromacs/gmxlib/gmx_detect_hardware.cpp
index 8846cb3242957338cb6444af00c4a3114c3c4c84..490bd87327ca2353d63805fbf186662fad0d2b10 100644 (file)
@@ -4,7 +4,7 @@
  * 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 h=ttp://www.gromacs.org.
+ * 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
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/gmx_detect_hardware.h"
+
+#include "config.h"
 
-#include <stdlib.h>
 #include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 
+#include <string>
+#include <vector>
+
 #ifdef HAVE_UNISTD_H
 /* For sysconf */
 #include <unistd.h>
 #endif
-
-#include "types/enums.h"
-#include "types/hw_info.h"
-#include "types/commrec.h"
-#include "gmx_fatal.h"
-#include "gmx_fatal_collective.h"
-#include "md_logging.h"
-#include "gmx_cpuid.h"
-#include "gromacs/utility/smalloc.h"
-#include "gpu_utils.h"
-#include "copyrite.h"
-#include "gmx_detect_hardware.h"
-#include "main.h"
-#include "md_logging.h"
-#include "gromacs/utility/gmxomp.h"
-#include "gromacs/utility/cstringutil.h"
-
-#include "thread_mpi/threads.h"
-
 #ifdef GMX_NATIVE_WINDOWS
 #include <windows.h>
 #endif
 
+#include "thread_mpi/threads.h"
+
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/gmx_cpuid.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/sysinfo.h"
+
+
 #ifdef GMX_GPU
 const gmx_bool bGPUBinary = TRUE;
 #else
@@ -145,50 +154,69 @@ static void print_gpu_detection_stats(FILE                 *fplog,
     }
 }
 
-static void print_gpu_use_stats(FILE                 *fplog,
-                                const gmx_gpu_info_t *gpu_info,
-                                const gmx_gpu_opt_t  *gpu_opt,
-                                const t_commrec      *cr)
+/*! \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
+ * \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)
 {
-    char sbuf[STRLEN], stmp[STRLEN];
-    int  i, ngpu_comp, ngpu_use;
-
-    ngpu_comp = gpu_info->ncuda_dev_compatible;
-    ngpu_use  = gpu_opt->ncuda_dev_use;
+    int ngpu_use  = gpu_opt->ncuda_dev_use;
+    int ngpu_comp = gpu_info->ncuda_dev_compatible;
 
     /* Issue a note if GPUs are available but not used */
     if (ngpu_comp > 0 && ngpu_use < 1)
     {
-        sprintf(sbuf,
-                "%d compatible GPU%s detected in the system, but none will be used.\n"
-                "Consider trying GPU acceleration with the Verlet scheme!",
-                ngpu_comp, (ngpu_comp > 1) ? "s" : "");
+        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" : "");
     }
-    else
-    {
-        int ngpu_use_uniq;
-
-        ngpu_use_uniq = gmx_count_gpu_dev_unique(gpu_info, gpu_opt);
 
-        sprintf(sbuf, "%d GPU%s %sselected for this run.\n"
-                "Mapping of GPU%s to the %d PP rank%s in this node: ",
-                ngpu_use_uniq, (ngpu_use_uniq > 1) ? "s" : "",
-                gpu_opt->bUserSet ? "user-" : "auto-",
-                (ngpu_use > 1) ? "s" : "",
-                cr->nrank_pp_intranode,
-                (cr->nrank_pp_intranode > 1) ? "s" : "");
+    std::string output;
+    if (!gpu_opt->bUserSet)
+    {
+        // gpu_opt->cuda_dev_compatible is only populated during auto-selection
+        std::string gpuIdsString =
+            formatAndJoin(gmx::constArrayRefFromArray(gpu_opt->cuda_dev_compatible,
+                                                      gpu_opt->ncuda_dev_compatible),
+                          ",", gmx::StringFormatter("%d"));
+        bool bPluralGpus = gpu_opt->ncuda_dev_compatible > 1;
+        output += gmx::formatString("%d compatible GPU%s %s present, with ID%s %s\n",
+                                    gpu_opt->ncuda_dev_compatible,
+                                    bPluralGpus ? "s" : "",
+                                    bPluralGpus ? "are" : "is",
+                                    bPluralGpus ? "s" : "",
+                                    gpuIdsString.c_str());
+    }
 
-        for (i = 0; i < ngpu_use; i++)
+    {
+        std::vector<int> gpuIdsInUse;
+        for (int i = 0; i < ngpu_use; i++)
         {
-            sprintf(stmp, "#%d", get_gpu_device_id(gpu_info, gpu_opt, i));
-            if (i < ngpu_use - 1)
-            {
-                strcat(stmp, ", ");
-            }
-            strcat(sbuf, stmp);
+            gpuIdsInUse.push_back(get_gpu_device_id(gpu_info, gpu_opt, i));
         }
-    }
-    md_print_info(cr, fplog, "%s\n\n", sbuf);
+        std::string gpuIdsString =
+            formatAndJoin(gpuIdsInUse, ",", gmx::StringFormatter("%d"));
+        int         numGpusInUse = gmx_count_gpu_dev_unique(gpu_info, gpu_opt);
+        bool        bPluralGpus  = numGpusInUse > 1;
+
+        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
@@ -231,8 +259,8 @@ void gmx_check_hw_runconf_consistency(FILE                *fplog,
                                       const gmx_hw_opt_t  *hw_opt,
                                       gmx_bool             bUseGPU)
 {
-    int      npppn, ntmpi_pp;
-    char     sbuf[STRLEN], th_or_proc[STRLEN], th_or_proc_plural[STRLEN], pernode[STRLEN];
+    int      npppn;
+    char     th_or_proc[STRLEN], th_or_proc_plural[STRLEN], pernode[STRLEN];
     gmx_bool btMPI, bMPI, bMaxMpiThreadsSet, bNthreadsAuto, bEmulateGPU;
 
     assert(hwinfo);
@@ -247,13 +275,18 @@ void gmx_check_hw_runconf_consistency(FILE                *fplog,
         return;
     }
 
-    btMPI         = bMPI = FALSE;
-    bNthreadsAuto = FALSE;
 #if defined(GMX_THREAD_MPI)
+    bMPI          = FALSE;
     btMPI         = TRUE;
     bNthreadsAuto = (hw_opt->nthreads_tmpi < 1);
 #elif defined(GMX_LIB_MPI)
-    bMPI  = TRUE;
+    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
@@ -274,8 +307,17 @@ void gmx_check_hw_runconf_consistency(FILE                *fplog,
 
     if (hwinfo->gpu_info.ncuda_dev_compatible > 0)
     {
+        std::string gpuUseageReport;
+        try
+        {
+            gpuUseageReport = makeGpuUsageReport(&hwinfo->gpu_info,
+                                                 &hw_opt->gpu_opt,
+                                                 cr->nrank_pp_intranode);
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+
         /* NOTE: this print is only for and on one physical node */
-        print_gpu_use_stats(fplog, &hwinfo->gpu_info, &hw_opt->gpu_opt, cr);
+        md_print_info(cr, fplog, gpuUseageReport.c_str());
     }
 
     /* Need to ensure that we have enough GPUs:
@@ -627,7 +669,6 @@ static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr)
 gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
                                    gmx_bool bDetectGPUs)
 {
-    gmx_hw_info_t   *hw;
     int              ret;
 
     /* make sure no one else is doing the same thing */
@@ -725,7 +766,6 @@ void gmx_select_gpu_ids(FILE *fplog, const t_commrec *cr,
                         gmx_gpu_opt_t *gpu_opt)
 {
     int              i;
-    const char      *env;
     char             sbuf[STRLEN], stmp[STRLEN];
 
     /* Bail if binary is not compiled with GPU acceleration, but this is either
@@ -770,17 +810,7 @@ void gmx_select_gpu_ids(FILE *fplog, const t_commrec *cr,
     else
     {
         pick_compatible_gpus(&hwinfo_g->gpu_info, gpu_opt);
-
-        if (gpu_opt->ncuda_dev_use > cr->nrank_pp_intranode)
-        {
-            /* We picked more GPUs than we can use: limit the number.
-             * We print detailed messages about this later in
-             * gmx_check_hw_runconf_consistency.
-             */
-            limit_num_gpus_used(gpu_opt, cr->nrank_pp_intranode);
-        }
-
-        gpu_opt->bUserSet = FALSE;
+        limit_num_gpus_used(gpu_opt, cr->nrank_pp_intranode);
     }
 
     /* If the user asked for a GPU, check whether we have a GPU */
@@ -790,30 +820,26 @@ void gmx_select_gpu_ids(FILE *fplog, const t_commrec *cr,
     }
 }
 
-static void limit_num_gpus_used(gmx_gpu_opt_t *gpu_opt, int count)
+/* If we detected more compatible GPUs than we can use, limit the
+ * number. We print detailed messages about this later in
+ * gmx_check_hw_runconf_consistency.
+ */
+static void limit_num_gpus_used(gmx_gpu_opt_t *gpu_opt, int maxNumberToUse)
 {
-    int ndev_use;
-
-    assert(gpu_opt);
+    GMX_RELEASE_ASSERT(gpu_opt, "Invalid gpu_opt pointer passed");
+    GMX_RELEASE_ASSERT(maxNumberToUse >= 1,
+                       gmx::formatString("Invalid limit (%d) for the number of GPUs (detected %d compatible GPUs)",
+                                         maxNumberToUse, gpu_opt->ncuda_dev_compatible).c_str());
 
-    ndev_use = gpu_opt->ncuda_dev_use;
-
-    if (count > ndev_use)
-    {
-        /* won't increase the # of GPUs */
-        return;
-    }
-
-    if (count < 1)
+    /* Don't increase the number of GPUs used beyond (e.g.) the number
+       of PP ranks */
+    gpu_opt->ncuda_dev_use = std::min(gpu_opt->ncuda_dev_compatible, maxNumberToUse);
+    snew(gpu_opt->cuda_dev_use, gpu_opt->ncuda_dev_use);
+    for (int i = 0; i != gpu_opt->ncuda_dev_use; ++i)
     {
-        char sbuf[STRLEN];
-        sprintf(sbuf, "Limiting the number of GPUs to <1 doesn't make sense (detected %d, %d requested)!",
-                ndev_use, count);
-        gmx_incons(sbuf);
+        /* TODO: improve this implementation: either sort GPUs or remove the weakest here */
+        gpu_opt->cuda_dev_use[i] = gpu_opt->cuda_dev_compatible[i];
     }
-
-    /* TODO: improve this implementation: either sort GPUs or remove the weakest here */
-    gpu_opt->ncuda_dev_use = count;
 }
 
 void gmx_hardware_info_free(gmx_hw_info_t *hwinfo)
index 68fdbb37e7074d423a457407926c9c19e29bb644..ec6a1f6f354f3081a7305cb3368307a22b94bfbe 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+
+#include "config.h"
+
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <assert.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "gmx_fatal.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "network.h"
-#include "copyrite.h"
-#include "gmx_omp_nthreads.h"
-#include "md_logging.h"
 
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
 
 /** Structure with the number of threads for each OpenMP multi-threaded
@@ -71,7 +73,7 @@ static const char *modth_env_var[emntNR] =
 {
     "GMX_DEFAULT_NUM_THREADS should never be set",
     "GMX_DOMDEC_NUM_THREADS", "GMX_PAIRSEARCH_NUM_THREADS",
-    "GMX_NONBONDED_NUM_THREADS", "GMX_BONDED_NUM_THREADS",
+    "GMX_NONBONDED_NUM_THREADS", "GMX_LISTED_FORCES_NUM_THREADS",
     "GMX_PME_NUM_THREADS", "GMX_UPDATE_NUM_THREADS",
     "GMX_VSITE_NUM_THREADS",
     "GMX_LINCS_NUM_THREADS", "GMX_SETTLE_NUM_THREADS"
@@ -236,223 +238,281 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
     }
 }
 
-void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
-                           int nthreads_hw_avail,
-                           int omp_nthreads_req,
-                           int omp_nthreads_pme_req,
-                           gmx_bool gmx_unused bThisNodePMEOnly,
-                           gmx_bool bFullOmpSupport)
+/*! \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,
+                                            gmx_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, nth_pmeonly, gmx_maxth, nppn;
+    int      nth;
     char    *env;
-    gmx_bool bSepPME, bOMP;
-
-#ifdef GMX_OPENMP
-    bOMP = TRUE;
-#else
-    bOMP = FALSE;
-#endif /* GMX_OPENMP */
-
-    /* number of MPI processes/threads per physical node */
-    nppn = cr->nrank_intranode;
-
-    bSepPME = ( (cr->duty & DUTY_PP) && !(cr->duty & DUTY_PME)) ||
-        (!(cr->duty & DUTY_PP) &&  (cr->duty & DUTY_PME));
 
 #ifdef GMX_THREAD_MPI
-    /* modth is shared among tMPI threads, so for thread safety do the
-     * detection is done on the master only. It is not thread-safe with
-     * multiple simulations, but that's anyway not supported by tMPI. */
-    if (SIMMASTER(cr))
+    /* modth is shared among tMPI threads, so for thread safety, the
+     * detection is done on the master only. It is not thread-safe
+     * with multiple simulations, but that's anyway not supported by
+     * tMPI. */
+    if (!SIMMASTER(cr))
+    {
+        return;
+    }
 #endif
+
+    if (modth.initialized)
     {
-        /* just return if the initialization has already been done */
-        if (modth.initialized)
-        {
-            return;
-        }
+        /* Just return if the initialization has already been
+           done. This could only happen if gmx_omp_nthreads_init() has
+           already been called. */
+        return;
+    }
 
-        /* With full OpenMP support (verlet scheme) set the number of threads
-         * per process / default:
-         * - 1 if not compiled with OpenMP or
-         * - OMP_NUM_THREADS if the env. var is set, or
-         * - omp_nthreads_req = #of threads requested by the user on the mdrun
-         *   command line, otherwise
-         * - take the max number of available threads and distribute them
-         *   on the processes/tMPI threads.
-         * ~ The GMX_*_NUM_THREADS env var overrides the number of threads of
-         *   the respective module and it has to be used in conjunction with
-         *   OMP_NUM_THREADS.
-         *
-         * With the group scheme OpenMP multithreading is only supported in PME,
-         * for all other modules nthreads is set to 1.
-         * The number of PME threads is equal to:
-         * - 1 if not compiled with OpenMP or
-         * - GMX_PME_NUM_THREADS if defined, otherwise
-         * - OMP_NUM_THREADS if defined, otherwise
-         * - 1
-         */
-        nth = 1;
-        if ((env = getenv("OMP_NUM_THREADS")) != NULL)
-        {
-            if (!bOMP && (strncmp(env, "1", 1) != 0))
-            {
-                gmx_warning("OMP_NUM_THREADS is set, but %s was compiled without OpenMP support!",
-                            ShortProgram());
-            }
-            else
-            {
-                nth = gmx_omp_get_max_threads();
-            }
-        }
-        else if (omp_nthreads_req > 0)
+    /* With full OpenMP support (verlet scheme) set the number of threads
+     * per process / default:
+     * - 1 if not compiled with OpenMP or
+     * - OMP_NUM_THREADS if the env. var is set, or
+     * - omp_nthreads_req = #of threads requested by the user on the mdrun
+     *   command line, otherwise
+     * - take the max number of available threads and distribute them
+     *   on the processes/tMPI threads.
+     * ~ The GMX_*_NUM_THREADS env var overrides the number of threads of
+     *   the respective module and it has to be used in conjunction with
+     *   OMP_NUM_THREADS.
+     *
+     * With the group scheme OpenMP multithreading is only supported in PME,
+     * for all other modules nthreads is set to 1.
+     * The number of PME threads is equal to:
+     * - 1 if not compiled with OpenMP or
+     * - GMX_PME_NUM_THREADS if defined, otherwise
+     * - OMP_NUM_THREADS if defined, otherwise
+     * - 1
+     */
+    nth = 1;
+    if ((env = getenv("OMP_NUM_THREADS")) != NULL)
+    {
+        if (!bOMP && (strncmp(env, "1", 1) != 0))
         {
-            nth = omp_nthreads_req;
+            gmx_warning("OMP_NUM_THREADS is set, but %s was compiled without OpenMP support!",
+                        ShortProgram());
         }
-        else if (bFullOmpSupport && bOMP)
+        else
         {
-            /* max available threads per node */
-            nth = nthreads_hw_avail;
-
-            /* divide the threads among the MPI processes/tMPI threads */
-            if (nth >= nppn)
-            {
-                nth /= nppn;
-            }
-            else
-            {
-                nth = 1;
-            }
+            nth = gmx_omp_get_max_threads();
         }
+    }
+    else if (omp_nthreads_req > 0)
+    {
+        nth = omp_nthreads_req;
+    }
+    else if (bFullOmpSupport && bOMP)
+    {
+        /* max available threads per node */
+        nth = nthreads_hw_avail;
 
-        /* now we have the global values, set them:
-         * - 1 if not compiled with OpenMP and for the group scheme
-         * - nth for the verlet scheme when compiled with OpenMP
-         */
-        if (bFullOmpSupport && bOMP)
+        /* divide the threads among the MPI processes/tMPI threads */
+        if (nth >= nppn)
         {
-            modth.gnth = nth;
+            nth /= nppn;
         }
         else
         {
-            modth.gnth = 1;
+            nth = 1;
         }
+    }
 
-        if (bSepPME)
+    /* now we have the global values, set them:
+     * - 1 if not compiled with OpenMP and for the group scheme
+     * - nth for the verlet scheme when compiled with OpenMP
+     */
+    if (bFullOmpSupport && bOMP)
+    {
+        modth.gnth = nth;
+    }
+    else
+    {
+        modth.gnth = 1;
+    }
+
+    if (bSepPME)
+    {
+        if (omp_nthreads_pme_req > 0)
         {
-            if (omp_nthreads_pme_req > 0)
-            {
-                modth.gnth_pme = omp_nthreads_pme_req;
-            }
-            else
-            {
-                modth.gnth_pme = nth;
-            }
+            modth.gnth_pme = omp_nthreads_pme_req;
         }
         else
         {
-            modth.gnth_pme = 0;
+            modth.gnth_pme = nth;
         }
+    }
+    else
+    {
+        modth.gnth_pme = 0;
+    }
 
-        /* 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);
-
-        /* set the number of threads globally */
-        if (bOMP)
-        {
+    /* 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);
+
+    /* set the number of threads globally */
+    if (bOMP)
+    {
 #ifndef GMX_THREAD_MPI
-            if (bThisNodePMEOnly)
+        if (bThisNodePMEOnly)
+        {
+            gmx_omp_set_num_threads(modth.gnth_pme);
+        }
+        else
+#endif      /* GMX_THREAD_MPI */
+        {
+            if (bFullOmpSupport)
             {
-                gmx_omp_set_num_threads(modth.gnth_pme);
+                gmx_omp_set_num_threads(nth);
             }
             else
-#endif      /* GMX_THREAD_MPI */
             {
-                if (bFullOmpSupport)
-                {
-                    gmx_omp_set_num_threads(nth);
-                }
-                else
-                {
-                    gmx_omp_set_num_threads(1);
-                }
+                gmx_omp_set_num_threads(1);
             }
         }
-
-        modth.initialized = TRUE;
     }
+
+    modth.initialized = TRUE;
+}
+
+/*! \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)
+{
 #ifdef GMX_THREAD_MPI
-    /* Non-master threads have to wait for the detection to be done. */
-    if (PAR(cr))
-    {
-        MPI_Barrier(cr->mpi_comm_mysim);
-    }
+    const char *mpi_str = "per tMPI thread";
+#else
+    const char *mpi_str = "per MPI process";
 #endif
 
     /* inform the user about the settings */
-    if (bOMP)
+    if (!bOMP)
     {
-#ifdef GMX_THREAD_MPI
-        const char *mpi_str = "per tMPI thread";
-#else
-        const char *mpi_str = "per MPI process";
-#endif
+        return;
+    }
 
-        /* for group scheme we print PME threads info only */
-        if (bFullOmpSupport)
-        {
-            md_print_info(cr, fplog, "Using %d OpenMP thread%s %s\n",
-                          modth.gnth, modth.gnth > 1 ? "s" : "",
-                          cr->nnodes > 1 ? mpi_str : "");
-        }
-        if (bSepPME && modth.gnth_pme != modth.gnth)
-        {
-            md_print_info(cr, fplog, "Using %d OpenMP thread%s %s for PME\n",
-                          modth.gnth_pme, modth.gnth_pme > 1 ? "s" : "",
-                          cr->nnodes > 1 ? mpi_str : "");
-        }
+    /* for group scheme we print PME threads info only */
+    if (bFullOmpSupport)
+    {
+        md_print_info(cr, fplog, "Using %d OpenMP thread%s %s\n",
+                      modth.gnth, modth.gnth > 1 ? "s" : "",
+                      cr->nnodes > 1 ? mpi_str : "");
+    }
+    if (bSepPME && modth.gnth_pme != modth.gnth)
+    {
+        md_print_info(cr, fplog, "Using %d OpenMP thread%s %s for PME\n",
+                      modth.gnth_pme, modth.gnth_pme > 1 ? "s" : "",
+                      cr->nnodes > 1 ? mpi_str : "");
     }
+}
 
-    /* detect and warn about oversubscription
-     * TODO: enable this for separate PME nodes as well! */
-    if (!bSepPME && cr->rank_pp_intranode == 0)
+/*! \brief Detect and warn about oversubscription of cores.
+ *
+ * \todo This could probably live elsewhere, since it is not specifc
+ * to OpenMP, and only needs modth.gnth.
+ *
+ * \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)
+{
+    char sbuf[STRLEN], sbuf1[STRLEN], sbuf2[STRLEN];
+
+    if (bSepPME || 0 != cr->rank_pp_intranode)
     {
-        char sbuf[STRLEN], sbuf1[STRLEN], sbuf2[STRLEN];
+        return;
+    }
 
-        if (modth.gnth*nppn > nthreads_hw_avail)
-        {
-            sprintf(sbuf, "threads");
-            sbuf1[0] = '\0';
-            sprintf(sbuf2, "O");
+    if (modth.gnth*nppn > nthreads_hw_avail)
+    {
+        sprintf(sbuf, "threads");
+        sbuf1[0] = '\0';
+        sprintf(sbuf2, "O");
 #ifdef GMX_MPI
-            if (modth.gnth == 1)
-            {
+        if (modth.gnth == 1)
+        {
 #ifdef GMX_THREAD_MPI
-                sprintf(sbuf, "thread-MPI threads");
+            sprintf(sbuf, "thread-MPI threads");
 #else
-                sprintf(sbuf, "MPI processes");
-                sprintf(sbuf1, " per rank");
-                sprintf(sbuf2, "On rank %d: o", cr->sim_nodeid);
+            sprintf(sbuf, "MPI processes");
+            sprintf(sbuf1, " per rank");
+            sprintf(sbuf2, "On rank %d: o", cr->sim_nodeid);
 #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);
         }
+#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);
     }
 }
 
+void gmx_omp_nthreads_init(FILE *fplog, t_commrec *cr,
+                           int nthreads_hw_avail,
+                           int omp_nthreads_req,
+                           int omp_nthreads_pme_req,
+                           gmx_bool bThisNodePMEOnly,
+                           gmx_bool bFullOmpSupport)
+{
+    int      nth_pmeonly, gmx_maxth, nppn;
+    gmx_bool bSepPME, bOMP;
+
+#ifdef GMX_OPENMP
+    bOMP = TRUE;
+#else
+    bOMP = FALSE;
+#endif /* GMX_OPENMP */
+
+    /* number of MPI processes/threads per physical node */
+    nppn = cr->nrank_intranode;
+
+    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,
+                                    nthreads_hw_avail,
+                                    omp_nthreads_req, omp_nthreads_pme_req,
+                                    bThisNodePMEOnly, bFullOmpSupport,
+                                    nppn, bSepPME);
+#ifdef GMX_THREAD_MPI
+    /* Non-master threads have to wait for the OpenMP management to be
+     * done, so that code elsewhere that uses OpenMP can be certain
+     * the setup is complete. */
+    if (PAR(cr))
+    {
+        MPI_Barrier(cr->mpi_comm_mysim);
+    }
+#endif
+
+    reportOpenmpSettings(fplog, cr, bOMP, bSepPME, bFullOmpSupport);
+    issueOversubscriptionWarning(fplog, cr, bSepPME, nthreads_hw_avail, nppn);
+}
+
 int gmx_omp_nthreads_get(int mod)
 {
     if (mod < 0 || mod >= emntNR)
index 78695c64d21f81a4427ad126fb8c71dfb9e1ac33..e4cc7386e1324c5e825e251ec8f25460f38cb1f8 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/gmx_thread_affinity.h"
+
+#include "config.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
 #ifdef HAVE_SCHED_AFFINITY
-#  ifndef _GNU_SOURCE
-#    define _GNU_SOURCE 1
-#  endif
 #  include <sched.h>
 #  include <sys/syscall.h>
 #endif
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
 
 #include "thread_mpi/threads.h"
 
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "types/hw_info.h"
-#include "copyrite.h"
-#include "gmx_cpuid.h"
-#include "gmx_omp_nthreads.h"
-#include "md_logging.h"
-#include "gmx_thread_affinity.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/gmx_cpuid.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 static int
 get_thread_affinity_layout(FILE *fplog,
@@ -371,21 +373,56 @@ 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            gmx_unused *fplog,
-                              const t_commrec gmx_unused *cr,
-                              gmx_hw_opt_t    gmx_unused *hw_opt,
-                              int             gmx_unused  nthreads_hw_avail,
-                              gmx_bool        gmx_unused  bAfterOpenmpInit)
+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)
 {
 #ifdef HAVE_SCHED_AFFINITY
     cpu_set_t mask_current;
     int       i, ret, cpu_count, cpu_set;
     gmx_bool  bAllSet;
+#endif
 #ifdef GMX_LIB_MPI
     gmx_bool  bAllSet_All;
 #endif
 
     assert(hw_opt);
+    if (!bAfterOpenmpInit)
+    {
+        /* Check for externally set OpenMP affinity and turn off internal
+         * pinning if any is found. We need to do this check early to tell
+         * thread-MPI whether it should do pinning when spawning threads.
+         * TODO: the above no longer holds, we should move these checks later
+         */
+        if (hw_opt->thread_affinity != threadaffOFF)
+        {
+            char *message;
+            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);
+                sfree(message);
+                hw_opt->thread_affinity = threadaffOFF;
+            }
+        }
+
+        /* With thread-MPI this is needed as pinning might get turned off,
+         * which needs to be known before starting thread-MPI.
+         * With thread-MPI hw_opt is processed here on the master rank
+         * and passed to the other ranks later, so we only do this on master.
+         */
+        if (!SIMMASTER(cr))
+        {
+            return;
+        }
+#ifndef GMX_THREAD_MPI
+        return;
+#endif
+    }
+
+#ifdef HAVE_SCHED_GETAFFINITY
     if (hw_opt->thread_affinity == threadaffOFF)
     {
         /* internal affinity setting is off, don't bother checking process affinity */
index cbfd3f341be9981f0c4d8bd4edf233a0198c3651..dee9b3ee078c3b827e9a4b8f59e6eafcb3256747 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-# (slightly sloppy) OS definitions required by memtestG80
-set(_os_def)
-if(UNIX)
-    if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-        set(_os_def "-DOSX")
-    else() # everything that's UNIX & UNIX-like except OS X
-        set(_os_def "-DLINUX")
-    endif()
-else()
-    if(WIN32)
-        set(_os_def "-DWINDOWS")
-    else()
-        message(FATAL_ERROR " Could not detect OS required for memtestG80.")
-    endif()
-endif()
-
-CUDA_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)        
 file(GLOB GPU_UTILS_SOURCES *.cu)
-CUDA_ADD_LIBRARY(gpu_utils STATIC ${GPU_UTILS_SOURCES}
-                 OPTIONS ${_os_def}
-                 RELWITHDEBINFO -g
-                 DEBUG -g -D_DEBUG_=1 )
+set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${GPU_UTILS_SOURCES} PARENT_SCOPE)
 
-CUDA_BUILD_CLEAN_TARGET()
index d626214d5cfee2055eb4ed53757c4b38629b4558..df477525c27c379c2cc6da02a21a8d1272559322 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#include "gromacs/utility/smalloc.h"
-#include "types/hw_info.h"
+#include "gmxpre.h"
 
 #include "gpu_utils.h"
-#include "../cuda_tools/cudautils.cuh"
-#include "memtestG80_core.h"
 
-/** Amount of memory to be used in quick memtest. */
-#define QUICK_MEM       250
-/** Bit flag with type of tests to run in quick memtest. */
-#define QUICK_TESTS     MOD_20_32BIT | LOGIC_4_ITER_SHMEM | RANDOM_BLOCKS
-/** Number of iterations in quick memtest. */
-#define QUICK_ITER      3
+#include "config.h"
 
-/** Bitflag with all test set on for full memetest. */
-#define FULL_TESTS      0x3FFF
-/** Number of iterations in full memtest. */
-#define FULL_ITER       25
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-/** Bit flag with type of tests to run in time constrained memtest. */
-#define TIMED_TESTS     MOD_20_32BIT | LOGIC_4_ITER_SHMEM | RANDOM_BLOCKS
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
 
 /*! \brief
  * Max number of devices supported by CUDA (for consistency checking).
@@ -72,25 +62,6 @@ __global__ void k_dummy_test()
 }
 
 
-/** Bit-flags which refer to memtestG80 test types and are used in do_memtest
- * to specify which tests to run. */
-enum memtest_G80_test_types {
-    MOVING_INVERSIONS_10   = 0x1,
-    MOVING_INVERSIONS_RAND = 0x2,
-    WALKING_8BIT_M86       = 0x4,
-    WALKING_0_8BIT         = 0x8,
-    WALKING_1_8BIT         = 0x10,
-    WALKING_0_32BIT        = 0x20,
-    WALKING_1_32BIT        = 0x40,
-    RANDOM_BLOCKS          = 0x80,
-    MOD_20_32BIT           = 0x100,
-    LOGIC_1_ITER           = 0x200,
-    LOGIC_4_ITER           = 0x400,
-    LOGIC_1_ITER_SHMEM     = 0x800,
-    LOGIC_4_ITER_SHMEM     = 0x1000
-};
-
-
 /*!
  * \brief Runs GPU sanity checks.
  *
@@ -204,353 +175,240 @@ static int do_sanity_checks(int dev_id, cudaDeviceProp *dev_prop)
     return 0;
 }
 
-
-/*!
- * \brief Runs a set of memory tests specified by the given bit-flags.
- * Tries to allocate and do the test on \p megs Mb memory or
- * the greatest amount that can be allocated (>10Mb).
- * In case if an error is detected it stops without finishing the remaining
- * steps/iterations and returns greater then zero value.
- * In case of other errors (e.g. kernel launch errors, device querying errors)
- * -1 is returned.
- *
- * \param[in] which_tests   variable with bit-flags of the requested tests
- * \param[in] megs          amount of memory that will be tested in MB
- * \param[in] iter          number of iterations
- * \returns                 0 if no error was detected, otherwise >0
+#ifdef 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 int do_memtest(unsigned int which_tests, int megs, int iter)
+static void md_print_info(FILE       *fplog,
+                          const char *fmt, ...)
 {
-    memtestState    tester;
-    int             i;
-    uint            err_count; //, err_iter;
+    va_list ap;
 
-    // no parameter check as this fn won't be called externally
-
-    // let's try to allocate the mem
-    while (!tester.allocate(megs) && (megs - 10 > 0))
+    if (fplog != NULL)
     {
-        megs -= 10; tester.deallocate();
-    }
+        /* 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);
 
-    if (megs <= 10)
-    {
-        fprintf(stderr, "Unable to allocate GPU memory!\n");
-        return -1;
+        va_start(ap, fmt);
+        vfprintf(fplog, fmt, ap);
+        va_end(ap);
     }
+}
+#endif /*HAVE_NVML*/
 
-    // clear the first 18 bits
-    which_tests &= 0x3FFF;
-    for (i = 0; i < iter; i++)
+/* 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)
     {
-        // Moving Inversions (ones and zeros)
-        if ((MOVING_INVERSIONS_10 & which_tests) == MOVING_INVERSIONS_10)
-        {
-            tester.gpuMovingInversionsOnesZeros(err_count);
-            if (err_count > 0)
-            {
-                return MOVING_INVERSIONS_10;
-            }
-        }
-        // Moving Inversions (random)
-        if ((MOVING_INVERSIONS_RAND & which_tests) == MOVING_INVERSIONS_RAND)
-        {
-            tester.gpuMovingInversionsRandom(err_count);
-            if (err_count > 0)
-            {
-                return MOVING_INVERSIONS_RAND;
-            }
-        }
-        // Memtest86 Walking 8-bit
-        if ((WALKING_8BIT_M86 & which_tests) == WALKING_8BIT_M86)
-        {
-            for (uint shift = 0; shift < 8; shift++)
-            {
-                tester.gpuWalking8BitM86(err_count, shift);
-                if (err_count > 0)
-                {
-                    return WALKING_8BIT_M86;
-                }
-            }
-        }
-        // True Walking zeros (8-bit)
-        if ((WALKING_0_8BIT & which_tests) == WALKING_0_8BIT)
-        {
-            for (uint shift = 0; shift < 8; shift++)
-            {
-                tester.gpuWalking8Bit(err_count, false, shift);
-                if (err_count > 0)
-                {
-                    return WALKING_0_8BIT;
-                }
-            }
-        }
-        // True Walking ones (8-bit)
-        if ((WALKING_1_8BIT & which_tests) == WALKING_1_8BIT)
-        {
-            for (uint shift = 0; shift < 8; shift++)
-            {
-                tester.gpuWalking8Bit(err_count, true, shift);
-                if (err_count > 0)
-                {
-                    return WALKING_1_8BIT;
-                }
-            }
-        }
-        // Memtest86 Walking zeros (32-bit)
-        if ((WALKING_0_32BIT & which_tests) == WALKING_0_32BIT)
-        {
-            for (uint shift = 0; shift < 32; shift++)
-            {
-                tester.gpuWalking32Bit(err_count, false, shift);
-                if (err_count > 0)
-                {
-                    return WALKING_0_32BIT;
-                }
-            }
-        }
-        // Memtest86 Walking ones (32-bit)
-        if ((WALKING_1_32BIT & which_tests) == WALKING_1_32BIT)
-        {
-            for (uint shift = 0; shift < 32; shift++)
-            {
-                tester.gpuWalking32Bit(err_count, true, shift);
-                if (err_count > 0)
-                {
-                    return WALKING_1_32BIT;
-                }
-            }
-        }
-        // Random blocks
-        if ((RANDOM_BLOCKS & which_tests) == RANDOM_BLOCKS)
-        {
-            tester.gpuRandomBlocks(err_count, rand());
-            if (err_count > 0)
-            {
-                return RANDOM_BLOCKS;
-            }
+        /* 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);
+    }
+}
 
-        // Memtest86 Modulo-20
-        if ((MOD_20_32BIT & which_tests) == MOD_20_32BIT)
-        {
-            for (uint shift = 0; shift < 20; shift++)
-            {
-                tester.gpuModuloX(err_count, shift, rand(), 20, 2);
-                if (err_count > 0)
-                {
-                    return MOD_20_32BIT;
-                }
-            }
-        }
-        // Logic (one iteration)
-        if ((LOGIC_1_ITER & which_tests) == LOGIC_1_ITER)
+#ifdef HAVE_NVML
+/*! \brief Determines and adds the NVML device ID to the passed \cuda_dev.
+ *
+ * Determines and adds the NVML device ID to the passed \cuda_dev. This is done by
+ * matching PCI-E information from \cuda_dev with the available NVML devices.
+ *
+ * \param[in,out] cuda_dev  CUDA device information to enrich with NVML device info
+ * \returns                 true if \cuda_dev could be enriched with matching NVML device information.
+ */
+static bool addNVMLDeviceId(cuda_dev_info* cuda_dev)
+{
+    nvmlReturn_t nvml_stat = NVML_SUCCESS;
+    nvmlDevice_t nvml_device_id;
+    unsigned int nvml_device_count = 0;
+    cuda_dev->nvml_initialized = false;
+    nvml_stat                  = nvmlDeviceGetCount ( &nvml_device_count );
+    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)
+    {
+        nvml_stat = nvmlDeviceGetHandleByIndex ( nvml_device_idx, &nvml_device_id );
+        HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetHandleByIndex failed" );
+        if (nvml_stat != NVML_SUCCESS)
         {
-            tester.gpuShortLCG0(err_count, 1);
-            if (err_count > 0)
-            {
-                return LOGIC_1_ITER;
-            }
+            break;
         }
-        // Logic (4 iterations)
-        if ((LOGIC_4_ITER & which_tests) == LOGIC_4_ITER)
-        {
-            tester.gpuShortLCG0(err_count, 4);
-            if (err_count > 0)
-            {
-                return LOGIC_4_ITER;
-            }
 
-        }
-        // Logic (shared memory, one iteration)
-        if ((LOGIC_1_ITER_SHMEM & which_tests) == LOGIC_1_ITER_SHMEM)
+        nvmlPciInfo_t nvml_pci_info;
+        nvml_stat = nvmlDeviceGetPciInfo ( nvml_device_id, &nvml_pci_info );
+        HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetPciInfo failed" );
+        if (nvml_stat != NVML_SUCCESS)
         {
-            tester.gpuShortLCG0Shmem(err_count, 1);
-            if (err_count > 0)
-            {
-                return LOGIC_1_ITER_SHMEM;
-            }
+            break;
         }
-        // Logic (shared-memory, 4 iterations)
-        if ((LOGIC_4_ITER_SHMEM & which_tests) == LOGIC_4_ITER_SHMEM)
+        if (static_cast<unsigned int>(cuda_dev->prop.pciBusID) == nvml_pci_info.bus &&
+            static_cast<unsigned int>(cuda_dev->prop.pciDeviceID) == nvml_pci_info.device &&
+            static_cast<unsigned int>(cuda_dev->prop.pciDomainID) == nvml_pci_info.domain)
         {
-            tester.gpuShortLCG0Shmem(err_count, 4);
-            if (err_count > 0)
-            {
-                return LOGIC_4_ITER_SHMEM;
-            }
+            cuda_dev->nvml_initialized = true;
+            cuda_dev->nvml_device_id   = nvml_device_id;
+            break;
         }
     }
-
-    tester.deallocate();
-    return err_count;
+    return cuda_dev->nvml_initialized;
 }
+#endif /*HAVE_NVML*/
 
-/*! \brief Runs a quick memory test and returns 0 in case if no error is detected.
- * If an error is detected it stops before completing the test and returns a
- * value greater then 0. In case of other errors (e.g. kernel launch errors,
- * device querying errors) -1 is returned.
+/*! \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.
  *
- * \param[in] dev_id    the device id of the GPU or -1 if the device has already been selected
- * \returns             0 if no error was detected, otherwise >0
+ * \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.
+ * \returns                 true if no error occurs during application clocks handling.
  */
-int do_quick_memtest(int dev_id)
+static gmx_bool init_gpu_application_clocks(FILE gmx_unused *fplog, int gmx_unused gpuid, const gmx_gpu_info_t gmx_unused *gpu_info)
 {
-    cudaDeviceProp  dev_prop;
-    int             devmem, res, time = 0;
-
-    if (debug)
+#ifndef HAVE_NVML
+    if ( (gpu_info->cuda_dev[gpuid].prop.major * 10 + gpu_info->cuda_dev[gpuid].prop.minor) >= 35 &&
+         (0 == gmx_wcmatch( "*Tesla*", gpu_info->cuda_dev[gpuid].prop.name )))
     {
-        time = getTimeMilliseconds();
+        //TODO: Maybe need to think about something more user friendly here.
+        md_print_warn( fplog, "Could not set GPU clocks to the optimal value because application clocks handling not possible for %s due to missing NVML support.\n", gpu_info->cuda_dev[gpuid].prop.name );
     }
-
-    if (do_sanity_checks(dev_id, &dev_prop) != 0)
+    return true;
+#else /* HAVE_NVML defined */
+    nvmlReturn_t nvml_stat = NVML_SUCCESS;
+    char        *env;
+    if (!( (gpu_info->cuda_dev[gpuid].prop.major * 10 + gpu_info->cuda_dev[gpuid].prop.minor) >= 35 &&
+           (0 == gmx_wcmatch( "*Tesla*", gpu_info->cuda_dev[gpuid].prop.name ))))
     {
-        // something went wrong
-        return -1;
+        return true;
     }
-
-    if (debug)
+    //TODO: GMX_GPU_APPLICATION_CLOCKS is currently only used to enable/disable setting of application clocks
+    //      this variable can be later used to give a user more fine grained control.
+    env = getenv("GMX_GPU_APPLICATION_CLOCKS");
+    if (env != NULL && ( strcmp( env, "0") == 0 ||
+                         gmx_strcasecmp( env, "OFF") == 0 ||
+                         gmx_strcasecmp( env, "DISABLE") == 0 ))
     {
-        devmem = dev_prop.totalGlobalMem/(1024*1024); // in MiB
-        fprintf(debug, ">> Running QUICK memtests on %d MiB (out of total %d MiB), %d iterations\n",
-                QUICK_MEM, devmem, QUICK_ITER);
+        return true;
     }
-
-    res = do_memtest(QUICK_TESTS, QUICK_MEM, QUICK_ITER);
-
-    if (debug)
+    nvml_stat = nvmlInit();
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlInit failed." );
+    if (nvml_stat != NVML_SUCCESS)
     {
-        fprintf(debug, "Q-RES = %d\n", res);
-        fprintf(debug, "Q-runtime: %d ms\n", getTimeMilliseconds() - time);
+        return false;
     }
-
-    /* destroy context only if we created it */
-    if (dev_id != -1)
+    if (!addNVMLDeviceId( &(gpu_info->cuda_dev[gpuid])))
     {
-        cudaThreadExit();
+        return false;
     }
-    return res;
-}
-
-/*! \brief Runs a full memory test and returns 0 in case if no error is detected.
- * If an error is detected  it stops before completing the test and returns a
- * value greater then 0. In case of other errors (e.g. kernel launch errors,
- * device querying errors) -1 is returned.
- *
- * \param[in] dev_id    the device id of the GPU or -1 if the device has already been selected
- * \returns             0 if no error was detected, otherwise >0
- */
-
-int do_full_memtest(int dev_id)
-{
-    cudaDeviceProp  dev_prop;
-    int             devmem, res, time = 0;
-
-    if (debug)
+    //get current application clocks setting
+    unsigned int app_sm_clock  = 0;
+    unsigned int app_mem_clock = 0;
+    nvml_stat = nvmlDeviceGetApplicationsClock ( gpu_info->cuda_dev[gpuid].nvml_device_id, NVML_CLOCK_SM, &app_sm_clock );
+    if (NVML_ERROR_NOT_SUPPORTED == nvml_stat)
     {
-        time = getTimeMilliseconds();
+        return false;
     }
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetApplicationsClock failed" );
+    nvml_stat = nvmlDeviceGetApplicationsClock ( gpu_info->cuda_dev[gpuid].nvml_device_id, NVML_CLOCK_MEM, &app_mem_clock );
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetApplicationsClock failed" );
+    //get max application clocks
+    unsigned int max_sm_clock  = 0;
+    unsigned int max_mem_clock = 0;
+    nvml_stat = nvmlDeviceGetMaxClockInfo ( gpu_info->cuda_dev[gpuid].nvml_device_id, NVML_CLOCK_SM, &max_sm_clock );
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetMaxClockInfo failed" );
+    nvml_stat = nvmlDeviceGetMaxClockInfo ( gpu_info->cuda_dev[gpuid].nvml_device_id, NVML_CLOCK_MEM, &max_mem_clock );
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetMaxClockInfo failed" );
 
-    if (do_sanity_checks(dev_id, &dev_prop) != 0)
-    {
-        // something went wrong
-        return -1;
-    }
+    gpu_info->cuda_dev[gpuid].nvml_is_restricted     = NVML_FEATURE_ENABLED;
+    gpu_info->cuda_dev[gpuid].nvml_ap_clocks_changed = false;
 
-    devmem = dev_prop.totalGlobalMem/(1024*1024); // in MiB
+    nvml_stat = nvmlDeviceGetAPIRestriction ( gpu_info->cuda_dev[gpuid].nvml_device_id, NVML_RESTRICTED_API_SET_APPLICATION_CLOCKS, &(gpu_info->cuda_dev[gpuid].nvml_is_restricted) );
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetAPIRestriction failed" );
 
-    if (debug)
+    //TODO: Need to distinguish between different type of GPUs might be necessary in the future, e.g. if max application clocks should not be used
+    //      for certain GPUs.
+    if (nvml_stat == NVML_SUCCESS && app_sm_clock < max_sm_clock && gpu_info->cuda_dev[gpuid].nvml_is_restricted == NVML_FEATURE_DISABLED)
     {
-        fprintf(debug, ">> Running FULL memtests on %d MiB (out of total %d MiB), %d iterations\n",
-                devmem, devmem, FULL_ITER);
+        //TODO: Maybe need to think about something more user friendly here.
+        md_print_info( fplog, "Changing GPU clocks by setting application clocks for %s to (%d,%d)\n", gpu_info->cuda_dev[gpuid].prop.name, max_mem_clock, max_sm_clock);
+        nvml_stat = nvmlDeviceSetApplicationsClocks ( gpu_info->cuda_dev[gpuid].nvml_device_id, max_mem_clock, max_sm_clock );
+        HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceGetApplicationsClock failed" );
+        gpu_info->cuda_dev[gpuid].nvml_ap_clocks_changed = true;
     }
-
-    /* do all test on the entire memory */
-    res = do_memtest(FULL_TESTS, devmem, FULL_ITER);
-
-    if (debug)
+    else if (nvml_stat == NVML_SUCCESS && app_sm_clock < max_sm_clock)
     {
-        fprintf(debug, "F-RES = %d\n", res);
-        fprintf(debug, "F-runtime: %d ms\n", getTimeMilliseconds() - time);
+        //TODO: Maybe need to think about something more user friendly here.
+        md_print_warn( fplog, "Not possible to change GPU clocks to optimal value because of insufficient permissions to set application clocks for %s. Current values are (%d,%d). Max values are (%d,%d)\nUse sudo nvidia-smi -acp UNRESTRICTED or contact your admin to change application clock permissions.\n", gpu_info->cuda_dev[gpuid].prop.name, app_mem_clock, app_sm_clock, max_mem_clock, max_sm_clock);
     }
-
-    /* destroy context only if we created it */
-    if (dev_id != -1)
+    else if (nvml_stat == NVML_SUCCESS && app_sm_clock == max_sm_clock)
     {
-        cudaThreadExit();
+        //TODO: This should probably be integrated into the GPU Properties table.
+        md_print_info( fplog, "Application clocks (GPU clocks) for %s are (%d,%d)\n", gpu_info->cuda_dev[gpuid].prop.name, app_mem_clock, app_sm_clock);
     }
-    return res;
+    else
+    {
+        //TODO: Maybe need to think about something more user friendly here.
+        md_print_warn( fplog,  "Not possible to change GPU clocks to optimal value because application clocks handling failed with NVML error (%d): %s.\n", nvml_stat, nvmlErrorString(nvml_stat));
+    }
+    return (nvml_stat == NVML_SUCCESS);
+#endif /*HAVE_NVML*/
 }
 
-/*! \brief Runs a time constrained memory test and returns 0 in case if no error is detected.
- * If an error is detected it stops before completing the test and returns a value greater
- * than zero. In case of other errors (e.g. kernel launch errors, device querying errors) -1
- * is returned. Note, that test iterations are not interrupted therefor the total runtime of
- * the test will always be multipple of one iteration's runtime.
+/*! \brief Resets application clocks if changed and cleans up NVML for the passed \cuda_dev.
  *
- * \param[in] dev_id        the device id of the GPU or -1 if the device has laredy been selected
- * \param[in] time_constr   the time limit of the testing
- * \returns                 0 if no error was detected, otherwise >0
+ * \param[in] cuda_dev  CUDA device information
  */
-int do_timed_memtest(int dev_id, int time_constr)
+static gmx_bool reset_gpu_application_clocks(const cuda_dev_info gmx_unused * cuda_dev)
 {
-    cudaDeviceProp  dev_prop;
-    int             devmem, res = 0, time = 0, startt;
-
-    if (debug)
-    {
-        time = getTimeMilliseconds();
-    }
-
-    time_constr *= 1000;  /* convert to ms for convenience */
-    startt       = getTimeMilliseconds();
-
-    if (do_sanity_checks(dev_id, &dev_prop) != 0)
-    {
-        // something went wrong
-        return -1;
-    }
-
-    devmem = dev_prop.totalGlobalMem/(1024*1024); // in MiB
-
-    if (debug)
-    {
-        fprintf(debug, ">> Running time constrained memtests on %d MiB (out of total %d MiB), time limit of %d s \n",
-                devmem, devmem, time_constr);
-    }
-
-    /* do the TIMED_TESTS set, one step at a time on the entire memory
-       that can be allocated, and stop when the given time is exceeded */
-    while ( ((int)getTimeMilliseconds() - startt) < time_constr)
-    {
-        res = do_memtest(TIMED_TESTS, devmem, 1);
-        if (res != 0)
-        {
-            break;
-        }
-    }
-
-    if (debug)
-    {
-        fprintf(debug, "T-RES = %d\n", res);
-        fprintf(debug, "T-runtime: %d ms\n", getTimeMilliseconds() - time);
-    }
-
-    /* destroy context only if we created it */
-    if (dev_id != -1)
-    {
-        cudaThreadExit();
-    }
-    return res;
+#ifndef HAVE_NVML
+    GMX_UNUSED_VALUE(cuda_dev);
+    return true;
+#else
+    nvmlReturn_t nvml_stat = NVML_SUCCESS;
+    if (cuda_dev &&
+        cuda_dev->nvml_is_restricted == NVML_FEATURE_DISABLED &&
+        cuda_dev->nvml_ap_clocks_changed)
+    {
+        nvml_stat = nvmlDeviceResetApplicationsClocks( cuda_dev->nvml_device_id );
+        HANDLE_NVML_RET_ERR( nvml_stat, "nvmlDeviceResetApplicationsClocks failed" );
+    }
+    nvml_stat = nvmlShutdown();
+    HANDLE_NVML_RET_ERR( nvml_stat, "nvmlShutdown failed" );
+    return (nvml_stat == NVML_SUCCESS);
+#endif /*HAVE_NVML*/
 }
 
+
 /*! \brief Initializes the GPU with the given index.
  *
  * The varible \mygpu is the index of the GPU to initialize in the
  * gpu_info.cuda_dev array.
  *
+ * \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).
@@ -558,7 +416,7 @@ int do_timed_memtest(int dev_id, int time_constr)
  * \param[in] gpu_opt       options for using the GPUs in gpu_info
  * \returns                 true if no error occurs during initialization.
  */
-gmx_bool init_gpu(int mygpu, char *result_str,
+gmx_bool init_gpu(FILE gmx_unused *fplog, int mygpu, char *result_str,
                   const gmx_gpu_info_t *gpu_info,
                   const gmx_gpu_opt_t *gpu_opt)
 {
@@ -587,6 +445,11 @@ gmx_bool init_gpu(int mygpu, char *result_str,
         fprintf(stderr, "Initialized GPU ID #%d: %s\n", gpuid, gpu_info->cuda_dev[gpuid].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);
 }
 
@@ -595,13 +458,22 @@ gmx_bool init_gpu(int mygpu, char *result_str,
  * 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[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.
  */
-gmx_bool free_gpu(char *result_str)
+gmx_bool free_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
+        )
 {
-    cudaError_t stat;
+    cudaError_t  stat;
+    gmx_bool     reset_gpu_application_clocks_status = true;
+    int          gpuid;
 
     assert(result_str);
 
@@ -613,14 +485,18 @@ gmx_bool free_gpu(char *result_str)
         fprintf(stderr, "Cleaning up context on GPU ID #%d\n", gpuid);
     }
 
+    gpuid = gpu_opt ? gpu_opt->cuda_dev_use[mygpu] : -1;
+    if (gpuid != -1)
+    {
+        reset_gpu_application_clocks_status = reset_gpu_application_clocks( &(gpu_info->cuda_dev[gpuid]) );
+    }
 #if CUDA_VERSION < 4000
     stat = cudaThreadExit();
 #else
     stat = cudaDeviceReset();
 #endif
     strncpy(result_str, cudaGetErrorString(stat), STRLEN);
-
-    return (stat == cudaSuccess);
+    return (stat == cudaSuccess) && reset_gpu_application_clocks_status;
 }
 
 /*! \brief Returns true if the gpu characterized by the device properties is
@@ -794,9 +670,9 @@ void pick_compatible_gpus(const gmx_gpu_info_t *gpu_info,
         }
     }
 
-    gpu_opt->ncuda_dev_use = ncompat;
-    snew(gpu_opt->cuda_dev_use, ncompat);
-    memcpy(gpu_opt->cuda_dev_use, compat, ncompat*sizeof(*compat));
+    gpu_opt->ncuda_dev_compatible = ncompat;
+    snew(gpu_opt->cuda_dev_compatible, ncompat);
+    memcpy(gpu_opt->cuda_dev_compatible, compat, ncompat*sizeof(*compat));
     sfree(compat);
 }
 
similarity index 87%
rename from src/gromacs/legacyheaders/gpu_utils.h
rename to src/gromacs/gmxlib/gpu_utils/gpu_utils.h
index e2960730495f0185e2374e3b87175bc6f05ff4be..46468b0180d7a5032ce57e910b2a8b8136ec452a 100644 (file)
 #ifndef _GPU_UTILS_H_
 #define _GPU_UTILS_H_
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
-#include "types/simple.h"
-#include "types/hw_info.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef GMX_GPU
 #define FUNC_TERM_INT ;
+#define FUNC_TERM_SIZE_T ;
 #define FUNC_TERM_VOID ;
 #define FUNC_QUALIFIER
 #else
 #define FUNC_TERM_INT {return -1; }
+#define FUNC_TERM_SIZE_T {return 0; }
 #define FUNC_TERM_VOID {}
 #define FUNC_QUALIFIER static
 #endif
 extern "C" {
 #endif
 
-FUNC_QUALIFIER
-int do_quick_memtest(int gmx_unused dev_id) FUNC_TERM_INT
-
-FUNC_QUALIFIER
-int do_full_memtest(int gmx_unused dev_id) FUNC_TERM_INT
-
-FUNC_QUALIFIER
-int do_timed_memtest(int gmx_unused dev_id, int gmx_unused time_limit) FUNC_TERM_INT
-
 FUNC_QUALIFIER
 int detect_cuda_gpus(gmx_gpu_info_t gmx_unused *gpu_info, char gmx_unused *err_str) FUNC_TERM_INT
 
@@ -84,12 +75,14 @@ FUNC_QUALIFIER
 void free_gpu_info(const gmx_gpu_info_t gmx_unused *gpu_info) FUNC_TERM_VOID
 
 FUNC_QUALIFIER
-gmx_bool init_gpu(int gmx_unused mygpu, char gmx_unused *result_str,
+gmx_bool init_gpu(FILE gmx_unused *fplog, int gmx_unused mygpu, char gmx_unused *result_str,
                   const gmx_gpu_info_t gmx_unused *gpu_info,
                   const gmx_gpu_opt_t gmx_unused *gpu_opt) FUNC_TERM_INT
 
 FUNC_QUALIFIER
-gmx_bool free_gpu(char gmx_unused *result_str) FUNC_TERM_INT
+gmx_bool free_gpu(int gmx_unused mygpu, char gmx_unused *result_str,
+                  const gmx_gpu_info_t gmx_unused *gpu_info,
+                  const gmx_gpu_opt_t gmx_unused *gpu_opt) FUNC_TERM_INT
 
 /*! \brief Returns the device ID of the GPU currently in use.*/
 FUNC_QUALIFIER
@@ -104,7 +97,7 @@ FUNC_QUALIFIER
 void get_gpu_device_info_string(char gmx_unused *s, const gmx_gpu_info_t gmx_unused *gpu_info, int gmx_unused index) FUNC_TERM_VOID
 
 FUNC_QUALIFIER
-size_t sizeof_cuda_dev_info(void) FUNC_TERM_INT
+size_t sizeof_cuda_dev_info(void) FUNC_TERM_SIZE_T
 
 #ifdef __cplusplus
 }
diff --git a/src/gromacs/gmxlib/gpu_utils/memtestG80_core.cu b/src/gromacs/gmxlib/gpu_utils/memtestG80_core.cu
deleted file mode 100644 (file)
index 2a4c606..0000000
+++ /dev/null
@@ -1,872 +0,0 @@
-/*
- * memtestG80_core.cu
- * MemtestG80 core memory test functions and OOP interface to tester.
- *
- * Author: Imran Haque, 2009
- * Copyright 2009, Stanford University
- *
- * This file is licensed under the terms of the LGPL. Please see
- * the COPYING file in the accompanying source distribution for
- * full license terms.
- *
- */
-
- /*
-  * CUDA grid layout: Linear in blocks and threads.
-  * Intended usage = 1k blocks, 512 t/blk, with N words (iterations) per thread
-  *     -> 2*N MiB tested per grid
-  * thread address at iteration i = base + blockIdx.x * N * blockDim.x + i*blockDim.x + threadIdx.x
-  *
-  */
-
-// Naming convention: gpuXXX and cpuXXX functions are user-accessible; deviceXXX functions are internal
-//                    gpuXXX functions execute a particular test on a block of GPU memory
-//                    cpuXXX "          "      "   "         "    " "  "    "  CPU "
-
-#define THREAD_ADDRESS(base,N,i) (base + blockIdx.x * N * blockDim.x + i * blockDim.x + threadIdx.x)
-#define THREAD_OFFSET(N,i) (blockIdx.x * N * blockDim.x + i * blockDim.x + threadIdx.x)
-#define BITSDIFF(x,y) __popc((x) ^ (y))
-
-
-#include "memtestG80_core.h"
-
-#include <stdio.h>
-
-
-
-
-void memtestState::deallocate() {
-               if (allocated) {
-                       cudaFree(devTestMem);
-                       cudaFree(devTempMem);
-                       free(hostTempMem);
-                       devTestMem = NULL;
-                       devTempMem = NULL;
-                       hostTempMem = NULL;
-                       allocated = false;
-               }
-        initTime = 0;
-       }
-
-uint memtestState::allocate(uint mbToTest) {
-               deallocate();
-
-        initTime = getTimeMilliseconds();
-               
-        // Round up to nearest 2MiB
-               if (mbToTest % 2) mbToTest++;
-
-               megsToTest = mbToTest;
-               loopIters = megsToTest/2;
-
-               if (megsToTest == 0) return 0;
-               
-               try {
-                       if (cudaMalloc((void**)&devTestMem,megsToTest*1048576UL) != cudaSuccess) throw 1;
-                       if (cudaMalloc((void**)&devTempMem,sizeof(uint)*nBlocks) != cudaSuccess) throw 2;
-                       if ( (hostTempMem = (uint*)malloc(sizeof(uint)*nBlocks)) == NULL) throw 3;
-               } catch (...) {
-            // Clear CUDA error flag for outside world
-            cudaGetLastError();
-                       if (devTempMem) {
-                               cudaFree(devTempMem);
-                               devTempMem = NULL;
-                       }
-                       if (devTestMem) {
-                               cudaFree(devTestMem);
-                               devTestMem = NULL;
-                       }
-                       if (hostTempMem) {
-                               free(hostTempMem);
-                               hostTempMem = NULL;
-                       }
-                       return 0;
-               }
-               allocated = true;
-               return megsToTest;
-       }
-bool memtestState::gpuMemoryBandwidth(double& bandwidth,uint mbToTest,uint iters) {
-    if (!allocated || megsToTest < 2*mbToTest) return false;
-    bandwidth = ::gpuMemoryBandwidth(devTestMem,devTestMem+mbToTest*1048576/4,mbToTest,iters);
-    return cudaGetLastError() == cudaSuccess;
-}
-bool memtestState::gpuWriteConstant(const uint constant) const {
-       if (!allocated) return false;
-       ::gpuWriteConstant(nBlocks,nThreads,devTestMem,loopIters,constant);
-       return cudaGetLastError() == cudaSuccess;
-}
-
-bool memtestState::gpuVerifyConstant(uint& errorCount,const uint constant) const {
-       if (!allocated) return false;
-       errorCount = ::gpuVerifyConstant(nBlocks,nThreads,devTestMem,loopIters,constant,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-
-bool memtestState::gpuShortLCG0(uint& errorCount,const uint repeats) const {
-       if (!allocated) return false;
-       errorCount = ::gpuShortLCG0(nBlocks,nThreads,devTestMem,loopIters,repeats,lcgPeriod,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuShortLCG0Shmem(uint& errorCount,const uint repeats) const {
-       if (!allocated) return false;
-       errorCount = ::gpuShortLCG0Shmem(nBlocks,nThreads,devTestMem,loopIters,repeats,lcgPeriod,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuMovingInversionsOnesZeros(uint& errorCount) const {
-       if (!allocated) return false;
-       errorCount = ::gpuMovingInversionsOnesZeros(nBlocks,nThreads,devTestMem,loopIters,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuWalking8BitM86(uint& errorCount,const uint shift) const {
-       if (!allocated) return false;
-       errorCount = ::gpuWalking8BitM86(nBlocks,nThreads,devTestMem,loopIters,shift,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuWalking8Bit(uint& errorCount,const bool ones,const uint shift) const {
-       if (!allocated) return false;
-       errorCount = ::gpuWalking8Bit(nBlocks,nThreads,devTestMem,loopIters,ones,shift,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuMovingInversionsRandom(uint& errorCount) const {
-       if (!allocated) return false;
-       errorCount = ::gpuMovingInversionsRandom(nBlocks,nThreads,devTestMem,loopIters,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuWalking32Bit(uint& errorCount,const bool ones,const uint shift) const {
-       if (!allocated) return false;
-       errorCount = ::gpuWalking32Bit(nBlocks,nThreads,devTestMem,loopIters,ones,shift,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuRandomBlocks(uint& errorCount,const uint seed) const {
-       if (!allocated) return false;
-       errorCount = ::gpuRandomBlocks(nBlocks,nThreads,devTestMem,loopIters,seed,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-bool memtestState::gpuModuloX(uint& errorCount,const uint shift,const uint pattern,const uint modulus,const uint overwriteIters) const {
-       if (!allocated) return false;
-       errorCount = ::gpuModuloX(nBlocks,nThreads,devTestMem,loopIters,shift,pattern,modulus,overwriteIters,devTempMem,hostTempMem);
-       return ((cudaGetLastError() == cudaSuccess) && (errorCount != 0xFFFFFFFF) && (errorCount != 0xFFFFFFFE));
-}
-       
-               
-
-__global__ void deviceWriteConstant(uint* base, uint N, const uint constant);
-__global__ void deviceVerifyConstant(uint* base,uint N,const uint constant,uint* blockErrorCount);
-__global__ void deviceShortLCG0(uint* base,uint N,uint repeats,const int period);
-__global__ void deviceShortLCG0Shmem(uint* base,uint N,uint repeats,const int period);
-__global__ void deviceWriteRandomBlocks(uint* base,uint N,int seed);
-__global__ void deviceVerifyRandomBlocks(uint* base,uint N,int seed,uint* blockErrorCount);
-__global__ void deviceWriteWalking32Bit(uint* base,uint N,bool ones,uint shift);
-__global__ void deviceVerifyWalking32Bit(uint* base,uint N,bool ones,uint shift,uint* blockErrorCount);
-__global__ void deviceWritePairedConstants(uint* base,uint N,uint pattern0,uint pattern1);
-__global__ void deviceVerifyPairedConstants(uint* base,uint N,uint pattern0,uint pattern1,uint* blockErrorCount);
-__global__ void deviceWritePairedModulo(uint* base,const uint N,const uint shift,const uint pattern1,const uint pattern2,const uint modulus,const uint iters);
-__global__ void deviceVerifyPairedModulo(uint* base,uint N,const uint shift,const uint pattern1,const uint modulus,uint* blockErrorCount);
-
-
-// Utility function to measure memory bandwidth
-__host__ double gpuMemoryBandwidth(uint* src,uint* dst,uint mbToTest,uint iters) {
-       uint start = getTimeMilliseconds();
-          for (uint i = 0; i < iters; i++) {
-           cudaMemcpy(dst,src,mbToTest*1048576,cudaMemcpyDeviceToDevice);
-       }
-       //D-to-D memory copies are non-blocking, so sync to get correct timing
-       cudaThreadSynchronize();
-       //SOFTWAIT();
-       uint end = getTimeMilliseconds();
-          
-       // Calculate bandwidth in MiB/s
-          // Multiply by 2 since we are reading and writing to the same memory
-       double bw = 2.0*((double)mbToTest*iters)/((end-start)/1000.0);
-          return bw;
-}
-
-// Utility functions to write/verify pure constants in memory, CPU/GPU {{{
-__host__ void gpuWriteConstant(const uint nBlocks,const uint nThreads,uint* base,uint N,const uint constant) { //{{{
-    deviceWriteConstant<<<nBlocks,nThreads>>>(base,N,constant);
-}
-
-__global__ void deviceWriteConstant(uint* base, uint N, const uint constant) {
-    for (uint i = 0 ; i < N; i++) {      
-        *(THREAD_ADDRESS(base,N,i)) = constant;
-    }
-}
-//}}}
-__host__ uint gpuVerifyConstant(const uint nBlocks,const uint nThreads,uint* base,uint N,const uint constant,uint* blockErrorCount,uint* errorCounts) { //{{{
-    // Given device arrays base (tested memory) and blockErrorCount (nBlocks uints in length of temp space)
-    
-       deviceVerifyConstant<<<nBlocks,nThreads,sizeof(uint)*nThreads>>>(base,N,constant,blockErrorCount);
-       CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-       
-    cudaMemcpy(errorCounts,blockErrorCount,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-
-    // Sum-reduce block error counts on the host - it's only order of 1k numbers.
-    uint totalErrors = 0;
-    for (uint i = 0; i < nBlocks; i++) {
-        totalErrors += errorCounts[i];
-    }
-    return totalErrors;
-}
-
-__global__ void deviceVerifyConstant(uint* base,uint N,const uint constant,uint* blockErrorCount) {
-    // Verifies memory at base to make sure it has a constant pattern
-    // Sums number of errors found in block and stores error count into blockErrorCount[blockIdx.x]
-    // Sum-reduce this array afterwards to get total error count over tested region
-    // Uses 4*blockDim.x bytes of shared memory
-    
-    extern __shared__ uint threadErrorCount[];
-    threadErrorCount[threadIdx.x] = 0;
-
-    for (uint i = 0; i < N; i++) {
-        //if ( *(THREAD_ADDRESS(base,N,i)) != constant ) threadErrorCount[threadIdx.x]++;
-        threadErrorCount[threadIdx.x] += BITSDIFF(*(THREAD_ADDRESS(base,N,i)),constant);
-    }
-    // Parallel-reduce error counts over threads in block
-    for (uint stride = blockDim.x>>1; stride > 0; stride >>= 1) {
-        __syncthreads();
-        if (threadIdx.x < stride)
-            threadErrorCount[threadIdx.x] += threadErrorCount[threadIdx.x + stride];
-    }
-    __syncthreads();
-    
-    if (threadIdx.x == 0)
-        blockErrorCount[blockIdx.x] = threadErrorCount[0];
-    
-    return;
-}
-//}}}
-
- __host__ void cpuWriteConstant(const uint nBlocks,const uint nThreads,uint* base,uint N,const uint constant) { //{{{
-    dim3 blockDim(nThreads,0,0);
-    dim3 threadIdx(0,0,0);
-    dim3 blockIdx(0,0,0);
-    for (blockIdx.x = 0; blockIdx.x < nBlocks; blockIdx.x++) {
-        for (uint i = 0; i < N; i++) {
-            for (threadIdx.x = 0; threadIdx.x < blockDim.x; threadIdx.x++) {
-                *(THREAD_ADDRESS(base,N,i)) = constant;
-            }
-        }
-    }
-}
-//}}}
-__host__ uint cpuVerifyConstant(const uint nBlocks,const uint nThreads,uint* base,uint N,const uint constant) { //{{{
-    dim3 blockDim(nThreads,0,0);
-    dim3 threadIdx(0,0,0);
-    dim3 blockIdx(0,0,0);
-    uint errorCount = 0;
-    for (blockIdx.x = 0; blockIdx.x < nBlocks; blockIdx.x++) {
-        for (uint i = 0; i < N; i++) {
-            for (threadIdx.x = 0; threadIdx.x < blockDim.x; threadIdx.x++) {
-                if (*(THREAD_ADDRESS(base,N,i)) != constant) errorCount++;
-            }
-        }
-    }
-    return errorCount;
-} 
-//}}}
-//}}}
-
-// Logic test 
-// Idea: Run a varying number of iterations (k*N) of a short-period (per=N) LCG that returns to zero (or F's) quickly {{{
-// Store only the result of the last iteration
-// Compare output to the desired constant
-// Compare results between varying k - memory error rate for a given pattern should be constant,
-//                                     so variation should be due to logic errors in loop count
-__host__ uint gpuShortLCG0(const uint nBlocks,const uint nThreads,uint* base,uint N,const uint repeats,const int period,uint* blockErrorCounts,uint* errorCounts) { //{{{
-    deviceShortLCG0<<<nBlocks,nThreads>>>(base,N,repeats,period);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-    CHECK_LAUNCH_ERROR();
-    return gpuVerifyConstant(nBlocks,nThreads,base,N,0,blockErrorCounts,errorCounts);
-} //}}}
-
-__host__ uint gpuShortLCG0Shmem(const uint nBlocks,const uint nThreads,uint* base,uint N,const uint repeats,const int period,uint* blockErrorCounts,uint* errorCounts) { //{{{
-    deviceShortLCG0Shmem<<<nBlocks,nThreads,sizeof(uint)*nThreads>>>(base,N,repeats,period);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-    CHECK_LAUNCH_ERROR();
-    return gpuVerifyConstant(nBlocks,nThreads,base,N,0,blockErrorCounts,errorCounts);
-} //}}}
-
-// Put the LCG loop into a macro so we don't repeat code between versions of logic tester.
-// The paired XOR adds diversity to the instruction stream, and is not reduced to a NOT
-// as a single XOR is (verified with decuda).
-// {{{
-#if defined (LINUX) || defined(OSX)
-#define LCGLOOP(var,repeats,period,a,c) for (uint rep = 0; rep < repeats; rep++) {\
-    (var) = ~(var);\
-    _Pragma("unroll 1")\
-    for (uint iter = 0; iter < period; iter++) {\
-        (var) = ~(var);\
-        (var) = (a)*(var)+(c);\
-        (var) ^= 0xFFFFFFF0;\
-        (var) ^= 0xF;\
-    }\
-    (var) = ~(var);\
-}
-#elif defined (WINDOWS) || defined (WINNV)
-#define LCGLOOP(var,repeats,period,a,c) for (uint rep = 0; rep < repeats; rep++) {\
-    (var) = ~(var);\
-    __pragma("unroll 1")\
-    for (uint iter = 0; iter < period; iter++) {\
-        (var) = ~(var);\
-        (var) = (a)*(var)+(c);\
-        (var) ^= 0xFFFFFFF0;\
-        (var) ^= 0xF;\
-    }\
-    (var) = ~(var);\
-}
-#endif
-//}}}
-
-__global__ void deviceShortLCG0(uint* base,uint N,uint repeats,const int period) { //{{{
-    // Pick a different block for different LCG lengths
-    // Short periods are useful if LCG goes inside for i in 0..N loop
-    int a,c;
-    switch (period) {
-        case 1024: a = 0x0fbfffff; c = 0x3bf75696; break;
-        case 512:  a = 0x61c8647f; c = 0x2b3e0000; break;
-        case 256:  a = 0x7161ac7f; c = 0x43840000; break;
-        case 128:  a = 0x0432b47f; c = 0x1ce80000; break;
-        case 2048: a = 0x763fffff; c = 0x4769466f; break;
-        default:   a = 0; c = 0; break;
-    }
-    
-    uint value = 0;
-    LCGLOOP(value,repeats,period,a,c)
-
-    for (uint i = 0 ; i < N; i++) {
-        *(THREAD_ADDRESS(base,N,i)) = value;
-    }
-} //}}} 
-// _shmem version uses shared memory to store inter-iteration values
-// is more sensitive to shared memory errors from (eg) shader overclocking 
-__global__ void deviceShortLCG0Shmem(uint* base,uint N,uint repeats,const int period) { //{{{
-    // Pick a different block for different LCG lengths
-    // Short periods are useful if LCG goes inside for i in 0..N loop
-    int a,c;
-    extern __shared__ uint shmem[];
-    switch (period) {
-        case 1024: a = 0x0fbfffff; c = 0x3bf75696; break;
-        case 512:  a = 0x61c8647f; c = 0x2b3e0000; break;
-        case 256:  a = 0x7161ac7f; c = 0x43840000; break;
-        case 128:  a = 0x0432b47f; c = 0x1ce80000; break;
-        case 2048: a = 0x763fffff; c = 0x4769466f; break;
-        default:   a = 0; c = 0; break;
-    }
-    shmem[threadIdx.x] = 0;
-    LCGLOOP(shmem[threadIdx.x],repeats,period,a,c)
-
-    for (uint i = 0 ; i < N; i++) {
-        *(THREAD_ADDRESS(base,N,i)) = shmem[threadIdx.x];
-
-    }
-} //}}} //}}}
-
-
-// Memtest86 Test 2: tseq=0,4
-__host__ uint gpuMovingInversionsOnesZeros(const uint nBlocks,const uint nThreads,uint* base,uint N,uint* blockErrorCounts,uint* errorCounts) { //{{{
-    
-    uint errorCount;
-    gpuWriteConstant(nBlocks,nThreads,base,N,0xFFFFFFFF);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-       errorCount = gpuVerifyConstant(nBlocks,nThreads,base,N,0xFFFFFFFF,blockErrorCounts,errorCounts);
-       CHECK_LAUNCH_ERROR();
-
-       gpuWriteConstant(nBlocks,nThreads,base,N,0x0);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-       errorCount += gpuVerifyConstant(nBlocks,nThreads,base,N,0x0,blockErrorCounts,errorCounts);
-       CHECK_LAUNCH_ERROR();
-    return errorCount;
-} //}}}
-
-// Memtest86 Test 3: tseq=1
-__host__ uint gpuWalking8BitM86(const uint nBlocks,const uint nThreads,uint* base,uint N,uint shift,uint* blockErrorCounts,uint* errorCounts) { //{{{
-    // Performs the Memtest86 variation on the walking 8-bit pattern, where the same shifted pattern is
-    // written into each 32-bit word in memory, verified, and its complement written and verified
-    shift &= 0x7;
-    uint pattern = 1 << shift;
-    pattern = pattern | (pattern << 8) | (pattern << 16) | (pattern << 24);
-
-    uint errorCount;
-    gpuWriteConstant(nBlocks,nThreads,base,N,pattern);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-       errorCount = gpuVerifyConstant(nBlocks,nThreads,base,N,pattern,blockErrorCounts,errorCounts);
-       CHECK_LAUNCH_ERROR();
-
-       pattern = ~pattern;
-    gpuWriteConstant(nBlocks,nThreads,base,N,pattern);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-       errorCount += gpuVerifyConstant(nBlocks,nThreads,base,N,pattern,blockErrorCounts,errorCounts);
-       CHECK_LAUNCH_ERROR();
-    return errorCount;
-} //}}}
-__host__ uint cpuWalking8BitM86(const uint nBlocks,const uint nThreads,uint* base,uint N,uint shift) { //{{{
-    // Performs the Memtest86 variation on the walking 8-bit pattern, where the same shifted pattern is
-    // written into each 32-bit word in memory, verified, and its complement written and verified
-    shift &= 0x7;
-    uint pattern = 1 << shift;
-    pattern = pattern | (pattern << 8) | (pattern << 16) | (pattern << 24);
-
-    uint errorCount;
-    cpuWriteConstant(nBlocks,nThreads,base,N,pattern);
-    errorCount = cpuVerifyConstant(nBlocks,nThreads,base,N,pattern);
-
-    pattern = ~pattern;
-    cpuWriteConstant(nBlocks,nThreads,base,N,pattern);
-    errorCount += cpuVerifyConstant(nBlocks,nThreads,base,N,pattern);
-
-    return errorCount;
-} //}}}
-__host__ uint gpuWalking8Bit(const uint nBlocks,const uint nThreads,uint* base,uint N,bool ones,uint shift,uint* blockErrorCount,uint* errorCounts) { //{{{
-    // Implements one iteration of true walking 8-bit ones/zeros test
-    uint patterns[2]={0x0,0x0};
-    
-    // Build the walking-ones paired pattern of 8-bits with the given shift
-    shift &= 0x7;
-    uint bits = 0x1 << shift;
-    for (uint i = 0; i < 4; i++) {
-        patterns[0] = (patterns[0] << 8) | bits;
-        bits = (bits == 0x80) ? 0x01 : bits<<1;
-    }
-    for (uint i = 0; i < 4; i++) {
-        patterns[1] = (patterns[1] << 8) | bits;
-        bits = (bits == 0x80) ? 0x01 : bits<<1;
-    }
-
-    if (!ones) {
-        patterns[0] = ~patterns[0];
-        patterns[1] = ~patterns[1];
-    }
-       
-       //printf("Host Patterns: %08x %08x\n",patterns[0],patterns[1]);
-    deviceWritePairedConstants<<<nBlocks,nThreads>>>(base,N,patterns[0],patterns[1]);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-       //cudaMemcpy(errorCounts,base,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-    //printf("First few words in tested RAM: %08x %08x %08x %08x %08x %08x\n",errorCounts[0],errorCounts[1],errorCounts[2],errorCounts[3],errorCounts[4],errorCounts[5]);
-    // Given device arrays base (tested memory) and blockErrorCount (nBlocks uints in length of temp space)
-    deviceVerifyPairedConstants<<<nBlocks,nThreads,sizeof(uint)*nThreads>>>(base,N,patterns[0],patterns[1],blockErrorCount);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-    //if (cudaGetLastError() != cudaSuccess) {
-       //      return 0xFFFFFFFF; // -1
-       //}
-       //uint errorCounts[nBlocks];
-    cudaMemcpy(errorCounts,blockErrorCount,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-
-    // Sum-reduce block error counts on the host - it's only order of 1k numbers.
-    uint totalErrors = 0;
-    for (uint i = 0; i < nBlocks; i++) {
-        totalErrors += errorCounts[i];
-    }
-    return totalErrors;
-}
-
-__global__ void deviceWritePairedConstants(uint* base,uint N,uint pattern0,uint pattern1) {
-    // Writes paired constants to memory, such that each offset that is X mod 2 receives patterns[X]
-    // Used for true walking-ones/zeros 8-bit test
-    //if (threadIdx.x == 0)
-    //    printf("Device Patterns Block %u: %08x %08x\n",blockIdx.x,patterns[0],patterns[1]);
-    const uint pattern = (threadIdx.x & 0x1) ? pattern1 : pattern0;
-    //const uint pattern = patterns[threadIdx.x & 0x1];
-    for (uint i = 0 ; i < N; i++) {      
-        *(THREAD_ADDRESS(base,N,i)) = pattern;
-        //*(base+blockIdx.x*N*blockDim.x + i*blockDim.x + threadIdx.x) = 0;
-    }
-
-}
-
-__global__ void deviceVerifyPairedConstants(uint* base,uint N,uint pattern0,uint pattern1,uint* blockErrorCount) {
-    // Verifies memory at base to make sure it has a correct paired-constant pattern
-    // Sums number of errors found in block and stores error count into blockErrorCount[blockIdx.x]
-    // Sum-reduce this array afterwards to get total error count over tested region
-    // Uses 4*blockDim.x bytes of shared memory
-    
-    extern __shared__ uint threadErrorCount[];
-    threadErrorCount[threadIdx.x] = 0;
-    //const uint pattern = patterns[threadIdx.x & 0x1];
-    const uint pattern = (threadIdx.x & 0x1) ? pattern1 : pattern0;
-    
-    for (uint i = 0; i < N; i++) {
-        //if ( *(THREAD_ADDRESS(base,N,i)) != pattern ) threadErrorCount[threadIdx.x]++;
-        threadErrorCount[threadIdx.x] += BITSDIFF(*(THREAD_ADDRESS(base,N,i)),pattern);
-    }
-    // Parallel-reduce error counts over threads in block
-    for (uint stride = blockDim.x>>1; stride > 0; stride >>= 1) {
-        __syncthreads();
-        if (threadIdx.x < stride)
-            threadErrorCount[threadIdx.x] += threadErrorCount[threadIdx.x + stride];
-    }
-    __syncthreads();
-    
-    if (threadIdx.x == 0)
-        blockErrorCount[blockIdx.x] = threadErrorCount[0];
-    
-    return;
-}
-//}}}
-
-// Memtest86 Test 4: tseq=10
-__host__ uint gpuMovingInversionsRandom(const uint nBlocks,const uint nThreads,uint* base,uint N,uint* blockErrorCounts,uint* errorCounts) { //{{{
-    
-    uint errorCount;
-
-    uint pattern = (uint)rand();
-    gpuWriteConstant(nBlocks,nThreads,base,N,pattern);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-       
-       errorCount = gpuVerifyConstant(nBlocks,nThreads,base,N,pattern,blockErrorCounts,errorCounts);
-       CHECK_LAUNCH_ERROR();
-    
-       pattern = ~pattern;
-    gpuWriteConstant(nBlocks,nThreads,base,N,pattern);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-       
-       errorCount += gpuVerifyConstant(nBlocks,nThreads,base,N,pattern,blockErrorCounts,errorCounts);
-       CHECK_LAUNCH_ERROR();
-    return errorCount;
-} //}}}
-
-// Memtest86 Test 6: tseq=2
-__host__ uint gpuWalking32Bit(const uint nBlocks,const uint nThreads,uint* base,uint N,bool ones,uint shift,uint* blockErrorCount,uint* errorCounts) { //{{{
-    // Given device arrays base (tested memory) and blockErrorCount (nBlocks uints in length of temp space)
-    // Does one iteration of the walking-{ones/zeros} 32-bit test paralleling Memtest
-    // With the starting pattern 1<<shift
-    // NUMBER OF THREADS SHOULD BE A MULTIPLE OF 32
-
-    deviceWriteWalking32Bit<<<nBlocks,nThreads>>>(base,N,ones,shift);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-       deviceVerifyWalking32Bit<<<nBlocks,nThreads,sizeof(uint)*nThreads>>>(base,N,ones,shift,blockErrorCount);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-    cudaMemcpy(errorCounts,blockErrorCount,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-
-    // Sum-reduce block error counts on the host - it's only order of 1k numbers.
-    uint totalErrors = 0;
-    for (uint i = 0; i < nBlocks; i++) {
-        totalErrors += errorCounts[i];
-    }
-    return totalErrors;
-    
-}
-
-__global__ void deviceWriteWalking32Bit(uint* base,uint N,bool ones,uint shift) {
-    // Writes one iteration of the walking-{ones/zeros} 32-bit pattern to gpu memory
-
-    // Want to write in a 1 << (offset from base + shift % 32)
-    // Since thread indices are aligned with base, this reduces to
-    // 1 << ((threadIdx.x+shift) & 0x1f)
-    // With conditional inversion for walking zeros
-    uint pattern = 1 << ((threadIdx.x + shift) & 0x1f);
-    pattern = ones ? pattern : ~pattern;
-    
-    for (uint i = 0; i < N; i++) {
-        *(THREAD_ADDRESS(base,N,i)) = pattern;
-    }
-}
-
-__global__ void deviceVerifyWalking32Bit(uint* base,uint N,bool ones,uint shift,uint* blockErrorCount) {
-    // Verifies memory at base to make sure it has a constant pattern
-    // Sums number of errors found in block and stores error count into blockErrorCount[blockIdx.x]
-    // Sum-reduce this array afterwards to get total error count over tested region
-    // Uses 4*blockDim.x bytes of shared memory
-    
-    extern __shared__ uint threadErrorCount[];
-    threadErrorCount[threadIdx.x] = 0;
-
-    uint pattern = 1 << ((threadIdx.x + shift) & 0x1f);
-    pattern = ones ? pattern : ~pattern;
-    
-    for (uint i = 0; i < N; i++) {
-        //if ( *(THREAD_ADDRESS(base,N,i)) != pattern ) threadErrorCount[threadIdx.x]++;
-        threadErrorCount[threadIdx.x] += BITSDIFF(*(THREAD_ADDRESS(base,N,i)),pattern);
-    }
-    // Parallel-reduce error counts over threads in block
-    for (uint stride = blockDim.x>>1; stride > 0; stride >>= 1) {
-        __syncthreads();
-        if (threadIdx.x < stride)
-            threadErrorCount[threadIdx.x] += threadErrorCount[threadIdx.x + stride];
-    }
-    __syncthreads();
-    
-    if (threadIdx.x == 0)
-        blockErrorCount[blockIdx.x] = threadErrorCount[0];
-    
-    return;
-}
-//}}}
-
-// Memtest86 Test 7: tseq=9
-__host__ uint gpuRandomBlocks(const uint nBlocks,const uint nThreads,uint* base,uint N,uint seed,uint* blockErrorCount,uint* errorCounts) { //{{{ {{{
-    // Writes random numbers into memory and verifies pattern
-    //uint errorCounts[nBlocks];
-    
-    deviceWriteRandomBlocks<<<nBlocks,nThreads,4*nThreads>>>(base,N,seed);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-
-       //cudaMemcpy(errorCounts,base,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-    //printf("First few words in tested RAM: %08x %08x %08x %08x %08x %08x\n",errorCounts[0],errorCounts[1],errorCounts[2],errorCounts[3],errorCounts[4],errorCounts[5]);
-       
-       deviceVerifyRandomBlocks<<<nBlocks,nThreads,12*nThreads>>>(base,N,seed,blockErrorCount);
-    CHECK_LAUNCH_ERROR();
-    SOFTWAIT();
-       CHECK_LAUNCH_ERROR();
-       
-       
-    cudaMemcpy(errorCounts,blockErrorCount,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-
-    // Sum-reduce block error counts on the host - it's only order of 1k numbers.
-    uint totalErrors = 0;
-    for (uint i = 0; i < nBlocks; i++) {
-        totalErrors += errorCounts[i];
-    }
-    return totalErrors;
-}
-//}}}
-//
-// Math functions modulo the Mersenne prime 2^31 -1 {{{
-__device__ void deviceMul3131 (uint v1, uint v2,uint& LO, uint& HI)
-{
-    // Given v1, v2 < 2^31
-    // Emulate a 31-bit integer multiply by doing instead a 32-bit multiply into LO and HI
-    // And shifting bits around to make it look right.
-    LO = v1*v2;
-    HI = __umulhi(v1,v2);
-    HI <<= 1;
-    HI |= (LO & 0x80000000) >> 31;
-    LO &= 0x7FFFFFFF;
-    
-}
-
-__device__ uint deviceModMP31(uint LO,uint HI) {
-    // Modulo a 62-bit number HI<<31 + LO, mod 2^31-1
-    // Encyclopedia of Cryptography and Security By Henk C. A. van Tilborg
-    // page 381, Mersenne Primes
-    uint sum = LO+HI;
-    if (sum >= 0x80000000) {
-        // If a+b > 2^31, then high bit will be set
-        return sum - 0x80000000 + 1;
-    } else {
-        return sum;
-    }
-}
-__device__ uint deviceMulMP31(uint a,uint b) {
-    // Multiplies a pair of 31-bit integers a and b mod the Mersenne prime 2^31-1
-    // Takes result through a 62-bit intermediate
-    uint LO,HI;
-    deviceMul3131(a,b,LO,HI);
-    return deviceModMP31(LO,HI);
-}
-
-__device__ uint deviceExpoModMP31(uint base,uint exponent) {
-    uint result = 1;
-    while (exponent > 0) {
-        if (exponent & 1) {
-            result = deviceMulMP31(result,base);
-        }
-        exponent >>= 1;
-        base = deviceMulMP31(base,base);
-    }
-    return result;
-}
-//}}}
-// deviceRan0p: Parallelized closed-form version of NR's ran0  {{{
-__device__ uint deviceRan0p(int seed,int n) { // 
-    uint an = deviceExpoModMP31(16807,n+1);
-    return deviceMulMP31(an,seed);
-}
-//}}}
-// deviceIrbit2: random bit generation, from NR {{{
-__device__ int deviceIrbit2(uint& seed) {
-    const uint IB1  = 1;
-    const uint IB2  = 2;
-    const uint IB5  = 16;
-    const uint IB18 = 131072;
-    const uint MASK = IB1+IB2+IB5;
-    if (seed & IB18) {
-        seed = ((seed ^ MASK) << 1) | IB1;
-        return 1;
-    } else {
-        seed <<= 1;
-        return 0;
-    }
-}
-//}}}
-__global__ void deviceWriteRandomBlocks(uint* base,uint N,int seed) { //{{{
-    // Requires 4*nThreads bytes of shared memory
-    extern __shared__ uint randomBlock[];
-
-    // Make sure seed is not zero.
-    if (seed == 0) seed = 123459876+blockIdx.x;
-    uint bitSeed = deviceRan0p(seed + threadIdx.x,threadIdx.x);
-
-    for (uint i=0; i < N; i++) {
-        // Generate a block of random numbers in parallel using closed-form expression for ran0
-        // OR in a random bit because Ran0 will never have the high bit set
-        randomBlock[threadIdx.x] = deviceRan0p(seed,threadIdx.x) | (deviceIrbit2(bitSeed) << 31);
-        __syncthreads();
-        
-        // Set the seed for the next round to the last number calculated in this round
-        seed = randomBlock[blockDim.x-1];
-        
-        // Blit shmem block out to global memory
-        *(THREAD_ADDRESS(base,N,i)) = randomBlock[threadIdx.x];
-    }
-}
-//}}}
-__global__ void deviceVerifyRandomBlocks(uint* base,uint N,int seed,uint* blockErrorCount) { //{{{
-    // Verifies memory at base to make sure it has a correct random pattern given the seed
-    // Sums number of errors found in block and stores error count into blockErrorCount[blockIdx.x]
-    // Sum-reduce this array afterwards to get total error count over tested region
-    // Uses 12*blockDim.x bytes of shared memory
-    
-    extern __shared__ uint shmem[];
-    uint* threadErrorCount = shmem;
-    uint* randomBlock = shmem + blockDim.x;
-    // Put these into shmem to cut register count
-    uint* bitSeeds = randomBlock + blockDim.x;
-    
-    threadErrorCount[threadIdx.x] = 0;
-
-    // Make sure seed is not zero.
-    if (seed == 0) seed = 123459876+blockIdx.x;
-    //uint bitSeed = deviceRan0p(seed + threadIdx.x,threadIdx.x);
-    bitSeeds[threadIdx.x] = deviceRan0p(seed + threadIdx.x,threadIdx.x);
-    
-    for (uint i = 0; i < N; i++) {
-        // Generate a block of random numbers in parallel using closed-form expression for ran0
-        // OR in a random bit because Ran0 will never have the high bit set
-        //randomBlock[threadIdx.x] = deviceRan0p(seed,threadIdx.x) | (deviceIrbit2(bitSeed) << 31);
-        randomBlock[threadIdx.x] = deviceRan0p(seed,threadIdx.x) | (deviceIrbit2(bitSeeds[threadIdx.x]) << 31);
-        __syncthreads();
-        
-        // Set the seed for the next round to the last number calculated in this round
-        seed = randomBlock[blockDim.x-1];
-        
-        //if ( randomBlock[threadIdx.x] != *(THREAD_ADDRESS(base,N,i))) threadErrorCount[threadIdx.x]++;
-        threadErrorCount[threadIdx.x] += BITSDIFF(*(THREAD_ADDRESS(base,N,i)),randomBlock[threadIdx.x]);
-        
-    }
-
-    // Parallel-reduce error counts over threads in block
-    for (uint stride = blockDim.x>>1; stride > 0; stride >>= 1) {
-        __syncthreads();
-        if (threadIdx.x < stride)
-            threadErrorCount[threadIdx.x] += threadErrorCount[threadIdx.x + stride];
-    }
-    __syncthreads();
-    
-    if (threadIdx.x == 0)
-        blockErrorCount[blockIdx.x] = threadErrorCount[0];
-    
-    return;
-}
-//}}}
-//}}}
-
-// Memtest86 Test 8: tseq=3 (M86 uses modulus = 20)
-__host__ uint gpuModuloX(const uint nBlocks,const uint nThreads,uint* base,const uint N,uint shift,uint pattern1,const uint modulus,const uint iters,
-                                                uint* blockErrorCount,uint* errorCounts) { //{{{
-    // Given device arrays base (tested memory) and blockErrorCount (nBlocks uints in length of temp space)
-    // Given a shift, modulus, pattern to test and number of overwrite iterations
-    // Performs Modulo-X test on memory
-    
-    //uint errorCounts[nBlocks];
-    uint totalErrors = 0;
-    shift %= modulus;
-
-    // Test both the given pattern and its inverse
-    for (uint i = 0; i < 2; i++, pattern1 = ~pattern1) {
-        deviceWritePairedModulo<<<nBlocks,nThreads>>>(base,N,shift,pattern1,~pattern1,modulus,iters);
-           CHECK_LAUNCH_ERROR();
-        SOFTWAIT();
-           CHECK_LAUNCH_ERROR();
-
-               deviceVerifyPairedModulo<<<nBlocks,nThreads,sizeof(uint)*nThreads>>>(base,N,shift,pattern1,modulus,blockErrorCount);
-               CHECK_LAUNCH_ERROR();
-        SOFTWAIT();
-           CHECK_LAUNCH_ERROR();
-
-        cudaMemcpy(errorCounts,blockErrorCount,sizeof(uint)*nBlocks,cudaMemcpyDeviceToHost);
-
-        // Sum-reduce block error counts on the host - it's only order of 1k numbers.
-        for (uint i = 0; i < nBlocks; i++) {
-            totalErrors += errorCounts[i];
-        }
-    }
-    return totalErrors;
-}
-
-__global__ void deviceWritePairedModulo(uint* base,const uint N,const uint shift,const uint pattern1,const uint pattern2,const uint modulus,const uint iters) {
-    // First writes pattern1 into every offset that is 0 mod modulus
-    // Next  (iters times) writes ~pattern1 into every other address
-    uint offset;
-    for (uint i = 0 ; i < N; i++) {      
-        offset = THREAD_OFFSET(N,i);
-        if ((offset % modulus) == shift) *(base+offset) = pattern1;
-    }
-    __syncthreads();
-    for (uint j = 0; j < iters; j++) {
-        for (uint i = 0 ; i < N; i++) {      
-            offset = THREAD_OFFSET(N,i);
-            if ((offset % modulus) != shift) *(base+offset) = pattern2;
-        }
-    }
-}
-__global__ void deviceVerifyPairedModulo(uint* base,uint N,const uint shift,const uint pattern1,const uint modulus,uint* blockErrorCount) {
-    // Verifies that memory at each (offset mod modulus == shift) stores pattern1
-    // Sums number of errors found in block and stores error count into blockErrorCount[blockIdx.x]
-    // Sum-reduce this array afterwards to get total error count over tested region
-    // Uses 4*blockDim.x bytes of shared memory
-    
-    extern __shared__ uint threadErrorCount[];
-    threadErrorCount[threadIdx.x] = 0;
-    uint offset;
-    
-    for (uint i = 0; i < N; i++) {
-        offset = THREAD_OFFSET(N,i);
-        //if (((offset % modulus) == shift) && (*(base+offset) != pattern1)) threadErrorCount[threadIdx.x]++;
-        if ((offset % modulus) == shift) threadErrorCount[threadIdx.x] += BITSDIFF(*(base+offset),pattern1);
-    }
-    // Parallel-reduce error counts over threads in block
-    for (uint stride = blockDim.x>>1; stride > 0; stride >>= 1) {
-        __syncthreads();
-        if (threadIdx.x < stride)
-            threadErrorCount[threadIdx.x] += threadErrorCount[threadIdx.x + stride];
-    }
-    __syncthreads();
-    
-    if (threadIdx.x == 0)
-        blockErrorCount[blockIdx.x] = threadErrorCount[0];
-    
-    return;
-}
-//}}}
diff --git a/src/gromacs/gmxlib/gpu_utils/memtestG80_core.h b/src/gromacs/gmxlib/gpu_utils/memtestG80_core.h
deleted file mode 100644 (file)
index cbacbdf..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * memtestG80_core.h
- * Public API for core memory test functions for MemtestG80
- * Includes functional and OO interfaces to GPU test functions.
- *
- * Author: Imran Haque, 2009
- * Copyright 2009, Stanford University
- *
- * This file is licensed under the terms of the LGPL. Please see
- * the COPYING file in the accompanying source distribution for
- * full license terms.
- *
- */
-#ifndef _MEMTESTG80_CORE_H_
-#define _MEMTESTG80_CORE_H_
-
-#if defined (WINDOWS) || defined (WINNV)
-    #include <windows.h>
-inline unsigned int getTimeMilliseconds(void)
-{
-    return GetTickCount();
-}
-    #include <windows.h>
-    #define SLEEPMS(x) Sleep(x)
-#elif defined (LINUX) || defined (OSX)
-    #include <sys/time.h>
-inline unsigned int getTimeMilliseconds(void)
-{
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    return tv.tv_sec*1000 + tv.tv_usec/1000;
-}
-    #include <unistd.h>
-    #define SLEEPMS(x) usleep(x*1000)
-#else
-    #error Must #define LINUX, WINDOWS, WINNV, or OSX
-#endif
-
-// By default the driver will spinwait when blocked on a kernel call
-// Use the SOFTWAIT macro to replace this with a thread sleep and occasional poll
-// limit expresses the max time we're willing to stay in the sleep loop - default = 15sec
-inline int _pollStatus(unsigned length = 1, unsigned limit = 15000)
-{
-    //while (cudaStreamQuery(0) != cudaSuccess) {SLEEPMS(length);}
-    unsigned startTime = getTimeMilliseconds();
-    while (cudaStreamQuery(0) == cudaErrorNotReady)
-    {
-        if ((getTimeMilliseconds() - startTime) > limit)
-        {
-            return -1;
-        }
-        SLEEPMS(length);
-    }
-    return 0;
-}
-#define SOFTWAIT() if (_pollStatus() != 0) {return 0xFFFFFFFE; }              // -2
-#define SOFTWAIT_LIM(lim) if (_pollStatus(1, lim) != 0) {return 0xFFFFFFFE; } // -2
-//#define SOFTWAIT()
-//#define SOFTWAIT(delay) if (_pollStatus(delay) != 0) return -2;
-//#define SOFTWAIT(delay,limit) if (_pollStatus(delay,limit) != 0) return -2;
-//#define SOFTWAIT() while (cudaStreamQuery(0) != cudaSuccess) {SLEEPMS(1);}
-//#define SOFTWAIT(x) while (cudaStreamQuery(0) != cudaSuccess) {SLEEPMS(x);}
-//#define SOFTWAIT()
-
-// Use this macro to check for kernel errors
-#define CHECK_LAUNCH_ERROR() if (cudaGetLastError() != cudaSuccess) {return 0xFFFFFFFF; /* -1 */}
-
-
-typedef unsigned int uint;
-
-// OO interface to MemtestG80 functions
-class memtestState
-{
-    protected:
-        const uint nBlocks;
-        const uint nThreads;
-        uint       loopIters;
-        uint       megsToTest;
-        int        lcgPeriod;
-        uint     * devTestMem;
-        uint     * devTempMem;
-        uint     * hostTempMem;
-        bool       allocated;
-    public:
-        uint       initTime;
-        memtestState() : nBlocks(1024), nThreads(512), loopIters(0), megsToTest(0), allocated(false), devTestMem(NULL), devTempMem(NULL), hostTempMem(NULL), initTime(0), lcgPeriod(1024) {};
-        ~memtestState() {deallocate(); }
-
-        uint allocate(uint mbToTest);
-        void deallocate();
-        bool isAllocated() const {return allocated; }
-        uint size() const {return megsToTest; }
-        void setLCGPeriod(int period) {lcgPeriod = period; }
-        int getLCGPeriod() const {return lcgPeriod; }
-
-        bool gpuMemoryBandwidth(double &bandwidth, uint mbToTest, uint iters = 5);
-        bool gpuWriteConstant(const uint constant) const;
-        bool gpuVerifyConstant(uint &errorCount, const uint constant) const;
-        bool gpuShortLCG0(uint &errorCount, const uint repeats) const;
-        bool gpuShortLCG0Shmem(uint &errorCount, const uint repeats) const;
-        bool gpuMovingInversionsOnesZeros(uint &errorCount) const;
-        bool gpuWalking8BitM86(uint &errorCount, const uint shift) const;
-        bool gpuWalking8Bit(uint &errorCount, const bool ones, const uint shift) const;
-        bool gpuMovingInversionsRandom(uint &errorCount) const;
-        bool gpuWalking32Bit(uint &errorCount, const bool ones, const uint shift) const;
-        bool gpuRandomBlocks(uint &errorCount, const uint seed) const;
-        bool gpuModuloX(uint &errorCount, const uint shift, const uint pattern, const uint modulus, const uint overwriteIters) const;
-};
-
-// Utility functions
-__host__ double gpuMemoryBandwidth(uint* src, uint* dst, uint mbToTest, uint iters);
-__host__ void gpuWriteConstant(const uint nBlocks, const uint nThreads, uint* base, uint N, const uint constant);
-__host__ uint gpuVerifyConstant(const uint nBlocks, const uint nThreads, uint* base, uint N, const uint constant, uint* blockErrorCount, uint* errorCounts);
-
-__host__ void cpuWriteConstant(const uint nBlocks, const uint nThreads, uint* base, uint N, const uint constant);
-__host__ uint cpuVerifyConstant(const uint nBlocks, const uint nThreads, uint* base, uint N, const uint constant);
-
-// Logic tests
-__host__ uint gpuShortLCG0(const uint nBlocks, const uint nThreads, uint* base, uint N, const uint repeats, const int period, uint* blockErrorCounts, uint* errorCounts);
-__host__ uint gpuShortLCG0Shmem(const uint nBlocks, const uint nThreads, uint* base, uint N, const uint repeats, const int period, uint* blockErrorCounts, uint* errorCounts);
-
-// Memtest86 Test 2: tseq=0,4
-__host__ uint gpuMovingInversionsOnesZeros(const uint nBlocks, const uint nThreads, uint* base, uint N, uint* blockErrorCounts, uint* errorCounts);
-
-// Memtest86 Test 3: tseq=1
-__host__ uint gpuWalking8BitM86(const uint nBlocks, const uint nThreads, uint* base, uint N, uint shift, uint* blockErrorCounts, uint* errorCounts);
-__host__ uint cpuWalking8BitM86(const uint nBlocks, const uint nThreads, uint* base, uint N, uint shift);
-__host__ uint gpuWalking8Bit(const uint nBlocks, const uint nThreads, uint* base, uint N, bool ones, uint shift, uint* blockErrorCount, uint* errorCounts);
-
-// Memtest86 Test 4: tseq=10
-__host__ uint gpuMovingInversionsRandom(const uint nBlocks, const uint nThreads, uint* base, uint N, uint* blockErrorCounts, uint* errorCounts);
-
-// Memtest86 Test 6: tseq=2
-__host__ uint gpuWalking32Bit(const uint nBlocks, const uint nThreads, uint* base, uint N, bool ones, uint shift, uint* blockErrorCount, uint* errorCounts);
-//
-// Memtest86 Test 7: tseq=9
-__host__ uint gpuRandomBlocks(const uint nBlocks, const uint nThreads, uint* base, uint N, uint seed, uint* blockErrorCount, uint* errorCounts);
-
-// Memtest86 Test 8: tseq=3 (M86 uses modulus = 20)
-__host__ uint gpuModuloX(const uint nBlocks, const uint nThreads, uint* base, const uint N, uint shift, uint pattern1, const uint modulus, const uint iters, uint* blockErrorCount, uint* errorCounts);
-
-#endif
index 02f055c1362a5b35373f6d3c2800f2fc62ddc567..e7e42f66447e97fc1cf81582805fb4dc9f98b186 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "typedefs.h"
-#include "bondf.h"
-#include "disre.h"
-#include "orires.h"
-#include "genborn.h"
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/listed-forces/bonded.h"
 
 #define  def_bonded(str, lstr, nra, nrpa, nrpb, ind, func) \
     {str, lstr, (nra), (nrpa), (nrpb), IF_BOND,                        (ind), (func)}
@@ -86,7 +82,7 @@
 #define    def_nofc(str, lstr) \
     {str, lstr,    0,     0,     0, IF_NULL,                    -1, unimplemented}
 
-/* this MUST correspond to the enum in include/types/idef.h */
+/* this MUST correspond to the enum in src/gromacs/topology/idef.h */
 const t_interaction_function interaction_function[F_NRE] =
 {
     def_bond    ("BONDS",    "Bond",            2, 2, 2,  eNR_BONDS,  bonds         ),
index 1ba89ef3aa71f9a140f550dacd0c49bf60f05e67..ad48b85814f6b411515fe72a08af9b275188caa0 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/inputrec.h"
 
-#include "typedefs.h"
-#include "macros.h"
-#include "inputrec.h"
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
 
 
 /* The minimum number of integration steps required for reasonably accurate
index a80087c754960a602012653bd6b7db5b0396514c..5286b27d0d0058d03d272149b773ba5984c0bc82 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/main.h"
+
+#include "config.h"
 
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <limits.h>
-#include <time.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
-#include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "gmx_fatal.h"
-#include "network.h"
-#include "main.h"
-#include "macros.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/utility/cstringutil.h"
-#include "copyrite.h"
-
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
+#include "gromacs/utility/sysinfo.h"
 
 /* The source code in this file should be thread-safe.
          Please keep it that way. */
 
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef GMX_NATIVE_WINDOWS
-#include <process.h>
-#endif
-
 #define BUFSIZE 1024
 
-
 static void par_fn(char *base, int ftp, const t_commrec *cr,
                    gmx_bool bAppendSimId, gmx_bool bAppendNodeId,
                    char buf[], int bufsize)
@@ -104,7 +91,7 @@ static void par_fn(char *base, int ftp, const t_commrec *cr,
     strcat(buf, ".");
 
     /* Add extension again */
-    strcat(buf, (ftp == efTPX) ? "tpr" : (ftp == efEDR) ? "edr" : ftp2ext(ftp));
+    strcat(buf, (ftp == efTPR) ? "tpr" : (ftp == efEDR) ? "edr" : ftp2ext(ftp));
     if (debug)
     {
         fprintf(debug, "rank %d par_fn '%s'\n", cr->nodeid, buf);
@@ -223,99 +210,27 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
 }
 
 
-int gmx_gethostname(char *name, size_t len)
-{
-    if (len < 8)
-    {
-        gmx_incons("gmx_gethostname called with len<8");
-    }
-#if defined(HAVE_UNISTD_H) && !defined(__native_client__) && !defined(__MINGW32__)
-    if (gethostname(name, len-1) != 0)
-    {
-        strncpy(name, "unknown", 8);
-        return -1;
-    }
-    return 0;
-#else
-    strncpy(name, "unknown", 8);
-    return -1;
-#endif
-}
-
-
-void gmx_log_open(const char *lognm, const t_commrec *cr, gmx_bool bMasterOnly,
+void gmx_log_open(const char *lognm, const t_commrec *cr,
                   gmx_bool bAppendFiles, FILE** fplog)
 {
-    int    len, pid;
-    char   buf[256], host[256];
-    time_t t;
+    int    pid;
+    char   host[256];
     char   timebuf[STRLEN];
     FILE  *fp = *fplog;
-    char  *tmpnm;
 
     debug_gmx();
 
-    /* Communicate the filename for logfile */
-    if (cr->nnodes > 1 && !bMasterOnly
-#ifdef GMX_THREAD_MPI
-        /* With thread MPI the non-master log files are opened later
-         * when the files names are already known on all nodes.
-         */
-        && FALSE
-#endif
-        )
-    {
-        if (MASTER(cr))
-        {
-            len = strlen(lognm) + 1;
-        }
-        gmx_bcast(sizeof(len), &len, cr);
-        if (!MASTER(cr))
-        {
-            snew(tmpnm, len+8);
-        }
-        else
-        {
-            tmpnm = gmx_strdup(lognm);
-        }
-        gmx_bcast(len*sizeof(*tmpnm), tmpnm, cr);
-    }
-    else
+    if (!bAppendFiles)
     {
-        tmpnm = gmx_strdup(lognm);
+        fp = gmx_fio_fopen(lognm, bAppendFiles ? "a+" : "w+" );
     }
 
-    debug_gmx();
-
-    if (!bMasterOnly && !MASTER(cr))
-    {
-        /* Since log always ends with '.log' let's use this info */
-        par_fn(tmpnm, efLOG, cr, FALSE, !bMasterOnly, buf, 255);
-        fp = gmx_fio_fopen(buf, bAppendFiles ? "a+" : "w+" );
-    }
-    else if (!bAppendFiles)
-    {
-        fp = gmx_fio_fopen(tmpnm, bAppendFiles ? "a+" : "w+" );
-    }
-
-    sfree(tmpnm);
-
     gmx_fatal_set_log_file(fp);
 
     /* Get some machine parameters */
     gmx_gethostname(host, 256);
-
-    time(&t);
-
-#ifndef NO_GETPID
-#   ifdef GMX_NATIVE_WINDOWS
-    pid = _getpid();
-#   else
-    pid = getpid();
-#   endif
-#else
-    pid = 0;
-#endif
+    pid = gmx_getpid();
+    gmx_format_current_time(timebuf, STRLEN);
 
     if (bAppendFiles)
     {
@@ -328,8 +243,6 @@ void gmx_log_open(const char *lognm, const t_commrec *cr, gmx_bool bMasterOnly,
                 );
     }
 
-    gmx_ctime_r(&t, timebuf, STRLEN);
-
     fprintf(fp,
             "Log file opened on %s"
             "Host: %s  pid: %d  rank ID: %d  number of ranks:  %d\n",
@@ -460,7 +373,7 @@ void init_multisystem(t_commrec *cr, int nsim, char **multidirs,
              * at the actual file name
              */
             if (is_output(&fnm[i]) ||
-                fnm[i].ftp == efTPX || fnm[i].ftp == efCPT ||
+                fnm[i].ftp == efTPR || fnm[i].ftp == efCPT ||
                 strcmp(fnm[i].opt, "-rerun") == 0)
             {
                 ftp = fn2ftp(fnm[i].fns[0]);
index cb6f5552f76946e6b8b4487b4ce77f1b77978455..cee3c06ba60857198e07f177b20e004692e186d9 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/md_logging.h"
 
-#include <stdio.h>
 #include <stdarg.h>
-#include "types/commrec.h"
-#include "md_logging.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/commrec.h"
 
 
 void md_print_info(const t_commrec *cr, FILE *fplog,
index 649db23f1bb32f078d22e2a37cfc012f1cc1864c..6e63f2fb62be84d75825dd35b6d1cfdd456e669d 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "names.h"
+#include "gromacs/legacyheaders/names.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 /* note: these arrays should correspond to enums in include/types/enums.h */
 
index ba89f439494890053892c695373a44ad82a16ccf..94905661e1c4b89bc11b4cc88c76f18b043f9d62 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/network.h"
+
+#include "config.h"
 
-#include <string.h>
-#include "gmx_fatal.h"
-#include "main.h"
-#include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "copyrite.h"
 #include <ctype.h>
-#include "macros.h"
-#include "gromacs/utility/cstringutil.h"
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
 
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxmpi.h"
-
+#include "gromacs/utility/smalloc.h"
 
 /* The source code in this file should be thread-safe.
       Please keep it that way. */
 
-gmx_bool gmx_mpi_initialized(void)
-{
-    int n;
-#ifndef GMX_MPI
-    return 0;
-#else
-    MPI_Initialized(&n);
-
-    return n;
-#endif
-}
-
 void gmx_fill_commrec_from_mpi(t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
@@ -144,155 +135,6 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
 #endif
 }
 
-int  gmx_node_num(void)
-{
-#ifndef GMX_MPI
-    return 1;
-#else
-    int i;
-    (void) MPI_Comm_size(MPI_COMM_WORLD, &i);
-    return i;
-#endif
-}
-
-int gmx_node_rank(void)
-{
-#ifndef GMX_MPI
-    return 0;
-#else
-    int i;
-    (void) MPI_Comm_rank(MPI_COMM_WORLD, &i);
-    return i;
-#endif
-}
-
-static int mpi_hostname_hash(void)
-{
-    int hash_int;
-
-#ifndef GMX_LIB_MPI
-    /* We have a single physical node */
-    hash_int = 0;
-#else
-    int  resultlen;
-    char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
-
-    /* This procedure can only differentiate nodes with different names.
-     * Architectures where different physical nodes have identical names,
-     * such as IBM Blue Gene, should use an architecture specific solution.
-     */
-    MPI_Get_processor_name(mpi_hostname, &resultlen);
-
-    /* The string hash function returns an unsigned int. We cast to an int.
-     * Negative numbers are converted to positive by setting the sign bit to 0.
-     * This makes the hash one bit smaller.
-     * A 63-bit hash (with 64-bit int) should be enough for unique node hashes,
-     * even on a million node machine. 31 bits might not be enough though!
-     */
-    hash_int =
-        (int)gmx_string_fullhash_func(mpi_hostname, gmx_string_hash_init);
-    if (hash_int < 0)
-    {
-        hash_int -= INT_MIN;
-    }
-#endif
-
-    return hash_int;
-}
-
-#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
-
-#ifdef __clang__
-/* IBM's declaration of this function in
- * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/process.h
- * erroneously fails to specify __INLINE__, despite
- * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/cnk/process_impl.h
- * specifiying __INLINE__, so bgclang thinks they are different enough
- * to complain about. */
-static uint64_t Kernel_GetJobID();
-#endif
-
-#include <spi/include/kernel/location.h>
-
-static int bgq_nodenum(void)
-{
-    int           hostnum;
-    Personality_t personality;
-    Kernel_GetPersonality(&personality, sizeof(personality));
-    /* Each MPI rank has a unique coordinate in a 6-dimensional space
-       (A,B,C,D,E,T), with dimensions A-E corresponding to different
-       physical nodes, and T within each node. Each node has sixteen
-       physical cores, each of which can have up to four hardware
-       threads, so 0 <= T <= 63 (but the maximum value of T depends on
-       the confituration of ranks and OpenMP threads per
-       node). However, T is irrelevant for computing a suitable return
-       value for gmx_hostname_num().
-     */
-    hostnum  = personality.Network_Config.Acoord;
-    hostnum *= personality.Network_Config.Bnodes;
-    hostnum += personality.Network_Config.Bcoord;
-    hostnum *= personality.Network_Config.Cnodes;
-    hostnum += personality.Network_Config.Ccoord;
-    hostnum *= personality.Network_Config.Dnodes;
-    hostnum += personality.Network_Config.Dcoord;
-    hostnum *= personality.Network_Config.Enodes;
-    hostnum += personality.Network_Config.Ecoord;
-
-    if (debug)
-    {
-        fprintf(debug,
-                "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\nNode ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
-                personality.Network_Config.Acoord,
-                personality.Network_Config.Anodes,
-                personality.Network_Config.Bcoord,
-                personality.Network_Config.Bnodes,
-                personality.Network_Config.Ccoord,
-                personality.Network_Config.Cnodes,
-                personality.Network_Config.Dcoord,
-                personality.Network_Config.Dnodes,
-                personality.Network_Config.Ecoord,
-                personality.Network_Config.Enodes,
-                Kernel_ProcessorCoreID(),
-                16,
-                Kernel_ProcessorID(),
-                64,
-                Kernel_ProcessorThreadID(),
-                4);
-    }
-    return hostnum;
-}
-#endif
-
-int gmx_physicalnode_id_hash(void)
-{
-    int hash;
-
-#ifndef GMX_MPI
-    hash = 0;
-#else
-#ifdef GMX_THREAD_MPI
-    /* thread-MPI currently puts the thread number in the process name,
-     * we might want to change this, as this is inconsistent with what
-     * most MPI implementations would do when running on a single node.
-     */
-    hash = 0;
-#else
-#ifdef GMX_TARGET_BGQ
-    hash = bgq_nodenum();
-#else
-    hash = mpi_hostname_hash();
-#endif
-#endif
-#endif
-
-    if (debug)
-    {
-        fprintf(debug, "In gmx_physicalnode_id_hash: hash %d\n", hash);
-    }
-
-    return hash;
-}
-
 void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
 {
     gmx_nodecomm_t *nc;
@@ -475,33 +317,6 @@ void gmx_barrier(const t_commrec gmx_unused *cr)
 #endif
 }
 
-void gmx_abort(int gmx_unused noderank, int gmx_unused nnodes, int gmx_unused errorno)
-{
-#ifndef GMX_MPI
-    gmx_call("gmx_abort");
-#else
-#ifdef GMX_THREAD_MPI
-    fprintf(stderr, "Halting program %s\n", ShortProgram());
-    gmx_thanx(stderr);
-    exit(1);
-#else
-    if (nnodes > 1)
-    {
-        fprintf(stderr, "Halting parallel program %s on CPU %d out of %d\n",
-                ShortProgram(), noderank, nnodes);
-    }
-    else
-    {
-        fprintf(stderr, "Halting program %s\n", ShortProgram());
-    }
-
-    gmx_thanx(stderr);
-    MPI_Abort(MPI_COMM_WORLD, errorno);
-    exit(1);
-#endif
-#endif
-}
-
 void gmx_bcast(int gmx_unused nbytes, void gmx_unused *b, const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
@@ -883,3 +698,47 @@ void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_mult
 #endif
 #endif
 }
+
+gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr)
+{
+    gmx_bool bExist;
+
+    if (SIMMASTER(cr))
+    {
+        bExist = gmx_fexist(fname);
+    }
+    if (PAR(cr))
+    {
+        gmx_bcast(sizeof(bExist), &bExist, cr);
+    }
+    return bExist;
+}
+
+void gmx_fatal_collective(int f_errno, const char *file, int line,
+                          const t_commrec *cr, gmx_domdec_t *dd,
+                          const char *fmt, ...)
+{
+    va_list  ap;
+    gmx_bool bMaster, bFinalize;
+#ifdef GMX_MPI
+    int      result;
+    /* Check if we are calling on all processes in MPI_COMM_WORLD */
+    if (cr != NULL)
+    {
+        MPI_Comm_compare(cr->mpi_comm_mysim, MPI_COMM_WORLD, &result);
+    }
+    else
+    {
+        MPI_Comm_compare(dd->mpi_comm_all, MPI_COMM_WORLD, &result);
+    }
+    /* Any result except MPI_UNEQUAL allows us to call MPI_Finalize */
+    bFinalize = (result != MPI_UNEQUAL);
+#else
+    bFinalize = TRUE;
+#endif
+    bMaster = (cr != NULL && MASTER(cr)) || (dd != NULL && DDMASTER(dd));
+
+    va_start(ap, fmt);
+    gmx_fatal_mpi_va(f_errno, file, line, bMaster, bFinalize, fmt, ap);
+    va_end(ap);
+}
index 85d96a1233ae37527c6a5f900d9e08a68a19f0c0..b4a0200fd1f57be757749770ef1f175a32c784a3 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-
-#include "vec.h"
-#include "typedefs.h"
-#include "nonbonded.h"
-#include "nb_kernel.h"
-#include "nrnb.h"
-#include "macros.h"
 #include "nb_free_energy.h"
 
-#include "gmx_fatal.h"
+#include <math.h>
+
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 
 void
 gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
@@ -129,10 +127,19 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     int           ewitab;
     real          ewrt, eweps, ewtabscale, ewtabhalfspace, sh_ewald;
 
+    const real    onetwelfth  = 1.0/12.0;
+    const real    onesixth    = 1.0/6.0;
+    const real    zero        = 0.0;
+    const real    half        = 0.5;
+    const real    one         = 1.0;
+    const real    two         = 2.0;
+    const real    six         = 6.0;
+    const real    fourtyeight = 48.0;
+
     sh_ewald            = fr->ic->sh_ewald;
     ewtab               = fr->ic->tabq_coul_FDV0;
     ewtabscale          = fr->ic->tabq_scale;
-    ewtabhalfspace      = 0.5/ewtabscale;
+    ewtabhalfspace      = half/ewtabscale;
     tab_ewald_F_lj      = fr->ic->tabq_vdw_F;
     tab_ewald_V_lj      = fr->ic->tabq_vdw_V;
 
@@ -178,7 +185,6 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     bDoPotential        = kernel_data->flags & GMX_NONBONDED_DO_POTENTIAL;
 
     rcoulomb            = fr->rcoulomb;
-    sh_ewald            = fr->ic->sh_ewald;
     rvdw                = fr->rvdw;
     sh_invrc6           = fr->ic->sh_invrc6;
     sh_lj_ewald         = fr->ic->sh_lj_ewald;
@@ -298,8 +304,8 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     dvdl_vdw   = 0;
 
     /* Lambda factor for state A, 1-lambda*/
-    LFC[STATE_A] = 1.0 - lambda_coul;
-    LFV[STATE_A] = 1.0 - lambda_vdw;
+    LFC[STATE_A] = one - lambda_coul;
+    LFV[STATE_A] = one - lambda_vdw;
 
     /* Lambda factor for state B, lambda*/
     LFC[STATE_B] = lambda_coul;
@@ -394,12 +400,12 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                 r            = 0;
             }
 
-            if (sc_r_power == 6.0)
+            if (sc_r_power == six)
             {
                 rpm2             = rsq*rsq;  /* r4 */
                 rp               = rpm2*rsq; /* r6 */
             }
-            else if (sc_r_power == 48.0)
+            else if (sc_r_power == fourtyeight)
             {
                 rp               = rsq*rsq*rsq; /* r6 */
                 rp               = rp*rp;       /* r12 */
@@ -432,7 +438,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                     if ((c6[i] > 0) && (c12[i] > 0))
                     {
                         /* c12 is stored scaled with 12.0 and c6 is scaled with 6.0 - correct for this */
-                        sigma6[i]       = 0.5*c12[i]/c6[i];
+                        sigma6[i]       = half*c12[i]/c6[i];
                         sigma2[i]       = pow(sigma6[i], 1.0/3.0);
                         /* should be able to get rid of this ^^^ internal pow call eventually.  Will require agreement on
                            what data to store externally.  Can't be fixed without larger scale changes, so not 4.6 */
@@ -447,12 +453,12 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                         sigma6[i]       = sigma6_def;
                         sigma2[i]       = sigma2_def;
                     }
-                    if (sc_r_power == 6.0)
+                    if (sc_r_power == six)
                     {
                         sigma_pow[i]    = sigma6[i];
                         sigma_powm2[i]  = sigma6[i]/sigma2[i];
                     }
-                    else if (sc_r_power == 48.0)
+                    else if (sc_r_power == fourtyeight)
                     {
                         sigma_pow[i]    = sigma6[i]*sigma6[i];       /* sigma^12 */
                         sigma_pow[i]    = sigma_pow[i]*sigma_pow[i]; /* sigma^24 */
@@ -489,13 +495,13 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                     if ( (qq[i] != 0) || (c6[i] != 0) || (c12[i] != 0) )
                     {
                         /* this section has to be inside the loop because of the dependence on sigma_pow */
-                        rpinvC         = 1.0/(alpha_coul_eff*lfac_coul[i]*sigma_pow[i]+rp);
-                        rinvC          = pow(rpinvC, 1.0/sc_r_power);
-                        rC             = 1.0/rinvC;
+                        rpinvC         = one/(alpha_coul_eff*lfac_coul[i]*sigma_pow[i]+rp);
+                        rinvC          = pow(rpinvC, one/sc_r_power);
+                        rC             = one/rinvC;
 
-                        rpinvV         = 1.0/(alpha_vdw_eff*lfac_vdw[i]*sigma_pow[i]+rp);
-                        rinvV          = pow(rpinvV, 1.0/sc_r_power);
-                        rV             = 1.0/rinvV;
+                        rpinvV         = one/(alpha_vdw_eff*lfac_vdw[i]*sigma_pow[i]+rp);
+                        rinvV          = pow(rpinvV, one/sc_r_power);
+                        rV             = one/rinvV;
 
                         if (do_tab)
                         {
@@ -537,7 +543,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                 case GMX_NBKERNEL_ELEC_REACTIONFIELD:
                                     /* reaction-field */
                                     Vcoul[i]   = qq[i]*(rinvC + krf*rC*rC-crf);
-                                    FscalC[i]  = qq[i]*(rinvC - 2.0*krf*rC*rC);
+                                    FscalC[i]  = qq[i]*(rinvC - two*krf*rC*rC);
                                     break;
 
                                 case GMX_NBKERNEL_ELEC_CUBICSPLINETABLE:
@@ -549,7 +555,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                     Heps2      = eps2C*VFtab[nnn+3];
                                     Fp         = F+Geps+Heps2;
                                     VV         = Y+epsC*Fp;
-                                    FF         = Fp+Geps+2.0*Heps2;
+                                    FF         = Fp+Geps+two*Heps2;
                                     Vcoul[i]   = qq[i]*VV;
                                     FscalC[i]  = -qq[i]*tabscale*FF*rC;
                                     break;
@@ -579,8 +585,8 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                     break;
 
                                 case GMX_NBKERNEL_ELEC_NONE:
-                                    FscalC[i]  = 0.0;
-                                    Vcoul[i]   = 0.0;
+                                    FscalC[i]  = zero;
+                                    Vcoul[i]   = zero;
                                     break;
 
                                 default:
@@ -591,16 +597,16 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                             if (fr->coulomb_modifier == eintmodPOTSWITCH)
                             {
                                 d                = rC-fr->rcoulomb_switch;
-                                d                = (d > 0.0) ? d : 0.0;
+                                d                = (d > zero) ? d : zero;
                                 d2               = d*d;
-                                sw               = 1.0+d2*d*(elec_swV3+d*(elec_swV4+d*elec_swV5));
+                                sw               = one+d2*d*(elec_swV3+d*(elec_swV4+d*elec_swV5));
                                 dsw              = d2*(elec_swF2+d*(elec_swF3+d*elec_swF4));
 
                                 FscalC[i]        = FscalC[i]*sw - rC*Vcoul[i]*dsw;
                                 Vcoul[i]        *= sw;
 
-                                FscalC[i]        = (rC < rcoulomb) ? FscalC[i] : 0.0;
-                                Vcoul[i]         = (rC < rcoulomb) ? Vcoul[i] : 0.0;
+                                FscalC[i]        = (rC < rcoulomb) ? FscalC[i] : zero;
+                                Vcoul[i]         = (rC < rcoulomb) ? Vcoul[i] : zero;
                             }
                         }
 
@@ -618,7 +624,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                             {
                                 case GMX_NBKERNEL_VDW_LENNARDJONES:
                                     /* cutoff LJ */
-                                    if (sc_r_power == 6.0)
+                                    if (sc_r_power == six)
                                     {
                                         rinv6            = rpinvV;
                                     }
@@ -630,8 +636,8 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                     Vvdw6            = c6[i]*rinv6;
                                     Vvdw12           = c12[i]*rinv6*rinv6;
 
-                                    Vvdw[i]          = ( (Vvdw12 - c12[i]*sh_invrc6*sh_invrc6)*(1.0/12.0)
-                                                         - (Vvdw6 - c6[i]*sh_invrc6)*(1.0/6.0));
+                                    Vvdw[i]          = ( (Vvdw12 - c12[i]*sh_invrc6*sh_invrc6)*onetwelfth
+                                                         - (Vvdw6 - c6[i]*sh_invrc6)*onesixth);
                                     FscalV[i]        = Vvdw12 - Vvdw6;
                                     break;
 
@@ -649,7 +655,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                     Heps2      = eps2V*VFtab[nnn+3];
                                     Fp         = F+Geps+Heps2;
                                     VV         = Y+epsV*Fp;
-                                    FF         = Fp+Geps+2.0*Heps2;
+                                    FF         = Fp+Geps+two*Heps2;
                                     Vvdw[i]   += c6[i]*VV;
                                     FscalV[i] -= c6[i]*tabscale*FF*rV;
 
@@ -660,13 +666,13 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                     Heps2      = eps2V*VFtab[nnn+7];
                                     Fp         = F+Geps+Heps2;
                                     VV         = Y+epsV*Fp;
-                                    FF         = Fp+Geps+2.0*Heps2;
+                                    FF         = Fp+Geps+two*Heps2;
                                     Vvdw[i]   += c12[i]*VV;
                                     FscalV[i] -= c12[i]*tabscale*FF*rV;
                                     break;
 
                                 case GMX_NBKERNEL_VDW_LJEWALD:
-                                    if (sc_r_power == 6.0)
+                                    if (sc_r_power == six)
                                     {
                                         rinv6            = rpinvV;
                                     }
@@ -683,8 +689,8 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                         Vvdw6            = c6[i]*rinv6;
                                         Vvdw12           = c12[i]*rinv6*rinv6;
 
-                                        Vvdw[i]          = ( (Vvdw12 - c12[i]*sh_invrc6*sh_invrc6)*(1.0/12.0)
-                                                             - (Vvdw6 - c6[i]*sh_invrc6 - c6grid*sh_lj_ewald)*(1.0/6.0));
+                                        Vvdw[i]          = ( (Vvdw12 - c12[i]*sh_invrc6*sh_invrc6)*onetwelfth
+                                                             - (Vvdw6 - c6[i]*sh_invrc6 - c6grid*sh_lj_ewald)*onesixth);
                                         FscalV[i]        = Vvdw12 - Vvdw6;
                                     }
                                     else
@@ -692,17 +698,17 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                         /* Normal LJ-PME */
                                         ewcljrsq         = ewclj2*rV*rV;
                                         exponent         = exp(-ewcljrsq);
-                                        poly             = exponent*(1.0 + ewcljrsq + ewcljrsq*ewcljrsq*0.5);
-                                        vvdw_disp        = (c6[i]-c6grid*(1.0-poly))*rinv6;
+                                        poly             = exponent*(one + ewcljrsq + ewcljrsq*ewcljrsq*half);
+                                        vvdw_disp        = (c6[i]-c6grid*(one-poly))*rinv6;
                                         vvdw_rep         = c12[i]*rinv6*rinv6;
-                                        FscalV[i]        = vvdw_rep - vvdw_disp - c6grid*(1.0/6.0)*exponent*ewclj6;
-                                        Vvdw[i]          = (vvdw_rep - c12[i]*sh_invrc6*sh_invrc6)/12.0 - (vvdw_disp - c6[i]*sh_invrc6 - c6grid*sh_lj_ewald)/6.0;
+                                        FscalV[i]        = vvdw_rep - vvdw_disp - c6grid*onesixth*exponent*ewclj6;
+                                        Vvdw[i]          = (vvdw_rep - c12[i]*sh_invrc6*sh_invrc6)*onetwelfth - (vvdw_disp - c6[i]*sh_invrc6 - c6grid*sh_lj_ewald)/six;
                                     }
                                     break;
 
                                 case GMX_NBKERNEL_VDW_NONE:
-                                    Vvdw[i]    = 0.0;
-                                    FscalV[i]  = 0.0;
+                                    Vvdw[i]    = zero;
+                                    FscalV[i]  = zero;
                                     break;
 
                                 default:
@@ -713,16 +719,16 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                             if (fr->vdw_modifier == eintmodPOTSWITCH)
                             {
                                 d                = rV-fr->rvdw_switch;
-                                d                = (d > 0.0) ? d : 0.0;
+                                d                = (d > zero) ? d : zero;
                                 d2               = d*d;
-                                sw               = 1.0+d2*d*(vdw_swV3+d*(vdw_swV4+d*vdw_swV5));
+                                sw               = one+d2*d*(vdw_swV3+d*(vdw_swV4+d*vdw_swV5));
                                 dsw              = d2*(vdw_swF2+d*(vdw_swF3+d*vdw_swF4));
 
                                 FscalV[i]        = FscalV[i]*sw - rV*Vvdw[i]*dsw;
                                 Vvdw[i]         *= sw;
 
-                                FscalV[i]  = (rV < rvdw) ? FscalV[i] : 0.0;
-                                Vvdw[i]    = (rV < rvdw) ? Vvdw[i] : 0.0;
+                                FscalV[i]  = (rV < rvdw) ? FscalV[i] : zero;
+                                Vvdw[i]    = (rV < rvdw) ? Vvdw[i] : zero;
                             }
                         }
 
@@ -757,11 +763,11 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                  * As there is no singularity, there is no need for soft-core.
                  */
                 VV = krf*rsq - crf;
-                FF = -2.0*krf;
+                FF = -two*krf;
 
                 if (ii == jnr)
                 {
-                    VV *= 0.5;
+                    VV *= half;
                 }
 
                 for (i = 0; i < NSTATES; i++)
@@ -803,7 +809,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                      * scheme, and corresponds to a self-interaction that will
                      * occur twice. Scale it down by 50% to only include it once.
                      */
-                    v_lr *= 0.5;
+                    v_lr *= half;
                 }
 
                 for (i = 0; i < NSTATES; i++)
@@ -838,8 +844,8 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                 /* TODO: Currently the Ewald LJ table does not contain
                  * the factor 1/6, we should add this.
                  */
-                FF     = f_lr*rinv/6.0;
-                VV     = (tab_ewald_V_lj[ri] - ewtabhalfspace*frac*(tab_ewald_F_lj[ri] + f_lr))/6.0;
+                FF     = f_lr*rinv/six;
+                VV     = (tab_ewald_V_lj[ri] - ewtabhalfspace*frac*(tab_ewald_F_lj[ri] + f_lr))/six;
 
                 if (ii == jnr)
                 {
@@ -848,7 +854,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                      * scheme, and corresponds to a self-interaction that will
                      * occur twice. Scale it down by 50% to only include it once.
                      */
-                    VV *= 0.5;
+                    VV *= half;
                 }
 
                 for (i = 0; i < NSTATES; i++)
@@ -929,192 +935,3 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
 #pragma omp atomic
     inc_nrnb(nrnb, eNR_NBKERNEL_FREE_ENERGY, nlist->nri*12 + nlist->jindex[n]*150);
 }
-
-real
-nb_free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul, real alpha_vdw,
-                               real tabscale, real *vftab,
-                               real qqA, real c6A, real c12A, real qqB, real c6B, real c12B,
-                               real LFC[2], real LFV[2], real DLF[2],
-                               real lfac_coul[2], real lfac_vdw[2], real dlfac_coul[2], real dlfac_vdw[2],
-                               real sigma6_def, real sigma6_min, real sigma2_def, real sigma2_min,
-                               real *velectot, real *vvdwtot, real *dvdl)
-{
-    real       r, rp, rpm2, rtab, eps, eps2, Y, F, Geps, Heps2, Fp, VV, FF, fscal;
-    real       qq[2], c6[2], c12[2], sigma6[2], sigma2[2], sigma_pow[2], sigma_powm2[2];
-    real       alpha_coul_eff, alpha_vdw_eff, dvdl_coul, dvdl_vdw;
-    real       rpinv, r_coul, r_vdw, velecsum, vvdwsum;
-    real       fscal_vdw[2], fscal_elec[2];
-    real       velec[2], vvdw[2];
-    int        i, ntab;
-
-    qq[0]    = qqA;
-    qq[1]    = qqB;
-    c6[0]    = c6A;
-    c6[1]    = c6B;
-    c12[0]   = c12A;
-    c12[1]   = c12B;
-
-    if (sc_r_power == 6.0)
-    {
-        rpm2             = r2*r2;   /* r4 */
-        rp               = rpm2*r2; /* r6 */
-    }
-    else if (sc_r_power == 48.0)
-    {
-        rp               = r2*r2*r2; /* r6 */
-        rp               = rp*rp;    /* r12 */
-        rp               = rp*rp;    /* r24 */
-        rp               = rp*rp;    /* r48 */
-        rpm2             = rp/r2;    /* r46 */
-    }
-    else
-    {
-        rp             = pow(r2, 0.5*sc_r_power);  /* not currently supported as input, but can handle it */
-        rpm2           = rp/r2;
-    }
-
-    /* Loop over state A(0) and B(1) */
-    for (i = 0; i < 2; i++)
-    {
-        if ((c6[i] > 0) && (c12[i] > 0))
-        {
-            /* The c6 & c12 coefficients now contain the constants 6.0 and 12.0, respectively.
-             * Correct for this by multiplying with (1/12.0)/(1/6.0)=6.0/12.0=0.5.
-             */
-            sigma6[i]       = 0.5*c12[i]/c6[i];
-            sigma2[i]       = pow(0.5*c12[i]/c6[i], 1.0/3.0);
-            /* should be able to get rid of this ^^^ internal pow call eventually.  Will require agreement on
-               what data to store externally.  Can't be fixed without larger scale changes, so not 5.0 */
-            if (sigma6[i] < sigma6_min)   /* for disappearing coul and vdw with soft core at the same time */
-            {
-                sigma6[i] = sigma6_min;
-                sigma2[i] = sigma2_min;
-            }
-        }
-        else
-        {
-            sigma6[i]       = sigma6_def;
-            sigma2[i]       = sigma2_def;
-        }
-        if (sc_r_power == 6.0)
-        {
-            sigma_pow[i]    = sigma6[i];
-            sigma_powm2[i]  = sigma6[i]/sigma2[i];
-        }
-        else if (sc_r_power == 48.0)
-        {
-            sigma_pow[i]    = sigma6[i]*sigma6[i];       /* sigma^12 */
-            sigma_pow[i]    = sigma_pow[i]*sigma_pow[i]; /* sigma^24 */
-            sigma_pow[i]    = sigma_pow[i]*sigma_pow[i]; /* sigma^48 */
-            sigma_powm2[i]  = sigma_pow[i]/sigma2[i];
-        }
-        else
-        {    /* not really supported as input, but in here for testing the general case*/
-            sigma_pow[i]    = pow(sigma2[i], sc_r_power/2);
-            sigma_powm2[i]  = sigma_pow[i]/(sigma2[i]);
-        }
-    }
-
-    /* only use softcore if one of the states has a zero endstate - softcore is for avoiding infinities!*/
-    if ((c12[0] > 0) && (c12[1] > 0))
-    {
-        alpha_vdw_eff    = 0;
-        alpha_coul_eff   = 0;
-    }
-    else
-    {
-        alpha_vdw_eff    = alpha_vdw;
-        alpha_coul_eff   = alpha_coul;
-    }
-
-    /* Loop over A and B states again */
-    for (i = 0; i < 2; i++)
-    {
-        fscal_elec[i] = 0;
-        fscal_vdw[i]  = 0;
-        velec[i]      = 0;
-        vvdw[i]       = 0;
-
-        /* Only spend time on A or B state if it is non-zero */
-        if ( (qq[i] != 0) || (c6[i] != 0) || (c12[i] != 0) )
-        {
-            /* Coulomb */
-            rpinv            = 1.0/(alpha_coul_eff*lfac_coul[i]*sigma_pow[i]+rp);
-            r_coul           = pow(rpinv, -1.0/sc_r_power);
-
-            /* Electrostatics table lookup data */
-            rtab             = r_coul*tabscale;
-            ntab             = rtab;
-            eps              = rtab-ntab;
-            eps2             = eps*eps;
-            ntab             = 12*ntab;
-            /* Electrostatics */
-            Y                = vftab[ntab];
-            F                = vftab[ntab+1];
-            Geps             = eps*vftab[ntab+2];
-            Heps2            = eps2*vftab[ntab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+eps*Fp;
-            FF               = Fp+Geps+2.0*Heps2;
-            velec[i]         = qq[i]*VV;
-            fscal_elec[i]    = -qq[i]*FF*r_coul*rpinv*tabscale;
-
-            /* Vdw */
-            rpinv            = 1.0/(alpha_vdw_eff*lfac_vdw[i]*sigma_pow[i]+rp);
-            r_vdw            = pow(rpinv, -1.0/sc_r_power);
-            /* Vdw table lookup data */
-            rtab             = r_vdw*tabscale;
-            ntab             = rtab;
-            eps              = rtab-ntab;
-            eps2             = eps*eps;
-            ntab             = 12*ntab;
-            /* Dispersion */
-            Y                = vftab[ntab+4];
-            F                = vftab[ntab+5];
-            Geps             = eps*vftab[ntab+6];
-            Heps2            = eps2*vftab[ntab+7];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+eps*Fp;
-            FF               = Fp+Geps+2.0*Heps2;
-            vvdw[i]          = c6[i]*VV;
-            fscal_vdw[i]     = -c6[i]*FF;
-
-            /* Repulsion */
-            Y                = vftab[ntab+8];
-            F                = vftab[ntab+9];
-            Geps             = eps*vftab[ntab+10];
-            Heps2            = eps2*vftab[ntab+11];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+eps*Fp;
-            FF               = Fp+Geps+2.0*Heps2;
-            vvdw[i]         += c12[i]*VV;
-            fscal_vdw[i]    -= c12[i]*FF;
-            fscal_vdw[i]    *= r_vdw*rpinv*tabscale;
-        }
-    }
-    /* Now we have velec[i], vvdw[i], and fscal[i] for both states */
-    /* Assemble A and B states */
-    velecsum  = 0;
-    vvdwsum   = 0;
-    dvdl_coul = 0;
-    dvdl_vdw  = 0;
-    fscal     = 0;
-    for (i = 0; i < 2; i++)
-    {
-        velecsum      += LFC[i]*velec[i];
-        vvdwsum       += LFV[i]*vvdw[i];
-
-        fscal         += (LFC[i]*fscal_elec[i]+LFV[i]*fscal_vdw[i])*rpm2;
-
-        dvdl_coul     += velec[i]*DLF[i] + LFC[i]*alpha_coul_eff*dlfac_coul[i]*fscal_elec[i]*sigma_pow[i];
-        dvdl_vdw      += vvdw[i]*DLF[i] + LFV[i]*alpha_vdw_eff*dlfac_vdw[i]*fscal_vdw[i]*sigma_pow[i];
-    }
-
-    dvdl[efptCOUL]     += dvdl_coul;
-    dvdl[efptVDW]      += dvdl_vdw;
-
-    *velectot           = velecsum;
-    *vvdwtot            = vvdwsum;
-
-    return fscal;
-}
index 14ba7a3978ada5d1d9ba425e8e08dc79785f6b0c..1672375f0811d480e0ba5e26465fe3ceca199de7 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _nb_free_energy_h_
 #define _nb_free_energy_h_
 
-#include "nb_kernel.h"
-#include "typedefs.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/typedefs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 void
-gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
-                          rvec * gmx_restrict              xx,
-                          rvec * gmx_restrict              ff,
-                          t_forcerec * gmx_restrict        fr,
-                          const t_mdatoms * gmx_restrict   mdatoms,
-                          nb_kernel_data_t * gmx_restrict  kernel_data,
-                          t_nrnb * gmx_restrict            nrnb);
+    gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
+                              rvec * gmx_restrict              xx,
+                              rvec * gmx_restrict              ff,
+                              t_forcerec * gmx_restrict        fr,
+                              const t_mdatoms * gmx_restrict   mdatoms,
+                              nb_kernel_data_t * gmx_restrict  kernel_data,
+                              t_nrnb * gmx_restrict            nrnb);
 
-real
-    nb_free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul,
-                                   real alpha_vdw, real tabscale, real *vftab,
-                                   real qqA, real c6A, real c12A, real qqB,
-                                   real c6B, real c12B, real LFC[2], real LFV[2], real DLF[2],
-                                   real lfac_coul[2], real lfac_vdw[2], real dlfac_coul[2],
-                                   real dlfac_vdw[2], real sigma6_def, real sigma6_min,
-                                   real sigma2_def, real sigma2_min,
-                                   real *velectot, real *vvdwtot, real *dvdl);
+#ifdef __cplusplus
+}
+#endif
 
 #endif
index 019ba8b3410946c852a81c644c78880079f2e4c7..55fdb28a01f334790ca3605d4b49a544fbe2d7cf 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-
-#include "types/simple.h"
-#include "vec.h"
-#include "typedefs.h"
 #include "nb_generic.h"
-#include "nrnb.h"
 
-#include "gmx_fatal.h"
+#include <math.h>
 
-#include "nonbonded.h"
-#include "nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 
 void
 gmx_nb_generic_kernel(t_nblist *                nlist,
index 6f03caa8a339683570ff6062a1b099b6df8eb2ab..65785f2bda286ff942a7528fa961010c93b7bf7a 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,9 +38,9 @@
 #ifndef _nb_generic_h_
 #define _nb_generic_h_
 
-#include "nb_kernel.h"
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 void
 gmx_nb_generic_kernel(t_nblist *                nlist,
index 10b687b020b39713f5c25c59537ab4471dc798f5..4334a04c7a9355da1555ac1ba95a17177026aaad 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-
-#include "types/simple.h"
-#include "vec.h"
-#include "typedefs.h"
 #include "nb_generic_adress.h"
-#include "nrnb.h"
 
-#include "gmx_fatal.h"
+#include <math.h>
 
-#include "nonbonded.h"
-#include "nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define ALMOST_ZERO 1e-30
 #define ALMOST_ONE 1-(1e-30)
index 9c27f35bfedafa445fdac54d269bf5a889e2699c..fd838f2e630e139a081d39faa5cba30136d0fb14 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2009 Christoph Junghans, Brad Lambeth.
  * Copyright (c) 2011 Christoph Junghans, Sebastian Fritsch.
- * Copyright (c) 2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,9 +38,9 @@
 #ifndef _nb_generic_adress_h_
 #define _nb_generic_adress_h_
 
-#include "nb_kernel.h"
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 void
 gmx_nb_generic_adress_kernel(t_nblist *                nlist,
index 61198647eab34d78b89c3f6d1fee08a31bfa197a..fe14f9586a278a65b8234eac961f62ea5d369cac 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-
-#include "types/simple.h"
-#include "vec.h"
-#include "typedefs.h"
 #include "nb_generic_cg.h"
-#include "nonbonded.h"
-#include "nb_kernel.h"
-#include "nrnb.h"
 
-#include "gmx_fatal.h"
+#include <math.h>
+
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 
 void
 gmx_nb_generic_cg_kernel(t_nblist *                nlist,
index 6dec55a30f66f1977604deeddb0454a5eff3f9f7..2ef87893d834f107519a1f2f5c933284f64c6bfb 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _nb_generic_cg_h_
 #define _nb_generic_cg_h_
 
-#include "types/simple.h"
-#include "typedefs.h"
-#include "nb_kernel.h"
-#include "nrnb.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 void
 gmx_nb_generic_cg_kernel(t_nblist *                nlist,
index b983e314c30eb508cefb1a5130e88bc02f822398..29b01659bcde7ce98602e708874b5159d7778771 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "nb_kernel.h"
 
 #include <stdio.h>
 #include <string.h>
 
-#include "nb_kernel.h"
-#include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* Static data structures to find kernels */
index 7ba7ddd1315490699dde8a874794d7c7b397b9c6..76f884aa868bd679af18c9d39741f2ea79f6648e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _nb_kernel_h_
 #define _nb_kernel_h_
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -48,8 +43,8 @@ extern "C" {
 #endif
 
 
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 /* Structure to collect kernel data not available in forcerec or mdatoms structures.
  * This is only used inside the nonbonded module.
index f76f24deff25049de18fc8a6ff7c44ec35fb89e6..5f5685b0d9235aca4431aa43e110933ed39b6d62 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -454,8 +454,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -538,6 +537,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 1b8b0b1475391a6e4d3728d9cfb728b89db960e5..742a62020c6925bc640319ab090972e8ed28122c 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 /* #endif */
 
 #define ALMOST_ZERO 1e-30
index f2b4a4e0fdb988b415ebe7416885ebc5008dfdf5..dba59bbf0e948b19edd68776a319007681bfb816 100644 (file)
@@ -36,6 +36,7 @@
 #define _kernelutil_x86_avx_128_fma_double_h_
 
 #include <math.h>
+
 #include <immintrin.h>
 #ifdef _MSC_VER
 #    include <intrin.h>
@@ -43,6 +44,8 @@
 #    include <x86intrin.h>
 #endif
 
+#include "config.h"
+
 #define gmx_mm_castsi128_pd   _mm_castsi128_pd
 #define gmx_mm_extract_epi32  _mm_extract_epi32
 
index 7fafb5fc85fc48208041c480836efb6148a89cba..cbfc8269abcceba1a60e10ff6009dc0372adb9a7 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index bf022067c62616fdd1d2f2aa219272d108555734..5fd8ddd0773266ccc545850480e1bea43c4ec53a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f698b34c4f3dd44efeb9446cc469ea41552ca86b..0cdebbb8e90ec3ce15ea48e3b81e09b4659acce8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index d2eb26cf935e9249dd9f92ef9402ec631726bc00..7740f00337d00dd54238edb5a50dbcf0c634c335 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 22c36051ba32b07f7792fb16a78e158cf8108173..91e7ac0a55ae9300e9b258c438105206913a378a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 85316899170f6ab7edcee4db9fd5aa438ea8a0e1..d07b478932596452042e432f50a9abc1ffca9281 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f3686bc72b38531ef6e29ae4c8cfdf446784441b..0c11fa03bf888b0f1148e1f5f71ae562c6a9c045 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index eb036d8d2f9c411bb0c30e80c80acbd8122c4404..ef30e5133697dd068da991723445effd1d0ad4a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 5b93375537d175d02be6a861b171c78d6a82aa22..5fe7141b33d2d2ad1a51f7adb7aa776443868898 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b5c0aa95d12db04a35129966748e9f11619bb2ef..c45eb9be9eff20a826be41c4f98376e9cfdf02fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 86b1d4dcb1f9dacae5c59101df4cb44cee66be5e..207023e7497aba33bd8c7962ae4e3b0c00ebd749 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index d853c4943bf3f1d0113d0658232d7e93f1215c4f..156baecf06cb9e1d19058e4883f72a2d08de0cc2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 95b08e36a02b759259d264bfafce7790d6133971..879cdd0bff6d531acc2f08590741000d28070af4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 362adfe5b90ddbc6990904d4c9b0e0a8e4a64977..811aaec5dce4b88ae8ea8f712befef12a5d0295a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index e529ae361aa102e05333d40a36314155506a2c69..2b55b3e4dfe3809ca9abe3cdc1a815250e116062 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 196ccdb9808301348b27d7e543c0dd2d2abc9cff..bd38195b215f1d0c0ea78bfdd5d1f677e278971c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 61cb77b514513387221303844502009266035d0a..c9d420994cb88f90462c06de0a3c04918bbf7df3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 5885a4e5bd9454332f88393ceb65d4fbb9dc3c83..7948f810c72854960731a1324d883fe077256566 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 6475f6fa339f36a0ece2226081290665e69cbce1..c96aaceace6eb7bccca58c958f5735999b1d9d02 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 171838414291f7a0baca09430097d447beeb940f..29760666361a8f0ddc9dd4fbf9cd1ce44cb77127 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7c0815aebd7ad554f75dd2ab7117faf68d8f6f19..1a4be5a8d0ae00c67df7ec161bb5a09e578b29f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 9d16d7c6f54e27bca0b0df8747107a3d9badda05..3ab7c849c7177a47fabd6cd1841ea4427693541b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 5913aeed7e50072fdacd35495d50aec894444956..d2bbb2af4ad16f2b69601102a67c0bc316792581 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 26ad7e39c12d632832e105d705a4b046b6fc430e..d50b68e3d7fe8a55846c702a11bbb5e83409af01 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index e1976eca49897fe217f58fc8fce46773ba55c4f9..c2552783c00a8d1c4264b57aebfc4c962744f6da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index bff7086d04a252b061fb3418bf2baa8d7bf4905f..7ab8c806dbd8abfbce5f4d059053e6d88f0172a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 822018c6520207f1d4220616b20f30ab17f8e934..eeb43e2c6bc9d6094bae06086d28a723dd10bd13 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index dff9b6f2a6fc54f3d1b168a207c626e440b3afea..65b60aaf0709c031f963fb90ccb8157617816c72 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index ef55d239e7a6c6e8ded45c17a1f1b64c7c236751..9e387fed85c9f48087a209ef8127beca3c548f7b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 5e3bf0be390bc3947b36729b2fe0fb6a5a9c2fdf..fb3ecd1b0cd80f66ff44f71b1fb1c947473ca8b4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index cfaada4b661e5038af0769ec88b1da52cedd2b69..d2f3c89ab78ba41e337e033e5eec72d5653b5a79 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index ed221ff747ea9f79f668008a2060422211b97aaa..8e34091ca33dbc9fe9a3bab4ab20c30ba821ae27 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 081b7475d99bf8a2e1d021383265b24ddbe3f59b..6ace8811f7250edc53a15c377680d40de0b37c60 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7250c93ea2f5fe2ade65dc0a24389c0d1f2f3772..ca05e994465ac2a06ffe842e69ca1eda45b01102 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b95e320ca510ec5183b1aa1e5a3575e2fe84bef9..8b0ffee8c0d5d48cc30cc579ece5cab9cfeb2f29 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 112077ef38d67e56ed673ada5cc05be54192fe0c..43b936512086a61087418a5862d2bebd748ec4a3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b6aecfb31827aea5ae476b598580f2365fca7475..6f654be9fea19b14243bfab3dc68eeb85374153c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 83318fbf0a22f0975da965622a882960edec7e32..5cc7686666410608acb87946f1f4d68522ae6bf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index a91e64d59e9bf2e16568ca844a8e62e9a67694f8..cf359cad6d818996e0dd6b84d9e3a4d16c03d6fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 01a4a3051abbd28af6f44592d21591041ac1a0e0..8c22555796e779988af50e7c46374b6e6e66e10b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 95b8dbebf0d50bac8bb9dc490c4e59167bd62452..b10adb328913b3f34e37a9a5a7d737a758a7a841 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b2f5e69ee91261af4b2df7f9a74785d141a0995f..ada3db8b9dea3d7b56263134c530bf0bad6f3084 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 47b4f8878430aeac5b1a96baabc70f92cf9f9b1a..ef9b9a5bffae31bbffe7793e428054335e8ce9c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 23e9c2325143be13324782e33a8975c3139a4eb5..ff65f3311b93bbf72622671679a9de3e78162189 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 4e4459f3c74f639b881d7844e98258e231572ac3..692f088472663a6d21135fc735b6dbc3cbed70fa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 28360b4520a09e2b629cec0093bb3a73afa53f2d..e9cccd58af74080d5f3bcb0bc1278b7d8b4d57ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f30ebd69549ed87c925a2c6f619c065e50bf8efa..5f95c6ec484cf2d4ad2335e2c841ca2af3d255d8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 70c364afd23f677fbde799347f33d669e396e54f..d31e4a1897707b0210113b31acc543efedfc1945 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f34fb967281d815105beb0c5867b64e8595b464b..74fddbca1c70df896599a1b61266fd861bf16cf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 645a6e06c0881c29791bb0cac3edcea9331fea65..22ebd85848cc2c2aa319b4158f8e7f8e317ff7e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 1782e8e47d36501992d26e2226f9ca4718a4d78d..17f7c22570d5d9006aa3baeb425e20ecf1d901af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index ced7a6838df9a3cc071682914969163008a0061a..027fa1ef84bffb9f3eb1a6282404ca39030ef1b2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b9d08db8ce8bca042974f1ca2e3ff56d90c7deb7..ff8a0eb72037cff25de414362726da0e2946ac36 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index bfe1fde40256f80571038eda3d00e6603722baac..b42f7fea6ec97805dc808fd948a1c4ac626fdc07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7d1049f0e0abe1d7224f819b4a6cff3bd540db5f..73f4e2f282a329df9d2d0059761f3a5cdf206870 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 1a2993fbf0a4c7cdabc67081166fc9e9ae38c1dd..ef154b5526a099074a78bd5859e8759e692126f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 87578cf70001f85101fe2f4f2a7e5c7d4e0ad59f..d6b7b977d18acc9cb1555cac1976958f4c86d9f8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 01c3782b922ee625aeee6db61776c38b54acce53..efc95ec1b7d26355b910f2be7269fc0796c88c4e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 8f34d4f732cdef957dc7b0f40e106aa6011c398d..48c4f2e6e9c0737a6a590e598dee7601d5b78ba1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 48e1c06b94fccb09518bd063afd24d1fa70bd1b4..d7b91134365d49a1c7014c60120e79ae95a33a44 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b7c78af992795c0d595c56c91b79a19062acc1da..f919193521af299a8c3764cf7b1d243300cba41f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 6cece91d20e25279471ac2804bf6275acbebd177..cf325f6b1ad5c48c5c570c2e8c0036fbfb5abe5e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f160968b92ad29df508dd944f5267278e27e9835..6c78b95ffcbff144a70c62d7512751c029200ec7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index c39382a2cefd8753f48fc58681170ac910d9a941..d892f243ff722122afb6bf124a5b0c4808fcc460 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 6f482e01427beef25732dde65c6c40d2f0060156..7f179460d381b9f09365bb9d0a1f21b9dd8ca48a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 27fe4f1353877eb526eab8ea81715a124406edf8..691edfc1b2db982436c376b0094854bb00e716cb 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 26774a478a9b560582ede5a17ffb6ae599717ff8..f53389e1f8bb515fa3e658c3e65c7dada5e1ed1b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index cd96fcadcc73b906a93d5a845cede252427b753c..8eb827787da57ea4b3691ba9561ea03937ce91ed 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index dd6379b448ead0b97ce8d75886280aa40a060f9d..a52e4d6c6c17d92937495da50bd27b39c3f72231 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index dd4ef28fcd091ca0ae7fdff67ab234da6f861d95..de80c057560c59f710f62bed0db8ad6cefe7d492 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7c76786e0ebc316c67e79f80d4f5617c393868b9..dbe93b91a59332e59806be5d5548251a768de8f0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 19c228c9541b6c8286eb12a0ad15b043c7e4204c..db5a394d2a377449e629ac658080ee3d1f58507c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index ab0958de6d70972abdd90d5ddfaff204970e8788..a44ac025880f2fb228eebe8226a568b2516fda5e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index e76ae0d1215732d5755d840b47ee9f217277ec02..c39bb48d0480e23d870c2eaff7742e044d060870 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 1d8d003ed36216c89c985147a6e5d501decb934a..d5917e896e645a01b5bfbf43b5478d60d42db563 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 22279514b44f0b157e9a7d5c0017730548851f62..00d50f02fc7f43ec9b69d5ef851737c359d3368a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 6a1230f05de17491dc357e006fd0b310e9241540..6e6dadb0f1c5dad308e5b14313eda254d206a9c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7500fd8fec11abd751a4c20dd9bc42fd95dcbe28..0826a6ab8c9eb1facf413d52f61811c5588f250c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 2584c4efbe837ce3040d8ca4899c11085fa11ed4..e01aacad46094c605049f244651164a39bc277fc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7507b94471c71f59938005c4c2bff1547bb0aec8..75de92f97891d728e3189d4f4d70f41105a0a4fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index fd4c323f019a30592f4c2cb523ddbb042680c118..e311fa9ed7f0acddd04406ccaa2f80c1ed525b90 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 804b0f4103eacbe4c7c267f74941b04f86e33efe..ade4a231bc15242c703153e967492caef4cbc754 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 121474ad194776e12215c71457ac6f5a653bba7f..639e5cdfe3c575395b55baea476d90c4607d4108 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index a033b9b39effd5efe67ce4b3a7b486c4dd2a3bc2..bf884759cc8e8d7c62d8376baeec52e7cf7cf6d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 8c1564e05f88cdb45b8aec43bb57a1ad46f56337..1fd19a1710767a2836a21e910916c1d870a9c352 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f29e649ba5d35087fac590738ce2156c637e7428..cabbba9d5a8e729cc632924ff37e34891bcb8493 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f202a8d3452873b4f28f320389088470d534756f..9e1d8d417665d26709f369b17f686e3ede81d358 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 256d739c8be86755905e25c5f7c28e74cd9f35e6..7c9099999cf833d13216634fd993a926e40c8194 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b563d2ad01141bad92c5cc0dae8fdf8aa5b01c58..92c650f233ea95370f8be1f9a6d96056f9c8de3f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index c78c3925c8f80b21f7e4534705d5133d93be99ec..1a500b9c64ef98a80a1ccb95e3eafc26cc0ff279 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index c193c409504dbab0e00cb73115f2750031bf7c96..ff15343cddfdcaf7bc6843ccce351cc48c4d355d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 75b1cbeb52e1de2d5b073ae01f992cd28822ea06..fa18eb779c3834bd0aa2876e6a6127254b4e7b53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 81532182c3f36947c2bf03ca860f019dbfda9a8a..aef5a1b2a5f4600674497c0452ded09552b00550 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index e44b38bcd37b00516822515b4aa1ab1672b574e7..931b89e094e9bcd2b60b6645ed010d82d3fdc928 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 22ece2860e219b7a53bc06c8900dc3215e9cdd60..1ae1841a914316283a5377336952f6b0a948671a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 25a342709b00c2a454ea1878ba62d5d58ce8040d..87d440680644a1ff7051afd5b814d7b7ed7fe50a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7d18c98d034500f878358f0dbe581a6894640136..a2f3424e96fe3f93c594787f0513c0ae6ab83326 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 9c5c32c0652a034b2f35ac25328ac21fe54fbe09..7a38350382aceffdfc8f5dcea5d86a414fc2dc3d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index ee62b01d9f36149b770ae38094baa912d6f7c696..8b0706d72694ee857ac4d4f8bebaee647001bebc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index b4e8bd36f159b3bcbf2549b687ef760073a3215c..0fa140296fbe6ede307f241a576507583a88675c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 8400742fcf567b17721cfae4f80cefd964550a5e..363d0f9e6bab125c61f7aebe37f26638e6ce3401 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 46aa8a7dbdb074d0948b1e1164bcedf53fbf8108..818c54f47c6636eb6646b04177e39561415ae263 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 6a7be3e614583495aa1b40caa557b33fc82a12bf..69088fb7a6c27e8471f093c8623e19e7f5730f0a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 538c5f518a9ef86a04a7c22d760d5b51eec9e8fd..c93e3f27959b0e148147e255d04fad6eec52efaf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 9cd38b549be94369836e77e8582870d3f38ac4e6..c370951cb0725f231f014cabfa30dec074bbd29a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 0b322c4b74a2fd2c1df3ef62e040c225c1adabd2..891980c7b91f35d847ae7d399b763cdb4f3cb494 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index c1d31608b46578e1d6538506d3b7b16b12169dfc..40fe5bf8571c0180da7de8168dbb4daf0c48129d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 0849d7d0c224db3a0b470ffd8a5e0eb6a2eebc4f..87cab4328331fd7a674f0953cf688a8c00ce0338 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7b46c68aada996e539e8afa90f4b60d38fd864ad..654b1e6f6c4a9400fce78ee000cd24bb83346ae3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 7863ea8fa9e498868baa7e59d61f3a0d1c79ec68..461e8f06e4d95be1e14216159ffdfe885e80e9cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f60d0a0651d0636cd3a3cb6d3a9b987a0ce5f93f..8acd6b51ebcab62ea32ae91290231a36c6f972b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index a1ae161c26e105efdcafe975ba5acac06bdafa22..bc65e6baa1218cc70ed16b963a495a0784cf091e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 5bf635fa4b65029738443f3b543854ece4a041e3..5652e4c406a57c323e7c2ab663c7a55a6aaaa051 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 47e44d03efe0fd719003bda2da4745b73d2e7f50..be1492610d50bc7a74a53ec4a83049600bd0e4da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index e0ea14ce343ee28210619a494d6eac2daa64721a..5cf6f4689f4dcb6438c2ab24a3999ce4bda068fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f7132eb8a7438c4598ecb9af12b15a489eaa1ddf..0122487f3f10174ce266b26f9f8b4c4ce87f6e5e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index f9c8e92cfbbadec3b5909748dac37973729e84f5..23ba0fd18887894aae97d673babe445afbacd7fc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 5332a35599062b29323e313461c71bbc52223971..322dbfa7c297fa54e306235d6a6280ffcec250bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 9234c00319fbd8338f78eeaf6a923a0a20ce2786..b36857e6220ced4b32afea02989043ade97f0440 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index d4aabaf553ccd61804ed41633d9bbefc67d53912..09b3c28b3d2617eb1e193eb6e32e717e9e343047 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 9ad88affd3bf990302d190cf23640c389ce37d53..e12ba84a318a60bf1fafcd246540908bd44ef201 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
  */
-#ifndef nb_kernel_avx_128_fma_double_h
-#define nb_kernel_avx_128_fma_double_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_double;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_avx_128_fma_double_size = sizeof(kernellist_avx_128_fma_double)/sizeof(kernellist_avx_128_fma_double[0]);
-
-#endif
index 14c3771d7ef0b6264e4d620b8125f1abf5b8d796..e6f9e12486f4827e091de9cd539def71b7da84ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_avx_128_fma_double_h
 #define nb_kernel_avx_128_fma_double_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index 55c229aa90095374da4c52a60bf73fc0d6dc202a..7a0248a1af1dd26efdef300ca1390ca3462abe44 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_double.h"
 #include "kernelutil_x86_avx_128_fma_double.h"
index 319ad63efa49a51665eaa0aaf9037bd2dd918fbe..6aadac8d352ad17cc0cfd2df5c00bd3476f38bdd 100644 (file)
 #ifndef _kernelutil_x86_avx_128_fma_single_h_
 #define _kernelutil_x86_avx_128_fma_single_h_
 
+#include "config.h"
 
 #include <math.h>
+
 #include <immintrin.h>
 #ifdef _MSC_VER
 #    include <intrin.h>
index 7a3f21b02dd6446d9740278a76a17b1bd5aacca8..98f0806bc232b6fabdbd7be4ecc63296da57bf6b 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 7936369a7e8e4297bbdc202132b9f93954002bb1..8b6216d9c80779ab734c320ef18fdc855d43aea2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 56b8e0317c5fedf50b2c605f42e39de49214bbfe..bbe1da7e9f64821a03a7af8abb7df392792dc0e1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 4577d81b1c1f5467e8c7b3d41feb98ecedc2d6df..483b345c3d75989c3710ed989bbd68de2c4d9421 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 727393eba37280384bd5f575239646c2da611a89..552d75bd7267add63d1a8010246c83399302827f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 2a3a5254d138427bea33ec78afedb7ebc3101cf8..0b3c9f54ce46e67c50e70e5b8e515cd8754e4b0f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b734789b82615299a5c7b05bcaeb0d75c4d786aa..f554627afd683ef32281ceaed19b4701d5a287d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b92dacc6633a71324da7c4a22c47afb12d2febe4..d49dcd023cc5cc9dc939f95960e926984c9320dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 0909a3368e66c815e245ff33ddb46052e2880291..2ad8d502bac5ed49140e24cbe59c0d9f3c8c094d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index e8dd4929102051723031a2663ce842bee194f1e2..7d6ee07a7e47649bce12192171cc4b00ba67dfca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index df97c46a9852f3031f13a306b12de54d6f6fd200..ad91a2d6f88ab0fe3fff72b6e83a00c1bd5d70d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index bc1b5acbedd3a6ddeb90432f31a19d730fc3648e..481f5744ec8fa8abb976e05cffdbf12ce65b06b4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index d5f8c084b2ac82cc3ff89b55991b0ca8448e2fbe..b14f2892cdcc1f395ab4be8a1cb3806da6bacc59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index e60b6f933383bbd164ba58f3f8476c97007ffc9d..b09aa6c13112e24dc88398c9ed29f95968085cb5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index c2fbc84f0927037b099507a3a6df453fba41fd18..0c03c137164b797a32a94218d941b385520f1f2f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index cf026b56fcc7b5486d0e0c33063ff302ec14d25f..ba2cab28e41c41c1f4e8ebb2801e8627475920c0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 32a3fe5155c08a15c53d6ddb341fd1aeb703a3cf..7b9b030e7e9124005172d5e949509c3743bcd2ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index a1d246fbdf7166d759c3062a536166b8fb816888..8d51bef3e4459482459f1c0cb6e799b892cabfa4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 26160b863dd4d91d55720ad7ce2d6f3bf660ce25..a2a3299df75f1492aaba61c15a2847dca38aacd5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5551b67ada57f87b2f9709d8aaf7fb03034871e0..0d686334c0f7f401e5798ad02a732e9fffc48ff9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index fe7be790e0a664ba3f06a928862163f1f61661de..d602db4b8f45d6435526c63370b2d6541131aa1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b67807906c3e1903e229562b1b6e57272e57d1c5..830a0d1a0afa35cc8dff754a8e32ce506ec389e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index d93bb9ac18725231d7df070e69719a464067db90..84b89b139a9c2ebafc153e9d6fcaea421efc5666 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 34d8fb726295b1b20099a40fdf9ed5fef619dac5..3685a8cdd25f78851c1f6324fa2efa1ceab9c618 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 7dc3fb10aef58f7c60ef34ed7dc61957db4417f3..cadf0c6447a855f4eb33225098f8a9d1a73b5deb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5c4778e81fc3eabc0fecb80dde9330d1e8a540f9..2837bd1d7b7e8a5d2aefe60c09870ead54e249a7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 9f4c3c72b3e9520c1bde75b3029f991300128457..3e23c240c404833b1785ecd745d23a8702e68d40 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 180708d08322e79da80cf25ddf1f15e55930fd70..f69e0f3c618eea454a7911c6081ee1f055a825f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 1f99542da43b8c66bf13c89e34394831e7d38776..392961db152d9cbceb9a7e9f5228ec71a34a8aff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index af140ef843c6e99a91f6eced8c64bd50fdab1786..56855a918c555ca98090d5c1878176e7c8689453 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 4aaec9eb0aeafa2e10f561ddc437bb32a689d43a..9a0e80a5d14d183008a4dc71e51d2d50605f0259 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b7c011a13cfb0610c4221072da981e1d0f8dff95..a65334f53c9b46ca19972a25a9184518f5cfb1d5 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index c699fc19bdb4424347adca9ae16eea543ff6de45..064ed3ff0f702c51003b1b0f72e16f931e6ded61 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index aa85bb3985c57cf1580d31d4b27a94184eb02650..0a7d3bd242671b19cc7cefff0ae58c4d534c84e1 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 15ceec75de09b058e277d6a5518253473213e9de..0e2f39afd17390496af2e5d951cfdc6e8377603f 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 078b9f7274e229a2c37c4da42bc083d5a6f0418c..7b71e0bc4bccab5b58214ff6f340d6ead347726a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 662d10e473455bcbec171d0e8d3fc891e58dc571..667f08d1389ed3e0fcaa6ea9926f55ba7287c496 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5fe79d5b060eba2bfd1227bd90367e256ba106da..1e6826c7ec06582a4ef392b6d944002058acbc45 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 79519b9929d644cadfc455fa39004db7bd6fc3ca..e3a739ed4bd2ffc5c7c98c9edeffbe2dd4fb30e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 4dc56e3304f01eeadab26c864aefe490f24142f2..b8054650a96fd310123180c9bb6b5d0dbcedd6b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index a9ab48691365d3eb4bd90d81b8687eb0bdd68d86..c3a6846251499562b4fc7c02e45844e15b0c3f94 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 17de0d1a0a609c75098cb59fd671acc6e1b8d13f..0f15ddb4c4d7ea98ffa80afe99788e474a619386 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 9fc241cb2cc0194a6b9955ba8b9539b6db0450f3..476b3dace6f94d1a9e11ff990c479ced9eecb391 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 32a2e0ac6a0f10d7b3eee6019712d08c55702b53..6f70e14add28bdb0bda708a9b024e54db67282f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index c5c777b8c4db423df7d0c34590fff55b5310c2f5..ba95dd882c15c88d1a2256a47fb61f476bf101eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 19b02e04ef3463fd60399e58a83b852cbc36e35b..693710d13b6d8f8e84a4fe7355a07af79a8933aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index d0a39f9a98000124247bc542840dfe0ba3b29c50..986ee692c7eea40fdb69591dc020ffcae4ee7258 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 7e80412b6287a906bdefd7b4d35c6e7ec7923edb..f00a125a415ce49115b7d7063b2bbcc3e02e09b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 083ef00bc70389135bde9e143607eba0a1d116a8..5473f77f46383d13025aa785b65d02e83a45e675 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 869843187a033b68b103c50391fbff47862dfd7e..abe976535b2bce70632567581a3cb5f718f72fbf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 4f5472a651ca8ab9e8b9ed4cb30a1a5a7c16d87d..5faa7f485b231bd587af9651f05e47ad50e276fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index f9f7f030b1f969df73ff3ae5a5a674d3074737ca..68c116c11585b2fc4060810606b0a6f3deecd07a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index a49cffdab1a0d93ac1e72081c1162031653fbcd6..c64162b099395c415989e1ac09b031ec28a6096e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b4352bac9a869950dcb8234784b5bb54082141bb..e96a948e6d6b07de26775fd596af2bdf67bbd209 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b6b1d575940e382b556b5815bc275a850a468f86..b7ec8d125ec3ca37da0721ba89c9fef385636576 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 6c080d32e23bf28a5a70cd5ae76553369e52ab10..3b97803496570b07e2d344136e1a06db07f28495 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index c2f6a4749eac42f0d409a6ee9802e5ad462f438a..772485c2d8cfd2251c986f43469cacecd59c6cc7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 6a149dacaf7bc716a52d66dfaf343a92a6b6cd85..e19e34e0e67893419d62c11990c68648f0c57ea7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 16c994799eaabfe4ef1bc5c0a3cb887ff2aea16c..52cfa64686837b2f581c8b9e8d7d91a7bc0e067e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index ef6c0135cad786659dd1fdc7b384614c8f658647..976f20922c4612db6d440381c091a4fe425fbfd2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 3fd1520632e5fbb5464d0528cc5ce49899a134c0..ed0c2b70594f6f0b8633eb0909a499fac4683787 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index cd5354afe0899560ce678cc9a9335beaab224d3e..55c72515d08003e3172745ad411daaa9e4c156ab 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 8d217f6dc2c48565d16fc7d29976da550ab27293..598e1400867eb028fee8294f9c6c9baf96d5039b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 51438bf45002f12afaa06547a559632ff95d6c5e..2dfbe40ab6eb815c2dc704857ecb7eeacb3a2d56 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 32025d735a7a1227561e6205c2a172a86540a1a1..0f8d6d9de37b580f59af59a26da521233be16f92 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 49c8dd6af17323e3e9912268813d4efa216e6247..c7aa5434933cd22bd4cea434387a5e84fa1e1a03 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index ffa3737cfe1228bf212890758b0392fdeeff046b..6721e66463359d9dcb7bd930e5bce0e4ef2f8e40 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 3f519a1d6898c0690d66d257904367bd01cbc4d2..2674a6c280e6100960fdd2ce5f898445f9f0c074 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 2fb099d2f3cc238830a3ca3bf0e477e8881b8f93..f58339e5cc7681bd9d825bf86b3a915041230ee1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 4d80378132bf46db12e38c7026eea07c1cb4d252..f56814bd51343238548c4fa1617951b70daf3345 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index cb7fe1e2a9ea2a87087c2259b621c9ad53f3e600..0e977af0ada120cfd0b1129d1af196e942ccea03 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 78689851b55effdbdc4c130c046e75adaf66d8e3..04ab82870888cd04e725686bcb0e68192c770832 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5473ec68ba6f6497a49761942285c34801734454..578e05fda786e9c67b5a16d3705e6f18574ac8cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 0301a29bb1cd97e8ffc251ad0d05b7071ef09e69..4a1ea82dd79d15bb7884b705c9352b017949e7c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index f44b00860cf44e6b58875db9a32cf992ed36c87a..999472b411ff2478b367af9aacd08234c406cf8e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index fddc966f586651a2144b82d4a08c719fdbcc2ddd..2655ef08f1b1103b1fae60e8c8743c949ebbea40 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b189dd5db9ab54de5eb97a3fefbb6622d28eeedc..32a9a9366911b2b8001bf6bda4f6d9ee62087f63 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 37d60b40d5ae5b9298e37bf61a1e898140a2bdf9..0a459535471d68fa4e6939b9f160153f8fa42cf1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5fb11907b2508bf5f4fc4151e262c908267a6b9e..21003ce9f1f488bb62751b4b29eae1934bba6d9e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index c40a1961b6670b3ee381424b99210755cbaaffa1..c37dcedad6670a53fe36196a0122f39623b96593 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 013daecc9644d723d9e12f4cd4d95bb677298bd2..88ec2a3081c51dcadf8e6be12e191595438c5cd9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index f2f2674e1097a3c10d0430b01b9f6c652e459912..dbfc3b7cbc2cd2c799ea204c620ffb4686cd7864 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b71b05a7c8c47ab765bc42add4a11a3fce269247..2048e04d541be5f78761bff696d49fb05935518d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index e3e216e167ec5cf8bd3bd753d5a2ef82b91d9c71..13e9018f272e2d2bc6e1359789d34d889357d554 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 3863582a74ec42ab4e5c77469a30505d8c68231e..4c58b3c6c2696674361d8595986880caa145b190 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 94a018d582c68377fcf227ebeafa42367e9da7fc..af57b92ae73842a86df5438cdd8d7f37e71a656c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 21f1f24ec355174feb6166ee08099c6320d8f6f3..aab497f43b9ba155839a0b990124f36bed6353de 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 8d566a3910c6464453ab14c160514523fd08d1ef..2f414688e94ace91292b99bf504ac99140518bba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 86673ebd913a15acffdbd23827cdca3cb785dde0..1ef818256c3a0a01f7365be77da5e86ce89568c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 964f851f45da394fc818457a94a0969646feab5c..69ca5ba3728e39cf6dfd58c0db7ff53133a4acf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5f7eae8718b46cc815176f251054c3588fffc784..31b1507e084c8b183eaa99e1740e84b568995a46 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index adad55ef83adcbde71020c72c552c0a5c118eadb..dd4506306f12d5e76da9340d01f548ba148b2e95 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 9f6890dcdfc94849e6545bcefc33d91543cb80b3..b1b532ccca54f28b9fc87061f90eb8f3040c5bdb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index d0d8c317e80e7c87c362f555c644ecd2bb0cc0a6..07be7b5ac85cea79c06ed6d0736db95e6d69d0c2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index f4f5739cc406e7d8f0fb9428cf5bd408f0c33e92..8efdbbc47d717c491c8e0c5dcb62b2e0513c7d99 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 10916f57e4b7fa39247e1fb14f498ff396d95d36..da988a250b2f37cd3f1103a0e18fd0c3fab16d05 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b8e71a88b8f3abf300c335f3bd6a609a47e1da75..ec4380cc5e264ab3935cfcb3b28b5ec907a30aa2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 56396bd3f73bceeb3367fa433681d572f0f9ea56..c51bc2cfc5bed04900f1c4084b584aa204cb3e6f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 8d4f5df8321d96e46bc649bfe3b2e6b2bf7afe7a..dc6f4951bb02ce718b32711b9512e5a49cea45a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 28f1ba9301934ae6b818db3e815e0bed8b5a5bd1..7b9f2246b6e3c449548ed024e4b07f2bbe7b6f6a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 6bbf310e9615b72f8a6cbb7e807e98be3c7a908b..1168f76f2f24ac7ed53922aba0d6aef3bce57ccf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index af6dd21bcd0aecfa96bf17ada5484011d4c7146a..4c7b4d8a25b5efb58d1ffdc60cf775935ad92af1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index d984e855769abf16ecaacc2e0d4523a10925d7d7..ca01f6b63b08d4ae115a0899f47d4fa12c35cec3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index eafc5604c667384b2034dfa586a44ff90dd47a8c..04d289bb0abd1d681f88c83c43a9777b8526c685 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 693c9834aa6029ff3ca3164ed1450b3ec58c0120..c4b51920b95222425d6a3c78e8db75b6c55711cf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 15735f48fb7bf88aabadc9e43a3d9af314c0aca7..55f329dedc15f99fb2b4c2bb1d51300e4c4d9776 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index b38e9d19096bffc61a1b418b6b94f44ed6d1982e..a40098102178c753ea64429f9c42f15627efa2aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 65220a606c8f565d1c42a6d892523b888a0862d3..25099d091984da77264dff96c792c91358b4f5e3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 07792c61c26da89ab2d2b9e93361fc74fbca8bb1..8c552648e982d93b9118ace413c1bcaf7accc74d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index d05265d3431cdcc4827daf1de54fbe76c8cf4f8c..d1d3cdd3b8d2d306dbb7156c2d91e0077bb395d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 634b8d71dc5d7e6a66dc4281796a1f1155ca7db1..9786c4e350bce804695785b8b4edc9782d8bb1dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index a0f7938233a4a8431b308150c6cc61546d9a25d3..2bccb2cfe736b61149d76dadcb330bf9a616ec5c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5b2229037eced9aace4bde5bc88910ce43ac46c2..524df012b1f4715b10c4658e8ecf32ca0d2f62f1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 383f0b001e708b5617bb9918b83b38196c17fdee..0c22c15aa22ed5f432b8407e0554f8c1e607adef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index f657b9ab9fe35d4db79e428edc9a5d9fe0149515..32c964fdf384cc93d7111dfcafe2491497410e82 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 253d0433d550727256eeae3119a603946d1fd31c..8b1e6fce7e994cd8c97895d51a14c2c3b21194e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 59bb55e859f141382d4743e9ff541ed3a6c373ce..82866767688149b232d1535819eb087438483455 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 1ec202e3dd7de383642304d1f12d6d8cdbe92b29..b3ef05ac514138dff19258bcbb476ca8f30a1b3a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index cb55c27b99e3ad99b105463d527422fcbabb8dfd..396e3f9a4d62cce7a58e20939db6c847df7c5d88 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 5b99471998b774daf4c2189075f44ad77e2c763d..e522fe370f118d05dab5c2f28726da7d75c460a5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index 9f196253652188d9de28bebc558f2c4e048c20bf..9dfb2dcf53242433c1bccc3cb79fc94e747ecb89 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
  */
-#ifndef nb_kernel_avx_128_fma_single_h
-#define nb_kernel_avx_128_fma_single_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_128_fma_single;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_avx_128_fma_single_size = sizeof(kernellist_avx_128_fma_single)/sizeof(kernellist_avx_128_fma_single[0]);
-
-#endif
index 8c2387aa36d2973523ee19ac38134a5d9e8d542e..a96f66b81ea503143fd7459198efb704f531499c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_avx_128_fma_single_h
 #define nb_kernel_avx_128_fma_single_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index e2849dc7545204c7cea122dbe189050760c660c8..a7bcfe03f9f2cc2139046b1e3b7edc397918ccfc 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
 #include "kernelutil_x86_avx_128_fma_single.h"
index e77e39c1d3528350630ab1573ba84f6e95e77f9e..6e37231046ffec138f2b1b4f3870e35867a3785a 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _kernelutil_x86_avx_256_double_h_
 #define _kernelutil_x86_avx_256_double_h_
 
+#include "config.h"
+
 #define gmx_mm_castsi128_ps(a) _mm_castsi128_ps(a)
 
 #define _GMX_MM_BLEND256D(b3, b2, b1, b0) (((b3) << 3) | ((b2) << 2) | ((b1) << 1) | ((b0)))
index 0b0bce00dcd134b5dfac74344d2882730bd936f4..d529dcd019d4ed7b2cb162167b94334f6dec35d9 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 340aeb68e625e9034f0b810103afeeefa3451ef6..1812327ebe7d7c98bada37063bab505066c24b28 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index de8ed6af081b05234a57215e7f8e99c1c3d9cf20..92050af6145a9d112b9a9a21b601a67b75c7d042 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index c25b6199a76c7374edca8927c8f7d1485a768800..30d868cc4b569cd0c99f120dc35afce2bb5d5412 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 37be66d8f36dd3bc5007a9c3b0f3c2f1b9d44217..fa88af6497bf0f3d692f7866d7b4e88563509a2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index c7fe531f732f05d061cfb976cbd7da678b577eee..bbfec367e264da2049e11b57b91d8b0f541194f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 711e1013a88f131a46aca80bf228e7e31f311524..e41556c06a51d59718cebabbb9fb4120676f5cca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 65233ccfedd15c9e54bb373e858c384e06642fe9..9347451094de683f0dfb7e9a0a4f2e0f52598a85 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 96fed27847baed2ffdf39ce906422065d9ef26f6..ce6a5fd1710437ab73ff5038a8f8bc1b793dd4bf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 84d469dcc9fc86843a592fd0b8f0068af18cdb93..480c8dcf91ec61583fdf1718a5b12f4bfb9f1436 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 1bab3887bc14c11d182eec444059a4abefc2ef56..639565bc49b597c6f39c8a17a9f7e90b6a57cb67 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 84604d3199a1bf43dcacace7548e6ee93c368f80..4437b10246e2e58fd80a33ba05fcbc191f732476 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 1dc2ade34a9e0a12a147315d3d0c41e1fdd8f6e9..458889777b67f43d8907cabe4dd134cd180c3a7c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 6efa635230816306e2b6c4bdfaf37b02bd47a323..92cbdc89cae87ded621032610e4d41552932c666 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index f91fc46f4138c5833f7ed86d5b751531c05a673c..245e0ac4397f8659728cf0b8606fdd366229bf00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 5632ae3c1d5880f56bdd35494b7decc3d067b8ce..429bc22b045b5205f27dbfac4088aa14bc259def 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 8e3906a52f241f8880284f7f17dc42bccc6cce6c..3eded00b2f86d1168e24e3f03ac6ec7fbe1c669a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 5be24bf676fe598a85ce293392f32331e64cb623..830ca0e03d1fcbeb7aa1c261bb872e725b264d3c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 5546082d08266298df296e22a01b5e5b2f2e0ff7..13706abf113dd524a638930f4bf427c7cc8cd00b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 0d3edf4a6397908da14e5a6ac16de211c30f2740..2a07685a43e04763a27b54af950ef0325c34b6c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 416bb3e3c2558210f145b5a2e341c6614007faa0..17ec0100ccfa562670555993bda81e4da1d3e273 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 180008dc93c814e9b9f4d99158d357031de41361..6781c3d1715d8e40c2d77a343f77c23d5d23312d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 64b2edf6db90f15bf7b160667633b1116133366b..7716eedcc45b7225d14e6dbe98faba2f7f3694ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 4778fca550d49f778b70b70e4414df89002759bd..f7a2fc2eddec3feecd94a34be5f1ad67c78558ba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 502051438d54a9001c605f46658c8686f5a63f5d..c369db56993fa11ac175c8de813fb6686ee15508 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 95834d17b0400b53477ab190a88ff1458b19e76d..cdce1df694441a75e9247788a6e0bb0f2cdb22fa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 00fca60439fdc2f88fdf8cf63d60b64d76304d84..1801ea297cd1af55f1eda5ca3c27eabaf03e1c60 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index aa3d3bb33932d1e3e2e9aae16c3e6334f4e47de7..c0887358f009adb473df158ba11cd5ae0dd75dcb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 875649df7bfaf1d1b1b2ff5c8d30125fefc713f2..7aba8b430ee3fe3dcc12f8681b6b9b40c796bb80 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 116958b86d562f7121f4753ae0e33a585e4a5dea..0cc88adb496c18fd2eac772cbea625d780e3ffe6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 4b693b3b1687c567fc8325e5cadf2f05cf861cf1..bada00a1821b8cc5a7133fa651dc97d8b378be38 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 61c224c30cd38df30508ea5a0bf9b86925a45242..70aa6f87bb271b9166f62839aefe5a97610c9583 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 6aeb9dd2d7f34db864d785c407954177cc75eb46..a32b1fa1bcab52b933c4ec069e5b6a1da60b3044 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 828fec18657ebf6ae046bc517520d0e04c73f094..1e3120b9bc617fbb5f86a8d15f0fa1e9f5423ca1 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 2e555c7910b56e43f715e0c31a62c549768facbd..ea28c3af3dcb4cc658ee31b199aebafbb6726f6d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index b5863435b3a74f9bb651152fc432af7114f1320f..6de72397472e616382522ae4cf2bd8218ee62df8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 48b01e9694a0261cf773799bc2cd2c9a74f68de8..1fa2e9b0de84b6cbc955a350b97c0f7957c2a66a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 29aaf5c3bbbbdcd409a8af74d966785870eae5f4..4e241cb085bdeffea44681679d1906a891e6dbf4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index ba499d8ac9cdc0527389fc1302f174e9f42a9c84..8e2762c5f4cc44511d106a7a3b2fb86bcbedc960 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 9919bbb0f72eb4b1c85f2c3aa761ff0e58ad49ee..f61fa2ec4402d7866d54ecea64edfa14e26c2902 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index fa7f0c6552cd9606809309351b3cdf70c01e431d..6b50b8dceee9e4b38b70ece35fd2b2dbe17242c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index e4a2c04c0af6ac4f95a579486fae891506b639d4..511c467b1ca01add56667847debeff7ff34632b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 74a6d826f3f8c0ed551a61e4946e33f82699fada..a705c686d4ffde1e226dd4d77e07cd1e6dea3f21 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index f753870cbafab94e011640265d320dd00765b7fb..48835ce17ae0571d9e86cc8ce6edd6dcb2583457 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index f1c783e3c1283be616763126df12ef5d779d9235..61132e9b459a9703ef7a4e93fb445c4c0708c1cf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index ab1a88f0e68c2477b799ccc227e1f87606b56866..ee0847edb91bc837a37ccdb75ed6e215c27ca3ae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index d867fef16ba4f4128288418f265bd27560916dfb..8ab7581bd6f69ca2ff58305d43a267f37a79387b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 0344952f487caa6145556a319d760e31f6858dc5..db0daef6ce86ace1cf526bede3e89f6d2b22db52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 6c0c5d91a234e4987793e7dabe0d9e9d4bdb6885..b6284632091d8f95d5cad359d64728e4c76a7e57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index aecd9d878e0002dc7a49349ad75db20a671f47e9..594494635e9741aa4dbbe477bf6d818f311dc38b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 37f458c1f4d92ec76218a1a03f52d7ba4c5b6a71..ae7192c471da00c5d235a5f71ba35f8ddfe01b24 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 44751fb733dcd04b90cab5b12413c2c0644b02e0..a7a270d82cf215ef948633c4760dd674313902af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 4d16e92ca1aeedd6e16d03733aa5532e36b3858f..b28d855ba5a8836fb5f607582e4164e324855f0b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 9c933ef017b011d9634f537af32813ba60456b7e..680196937d70ec95160a05958025907bb458a86f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index ffe2fca9ad339d2238db90eb10639f8bfa1390ae..ef1524dc1212bab80feea7b2183530d458f503bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index e1226ce7ad6d19cacdf6fe739f1f8494786ea127..cf4d5a8a0993dcd434eae586c256d0339ac975a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index c4ff14fc28580f2821155e6cf3b1f3499db7287c..21ea776621abe3741a387f7db602246025f8d018 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 39c125a19a38bf12d60f94ec020551f20dcd3e03..4673789472e30626d598edb89b1065ff9fb8d36a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 14dab8661d4a4849ff6b6d35eb61eeb556f839e9..eeb9e6e05e014aa722fcb456564888ea839178d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index df2a149613a86afbfe5df1d4e5133031b3f4379f..93f60cd4b173a97ee42d0bcb34398a6d8f9c1e9a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 15227870e20ea2b192e99499b8f5a318ebad28a0..e157f789f0590a5f013cdeb359f00b2153e86e4e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 75c342198fcbaedd9723c03b577d1aaa9fda511f..e24a762c1d288a44b9668473cdd6d0e30780d47b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 651be4ca2deb77d6c8e3eca27d81c1c921956aab..ab6a0615f32954dda05fdfec0ed1762ba91d9c84 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 7760286a4c019fd7fd7b7dd8cf21e69e4857f21d..cf7c18fef456a1f98864ecf5f3ae316265bc98ea 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 294e59768900761fccd05c9b6225be6a8ff44a5c..c4307c0d512ad870b93ce9bf61b6273ca9203c40 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 3fe41bb7b824fbfff851fdb4b5581e6ff91ad2d7..ddf2d7d1bfd829238fdf3a15f7b97a09af005ae9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index a8dfcb78009956796c8b674fcc8f1009794e5271..c0366e4983648d02aedb99bb48c19a278293ad00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index ee451d705d6f2921c97cd9e786b1849df69f0943..9d6087414395ce106990ae201c6e18621cf1143e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 1f66e97b84de6e4e062209efbf1292762b73da52..e34f9e9f80f516afd13e7e6c4fe340b79b25b307 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 58f65a4039fd730e9f39e73aede7fea5ffe56b29..fd8b34897424260fbe52a10503ae3b5ee9369a2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 6ce6bf0c6d8059540e5865b158409259a410c106..40ab27febf33d742992ebf01146a37dbfe51da84 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index d881351af11d9ec028733bf2df90369876784cfc..81ba1104ec3485bd2331a8c72d1be128e7bd7165 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 10fc60b32f3e9e480eca7ffff93917ac3e982e74..33613e64d637f4d9a92a9687b5348204f9daa4b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 78ca07f261ce392b4566450cb5e5ab6a6d6db152..325bb89506b192d48a82876fa1113f4c7c20273f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index d6547d53f467542b34f96619651b7f94a2689883..1a12aabd3971e05d369381266129872916247cb9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 8e5dfdbc4cf6cdde91ea919ba3bb78055ea551f5..55036a64571a19c386756d631484fd071f20a2da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 118fcf0fa0864139b96e6e508f7a5068c8959d7d..c7d3b2e2287fd83531c476d9e7f45fb3477270c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 09d93dc9cfa10ed34576782caa237c5636b2fa62..0cec5a037e1279aa62e8994c04c74a2cc87d041d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index b3846211862cc850ada33578d13c2060f204b32d..b1b32ab6d8fc1cdf30b6829ab5a65ca7d5219dde 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 2709c6a2d5c22e8a505f3815fd454913bb1c62e9..3746403332cd850c00f8a01c8c285e3d7aa6ae20 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index a07ba3dd51537ae9af16ea7ef8d540c62bb83153..aab22ad1179339cc6a1f0c84f81a7d93d37c0a40 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 9372123866a449ccece551d9ed2949823afe3933..d709d7e4293518cf17821f45fde95be3d381ddea 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 9086637bc24359b989b91d53282e2dd1ab2a8f78..dfce8c8ce3597c8221d985cd1053619281806de3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index ee98ebd2d4c9d8ac34786b04e524aa4ca864eafc..c5774657da83cd9a85c10babab1fd968fe6b7998 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index bb765da84ce3b976768aedf384f2435fde1ae2ef..a07db1ba1ffa0f7dfb356021a48b87b661726ec2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 39ae14575df0505718e4fd9ef4afc205845ee30e..c9ec83021ce7823033100f6ee4847d80d6d25c08 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index c8024d273fbbe42f9de4d1e64dfaab4ba66fba23..f9b7a3f7654fda4c0a8843ddf9da48030e12e57b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 7610b1cdf92781ac03abe14e83b46d05e5d21e8c..aa50ee59bdd991b3cffba1a3a591ee97e94084ba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 2ab6ab4b4b1a6cb6fdb69b3e133218171ebd4c45..ade570405c22d0e38bb4003d45bec614cc3666b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index dfcd6bf39104261b5335d575516639e744ac8e66..a584d2496ef8fde009c8d00ff2badf5eedcab9c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index e2bda1b267d33801e66334975634e7c4bc6869f5..1fe2cca13b7dbf55c913b7215dcb2eeaf04c6e70 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 84ec51fa0178a4823b3dc0bf74cd4c4d6fff31d7..8626adce70f9853458043c207809cabc81d75f31 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 2d51d5943fc091569a00889320cee50cfd388c8a..01592100093f31128d6f86db35fa2a3bd5216ed5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 400c63c4adc7f18a882bc038c8fb5c77d2d93e1b..4e9615fb611fb2a5f092bbeef2d684077946cd07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index c172fe9b0ba9718a96e41cc406485eee1dbf43b1..a150ec3f66aec0e09e42b732600c61f2f11808d2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 4eca4fe1de15c71f7c0023ab1964edd8c3b3bbca..62b0d7aacacd89ce23bfb455227d70477492d2cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index bc014001de460c6aaf6e9a424c485f3d79fdd8bf..32fb7557233073e9bebed77e385b0de41d1093cf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index aa69f8b8bfcc6b180014428be161072282deb834..9363d65a42806cc4b9f226f14bf9efaa4e3d7244 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 1d13db7eb8b037d783be54f8eaf5c239b1ef63b0..c12bfb6a23ddd6bd20f06e0c58c733046afb014a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 3f5365c459b4d828684f22cbc029d002ad46d0a0..28fc769f4781b58bd7721a05b61db3c05b890b4b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 73bca302e20a0f9835836aae3d036025a06b3202..a67bcb2a32046c9cb49250e81627c56fb8477cff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 3a271fbf7c8b100e82868e00b4b1c3380aaa9054..e2352e94d1a67f88c0a14cbd345dbc1674ff1947 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 4a3649f3b228c4d98e240cb2c3194ff8875f346e..36218579e6f918d488231f39b2235b8d4a7bfbbe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 0ca7e447d10236eb5d1d014419ce6a644bcfeeda..ffd29cbf034d3bab59e78bc457774b082d8bee84 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 39f49cbc86c434715481710e0123af1861d9808c..09358f1d853417bf8f3285954c7f32f5e012918b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index aaeb6638a490148584118f5630f6841fe897bc17..00a36f40f1dfc5517676ad7fe7c9e973d885fc20 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 6e3e6d7e4798f9055aaab7737bc31287c773d619..10da1f16d128f92b7c705cbd37d13712ea565a0e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 1d25d6f4b50b7ff9366f14b78ef4f4eb588aa57e..7c9313ab81296b799374e838b521c4ec8a41e410 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index b982a0549801ae1ba20fd256f535d04a3e2b75dd..fddf82b951000add43c12dcebdb8939d69311f5e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 7eb04311a56aee7c57e91c567862d21e05137905..fa0cbb4f22e50137cbce38eeec8569251b5ce7b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 7ffccf46952f4dddd9267d9aefa699c4fc68b1ec..d5b743785fa76b4d638155ee0a98e2d08a86111a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index bdc230ae10777858de8fde9d088f884a966456db..37c00564c87ec70b2899c48c65575e6f06d26773 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 45ab560a4cf3b6ec67b18efccd5fd9c7433f14ba..7e3a85ba7c5e589a6bd08ef00b41d59d15872444 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 2697f5cffa849251bcb00129d588b16693bc5efa..c2a681c5dc7684c011de2f25049848f76d88d662 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index ddd634ca1103d962ad794d289edce238dcd06de0..47a90cc7cca94e1aaf4bd5147f06fc27aec7efff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 9fb428f761ce7c1f098c0810ba0e46e3586b3604..3634f92e18b511a7152e85b658fe4c7f553fd1e0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 9c4c73f4ee4108af313ab50dfa58f0368902a480..a59799cb5540a969856999eb7065947a5656a4ec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index b9030006603d50ad5a4f63e9811b02bb29887b13..ddcd71589a263f627cdc3dc67adefbb530defc7a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 07d3e839997b0721af9f325d424449efa1f2e0a6..3aac60db196fe56a415656bd504583e5edaeda1c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 106ef8c8ded20565df818c9642e8deee6a5350df..8c399d3d5b5b50f3090eb3cf4b5fbdf573494a3a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 94d6e3d1c98d86c25e5d3d147a65996c7489b9ad..b536da526a630731118bdcd568e24eba0546a2ee 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_double kernel generator.
  */
-#ifndef nb_kernel_avx_256_double_h
-#define nb_kernel_avx_256_double_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_256_double;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_avx_256_double_size = sizeof(kernellist_avx_256_double)/sizeof(kernellist_avx_256_double[0]);
-
-#endif
index 308256944e686a25a231cbc1a77d372e1bd092c4..97a60c168efe3b0616112f113bef2802affc685e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_avx_256_double_h
 #define nb_kernel_avx_256_double_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index fc0fb545f55fcd7383bf34b3bdef3ffd3325cbbf..a620795367d1b25d7fb6e7f163d3bac8b81e19e4 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_double.h"
 #include "kernelutil_x86_avx_256_double.h"
index 171e1653ecbc0c36e4857d3d394d316bc66614e9..eacf202462a7a6d4dd1fe1cd63ee3bb170ce35e7 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _kernelutil_x86_avx_256_single_h_
 #define _kernelutil_x86_avx_256_single_h_
 
+#include "config.h"
+
 #define gmx_mm_castsi128_ps(a) _mm_castsi128_ps(a)
 
 static gmx_inline __m256 gmx_simdcall
index 7fbc8e565ac6bf737e77e4bf4752833b0d0fd5e8..7a190dde8bfd30cc3ee4ca951ff59e231ce6ad49 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index a31eda80977ff018d5e79c1818272b580b1deea0..3697ba2593a85502ba86e02f5fe344647c466354 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6e13e32406f32e5605b0b76653d3edfa600b10a8..267200d42b690359ac8d5b7172eea730d38eec2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 85b0b343239767ef44e3cb7243932f08476a0f46..6e8af0bbb31de5494f1a4952b9e29ceb5a12e449 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 571bd3b30564713576c237935537ecb4834d2652..d4a3fcbfb893c1bfc60dd17900f0d50e9735e843 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 8ffc459f5cdf68a6556eddf2f6655d51603b0868..aa2d063de1f56bb2b78c7a2679a0038e9e671bc5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index bd02d38a6da8667bf96889fd367016c7efa0a0f2..ff98ee27fbc5d1060f7bcc9ec4696ff0d807ab1a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index b3061c5a0716a551275a75d33a72880d091e19be..f0ff0f115d69548887e9558e329465389dc9db00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index f58e48ae27b2362b78d3350c61c21d31e18fee3f..2cac31f4e4d1009acb4d29678297671ee4338c9c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 90f8e86e1197586c9c3e7894f57d9ef1ea154d75..35ad386ceccd65cdc652899d0e43dffb3c4ea577 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 0bbd2fed8ecb584b4221fc028ec2c9df0b704a5f..36f1b9c55c7a37e9796d2e393c8335985eedd844 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 1acfb9628350293a123005b693cc8e7733649955..74034d60b95df02c8a20cc9421606eef11e83c4c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index d7c1c500338673d7e64cb5731fccf39706f41e95..cae9b3e9b716bc480396884aa10296f3946d5d55 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a8c810fac520dd2af17719c07146ff36c921818c..4bddba12778afd278abbd462c74d6f0d9605d577 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a9b004b4043bcf6f33baf01ea33fc2d043fccdd0..766833835ba8b4fc9c8d65540ed69b708e11ee47 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6abe07efeda4938515259b1fe37fcda29468a003..1ca0510033628a6b579837fe7fa809c7c55b02a8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 4139080c8d633d3d29263977db9dfba0ca516c57..17ead9e889f60507d89f887c5223dd67a60237fa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index c89383bb4fec4b088ebbb141786cccc8433299db..119899324de6797c3ab8628ffe3f3a1c658093c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 4ab736cbe44269e9b812ec3e73a7022ebe2d4e56..9454d34ed2466dde5eb36e0cfcbf56d37778fbff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 1e2b2750ea2ddc051e50f45d39eb8a95990dfa4f..eb0a65bb38fafa114b48ac9b487979a88844fd5d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 724bfc6a807db4313cf4718c6ff2bec7ed2feb41..d2ebaa8b6f980e508692b1da59fd8ec5abd18b09 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 8e33b714725ef9703ef83f172a784aa1f7d44933..e78a8983aa17fe10ca74ec373fc6d4a03934a1ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index e015d71523623d03ba3326e0198b2bdc140b5886..c6591cb4164c8aed703ea3308a15a5461680ea96 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 58592a4b2e8acf5af3cb3f70ce14df54a4b9d62f..fa395d7a33bf672119bdd58e71bddba34e114440 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a5142edd1dafd28d2263fdc2b13224f06139de89..f6ba31b1b5ded0ef1c535f2b3f91bc3fd15904a2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 74e8807fe4276ddf15fb17484382db84410ea211..1f585ffd24b9b3416225f3e904085250b814aabd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 72a9e404a1b14ab218f050b9c423c8da565f400c..e9fd9ad5385395c259f7079469c1d4d26bd81e3e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 5e142007e88c8d7a44a0a76b7b0e73f85ba69f41..66fa12dad800701ea9b2b664694245430f6c3543 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 886363fb6b47bb04489b1106a4589f75914006ba..8c564f36b93662ef743623e55c1a8ee2e5e95d87 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 8549fda531175073cb47e09ae4ce63a8a76818ba..1b971d25e9530066eb0b72018aee994cec598eea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 8c37dff5f708559aa033f797836444206dabd9ff..ec67f7ccbfb699a967cc95e0ac034585669223ca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 5eca689122e617bd1214f09031c486728c9d443a..e9981e567b1e058bf3a34d67a9877a3f3debfa5e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index cd8a4e475a23ca0b07d9832e107d72ff89fcc3d7..6a699a5da8530365d451dc1361ab7816d81f19dc 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6b8296b9276b695baa214d6b38778270d46882d0..1d608b53ed467aec1bc812195e5798d8ccd57c1e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index ae0dfd67d984eef9230548933563a06a12c057c4..f7732fff1913a6788ec1bbd3c4c3b510d3548a70 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 5da9a1da970cb43e43fcf762155690c4ccfd312a..4cbc7aafddeca2d86c9e9b6735bc3c8d0e60c098 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a47b1e30c250df595bfec94eef16f824c6fb2638..c15eb022a6568f5dced554951271749a1a1ffd65 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index f12a5936acd9e6fefb3fa7957d9198b0356e4a9c..e1cc7bdc19fc4d6fea69fd4db7667bf07edc5cc4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 1a4dda9aa3df5827044dd9a93c7c07d35479dd80..c05d3a87b4aae41a462d3b7244988bb6b1a8964e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 20ccac0f8630edf52c45192dc2474a89d903bf63..e7b5ba6e10fee6315a2218aec4b8c11e55b7d024 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 4a40b8e29b5bf9b27eb13ff0eaae9f8d5418d340..0d7de90d422cd863aabf3b7d316df72f9e58f8ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index ca5729cf5a3cc0af982cc7ee60bd5e7a316a402e..6856042f831c25eff0c8d66a176ab196bd543b93 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 031b114c85a08343b3da30831a0e019ef8cdf1e2..f8c7dfb9be29da596a791e8ecf67e3b5d01134cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 960eab1e4d9f7061641fa5f0bc2db26cccd791dd..aa0dcc27185fd51ba836216c6077d48b8a29c9cd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index f4e6b4f9a84e8cb4c85c50df33b83cacd553c677..0bcd625f37c8324da3ce7eea33334764eb0369c0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 5fece7098968b9ddaff68de11b46fe679f1b6186..645972b0c3171a6ca96a556d9fe83dc0315efca7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index fcb460ba8f7b3eceacaeb1f243f7ade2aed49c57..5fda5f1e3c11574bba173a4507844507e295d369 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 3bffc47b7a698052870c7c529f3708af9af0ba51..6f61398cbfccadd825697791a147898d2d0bf394 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index cad4bc8c9a913411f17b4a2ddd56da0573b1c3b5..721cb3427f9f773789407d267dfc21b7b5d35c59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 438a83d3047e8d9503ffbe9690b7474d8577d218..e14334055d4dd497b5d6f1c54c7b519df8116ee5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 933a9e0041e8fd16cda9474c95a34239cf9cee5e..337d13d11a8618f0523ab694068874f24699c90c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index ad3021dc7cf1811038009521f2d14c15b3d48fea..ff65c001098d294028a9af20bbe4d7c1ac026544 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 934a63e443664d91b305ced1e1799a2f885b9c12..6b95093c22286fa719d4cfa5e976a662ee863b31 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index bc130f565cbc075b54acbc5aa9614b0aa8d96824..93ed08a61800605e3d52b1f828322b78225b3df3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index b7328ed5156a6e9c23acfe4a574c216cb9389a75..398af45985e74c4bf58292f400fdcea4917ce293 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index c967705b53df6cf6eddd222c8e7f0959d56b92b0..02d49c27a6b5c43d0d1750f41535202f0e05cb5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 18e0d5c13d415d16b4524b8e550e1bdd7799cd25..b59af266b44f7185eede6d52817056b7e667cb1d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a1e1a12c9bdc4f761c1b4e8a606c8451a8be5748..18d171ee8e20fcdc373737fa922b54d4f5ba5655 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 7765dfcb6724021b0a5ad8facc69f88c7e469006..2e531ba637885895f9255a3451fed6dabec77ca3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 1b71717bef4621f08efe9cc211fda89301377cc7..da31f53a6b8b68ae6393c3675e9cfb8947f759d0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 3e891d2b40dafd3993e53da457307c5b26cf93f8..cdfbb0351f7d52c31fc8ca56d981e0f6c8942105 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index d98f635faa336051d6dcce8057cd20e4deb8ea82..68a3f3118b8fb4079f4c2ae853865f6569d60543 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index c75eec892925f515b2eaacb67759908e24f5953e..382eccbea73d3b33375bfdf58ec95a29f98753e9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 89b9ba67a2860c9e688816631046cb2094c35900..22b4d3e25c16d135fbab371a522ed90210dfdeaa 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 0e362a5e5c4fdc0801df17c14d05bf1bd0a8e74e..8fe5bbbe7c328d7690a9129621f6f2d357353601 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6eea3e82a524a735e6ff973735bf726923137373..ec92f0293744aaf84443a1367e15c1bfb9359311 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 9e111c58abf69cebf6eae1e1390aefeee055a670..9b26daa6cfee379e9ca24e502e1a6379ea440935 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index c72d60fac4b9ac422cce6ee26cb6079bf8071de4..0ccf2aac38ca8ea39890c6f0c87ae95156cd645d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 25dd57bf7226526d4ea54baf86b3af1527535421..7e40da14085420d434b1a29a3cd17c799c8832c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a9ce40a2ce0deca05da2f83b076e3140b2d57297..e896b0e0bb8e77c8191c0400f91fd00687686d39 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 5c96f9e525887888f74ed3f12ec96a537b2d5552..6a31955d6d69d06837c2cd5d2a22325f5f71ef53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index aeb732b82be9db465521e5b2a0371a4ccb25216d..eef02235fb68a98cc93bba2aa47b20ee66e6f301 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6be2e984edc794eb90f08727e966432c91988e2e..bca128b5c3699adec799c37535b406272f76cd61 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 9c9c361d2406317fed2bb862c7f02c444df9bfe5..9fddcddcbe3e23904624af1cf79147bc3871dd43 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index e1a50a93ae35d7908b10cc2435a68476d94deed4..11d94712bfd0841914d0e4c05ecaa5950325aab0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6757200d3663b32944304aaf9b20accb5410691e..b8f165f095464b93512ff39c16fdb45ac108efa8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 846ec020aba305d087d7017007d077fb0be8779b..eb5adf87ba35ed7fcae3a5e50bb269a2f2cbc754 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 839a2fe7a87f4a84cb95c9a048a326301fa63b06..7b86ad971c05b53ba26d66db24751de0dfc2ccd8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 05568fa27151379f20ea4c4729989e913553a0a2..bd6af602f642a716bde8d1558ec931f3aebbad5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 42fd0f4c5292379b290aa88af559fbc4e1d187a1..6acac1d65647877e45856d1478f3ee18ab04edba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 2f49769097acbabd94d0af4a7c00f5c86256f000..14b58412e04c875c2eadc07facd0debacca59b35 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 465393ac2e9383f716bbf7c0394991885d387316..850b87efd70b89927b58de133c2d713b87ed3547 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 2a799a92ab873b0784d63f137b69e47d51b59906..56c998ce75fc5ea9954b4b9a39c88c985181b56e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 4dae0d8591655fe71d6fc15cc71369df18b92682..2703377a903d2770b9c09e109637f6d6cd98622b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index e90999a54e4c84b6a225f9e893806de5d60b3285..b23ec8e84ab6e14441d00a2b34eef09c9a43ff33 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index d6c3d6802be70e7d14ae566a62e6af972951eae6..ea89d0d6499fbe95fb148ec609c196bee66bbd73 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 783a23e44c213660c45692c86035fef8a359d953..c72a83e7ce7fdf9dca0bda6a6e0ceadcd8c5ebc1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 4821b27034157fd7807fab9b8065650718776096..b41f83a032cadda12c68e6d7a28e11fbae534926 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index a8ac42a539ccfb9a1b115203323edb4279aafba5..4c16ded71431f97b187f96b52009eb3eabe241cd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 438e38fb22529d2cd1bd2128694743a1cf1bc89a..857448c94fc3105a39a210dd88278c589b333948 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 7055594fe194ecb540427f1f7fa6c3bdc6d2ef59..b0a67b711508650ab88404bed11bbb6d5f55ef81 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 122eb43bd814475b6a92d0e4aa42e39485f21f70..acb345097b6bce9a1e5c4ad4efb1178d69f88f2c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 0709eca87eb409e5aaddb41bfa8641046dd3d650..0f96a3f180bdf53efae9136d0a55f55ccc774a82 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 8c2073d185a6e87c59eb1ce967bb559905f25c15..f49aae4c682fa307c0ebad09187a3bdf7e7147ca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index d274860cb2b420d46bfe4fd2be055eed25d7d96b..b6ee4e0870b8d57e4b21be0f37bb80c91139f209 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index bba56c91256c178fd6162b995b332a7b9f280982..b4155eeb9f9f6603ea82c702bc533e982f533d50 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 391c66e0355d5e7170528ac6fd83167e01bfa363..205bf8e151e820fd909794a101499fcf0021c266 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index bec0c9281f48d54bff39c4e20b90cd20e9a714cf..8288d2ce66fef74c5fc0ea7d64b6057ead3fdd9c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index c02b483d73d147786a37a66411147f765bfd8b8a..18f71907d0b4c58cec836474de95690c69bea3f0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 812961b4579a9b737e75fa18d223a3bd5b87cd35..693a9ab699224dcd8e608b32ff21bdf49ab50e4e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 66609cad15fca70e398feda2a89aacd4c19a2af4..4a67327ca1aced8169d0828446a63248d62af567 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 77789306e5f5fafe2fda88c101344045fa001e62..7b3b3db98fbbf0103f5cf9cb7d3d97831818139f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 06226933cbe92c13a350c7786c2a71fe31da0d0c..b7a5ffa162697b28eb019fb63e22d59f03298be6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6d26141a39de614440f977319e4d98f38f1a89ab..31e890b59c59a759f2e11ba17fed8437f384fd85 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 9cc53dc32451cc3733b4253d4a8f0ecfd3355703..9a04c7ba4e25247c7e9548685198d53d1fbdb103 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index be29237f7ca88c08f89e93cfb5ddb9f371d4c593..15f169e9d262fa7eb5c2d8c1a1cb835ef6096250 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 60f5e40e51158d9b0c0312c5d8efed6fa1f36fd0..0ec8412bbcfea85c67fca3bb302032d310d9506b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 95a2616b3823fdfc26b81018bb3c15003f0cceb4..8cc22f71845589b2270cf35273d3d6ae9a11fbc3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index ed2118b7a489fef40e83f724df8725a188a6f20c..5ed047b9398658f6dae06518f2067a16ef4cd31d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 45fb543596757d8e5b9031d78a227793f33228e8..3345287da2eed43e6235c53d989c757cac8e3d5c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 26127febae4368c9e0fc082e074b81f77fd1ed8a..48616c125b2def412629b539d3b717acdca20bb9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 9bef5e60e80d059dc6d9a134744ff26567d50190..5338f49007669282f2ff8efa9de0e55af39dfc54 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 2ac9309257a031bed719aef8716f0d3bd6fb9661..c72295c8672e16660760fe586d80e788d4db3b44 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6b7fe1cfef2db4839ffe8c5bb15a2ad1ee180094..efab21cd87a1064d653e937fbf67179becb9eabc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 714e5ef5c3daeb163a2108be66d556f82aaecf4e..918553f954c81521d2551019352411b37e459618 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index b70518f0043a7ff333ddbff9d5ae19e37e730d55..fdecafa0c0db401bd08997423199e266d33549f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 6eeefa77d0dcd0ec0523c045965cc04885029a0e..42ede680ce3a8039e02926f9839c8df258244a51 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index d3e9fa1d65ddeca441f9d30fe12e897a545c29dc..0e3b8dcd75ac70e9672515daac5fda767f07997a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 58e2262036751d81b010ac61c45d7bc0ec0c4ef5..b6c646e6c9be466ce25a8fe577d19044e79ac822 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 14ea9d2f5cb9fbdd704c04c8bbe613453ae6ce44..fd089922cc69479420a3165274777b47776813eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index e94a4d3e3335409a087c4ebfdd228ad1b88bf839..02155949561dc58d2286f4f5e9fd0828c7655d55 100644 (file)
 /*
  * Note: this file was generated by the GROMACS avx_256_single kernel generator.
  */
-#ifndef nb_kernel_avx_256_single_h
-#define nb_kernel_avx_256_single_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_avx_256_single;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_avx_256_single_size = sizeof(kernellist_avx_256_single)/sizeof(kernellist_avx_256_single[0]);
-
-#endif
index 35c2c3b514ff9ceff693b7c4f5aa7b8137d25e47..bcbb42de557b2c2e325085ceb51c260d03f3091d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_avx_256_single_h
 #define nb_kernel_avx_256_single_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index 77e9227ff7397b243592d12d2e869ed8a95d4db5..e81e342bfd4bc490b12e99411b91b0741ba9e77e 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_avx_256_single.h"
 #include "kernelutil_x86_avx_256_single.h"
index 295fc899e662b8aa18358a05231b45120df96116..a2cef9459b49dffb5fb935a3afc638d5c7e1d17f 100755 (executable)
@@ -91,7 +91,7 @@ Arch       = 'c'
 # 'cutoff' means the interaction is set to 0.0 outside the cutoff
 #
 
-FileHeader = create_copyright_header('2012,2013')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 9499f7b90919e97af56b3215a236a0c342e01cc4..95476dd3f942fb9b9c83e1d7c82f55fae571a6c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c
index 16049aaba01fddde0ba2d7c41a7a6181959a3060..893ae9dca26d2af0758a55902903e9ed1c374018 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c
index 9643d02e7c7e3113c9f98937d373d502243ff1c5..b3c253a879ebe6d7092dcd6db82133ead5157025 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c
index 21e04731399a796ccedaf8e22a94972dcc5a5c94..69c04dac51890232da352a0be2ba2645917bd3dd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c
index 611e1ab72a0094605cd23460f3ed79043c5ffc16..0157aa88d5cd20e43713a8faaa0cbe672284876d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c
index ffb2e9d54507ce7684fd3a05ab5a2d7d5b4c7f02..bf97ec9fb66720e194c665e38c231633791f4050 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c
index 3ef92fa8a02e25a5c5605ed4c949c767b9eca05c..89ef3a6c6d3a9a46ec44d564979ff8d26d761ea1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c
index 6120917f4abcf4c0487fd498d2d55c8477a88022..c312d876476769d3d64b62bbea3a8bec450fe49e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c
index aadc01b3216b958e68d997ffbf3ac397e7a2a4a5..a61d74e6aa7a02b85e9ef49e3f81826459a2f495 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c
index 552622f761b6b79f61f16417ae536795a22bf89e..94f31352fcd6a8c14cbc62529b6f282726833c4e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c
index 0f97c88875e7367016aa84410f243321a6b27ff6..26141cee634a617e089c33f08a77461f7f58fb15 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c
index f941569b7b8ac134b791bda9e9f554172e75aa22..5d79745a7f6aea64b2c074b54c4f44746f6a2ead 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c
index 647dc047ef7f4bdf39b84271bfa46b3f94e08318..9379eeb7e9e912b26980ed887c3ede3aade9a9e9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c
index d6153965b408dfec902e34b818c517d888584033..d010e3241e8b511a8f2f94799bad777ea1d000b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c
index 497c65af54f4f210f8249dd1664c939a36e760e1..fae967bf0bd5d342c1d907bda5439a77586d6efd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c
index 5e7fd84548c0df51f046223281eff477e4ceebc8..32caed07984269007ed7a52d36eedc7e9e2e9fbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c
index 164375706f9049b421b9d950c4109d17dfd0b10b..f5854a9532c5dc45d35bdf672b4aea0418425233 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c
index 43528767e3cc633bb8647ed74c34110a34acaed3..3175f250126d011d8e27ebd057a5cb839df78656 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c
index 535202dda0c1d8e24633220999f3fa97dae9561c..7f8b8d36105445a8fbe7fd295ae66ebb51b3692b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c
index 2b5c5273bc927ce577d421ec347e22c8918f1196..e99ddffe27a3f28ca92021bb36ac667de604f1f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c
index 8c28c2a5b03bdfb891d2d2279edd6ec9c390ee40..b91ee73148a987c8ceccdd42916eeea9b8db1e96 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c
index 81d07fd3e05554171929b2631bc53b025d1a1143..d56c1000e67befda23a2e8007a100b8afe9da42a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c
index 0ac84d551e00a7691393dc98e706e10fb5281e83..59204ff3b56dfbea2b8c13df59eb135554e10c90 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c
index 4ae2afd82003cebd3804f29a604261fbf45e69e4..5716c6e70d5c8e53c2f15b1febb1243f179a07db 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c
index 4f4391506a8d03dc8da3b95fca3b5ce18b403f84..22bb33baeb041d4c3ac616ee6fe58bf5734720cd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c
index daef047aad97ebba31a8f65ee0335ab30455957e..63dc686b56f3f75d34018b7274d53b4bb600e39f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c
index 2d8484b34c4d43149fe1233b3a837e0095ee30df..f485121eb3cffb076756f9099fc27c3da7ec3ec7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c
index 888d80183f551e1a6b6df1f60855a13ff2ba48ca..e140fd389d12efe8f939406e550fad434f93206b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c
index d7dd3828e5918592b1c5b62c82ecf358c90319a9..76955fc554ec9d19aea21cf8c4b9a4c57d0f3e78 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c
index d295037cb2fcdf2bd42211a780fc0c1ef523b952..33545b56c863ab44f0b249721710be484e299285 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c
index 5af7862a7b1903ff094cb7c4558e05c4b02617c9..41a0d7761cd5166779e2c8d3e54a5d0c5fff98d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c
index fd8a6e3d7c0dfd216ad5bd71594bd82deddbcb2c..0f026188bb74ff4713fb6bedb84caffe6a9667fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c
index 0ad9809245c11ae9d0d2972818c0683abdb0359a..3f433bd35a53a686835e10caa34c1301212b71e0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c
index 2ce4c233034304b2fac72fb699be26d518e432f0..95e1eb0631ac27b243826090db3eec9ba6b35983 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c
index f438ecc51e12cf673d84c9937c65193710647945..2df3aa198243d80cb93ccf781fc3f5329309de5e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c
index d415dd2632115d42dbb6c26b12a749c322c3566d..a65ffa8a181fd95aebabf59ac9b25bbcfa469996 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c
index 4766c6163f951a5be57c8e3b592a086c8657414f..3cd3cc0ddf0484fc0b89fb0153cd01090f3daaeb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c
index a4ab2122175e01989d53767064b0b2b9c2f66815..e263a08c26c9d9a3edbee43a23800705dfb0e302 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c
index 0596650da0cd79c60f88b240257a9a7602f87fbf..319215d54940613dc8c6eaa83ce2c2a4675b3a75 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c
index 9cf41ba99204fae87de4a9b013c6843240c0e192..5914dde65d40b6bf5c8bdba89c0e3924b0ee3bcb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c
index 75a403b8001e2e3c731dc7608b6ce3813dc30948..c7f4a41b65625863fc4f8e8148ff1fb7d319971f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwBhamSh_GeomP1P1_VF_c
index 12e60505030d13b0ba674a9728d03fe4617a4f6d..7d97974b598d53e03b025323db7759148dc3c45b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwBhamSh_GeomW3P1_VF_c
index 94879f3e6780da7128026b4d4e436c54b70ae241..6026812bd5410f5c4ed98036537cfaf793ff9b2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwBhamSh_GeomW3W3_VF_c
index 303a70d716dd9c1b7c097fa71b4853b3cfe32c1d..136f785b0174959c49f2467a3caecb87ff73f034 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwBhamSh_GeomW4P1_VF_c
index 90605ff92c9cf4e69d22cfe7a88b131958b5c6ca..fc257b402f55e1f5f0c8ef0e3171cf35571bfdaf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwBhamSh_GeomW4W4_VF_c
index 9c5f5fe56ea0cbe2e06129a391b84943e9d3e163..2e5c2a7fe0022384e731b2d2fdb99019ff74a2b8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJEwSh_GeomP1P1_VF_c
index 51665bfd15f45a5a43718636f173d34121b3c6d5..184100665211020e7d8006cc4018916efa9bd53a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3P1_VF_c
index 2836f459cbfb01d232890e3e0f4a295683bd06f0..8a60c3415c4564fe1d70e657f367a2ce19bbd325 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJEwSh_GeomW3W3_VF_c
index 82c747db15efafb0b4830f0573b46faefe965219..943f062bac92536914cb571c4eaff89d0a4fc84d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_c
index 708501b214675dae8380dbc16777a1ac4080c269..eb4b45a327fb9a4a9d89b78d2a643a57241a6c0e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4W4_VF_c
index ce69cd0190df0a7d2bf06966f09f8ac5dfd52910..72806de29ecfc3815f8494a896d30a4418de4abe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomP1P1_VF_c
index 2e8b3aaf731edcdc6a6f524e506631f772c472a0..062bd64f5b90d68da5acfeb3a426e5f7487010c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW3P1_VF_c
index 57547d680d1fa8a75e986512273e676ff91d7887..2bc1042272d22dc318e2306dcde66051056d4493 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW3W3_VF_c
index fa0bdf052e5d23ebecdaefc21ee135146c3e0000..36f2f7c6a738641bb53c51e520d9ff576ed7c472 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW4P1_VF_c
index c2f405e926aa33d3325f14c16a9ab5cbc4e2f77d..37c6abe43f4a003970b68124f8127ac15e9be5e2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwLJSh_GeomW4W4_VF_c
index 04ae1748f7b836745a22a1f4bb424554a5eb5afd..33df24126ac340a12cd0b8533a8ed3b6bad29130 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwNone_GeomP1P1_VF_c
index 9ca1308997277134840992e3a0bee1c64c5dbe44..2163846c919f8e87c4976c231246c90f86647b9e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwNone_GeomW3P1_VF_c
index 9afd15c2d7484bc0b14ca4b2718bb97139203149..4316eaa2eb140238e6d49632a228acecbeebffe9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwNone_GeomW3W3_VF_c
index c04134dbc0e4cb38d179a616b2984f2d0d1fbbc9..72fc8e46e20ee687a6122ef099da014c53645621 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwNone_GeomW4P1_VF_c
index 3739571181eeffd0ef05062cfeaeda6915e6de89..5a67ba2cfdd83712a5378e2ed993196a9eacfb00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwNone_GeomW4W4_VF_c
index 319baf3732cef326cfad800185e615874bb5c118..2ca78589dd751d11788a11708c172fecb55f2f6c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwBhamSw_GeomP1P1_VF_c
index ff57f3de70ac6f28a43812d8a6e95a82edfd63a3..91e8960a6d735ff634aa3a4eb63169f93d5ecf6c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwBhamSw_GeomW3P1_VF_c
index c95279616ae0964b8e873701bbb9f155f372e161..9c16597123dcc4fc6d30ebb8174a4a152494b32f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwBhamSw_GeomW3W3_VF_c
index 3bfe9f1dbf23ec01190d5fee01fd9e625efa0b42..5ac405e7f2058ef3063157d0bab0c8779b78a095 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_VF_c
index 714dfefb4884bf0e19984e2e730a65247f2b58f3..e77bed7e368d50119b729f47de18b244bc51d332 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_VF_c
index 85258cd5ed4a30f4f910e836def7928cf4c0c75f..24a50eedf6f06d394072352cdb28a4bfdb17ba49 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwLJSw_GeomP1P1_VF_c
index 6ed0b5f876248ab0d27b3b2f4de01a06acbf024f..48acef108d09215a8118c04ebe49ae855e0d0841 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_VF_c
index ede5d428d88722c9b64305f5db704836fde22673..47437e00d369f326b2d05c3f4405742a3cc9822f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwLJSw_GeomW3W3_VF_c
index 17f33838b815a414205d0ddf022d61584ad3ec56..13b1cec003b1d12d08bfa5eaa7044b088d1cc49a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwLJSw_GeomW4P1_VF_c
index 9a5cd89df2518452ace6fc102448ec9e0f649fdb..04b130ddc44acab1c17a1ea9025fe83a742bf5c0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwLJSw_GeomW4W4_VF_c
index 48ad7002d85a67751ee437b4844fc4c1d34af463..ae6f467a8e7e84868042412198e1a17d0f4a63e6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwNone_GeomP1P1_VF_c
index 3510cfa436397fbc144a93472fc5641e672b4cb4..4988f9f55dc097a4eb03bfafc66dfe3fff625ec1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwNone_GeomW3P1_VF_c
index f0c751f9918c1769501fbd2901f6094c184a116a..f90f14899b51a30a8702a8bcf5649915e755c476 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwNone_GeomW3W3_VF_c
index 0dd4cabb16bb88981a0200f51b4265f6403b9c09..c60f6085f114bd364416c8ce24a73426cefe2618 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_c
index 6aa6ec24519d63beb6512c49b9280d37b7e5e930..2c82631c0068f6ff31421f7c42bfc6ec40825689 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_c
index 47fb0a5d5cff6befcb6ad15d4be404028deec54b..13fa6a2f6d718189f355e153ba030a544fa1fbde 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwBham_GeomP1P1_VF_c
index 8f11e01c2cb84239bf496b53c88b2aa53a2d9d1c..f2b37d8863763fb7936a239ff469ece790042958 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwBham_GeomW3P1_VF_c
index 2b3eb9ca9b5fbc13bffacb67a18bcc04135e1cca..ec2293034efe8dd743c6d01637caf92784c82e32 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwBham_GeomW3W3_VF_c
index b7cf47a3d0213e21af9fc209887dcaf401646b24..835b834519269fb466053574bc0874cf2820ac5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwBham_GeomW4P1_VF_c
index efbd2698757da20cea3de879194a9d521c3dc2ff..903c632436feace3f452bbd5d96905a38d67f512 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwBham_GeomW4W4_VF_c
index 5ade3204480c8d0d630cb8dc4513e535a5b89640..e74a9e97cbc2e83a2c701cf7c2fa17ad5b3c520e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwCSTab_GeomP1P1_VF_c
index be89b58d937adc2a9fc61ab5bd814a67a68342ba..bce64af9be46268fa18ba6a0836914871562259b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwCSTab_GeomW3P1_VF_c
index a77cda6613ba8d7a4bea29f8b2ac6dda4a92b485..9335b57bc80f3ac3e3d798ee01d6aa387e14d628 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwCSTab_GeomW3W3_VF_c
index 186716613f5cebc6dd6ee87a08bdc9bc8b8333fd..ce303f1a521b53f49a11ad632559ccb7c3cf9caa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwCSTab_GeomW4P1_VF_c
index 718599c1ef9a827458971bc36896be763bda0c7e..7aee8dc36cf27a206a1f7fa5fb6bd7cf79e6420c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwCSTab_GeomW4W4_VF_c
index 4c5bad57b3715befae2e026a60047ab188de61b6..3487ee46f54bc8926145546c3231d8e782774862 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_c
index 130bd6600f842e7850c04cb0e193a93e11c603d0..53c497ac7ddcce3b4f83a17532f4a05179f2a37a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_c
index 30301f6152befadf2bad550776b538d81334632f..b3ce840f30d3333bb7e1ee5d99aece11928178ca 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJEw_GeomW3W3_VF_c
index 7baa0a449a064f77f7301bab36bea93a2e556335..86c2fb138efc3e644c5f982b35edbd522c429453 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJEw_GeomW4P1_VF_c
index 064da2180a09ddecfb5f04124d859197acdd6d98..b1b710aef46333e200532dac75f9dd798cd24959 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJEw_GeomW4W4_VF_c
index 8270304174043e0b38acb5139ffabbaa58cbc080..c9fc24aa126fe6c51b6fe16c8cd686ea5af1808c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomP1P1_VF_c
index 3f703901c0b29f6fabe3527ec23af47060c649dc..6b3dcc0597d081d80d37fbbd764d54697c0bbb61 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomW3P1_VF_c
index 840728df347979e7e130fd34eb555e482c09a838..e246c5cc78713eb5e3697e1ccb9dd00bc2d41004 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_c
index 3a35f917b05dc93d707c408f5b0870cad32fd01a..0350aa8b498a3a5fcf79add1483e85827d470c2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomW4P1_VF_c
index f5433aea9e1d94c9516888449cd31c2310bab7f0..d45a0e0cd2c2a672c55ce0420c5b00e17ef68312 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomW4W4_VF_c
index b425227f06b8ea07e1597f5c98a4ddd7fd03ad41..3a35105f417d6fdb3dfe085012d45a3997f8b266 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwNone_GeomP1P1_VF_c
index 89af6a13d49e2d7934d9a943d0dfddda0ebecc7a..41d1664dfe08b1bc5e861b1ee9102bad7cb98dbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwNone_GeomW3P1_VF_c
index d27d346f645f468d65c9d44972f310bf24f295b7..70b1e1983f193964051555d32cc000677e01a830 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwNone_GeomW3W3_VF_c
index 816859955cd78ebd1959031c3e4dcc1ab83d9866..27478026ba81269d1d938c6bf5f1392c47444847 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwNone_GeomW4P1_VF_c
index 24e2961dbf461660e2d34dd18a57e184b4059e51..b6c916940438d1abf0dbe4746ccd02632cae9bfe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwNone_GeomW4W4_VF_c
index 6bab95c560f15ebcff070ce2b620dc4a800e0265..c7a3218abf9ce4c63da29ce5fadad4e15d12e3c2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c
index 5c7bb04d1c334ed614ac0aa2059edfb31e6ce46f..92057a12de4fc13e1fdd17c2466ca773d69e3539 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c
index 97d2a1be8499f9871b6b936a9eecca005e318f7d..666feda856fb7b0686929a1b97454b7351468ed7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c
index 551d564e0da0aacd522a4fb16366a590b7f5a1d6..ff5d7504959757531bd869f5cf6e286d75e6f95c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c
index b5e99f9b41cd9f2a25dea3ae6e5cfc85139c8e3b..ac83597a4f4050c688077ba2b4baa9cd0cbb90a8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_VF_c
index 80967c46ab266814ee9f8dfba7c76dcabfe37049..e1ddc0fbc8140e41635cee6de6f18ada94a03b15 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_VF_c
index 009ebe8ca77c6d336809a168bae4cc03536164b2..13e5862b1568ea95b819ac584bbb1db2bda6077d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwBham_GeomP1P1_VF_c
index 1d03727aafc78aac83c051f6c701cb618a091d68..a9ab4fd819a3c12ab1174180f536445f91869886 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_c
index 74542ccc70219ac7c8867fa3051b80d5e4ce4633..6bb5e1d39b8141e1ddf9f24ffa7fcd1d04c440c7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJEwSh_GeomP1P1_VF_c
index 7f7a2b02a7dd40ac7af65a0833c9d77505275bd8..b7ae5dca871fa995fa0ad80252f99a18b99e77b0 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_c
index 7056b556f0989ab8f3a9dfd7a50a1773ce8800a5..ca9cf971862511060a8f4f5568e4725a2a57c895 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJSh_GeomP1P1_VF_c
index 07dfcce3f02e17e17b8f21788f7e54ab03085bae..3b35ed853615327abff1df8f379abd7c8d30b393 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_c
index 14c5d6d9f023a2f38c4d249483fb2faf88cf8f9c..47680500e0de6143eb50f571c7d1d56665470396 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecNone_VdwLJ_GeomP1P1_VF_c
index 842e8baacddb8bf2868986d6c2808bc4041c5dc5..a6335f733cdcad162569660c8e5d3415b54deaf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSh_GeomP1P1_VF_c
index c693d9309dfa3322cae151721d1f8d255f4d4d83..9d210e6bf37ab96cd0dfe40d438a0e1cac850986 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSh_GeomW3P1_VF_c
index 843a8d3ca5f6d326edce45f1bed8b983afc68a3d..fca64e296461e22ee958883453a590a353f6f546 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSh_GeomW3W3_VF_c
index 271047aa9c334cb48023744dae6dbefe15dbb3f9..3eefd31617e46a67a4eb9e94df072b3c7b16dd8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSh_GeomW4P1_VF_c
index 8831cd85dc717a5a5ac0fb6f4061281f9f36f897..f09c2a33adcf98bdaf79dd5126edd2812d07ccea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSh_GeomW4W4_VF_c
index 82bd29097b8ddffccb5703ab0e5a896c9e28836a..420a8da8563b2722a6b5f3191c30d7d1c4854dc5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSw_GeomP1P1_VF_c
index 5d6f8d6513e289ee479769059ae0d34994e2da0a..8d99adce80973439db48db809839667c6382f572 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSw_GeomW3P1_VF_c
index 2dea8e3799b84c3ca5de90fd2f9e29796dcddda2..b2ee15a031800429e9ae1aad3b28571cf5852fdf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSw_GeomW3W3_VF_c
index 02f9bd777015e5d58b30888998cc803398168c76..3407b41fd95414f94d322690502bddcfc1574a16 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSw_GeomW4P1_VF_c
index dbee526fc5e6a9ac57e211560f3e2a16fd748464..6d27764c3f55303ee59e8967015f1ae3d4045b7d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwBhamSw_GeomW4W4_VF_c
index 8f95fc6a8dddae6fed9e9d99dd744a9a1181139e..524079959d8d0746ee1ef961d29527b2f7916a93 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_VF_c
index e43ced64e0b0631005d81a770d3d5c8bfe7e76ce..ccec3d5ba0a140f3ca6b5fbf227a44245814b09a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwCSTab_GeomW3P1_VF_c
index 02c0f21827b3a51e67faf7b3452112627d3a3d2f..61c2dba3185fef67be199505aed8280e18d7f144 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwCSTab_GeomW3W3_VF_c
index e9a78c293c69a9c6ece87fcf697b9fd84a3f7bb1..24397afa4deeaea091b3e67310f67b859ee513fa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwCSTab_GeomW4P1_VF_c
index 9accce27c1bed191d25f568f68c7b4875af3c215..5bab0d21ff998b18b2a706f7f6aca1b3cb9087fa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwCSTab_GeomW4W4_VF_c
index a3d90f693cea5e5c473a0a93d3e275f71313db72..b76347d1eed63850ca2ea1cb766521391baa6861 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_c
index 7234e1d9904b8c5d73d2c7e2acbc0ed58aaf4cee..68a35521d76c278eeac852f02a66e427e00d474c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_c
index 078e9ef31f7e0755ea36b90ae25d96f049467486..fa9ed7f4087fc1f0ae30f1160f287f84c0e40c07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSh_GeomW3W3_VF_c
index 6920e83ce3a4b039fe7c8504f3521090820109f0..b3f092011f2b3fa5f2b5dc33c46e687c19b158f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSh_GeomW4P1_VF_c
index 0c9582a0cf1015af808bf44bbebf51cdda7817f8..065c56aee0cc5b94444e7aad359e8415b25c5ba0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_VF_c
index d45c33277c2cbfc20758107dfbb3730ca921f9a4..e16de79d589b274099ca6962b2ce7788fbb36c4d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_c
index e05f35aa847b43e4aa18e543b2c86d1f14f51cbe..75357a083e7508dfc3d878f462f0d61310e36f24 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSw_GeomW3P1_VF_c
index 8e4a05c6ffb9b8fb6cb45e3f952ec4e293e8138f..265fd21a7ff6cd6c92b434ac2c40f0bfea1de101 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSw_GeomW3W3_VF_c
index 17fb675e6144f3a404f65464bd4ed3e5e485d65e..d7d4eb7703fc65b2fed669ffede1549ff9033efe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSw_GeomW4P1_VF_c
index 4976f6046c0f98ce9980573e1e33afa9abdac006..541e158164b947b842fb1cb8a2f1e9f9eac8a19a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSw_GeomW4W4_VF_c
index 7af523a16ed520343d5319ab1f2c0c6e0fa6845d..324252d81c895b0a30c7c1a020d43725e56c1f3d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwNone_GeomP1P1_VF_c
index 7abbf0f2dd4d97fc904cdc3b8633ee5020ad455e..4ab05b53d1c7ef57358b02bb48f772e49e9fb766 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwNone_GeomW3P1_VF_c
index 1e736fd0b6e619c2ae9fc845538d460917b0c38a..24fc750c8a017d360af112e23ff179ea0b45841f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwNone_GeomW3W3_VF_c
index 7e1128099f0d1baa3d6778e2dcf6b0b7231037df..fce42f82f7e94e0f1c895669593ae158e6a96a1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwNone_GeomW4P1_VF_c
index 341009cb533f3a1c73d0df5848d974020b0a1ac6..6105c0ca4037dd109869271b03b9f46ac898de14 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwNone_GeomW4W4_VF_c
index 61761deaedb6b348859b1faf80240acd31ea0f51..e78dc90895945cc1b56cc5e9e91fca2cda953ebe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwBham_GeomP1P1_VF_c
index 5c01354759d37d33cd199b5f00a2da9d67f513d4..24e09b6d3d7c6d587c3dd29a34998023df9bfa3a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwBham_GeomW3P1_VF_c
index c4918b296d411aa0ee677fd6b79df4e0b8963005..58810ed7b022b9575a65cb8a7db953aa95a89a53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwBham_GeomW3W3_VF_c
index 7c4e089d0041023b7c89ad924c81dfacc2fee457..4327622c09d0656559f3afe047081bfa5df811ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwBham_GeomW4P1_VF_c
index f2b41551a5da2bdefb670a4ace06d98479bef5d8..95530e1e9fac62f055f5e8019b0ecb4261e65d54 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwBham_GeomW4W4_VF_c
index cab95e5474a0a784af284c6e89b6205c2228328c..f95eb642130e4a139f18719d4854b03bca7b4feb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwCSTab_GeomP1P1_VF_c
index 9a7d67bfa033297eebcb57c142d0d6ccccc77e81..e7faeb574e3b04fcbc58959e6eba369c5937ab2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwCSTab_GeomW3P1_VF_c
index c720402b2acc8e2fb8ae8f9de1f20ac26ffe89f2..1cc983deed03ccb318d2438c1abbad87d9f62563 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwCSTab_GeomW3W3_VF_c
index 173954ebe4d2be4e52da1141daa34a18d09b4043..8ce7546c1953441c240aaec869e22e693574e9b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_c
index 760a1aac0c197804acc4ae103c7e0ea95a9dac1d..59095117d5e16348b4ca2c292a8485152bb433b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_c
index a41d67c4c71627208d6600914452431545a07883..b35c88b792d0f42f47e9b2cf5844fc0fd2be0785 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomP1P1_VF_c
index 3b10002918300878fc642a40d9c3f3e54140819b..603164110a82017466ebad2d8999d27d0b481286 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_c
index 1f3f1092c44d22521769c7459522a658259497aa..1177a1ecab4a4fc733664851c43bc22754c1edde 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomW3W3_VF_c
index fa7354954fb506c515971d08244f0880ba63b7af..3cc87f273946c8f663fc9574dd05304b1305b85e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomW4P1_VF_c
index 4cb59bd36cd9db54313a307b96a7d160d23ee851..c2c96ce7562e816de883c1c9a745d69af707baf0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomW4W4_VF_c
index b4c38aea7265b875bf942a7157d37f5a9369d493..57179ed20b5f3b77c372c3f8baf4e1ef474158b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwNone_GeomP1P1_VF_c
index bf2900ab51d4844ac128d6e18b4bf0ab7327c5ab..556646b40b1affec6b63ed6ad1c4425a1c38fe10 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwNone_GeomW3P1_VF_c
index a28215607a77b0f95658f9c188aab180dabb7b5a..af70ba1a0b3bb5a712d3721c6c173d9ab1a05a7c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwNone_GeomW3W3_VF_c
index 366d43943d0ae9c32dc14b26ef8768a67e6f128a..5a84f8c2b7d2fbf9e89bab1dda387004bf0fae87 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwNone_GeomW4P1_VF_c
index d034ea769b712e0d1dc26f4670c8a783346822da..52d8e6a8850e55ed5d5ab86fd95202ac03c4045a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 /*
  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwNone_GeomW4W4_VF_c
index 6eae3017090abfbc46c8f0f1dc966027f8d88c3d..92335ff0c0965190be85fe1344db5b73f4bdb6c4 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
+#include "nb_kernel_allvsall.h"
 
-#include "types/simple.h"
+#include "config.h"
 
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
+#include <math.h>
 
-#include "nb_kernel_allvsall.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct
 {
index 048c7feb1161d3998daa57fb6b9a669ba5372fbf..62b60ca939f3770c5341beec8da4f6d9ce4fc6ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _NB_KERNEL_ALLVSALL_H
 #define _NB_KERNEL_ALLVSALL_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
-#include "types/simple.h"
-#include "typedefs.h"
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 void
 nb_kernel_allvsall(t_nblist *                nlist,
index 532702ebb8768e22739dd1b3cb478506955370b5..be401ee7bc86d6a4e0c7d764a89cde4ae2257342 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
+#include "nb_kernel_allvsallgb.h"
 
-#include "types/simple.h"
+#include "config.h"
 
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
+#include <math.h>
 
-#include "nb_kernel_allvsallgb.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct
 {
index fd5d2968b8170f395fb4d8ee361851c5c65dc221..318b103008b324d6193c721f0a31e8d3518715b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _NB_KERNEL_ALLVSALLGB_H
 #define _NB_KERNEL_ALLVSALLGB_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
-#include "types/simple.h"
-#include "typedefs.h"
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 void
 nb_kernel_allvsallgb(t_nblist *                nlist,
index dab6b617a0704392d60372fc61801137f7623533..ca9b753a792243d902da57962c3db301a9971bab 100644 (file)
 /*
  * Note: this file was generated by the GROMACS c kernel generator.
  */
-#ifndef nb_kernel_c_h
-#define nb_kernel_c_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_c;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_c;
@@ -701,5 +700,3 @@ nb_kernel_info_t
 
 int
     kernellist_c_size = sizeof(kernellist_c)/sizeof(kernellist_c[0]);
-
-#endif
index 32640c7d443d66d5e24459de7247c87f9794d846..e524079cd62af3c491e58b4230be449e60728024 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_c_h
 #define nb_kernel_c_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index b59399eb041f96078d48bfca992074409fad86cc..47836de96915197c8c8f1aedd14eafb441bed3c3 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 /* #endif */
 
 /* ## List of variables set by the generating script:                                    */
index 6a567035f60209231581c935aec2ea54fffa6c49..d1b1ba034da53ac09af3069cde3e52c066f6af7d 100644 (file)
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 205f843c31bf0ae72a54d35594c3d0f429ac338f..3c8b96e7ba50134bef697e14f05f2e65e0334819 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c9fb58eb310f0b3160de047111a7754cef9658c1..310216adb6a5c8f272caf84cb46287c1606f64d4 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index ea7372eb3a35774a4ed0d51897393d20b5d533c6..e75545b19f6a84e692d0e97ed248511c20e14255 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 1800d4f87dc86ab327621b5e4244e3988d509aa3..f1f9b8f2af375906756f25fc720986a2ca7ab47e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index a5d53caee4080ba3d48f04a1caa2d7ce40599e5e..e636578026ea6d8c6d50553ae98a766afc5657ca 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c0d830ba08cd41fbdc3020a0cfdf52108872663f..fe3259d2276fbea632ec9b798535e9b0fd84c048 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 9b6cbc85ca7e1456d10b77739ac9771b1172012e..31d53447dce169070134feb7d8a2388ee04e643b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 1bf2bd9377fd4f56de8f5d1037e432245dcbf17f..d418a8a074c5ca1ceb33e418f4ad72555712558d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index fced48c2221e64894ce9c48b9da428a2a4910096..cb81142c880ddb2a1bded8e700cf3c2fba45cbaf 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 81de44cb37063e72186eb3d6bbc33092e876044b..828d306d1479c153cdb5a333d5099c746c22b0ca 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 45a7a3d6128f45baf38b32421d4ce058ac8cbf0b..fc9b9693829b742f169c634586c7ce7b75f91981 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 740347dce85b88808e1df285af99907cbc5d120a..eb44c5d5490745abdb01627c0fd8e712766cd0f1 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 4e6dcc9e60346f2d0719d673536e4d1d29445747..77c10b735e0d91f16fd8c5cd895d5365be4cb969 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5656188c48f8151e49657c0236e9c20513cc650b..924cc2b757996fd63456651a78fd38857fc919a9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index e09c491bdffe3812f07224dc9aa77b84ebc08d4c..94bec0b48658883d7e7299c1b3c6828be9857764 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 1666f42b73e52f575dc7f3952c944e8e43aba792..111f202a7e679fced29cb87140cc29c879651fc6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index cc730d2aa31d54d0425c8a8088c55928f824bf36..e69261ef63760f33d00fd5970bff84c07786407c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 0e69e225782d06046910e31eaa03fb728741b877..7b70741ef99407a97ec2f29e3c8aa84d3e45d8e3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 2a71b9706ba2782032ba0f26baf27690b83a09cb..48d2976c68d9a421275291b912668aadde594ab9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c94c2b04b96119a0bdc0ae2fff610efbc8bc5f10..0aabab14a38e00b8b2d6d72e66bc75d9cbbc5aaa 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 50b56ae841a7f3caf9ce931571e57663547aa8d4..42d8daba0324f870edf4f9b61ea5b64ace2c9d18 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5a8564f0ee93284cc79835c8559cecc162b1b03b..fa424c4e4a1314e980957c8f254d08f9e4a2e3f9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index dd10c3e3f008d01fa255e305bed9f3e977649825..6db09d216477a0b2925381ab54c2d5076cf97430 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index e440c725b9c43bb1954a7da69005808a59babb4c..2beed1988a424283684abaac9e7e945353bc59bc 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 862e419e7e2c2e8f2f7b8c06713903abf442a1a4..5b465030cb6586ddb7a3b995bf65493875fe779c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 6d57949df3290065573a6f992797106f127e0245..464605bf08a78cc5b618a92f401580c5204cc16a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 803ba0a50789056c86f98884ef31d4d50a3d9e31..bcf4eea35bc0b749833fed94f0852a55d320fdde 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 56663adae4f3178452529dd85b942312e53407ba..9ad2ee3b4fe72f6bcdfc2bd807b80a31acb01cbc 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 6478d04887b5328c7d4c0b9e35de820a7491b375..681da4c5230d8e5e6929bc68610c829e70fb946b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 88707e1bcf1ac06375e1dcd468c648a7ddc9b14e..2db36131cdf0f0b5ed07b6143966f448a51aa7d9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index eb524e19a788cd73c4d52adb767175da6f115af0..652086ce891c293605dab91d23b796d4c78ea1f4 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c5582d564e5830396123e36911fa468c0f0175a3..046fb5655cf438140c82da1754e47ce1dfb34bdd 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 99421c554db16773b4e993fbe2720fee376f9ad5..e3760142fd89d01b2c7ac6451964970cae937257 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index b05d570ca4b849320a86edfb83812dccf67ad6c8..d8e80bef4334bbcaeea57172bfcae301e0fd7d77 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 770162ee605d1327279e65efc7ff210bf5d6cf06..5dabbd9a3045d1c47be11df312e44b24013278a8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index e8bd4876ec592a070f4e824e4569bf78a2b7267a..35be03c0ec1ff9c450f90f4e7d607fa771696d4d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 09cf8d502c2f6adfed5ce5286036940949196543..5590857dc8bd18e3d1d67f8a84fb62661099f5a6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 47df9cbac56e9bfdc39bcc8157a6b1bf2d4804f2..8329ecb662438708a55ac00e4743ba765a09c2a4 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 26a7b50fae9a3ad0a7c0999afc7ef9d219972e9e..662c00981490f417001c68aec8b1da66bdf1b5ab 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 17f2a514e5d1208861bbd0d935485e7aa300ecf3..17a4bba9bf3a979c84c2fccffd2bda5696ad1040 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 4a58ad5a7213d4a65f77dedb3abe32721ac02c7a..80422bec6b0d9f5e63a412faa34ded092a45cc1b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index bee9461a4a195793d22efadce43cbbda6cab69fd..0b74781b150a66b2c8a0279453b4cb0a97b21828 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index cfbe1589ed059e39581ad3352f4889048a3b7763..2b55794f84a9fe42e07905edd9924259175dd3e5 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 6690b7fbc56d69930dc1afda7ab70c3d070cd421..42585716a1b2a8997d6da2a935bf78f7adf950aa 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index a55e623769ad416516ec36de4b1e1f36d14c4988..ecc042a93e474c7cdced085c8599f7e4801ba475 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index ab8a4f9523dae756688ad8d4626c44efaebd23dd..02c75bbaf563824ff3922da8ed8fd195171216c9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index ddccfe10d83404d3706762c26e48f7833a4861c5..86534b4b33c3c9e306c3d9dec11a6be846073fba 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5a6cdc0ec6aba320c7e64dd53589f9f2e4f0c9ec..59afe496e69f9584bc7770a2bfeb8e6faebba7c6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c55d849689d0d1dd7dc1f20746ec6cba1ae603c4..e0e9c060889f2de130c7e7a8c941a0a939029e3a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 510daeb28c8c2115f35bcb0ee45d276dc4638690..c88ce13e18a1ae8d051330463265bf9c39b0bc92 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 8c16d5c4832feee4362b38c6acbeeacd0bb72a2b..c97585adc02bd2aa5a4d407cac3887e0f0a63897 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 9283d2d6605a2c68300fc79d8bbaded88dd11c7f..0140bbcf50620dbf077ff3452ed5050a08c24cba 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 6ad2a8c4e1829f30343d111ac67b6452a5954c17..f2ecede525b9e236d630bd1d05ba71f0d8687905 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 84de5c02fa08c15f200a0754968ecf19a35de0b3..34fe2a37148b4400e04c33432208944dc410b7f7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 8870abe114706b53c062b69c48236099c590b5e5..24fc1a0ff90f06858c7ea59a6444f4b6e4b1bb3b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 1d38e53cc6f6ef99db740bbd513c05d6640cf9c4..dfdcbe424bb81b62079148db5715cecc237f0034 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 9f992bf22024028da650ef409ec4940bca4db6a1..a5df390d684d5c47d370d3bfdc6b2b7502a603b0 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index b03397a3bde86684384c7d386e555e3fec27603b..39c769a470a47ee9b5f27321ecfaa47f28c4ed57 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index f8add6c515f46f210f9f5e35077fdf2ce3452717..0cb4333284755557664e4937fa0ee44b66a1879f 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 4264fc94a4cc8a8d426a6766a0f646a91a10e56a..61cb2912d8e9213edf54c6b1a2c4a5d0b9407cb8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 81821a11666da0606eb309d09fb60cc91e67fc1e..a4e5a843659e0ec40c4c2c2003d74af6f14eb3e8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 38a986a4bf926b361dc7b9c9d172849cf15d78c8..02c004d7975a15bc1d657dd745005449a0f377e3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 1d33ef6baa972515741967ab19510a01b8c51da1..34304fc32dfeda9dc9b1f1d117d3b844078e10a8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 01312e63524ac4d4cb8a2ad005bef373cf4966ed..d15a704666dbc0ca481693d09cf40c50ed83c7e4 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 52a678aaa6f67416e3c4b633cc61d6f9806e5c87..379f2e65043a0d58216fd1d63203c2cf19364064 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 4802d316a99bfad6feba6412578301a2cd1e6ff3..be7bb6e5781d120f661c6dba998ba0f47770f304 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index f6819e234c74c17bcd3d98a8529f0856903fd23e..6673a44eb2aec143565a530d82ee90e6fdae1598 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index faf9ce53b222d6fa329eb3e20737ca5efe60d350..2bc7583c01d2b145f36255f259b61e4a98d9999d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 380a4a454acf4000c46087fdd7dac3ce5d7fc5f2..5189a947bff21b54142f08a805403015efffa1f3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 71460f12888bf5fbe35329d91efd34a755388e97..4244fdee39626512074b43f2741041d2ebfc2a43 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 731c3c43ab4e3d0ff1510140567532b39fe34c2d..21bf192cd70f719fa3879f64fa1d5617d961de9c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 71ec483f9c421ed58483b52c41d2008c737c0a71..30fb395ac242001a867468adeb4847030d484b3d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 6b941f48ebb6121c001bf9c117d10ad47fe70081..fbe123ec5086dcdcdf0db6a230fafa5c35713810 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 30168ae29e314b328ace94aa65fc2361994e4970..155a200228a49361f8f46dac1164a8bdeef23b49 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 64dc2b4aef367440ecc5a3ade14ee3d0ae3ae2c2..62c99cf8d16c6166d3950345470f8cab99c8c3f3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index d5f3346b02d5b39d7aa49f4e98634a4be213c6ec..141f61f8243dd24fbab18a4ae2883e5cf745bc03 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 2e3e255fbfd7771e457240dd4573a48235663d72..b9c8f053759009a6351bde2d037f8e83989cccfa 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 22836d5df9dd71cada983fcbab825b2ff0008486..84b37d2bd9d5a5c136822a82f75e97b3eac649be 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 6d1d4705f782cf610217f99d1d37b39385f3e00a..8547907a362f257b2d94dec45ceeda60ecd742e2 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index f7785709002ef68ee331248f39e49fcc3a3f25f2..c096e05f1b5c9b8e054729de9b82a659e68ce993 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 1b354f3543642d05d0ca5b2568e444c1eba19165..6c52337bce5fc4f85462c6990d7098d0ea571091 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index e7e5b27696fde1de1b01353f9cade1a44149e837..638ef0abb58e0dbaf43502a65b8901fcf6f91116 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 3efb862dacce95249274c51201a5677f998cca62..515cac9eba6b504c96e9e38db526e080c260d8b5 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 2b3f34e4ae0fd80cc0e8d1cedf30d236a9fcf986..b62a36499ee0a721dd4fe092d81a123019dafc4e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c42edbd9665f75146dcc16e8217f90c9e627f177..e4367156769bc86d64093441ed2ccfc876179b6e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 018952c15612f45b278aeb951ee06e0510566a6e..c7fa1728ea48d79ae3db01fe3ef14144f163c389 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index e4896d9bc135009b6f95ed38fc8f1a0e02faee76..38314a5e37154d6776932816b60e2078069d76fd 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 82381b12a1932088f9ad21f6e4535a70a9f083a0..495a32a634549e946dfdb35e583d8c7a8c833cd7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index a76f0003dec33e9954d9c90c043366c13d04b6d5..552dedd8a73ac0e1e3b75a75375f31b21b65e5b2 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 00e2e4d8bc8dba65720e763bbfd8fffb52bbf481..95c1bf4946b8f1ac0e2c0549568c93c989e6d72f 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 7bd46a31596b07ce5a712062cb78270d8174736b..83148ea8666e9610d92b23dde1b56cc6743a09be 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c2fa121e3ec831fcae046a50b3e5cf2ed3f76d2b..b8d25867b2f5046f88d7feaf6924f5676b3d4067 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index b56a73d8e5bebf5e692880e7d3619d1318c89dc5..1b908815ef9a31953319ae33629a6214516908b7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5dffdcd13ac6185349852e38d13c5b865fc22264..e4e8ba52b2aa1ae52550036b09da49164dc15339 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index eb84028588f27f8a1d6cd51d61b8e8e0511473b0..55b463e8e77b3416154646be5a4d59325287072d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 2219811420c0d2681105a5af483f950418ae1838..680a0df90edef7d448e5234a6a155cfa10dae838 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index c42d44669928e187f2211dec21a5b37f09a18ce5..565215b1b451553e3fb485f7b95f33b5b2fd33d6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 8f0dbea164f04e8f90b58fa08cbd27b69621cdc4..ded5f63a03f6b350d108561d473507c060065754 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 59230a7af8a2e44094ea9f4909ba2bb939270d92..3b2c3118633060ad3f82460bb273d4553e5bb5f7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index d59adf4b9ad1c1daebc582606c34ab4066a5dde3..0aac09cdbfceb038fbbb724244abf8c49e17b5bd 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 96e951e47f15a11acf0132c937ea8c68be06b38b..022cb3335e2d96ddd7688f67aecaaf131e20e04f 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 67b60b5fee28fddaafceb6d30e457e08fbd699f0..e4baf4cf91dc8e72455b3d83f3afbb8c58344261 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 305551f2d29328bbe991fe2f4513db33504259f9..fcfe02cc638baf15a6cee0e13f478040a61ad33c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 94ecbfd7f8c9af893ebbf726ce581af48c28e9c7..59d91c053d03ba63f272c6f4cc8f27608b200baa 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 15436673e224561f701bfc097ccadada862fccc9..0b70695a78d7408dcddec8ece6a3c03461f64628 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index b0f5066e984ffbfab2521ebe76019478e81e605b..4e13180e65747768d9c6f476b2b740d0548a879c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5af27df8a8b4017f1e880e1dd09bcb8f85dd7967..39fa7d1982fec600f5c88d7453feebcaafba553b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 7b2c2b7abda89e422392d818fb453f205f8afc0a..ad8da6d53710d93f5804f7f5a01596e5e4f76c46 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 9757139ce522fb4c576d06092a5c4c061a9cb93d..5eb7b896183227861076c64e1d25d1cc0f33eae5 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 4588517f7d0dc7aaeed3805a2a5e933d0a711f25..24b01bae5f5ddae297619eb6b283df389c1e0383 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 295f5be73f17ed0dfa9baee618ceffe2efc0233f..00fcc3d7133c687106cffc8bb1fe54bb1f037610 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5dcaa421857a77e86d6e23039620bfab1526bc92..87a4a22d043334b6c994bb8e2ef256c0ad641a79 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 93df321d6cc843d5cfe69cbeaf41fd5721534915..7df06226d85858006cee842adb397edc3cadf4dc 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 7156eb300074aa75f9ff771917cdea843ad3833d..e6b7ee77c8b42b7f3727b3181c2019c54a0858fd 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 65dcd12145646eca4b2d4305cfae01a8250d4e1d..b896d6429483679ce6cdd292c6295406f8a76b06 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 4f7ed2cf0619545485ce589112e24be8cc58132d..0479c74ff00b036891778b977306af0f185f97d4 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 36f9117e94a3d46425c6ea9d59adb16d0730b514..cbae5f02b5d7230d35523962ccff0e42784e5a8c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index f7ddba907c04fd8e44b3231b411cd67f1fa9c8a2..1ac2bd83221aaeba8d22e48258f8ed5e26c558e3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 3b3c9c17db24322786bd80e339138b0d6ef87bd0..b89b6eafcfb4d8a5db8f3647f6e1e9a679f2abfc 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 
index 5055ed655ceb21b5848e1b6081c1b80915e14436..bd2e022fe867ba2c406b5f14d9a47461ab2df3cb 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
  */
-#ifndef nb_kernel_sparc64_hpc_ace_double_h
-#define nb_kernel_sparc64_hpc_ace_double_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sparc64_hpc_ace_double;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_sparc64_hpc_ace_double_size = sizeof(kernellist_sparc64_hpc_ace_double)/sizeof(kernellist_sparc64_hpc_ace_double[0]);
-
-#endif
index 67ace2f0e7400de7daad22475f1af9ac209bb992..a18c8857577211e64b7d17f6bbf3e5baff1253ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_sparc64_hpc_ace_double_h
 #define nb_kernel_sparc64_hpc_ace_double_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index 422e6a20a346ff3c9ec95497698487d9b2b08b7f..2fe3d394922d36a8d08ad29bdd041a94683f9c46 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "kernelutil_sparc64_hpc_ace_double.h"
 /* #endif */
index 35c2f1e9a915b196af25f720d40c74589e3982a9..4885d6df1a4bda18cde9df1e745a949f1f470f15 100644 (file)
@@ -35,9 +35,9 @@
 #ifndef _kernelutil_x86_sse2_double_h_
 #define _kernelutil_x86_sse2_double_h_
 
-#include <math.h>
-
+#include "config.h"
 
+#include <math.h>
 #include <stdio.h>
 
 
index cbe9ab78d073e090fe11148233422c1177fdd022..661ade730b90777cc85fadbd4980d8a46eb80946 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 8812dbb18f4302f649f4711440d14ddb06dc5bbe..63a2604c580f8af548d3960b4b23383ebb6cc63d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c4604ff1ac5d24d55eeebc00889c47b871ad5f47..f7f093aba59523b3b51b06a33728bedf886f2010 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9060d4332f43c6470091b36be1029ecae465d1a6..de4611e6fb99e603b65136f4d7f53bfe4d258827 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 518aa69f5898f7f27ea86cca39fe571455f3c7e0..fa4d616f6870602901acf11cf11ff84661a7bf2f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 14a8fed7b80f6434829f05b48b14e1baea12f133..3997922505e34a8077aca41b329ba9858d0a8533 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 46a5a5dca533a8bbc87dd2b815e047023e83bb68..d3a9f7a104c466c2bccde0f6dfc42ca1c2bf23f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 0810dced565da170349a8881ecaa3e0f95e9d17c..7f9dca6ac2f92596a2838fe4a2f6980864876bff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index ef6a63ef9d1cebbac5e952ebe90c5f0ebe3681d9..b25c39117c62b5c4626d80625d9f9337c53eeac7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c33d96bc6adbb05fc1c9153ad90aaf1baaf37333..4f1be0faa7f1845fdc84402924b2aa21a7c0974c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index db5fae621a0c9ceda672b6407f346fd326387616..62b0772c5f17f537192a2cab2d5ba4f5bb4bb338 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 674ce0af3bbf08a4e06ac5c604f5f76d4e684931..6b791863fef42db2ae511a14abd5aa96542c2951 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index ca74086c090bf5ecc57ec61ecb4908762547a7cf..79fdfab18412729bc3724f93818b2b6e500577f1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e6e86fce2d589de9b0f45f3be9142d993ec72ea9..b9cdf0beb61f9689f8b5bfddde1f7a68bc98a75f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 2a912db4dd0f7c48f0f3b70cb38b3280d10259b5..36fbbbb831b125ead193d8696eaf6ce8820b9204 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9842b3da93dd49a7ebe668b206143a725fcea119..6911f50868a3c587945c1029be0d0ce68778449f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 7ed18dc6c2fbba187583eeaa57a61524fff3a587..4eba9275a8a319ff62174328230f7f38ba2af84c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 62f3caf4ef1280e4589b50591f3d26022c264ad7..0723259f6d6a7e55955af54636ed629e1da2c225 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9ca81f960cb128865422455bfd7300ec85e0378d..d632a13bf9e269350f2922bac5a713a0640eeb03 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 7ada0d0df5bce93b4ea7a178252e2b5a724bf5a6..80c450dbb48a7ae73db612d6353440ad3a6dcd44 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 752c5e8eb66ff31c9a240a2d715478b072ecd0f7..6e1da3c192b2cae2ba539674074743fe719da50a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index fe1f2fafd2dab99667303cc9a0ba3f95ced9516d..d9cdefa143c3c5a5a23fbb25464f03dd0e516e1c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index aa57a7322f23023c015883ea4d03de6148726dfa..991f25a2306e7d2046194e6ed700baec14341a57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 02d110f516e374e19365c05eb1f3dbbba0be8bb9..5fc9db2ba52aaf20079f47da6f5728a820e28ede 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 423c3ee39b6c50f4d1e884d970313216269c05db..e6918101bfc1a9fdff532f4abfb5c1837fd8fb41 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 457fcfd409db03823d8e1864116ac70d45b4fffe..9e2423c18f757190107955cd2b1eac77d62c8aaa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index eda2975ed329349966e3cc16f5079510487749a2..ba462de670fc88d287ec5fc3a9fe48d1833b1d1e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e76d6333cf057993e01da5e53c270394232229d8..5ee62947109296196b6df0c0a6d90a92ae5f9bdc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c6e46d9b0814c29b7c4add28d814ef47685843a9..430faf18c17fc931b083b03399e55d8219ce7aab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9eefcd3cc023d22238178a8224ad9016f44880a4..95b3a82ceb46da4c6347d5c4345dd4b560b0afab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 27016b8096848bf28959e85505dc44da6bf5ee2d..5f0f02190f373214c0c4dcaf91c777a759d144a4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index fb8b0baada5f32832240e0e03f4657e254f1c0ef..183d693824497f8bf8190c4ace7ee9ee63956b96 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index f156207c8ad93bb6e4e914a712f5c3c99e158d17..c3c86fc614b1fb19ca280dbf43b54de27a41ec9c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 437ae4c6de1f5e565c67dd9eb3561e82acbf5970..edb0cd76900cdec09e3e59e3cbb5478a059cd34d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e8b09745c41cc6b461b68cde0aa1ed6c72c1def6..9c13e466e91200f5fcdb004b26972ddd05975fae 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index a468859a5cd3a6a3531374f0ee6315f7a33e4c41..ecacdd118d77ecb7efae9caad89b7defd79841c6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index dfd1df2b019f25c827858a3470c2b88e70d5ec2c..42e6eeca2f2d138a841c869ff760da27846351ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 6c51e1c94afb799bd81eb39f3f07feb50e9e5476..4b1eaaa27389da3584885e9c19bcc4520fc567e3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 607e82f009ede2f6d05e20839b6dabb2f3e25937..7b450945ebfa2ea9caa236373502703992c9ba10 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index a78d4c61fed1c61ca0b0b8ae5ca72ee94203667f..6646e46451f0e7e39efa3b21a68c7d103ef9be1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 7ebb37f721a9ba204f592de6a7b7645be89ebb05..66f86fbfebc1c045913ceb2022134effb847aa20 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index b05b026adb462927730fb485aac3dcbc5a0ecec7..a3666e28fbb00bd621094df7c607866c402a5331 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 21ca7768803d3f7b0396d747c041ba25fb5fc208..e9b0d4eac00c646195a386d424234ba1957c9842 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9504e112832c6f30f9d19bf580b25f1efe8fe6ba..a28206aa3dfb376c1237f48fdeb40b9364d23d52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 0494150c7e712571216debcc77a4cba7ef891a69..3dd418e0ad3a5b55f86b03198bd8d05b632038e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index cfa8f4006adf4eaa1efcbc51489bbefae2087163..585487eb10fa86fcbafebbc5d4fc7208aa4c69c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c2a89e1f94d59048dbf8b9a9c83b4ab775398694..0d789f78be61e7aebe4fb2f15e477da3dbf62113 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e081e211c7168ba9a567fc66290b31ac66373e5c..32c76d549f512c219360be83636f68f14faee9d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index f61fcc38db65d6ec32251d08d11d37031485b662..5a81b6b1101843d2830fffe4c27bfc2eb66938f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 914b77ab0325b27b48c078ed5ed1008033724a7c..a3b867c6cfa14b2335708d6aedcc06dacaeea3c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c7040fd84378eac28f0c2945d2caed7b5e90bbba..3e5a7c6477ac6bd461165c1f93bb6d4683e104f7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 4969a4a242e9bc563ca353720ea180eacacfa931..c8515d13b86706d0d0712f6e466e1319cebdca41 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 0fba7a1ccf05e98e5ca18f5aa49e79a00fd60424..aa02641a70d756e2ea3d68dfe9accd64e2849574 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 99408aba46b4737a6cd365387163dd0bb6bc2967..340a6e869d49f3bc4df147a5936f0c5e54b56758 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 601cb2e9e4ef8da99b19935a3190d010674f6c43..26f7c30af61cbbf403e3319d701d78eaf721cab0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index d2da77794e1f58cfc1e2ec16eea0c14a4178e971..0523eaa15976de79a15ea5d9090ed442140d63c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 431a57bf4fd71a7527a18b7093ce00f4be1594d0..8c970cf42005212e1b9802aedaecec098864f27d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 698aa03506dec714bc5362bac5f6e14f278a0ae5..f3ccb22e2787418af900b7cdd675e59953d0d274 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index aa695c79dfd648187f5f6643e398a64ca78b8130..8bb40100d368085edc864dde30300506af39aa99 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 68e85aa367a371ad91b732126d0a0dfeac4a4341..b16cf86ce761fff5d4cd3f51e605355a08652bcb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 2850954b3122af725478207b52f2c733acb15ab3..2ebd6b3d2894d620ba4b06bd1bb27d546d1ba5cf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 2f7caa6be164ce687fdb9e524108c1ff71b2d22e..e70cd1d45534375a8521581a7175a8ab43d1e4a8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index d49d69e3de471a3e19848623d5cdae33a6d22133..b25868bbbfe1cd1d2569299ea75d567a5a5ae348 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 79c9f96df61b764f5d80372c7f3fb29807a814e2..b2d37db5804889224e0c1c4ec6a363e6fe93f6a9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index be827df344acd7ec7cf94c622f29e90e6a7e204c..13f189a801fe20f502058e4ff32c7f4250b48232 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index fae7c28911a02fd12442140b3360b689798dbf62..388a53c2af6b996d9e1fb4c0dafb8d7e8cb09f34 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c096180cf7126dd38b215dff65b372610f06b760..36f85f1a80a49667cf8bbd506a09bfd7e7e111b6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 68f1f9d7d259f6437f3041a18d8a8640caec9a4a..5471507e14fc7fc785035c33e3a98454053e3096 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index daa666ce4cae11635da02d6950e2955e1d0e087c..22f757253fcff0cd4ed13e6b2504dd12b3fc1ae5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index db191566594d841cf3b3b7e421569017da0549f3..168564c0e10993c8873dda7e901fb7f62681c4c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 70d7c287b13fd34181d9c84d7018779a98206c9a..94be8c4c947829ff5f9d4bd15200cfbbfe4ffd2c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 75ef13cca3583db0773e164eb7da63e4d1d4ba20..58e425b7f4c97480e391a3d54221d19f98185fc0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 5f37b0a5d0b6c5372c5da5766baf26a5c3289b80..34f3ed2c15e3c83c701533707fcde500acfbde5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 1289d9d9724271136c5cf83b106c4712a960aadc..001ba679660c34cc20a5959337a050d7c5a9616f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index ae1a0f7e6ee51dc084007c9571b5344c03e210ee..03779c266cda4ee0e96f21865eec1061cec1565b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 47ef9a1e79bf55483ed5718564e0f961cf06ac12..bdecac3550645b0ef2e1b6840cc2cc1be8582fd2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9a2b797587895e2fe316ca6911e1ada12ad25986..c58ef6c5d147521a6a8361233d4aa76607808bd9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 54c5ef2f9ee1d6ab06d26a5434c6546bfb1e6d9e..83589e20f9eb9b7a8370de7fe1c2a0ae848d1227 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 222313e4a751838966a7b0c5d513298b2dc91d43..22fa08bb28cb78afb73455ba2e2ff322308a8333 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 27e5c525f0d6fe2cd7082b7ff28a771d82839c81..761b35d876f5276b389646c610fcac5482ca94cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index df89eddff33f887b970f6804366a4948778a020b..237ad5e4f02142cb29570ce0d91beef34a4b32d4 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 1719de5164d2ac821df9ca0d5d87c43f24494c23..852a3f30121dbba6fff5c8c35026fb09053daded 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index d1142948cc19448b6d87d6bddbda02486a605a75..6d000c9d0c2ace06ea55f111048002ccd092ce3c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9888e8087f1ed4cafd4ce2440a399e09486a36fe..654c8085bc9956764d2d1531fd8a2de0a358994c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 6e8d1bc702272fb58bdd457fa315d7a5b2a5a8e3..1dde2c73ba20686d6068219c71184bacacb76106 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 6d3a35019eee27a068fec7018d12ab7f6ca15e83..4698a0b7557a3c66ba528458e6ac2958e8328914 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 562c79fc434837c13caa184b64767464e8f3f97c..e05d98f14a3ab2f6b7e99c9ad66acbf2bb7a9568 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 33705c8cdbcd21c55d4c8bc992d51e65fdb16068..988052fece64f3830729ddae5c74d85ad04bc676 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 32c90b295054e4152794213857b790560183d149..817d907830463650387ac6a5ee05102b5aa06cbd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 1ff8586e8663c26a123ba407b100390da12c8496..d34af153fe9135c5a3ad0296e108e527bde46876 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 91b0201e1efb6854115eced679e39c60c117a16a..bfc332ef979aa1596d53f69f942d654310e96f2f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 85f3041766b16d3a4e7bf199337bfa0fbb00c3e6..d6fa3d72e5a62280eba714c7773b509288540746 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 810625993b1f370d5362928ed45dacf8657e17b7..a0e2e952d00d83faba19f6696d42fe04bd251d60 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e370f0564ef525721682e58048647be1143efb55..4a76c9a12f6d36e9daebeebec9780588d5219c43 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 54424803d0c685b03b51d4873b7ed5d5ef35376d..66138806535fd34e67c9c4e08c6c27b5e83798bd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index efca2149d085a98ab6f415af07bf8629d5e0c20f..836540639d74ff667e05076012ba85588aa34630 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 71222b0affc554f6043175e8fd00f28894b4d59d..52a74778590ae04fb791d08fac07cb65ab2153c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index eb3aebadad47622b874c0e079c04611f78516ce1..1fac8647f8f218385e5609c59269ca867c724007 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 251486d765e2b743af2bd9d9899f6aeca47a17ca..7e54372475dbcd759c59ef49031560fbd18ed706 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 8d08235351b8f584b7c644c9c4df8e717364d537..b339c3774e40e92a25ece44d4051249edeb68a59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index f1acafed8ff51d62c4212446aded735fc45b8fe1..a50084b4bd775c2732a0fedd106c97500cbbbda2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index c0883d976d88693d6ac52b73204ae65ddf729b77..0fffbed363fed757c309c83ce66ccebd119bdb96 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 1a5e4682bfa697268f0e9d1cf1a662719f4ecbe7..c64afcaab0e82053301a5b467ab3fe4e8f698989 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 382467dce28af9bf640ecfc23bd7aa02d94388ba..1152b6be2e7b4b8fe4e8c9a1e31a378157f69809 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 580376252c230850e3c6e34baa00bc5ae907a3a6..a7b2d8ac7164e26a51d276096324025f1a929393 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 696d541e987baeccd6268b47a7066fbfbdad350f..e2acda3db4fdb40ab8dafdfd3ee2111bd3f340df 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 534f260ce39c0578c2032c63d3e3cbb33cad4c4c..5f1385ac293767f9e02091d5ef9b490895125870 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e092b553dc34d7aa69403686d768da7a274390d6..5d878fdc4faaf4f536488b63d2c04c428e59a0fb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 80f282b9da77bc4b77dbe5edb4ea0a35e7828c78..2cbd1dd78e3dccb1f17a14b7e989329ac1b77705 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e8a739d97b2bad7e8c2afe451bfa0eba743a0397..4d905a284ba6a9584d42863d814099a8cb90caa3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 4710f11b8561cc05649cb74d833e3553aa370109..7fc34aaebd6fc401d4ca6ca90bdaf20f1521df72 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 464e690925d8d501358bd6e09e7d96fdcebff454..ba1030630c8bab0604ff327ff514cd978c40c8da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index dbf0fea0736c351559258136bd677a01dff7bfe2..7c405a7d5c9d2936ccc8bcbca311352766edecf3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 8f9d31ee3b30ee12f92847b38e576827ba480312..36d145d8d4395693640bb5e58a64a61437e19aad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index e8cefe8a8d371b3a9ca78e4451ff826aef67af63..0be6f86c8c0e0f4ffa6168283474511bef8edb57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 9f0091bc12332351bc89a3b10d15216f8879b6fd..190d78d8544ede9b28b96e40cbf38b7a5b183b9e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index eeb517bf13fa956bfdbb47815b6e265b330114ed..3ddfa25b2e639c0907ae43d827bee72198f1a8e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 37d656078f2d110fe5a263879b8d6a7ab03335c8..43709697e63fd453f48299d5cc3d1d89653a632b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index dd1b9608f403a20861d1b4cdd182320c0c120b71..3b88c1b4d41a59a88badbb4f20d6f075877f4795 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 19e8a07516f6dc035d86d352b186a0f7ca975455..7d814237142bc96f2980335286b379c60b1b65a2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index b997aea7ed2b92ce2d183538c4cfcb4fe816fe2a..ce36e1c56d528cccc2970d2b2a9fc50d0fe8cf3e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_double kernel generator.
  */
-#ifndef nb_kernel_sse2_double_h
-#define nb_kernel_sse2_double_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse2_double;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_sse2_double_size = sizeof(kernellist_sse2_double)/sizeof(kernellist_sse2_double[0]);
-
-#endif
index 1720d436fc1546b835d2a593fa4b3906b25a4b69..3d45667bd2462bc4034a5fc2ee969b8ed2214236 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_sse2_double_h
 #define nb_kernel_sse2_double_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index 955b06d748bd60fa1a04481949a3d9bb66ca75ae..da75ea30ccc4b7f0596c9858a2714220f7bef6dc 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_double.h"
 #include "kernelutil_x86_sse2_double.h"
index 820a37031a09824f89de94e2517f10227b1bce03..3356a780c17fa141901a580346a3e332a91b20ca 100644 (file)
@@ -37,6 +37,8 @@
 
 /* We require SSE2 now! */
 
+#include "config.h"
+
 #include <math.h>
 
 #define gmx_mm_castsi128_ps   _mm_castsi128_ps
index a323ea69019e19861f9ad9d716fc062498c9f4d1..e398e3c7ec1a9266f0b7203b3b91864c31d8b2a5 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 853206e224e972b0b47d11aa53915cdf7f1b3de4..944968a0ad445e3fb23302e2ac8c0718c9584012 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index b149aa2fa4a1cc4fc723be556b2b1b020a6c4feb..b69fb42a999b3926abb495a025dfb7a8fb753c5f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5d32452902df8c65c851e4ccb7736cf971040e28..f4109e7b52226698e12d95c9bd796ac7befe03b1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index b1f235427ccfd42ae5de46d3afd122b8c0abd195..fca9e0aca5d2ebf26b0cd87ff8aee2856495c92a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 12dfa40c1ba2b495d31c458c8459b989292717b4..d9182b50232cc47dcb1eef41cc1c2476ca185123 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index bf2fdde1a1a3f83764d15c9c02eccd2a33a555b4..6b8e6694b55905496e62dd6c80e4388e69eb3a35 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index a954a738feb9c5022d9d4b8fc7cd96ad645fefbe..7cada150efc66136706b570db897d0e77536f08d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 786fe7d97bd1627502f84b95ef2ce613f989e168..6048064eb7ff2127fbb6cf753e56069158b0a4ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index c049711823e8fb9235ef5a8a65cf0bdb2142fd28..f92df505d15047ca3c9c27859553320e9bac7cae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5e496064ccdcde2738a22e28ef8b621026f93d22..5fb31193a5a35b462de4528411ccc80950391004 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 25c99b41442e0678bbe3841983dc354c542b409e..a51ce74203f1745b66c228716892a867015d19d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 47d0b6c7b7d5dcbc805121fbd8e05c5c45e24e6c..e56aba56a355e4d37f91f672385b801c958bf5cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 32b6d8f9deb8443a03fa6023e49557dc9e131fca..feff2fc604b7b40314d526aeb6114602e96429f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index f899aa000105983608a13a014f0fa69c1f5df2e4..bce8e04dcab77a5ca5edde5cbc1b472d54743e40 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 21327db3037c0dd2f4f7b47a406808aa7f519657..bec922ca11990e585a1bd38c1ddc3629798af57b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5e2ef2430c5391ed1ed71819c02cd89b08677186..33727715292b8b26092274f3fa19e9cb7fa8ece6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 78f743c034cd4c8b024fd4b1932fb9a91f5cf7c4..b8fab59079c5a46ea1e035295929cc46e6a88f5f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 3d74ff63a8bf1243420df81e782796dc223a9c91..751a7d5413081ab116cc78961eb9d910e8ece91c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index d0686bf46ed28653680a630dd2caea4a4bf370d6..bf153478a8d2089217edc096810bb300b61727a4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index d30e9ee57eff6d529437c8e0eee2624372295410..f74316e4224d629b829ddf9aebfba442cdf255fb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index b6e78dab0ba6dc0fc610e973948b4527c654daec..939d7cc88945ffdec0e0d9a94a24a25feddcb801 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 9cb9e56c79118b7dc102e2dd748ef5d0a3b19907..f1b29dee546ee186ff9d74c99c83f86efce16b39 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 28f093be42c2b58c60d39dd1746d5aefd8c8df4d..f9e44170f58ec3b9cc073cdeec0ae068b1570dfd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 8a45cbe104bef3a62961d455957f7a82a363cfef..3525cc6f350e45ca8e798266d914c0be00beb348 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 20af76d96a8643227a763c202bf0f63553319dfb..24e086ff2641e32fa78c5fd3eeaa68985754f83d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index f9be33ad09a3435c50893b7983cfdb8d9708a5dc..3a591e67d16c51ece5bec3a0bc9cd3fe03d771bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 404eaede4c7a5c3f1c6be8193c6508bfb6c2f2bd..5c3955fe607ad125e5f96eb35feada2a19fff2bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 7931f62221e253abac4a2c472f5d1e7f40aa3335..c0133adf4e9081dff0b9b3a51d60ebca8afee360 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 047fb9bdec03dafe4b90fd7ca22ca8a9d534d654..a274a6359cbbc82fbfcc3091e592d053e9ec2691 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index b7035c4bfed168b8dc1282300ce2b8f38fac27a7..ceeeb5cba9a4557ff8ca88ceb3b5df9a1bca7142 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index c57c217d2e74a896e137c0d641eb31eb4d323879..eb5d22c5127448020a11e697548bfeb14e317166 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 47bf7403e49cdfc4503ab3dc3f09a93b89c0df60..879ce0d511a35d69a66359e172ae5c6cb0f1fb92 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 238c93da8b98ab68c9e78e9058d01423a3a4598d..eb02d47fa4a44b485010f395756ef5315d8b56cc 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index ae898fbea08e6b2fb27a26b27f21c19064682302..a3b178926e490768fa3102d87dbac16da712746e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 2bb109c6109a69ff5dbb182e7539349fb4b877e3..13e3bee65c2766ed37abef12658682cb10f4748e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 89302e686a1313879e5e2c3fbbeb43d680b5cffa..5ed743adc6e4a9d270f118ccc45d9953a55d2ae7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 8286e490db8eae1c2a39e4ee821b638902af4e40..1e494f4b3193d823c6d0a2fc8e1e4cdcbbd6f9b4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 02f6dc6103d85fe906b8910c73824948f042d773..929d502a45bf5a1cedf42e28f6ad4a8d757757ac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index d97553b603f86940325a929ff7c7b83523144648..fb04ee1bfbfcc28a0b45403f3191086c0cc3bfa6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5a90b63c1420adfb548126f663316905e6d26d58..b3d0172dd706007132874d483cb850717f15f4ef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index e372eb0b0bbf1e19689129f9fe2dfead4a281059..47375a6824c3c466178cb4f748dfd9db492d4947 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 7f81f331c7c5fe2899df9cd621d9a9bf618d6fc4..11b79ec64b3360a3c7369b66c4e63bf6c917bfe6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 4bf397d6449bfd3095ed6a317778e8458bf1b360..eb33806fe71a9334333a1cb9386aafa69d2642cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 521fb7588094c1bbd066f1225dc832b071769d94..82766940b19216ca07a8d8f3433075f6e3837058 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 67140cad9ac7738d798522e0ba4024fbda4cff4f..4bcb1380f6fb8d110b219fc16b7ed76fb77de5cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 9cc5a8dc160f5be1ab65b902f1538c787a45ebda..c935859b4cb78a23cf27a9ba24f5a15928248569 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 8000a51d0f58658d799da4219ae3c1c5d86ff833..ef354cc6acd02cbb8f80746af33ab4d614179216 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5fdd54de150786ec6c3a3779d938a5d3460e878e..d7b9a7a17d517cfd89cf0b4ad594f31e454fc5b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 9c8238521e29dc80dfe653ef8ea461f7129c6386..b0a63e6db7fa80e5b927243df9485ba140568cbb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 4e4aab3dc75bcf4ef1096b38df063a4257eeb76c..c63d7720f455d16bd9753d582879b79053cf6bdc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 25f30ba465108defe95fcd624de3510a009a01ca..555cd4a539660a58a6ac79acef7ee76906274bfe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index ffc3c2548f61a9779dc6f9452071c2b35434131f..139b8e7c7fe137220b06b2a4f626b86bf6da2e73 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 9b800e8263b6e135213b0480d862eac0e5c15834..d7e5020c386c32fe44ac34982d088c6d0000ba71 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 010ec545de953ce38b661b14a496f3a6206025ba..2dcc45e448ec54a1e6bbc3100628c524a10c1255 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 191b040aaf4e5f7f2ac4a9845ae0ad87e3c6e82e..379442cc74bb2377a226e50df0006b164aed0be5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index bfa897a7e058ba0f9ba7bac1cfd1d02d0c4a48bc..3998cbfd3bc92d5871eb822038278e875338bcae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 1d185854a61d481c7ad0f4d419b3df2af4b92ade..0660012f97c45e207079d2b0773191040c601a82 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index a69f4f295f26b972f3fbb7eea6175f061ae4cc91..1de10558d220bb9b107ce758ffc894a19135991f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 14849c317e2b561192e1ebe0c838ccf74c9435a2..98321a47f22ec2c59b2e17f830c98e4bce732117 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 91e0f8711bb3c0fe0475846d4c3070a0fe73feb2..9efdacb6509946b9040109f308a926b44410dc8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 999d9b042ea947ca0627f7b99e3da5ce2f0a1f55..1a077a715676b2972d90ade8dfcf3a2eb31dad36 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index b01cd4c5de12f0d459e92f6b17074a5df49c91bd..eb8c17a18eb678024ec3f6fef01f1b1addf49c84 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5427e5dd41b07376a3301fc9172bc514f890f2ed..aaded0432a9acf78a0ac54cc8a9798d756ae450a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 4a933460f88d762013be9922a7574bf0af9dda83..35fa0108371a6bbfd7c80a355761b619a56a47c8 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index bd4a52194fcecde2bc8d8b09007a68f61b641785..b142f4124d7ca71a526b328f32ec7c1fa383e96d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 72d1955ee36b6431c73782154264e6c2d10951f5..181a6ccc91b15c4b8885a8491cd5cbbc06e7e775 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index e9bbca794cb2e091b85db6484dedb2b9f6d839a7..104939ec04cc586811f5eaf04f43d6062d91193a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 8b5cfaff03482d1ced151f52fc266ce4031728b5..ec72a5baff6e7e70b521198b60ae0790f9e550bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index bcd18da36013eafcb0ff662f60fb4fdb7b572dcb..a9cdeea360add7dad87a1b5f46bf57063c3a4a61 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index e78d38eebdefe8a6c13f0c246b5c57a8f7b76ada..d15b26af7879157468b0c211ab8904608c65fb14 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index d567138f0c2c4623f9a6285735e0057191dc0fec..923a5b917a7382f1e4df816e1aa484f293f7712a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 083aefee08440277d0b062fbca27ac6c15056731..ec9119922335876d21e16291d4ae5f984abcb724 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index e4c4e08cc3bdd3f4b2e074bdd13eb6fdfd64255f..d7644a4ea694255c10589aec9340130624f85a06 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index cd301e9c5cbe714d206e56d76e8d8f51bfd5ab19..63fde3c0ea3a54066fbdee6a9255815486d549ef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 6b01187f325ac3c2ba9cc89c0f1ad69f2660a236..ea2d9975d5941c2f2dc25808af488ef7726b0ad6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 0717da1773b273a6b1d97a96febc9b8196f079f2..10042fda8f3fc946a8d47a8ebc124c7c542e6e6d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 3130ba44e2146d81c74bc9998af194d8fca8684b..d732129dcacf61f025e505aea5701982fbdc9e2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 451f96a511411efebaec51c5e7bc62306d2ec7b2..79724c1ef3cfb1996657ea82db016fe85367cb30 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 3c80b4e2c57aae4a30c63241ad303f7fe233bb41..b95d69741846966af275256edfbad31faf149421 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index a6c2c6e7c3848cfc0fbc548841ef10d3c803a334..836bfeca696fe03307536a1a6a28f968addb765a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index f2b7f698a1706010ae6976ef3ede38dde6626523..923346a829f949cc113cc99175e44ce4c71445c0 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 956e8831250bb4fe2304fea294ee6dd1963659c7..58f43d74ab368aab8486464e990e8eb9161c663a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 9b1c31f7d08a0716604737a3d47167d364d0cc6f..3311659b28391561fe9b521f3e762813969f55a8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 7aa5c6afac520bbdc5605ad3ca78e16511439081..665837010cdd186d55e63a25b0a41f07df94ceaa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index fe3f10de2954601a7e05686e6059a183b0300eba..640629db5ea161381bf1939e4ec9e17daf891764 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 33cd05b198b3bdbcbfbd14c0e5082ce39969c78f..75efe61710b0ff826887a6728d897b96cefdb09c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 1e46beb6e1ccc6ebd0744bffbd716a7b0b8f1777..9a11ef53f31e78bdf8de6e4a47d11faa046cfb8b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index d2214aae8572c913e5b17d0beb0fa7f9b7dac28f..50196ee77e3c79a1a0963b4f253617d08a4aaf77 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index f4d5549fa6274b264b547ddbb2e6acfc997a002d..d738201f6135616069411dc8bdd5c946af0e03d8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 466b808ca3db107f48ca740670bb0eb62f24fcd0..a096c464fd5b603cc69923641b45fc28bc196297 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 0c18418edd09de7ed2b3620b51387a5e0a527cc7..acd708d52809676eb8b5516f3c183af4a7e41221 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index c2e86560f578166db409d7c503334dbacf27a383..febb58aa1238e607ab95c5a8c1b17ae9290171b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 9e61af810252a245d16c80c27e4590f96b89f738..bb4663ac92b4f299724cba11eecd72ed542ad276 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index a3e3b4cc9af41857f7696c2d41dccffe66a06421..96f0deec5b3d57f5b10cdd3632678f6f4d5483f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index b063a244c406af162e6236c0a5857522f1edc08f..3324e6e95bcd054d7d13387df7820b873590a9d2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 07e22ad09dbdf56aa50d210bbd3bdf73ec81611d..3988b53be8f4d5fd08ef80f644332bf84b5052ef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 7af182f100a587b3c6c4df308a908340749ccdfa..0bebdc8d6542304d46b3bc3b9081ff6ef74fa201 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 2ed4fb7881a6d8461260b39e0492bad9c1b970f8..d70c420dedcbe40ac997ad78076b4d6f694e3660 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 91c7efaa43d5f73a35ee84d486cb916992bd99cc..85912be6cc678a7a0a56ea3486d957cb03e4acab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 180806d27b31b857ac49914c6c85cdb3d2b8ab4e..c47f10ff2fc841e470d46184691d5fa7fc1b4630 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 8dd087a7f4e1cdfc05600d3df1f77e79da8bee89..307063b08290538947b857e46d7b2fcdea930a12 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index f36e788e0bccc99e6eeecd91e1a61db47d4dfc97..5b30b0b1d79f5633842b815d96e9836cfcfd02d2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index d18752f4bff872c9eb8f93065a8bc3c9468e7624..b44941d1372dee3f00d7e10b57d6942d3b98f46b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5d85e946bf407ae31ce8be8018e38804e3793933..f4c5985c3de130c63fb7e86a53d2f2acd31edf16 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 39b37aee6da54f533343ae7d1caf2b4e0cccff83..121699b128b6e81b961cf2dddc03603ca5f00349 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 06fa5e62da75c25cacfca4e38f98d8d0b83aa76e..6829f4f5617f0c60e404085f6b9461f0a1a8003e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index fcc35f9a71d01f09f92c548174274bb27d41bed9..86801bc1d6994ac529697c5a5d139c80e23f8d2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index a9e5dad425b5a323f1fc5b4688a38928efd70391..7db65db9dfea7ca99f5866674da0415bf9afdde7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index c8f2f1f79acc379329b8a2cb277bf8e1db42bc1e..0eb5f98a9f47c04e9cdff5357b92383928b7897e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 7c4af96763421796efd78c45c6602d5e4143e27a..b9528802c978c2139cca6d6e0b3a96ff2a1ed588 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 830fec7c71dfe8c01c878193dfeb79e639abd825..b6180869cf44222463d72bcbe0c99043a309f8da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index dabe5ac4174b074cde58e5e579a7d049d416ed53..cd52143eff1716ba27fee9a68cdaa29e8c96cd53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 5956e258ff9d209ad39d9f946b764018b4300867..adad370a9270fc2811ffcaf41e00ed144e0797ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 03ddc09b7ee6fc6acff5c5acc5a18034782aedb6..bd472c5e3e47c291129fec2ce7a02396c6b481fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 2bd86b5bf0f1f7673fb464d42797bd1f416553ab..690771e068b672f5b1397bb1f3b7cd71358d6063 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 4faaa0474937ced28bab3f678f1063fc6df4068c..784f627abe458425c5fe4e35406180834db3645c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index ca604e40bc376cdfca4353285541c2fd6cb73721..38d449d60a607663576e9d87b5482e8bca71dcae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 263f1238ed6d2e0c6944d0dc795da6c1c61ef9b0..eb35a819dd8404a19ad55b2534a618ce00b820de 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index dd3720089a3260e615dda6661438edc7e5253a4c..ac7153fbb3f2054aff16092508ea5107a66eecd8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index 546d1c87bc0714c7c1d005f39105b344d6de6933..3bff2be8b3070b32f57d1bc615888ec79485d26f 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse2_single kernel generator.
  */
-#ifndef nb_kernel_sse2_single_h
-#define nb_kernel_sse2_single_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse2_single;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_sse2_single_size = sizeof(kernellist_sse2_single)/sizeof(kernellist_sse2_single[0]);
-
-#endif
index 331870820c5f4ab1ed9598890ca72ba9fbdeab8f..82b0ca887b9ba6e74bc8e1e8350ed42807edebad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_sse2_single_h
 #define nb_kernel_sse2_single_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index 6f7f1b37469559094b3969a854521df72db0a07e..d6c90187a4ab0d93b9d7eb70da03c0d0b6006cee 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse2_single.h"
 #include "kernelutil_x86_sse2_single.h"
index ccbb62750fad77879f722578b729f75610ec8935..449fe3666eb77e81513f56496619abdeae643170 100644 (file)
@@ -35,8 +35,9 @@
 #ifndef _kernelutil_x86_sse4_1_double_h_
 #define _kernelutil_x86_sse4_1_double_h_
 
-#include <math.h>
+#include "config.h"
 
+#include <math.h>
 #include <stdio.h>
 
 #define gmx_mm_extract_epi32(x, imm) _mm_extract_epi32((x), (imm))
index e21524a9fff67c8c1c3129904a70299ad3aae12b..21d8185246876a5c30497457fde4239ff215a688 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index fda6370b64d2a325ef35db8a8d642943141e7d22..d5082e3690545869b3c6f6356de75c6566f11e09 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a8a9e26dac0d5986942062cb7388f1ff5835c917..8e67c2568bfb0b6de6487e66accba5cc50e23fbd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 8313e952ad1be126b8f44c030d5e7cbb7b508feb..df651699f78dded013234c7364a0c3b0f7fed9bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a255bbf29390a906314f24e1099e41015c1ec555..f6763438b6e86fd0c4726a04672bf784e763dd95 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 4f9ab91c8ceed0f9f297c79786d652860409bd18..554acbea8def2b96335cd198af79d4864cb286d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index b04fa0ff4c49939b0abc30f362e94c7c19f90cc0..d87a47ab9ea54cdc0cd4fec8b1122d2413ef640e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 49e61fb996e648a9a0ffec0601eb1f73ba4b33f1..f322f37b9e38e604b6e1f709ba62dc722f44f1f8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index c58caf11f0df5345b383603615d1af79a0450855..f974ebf581ab6a45d3cb8189a47f5df5552bd053 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index bf18f815fbb381023ad4751200eb4461ea688f7f..ee500cdd8d619c79875d97a163de61763a7f4d14 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a59611c51db41299424a86c336089cf281c90365..fc2b427c286890b7755aad22dd4236d276e09da8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 0e9d40a732cb6493c500fc0130160206114d7aaf..806d0ed5d5f9fbd20831682e7a854b76ebf59072 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 87090da7897bc085718da40d80e44c1c2eca6924..b38f1a374d0ed1245d76a83335f42f290aa46608 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 3e3204b427f036c43fc0b3494d50233ca029f4d2..29ac20de5cb6fc52dbf476488bc5b4e05cdec821 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 0bb5f44459a25c180c0873dd40a6c46f3631f033..f5bc6d39462166ff67833fe6b8a4b11bbed0961d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 45a4e2523d0a1f52164c384e2aecec7f7d1b9fd7..99b30f4e1676061369cd16a0d6b3fa9b47cc4828 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index dacd64d9ef167d5ab277f3db1f28ad0304b3bc01..ccee20148d403edfc6654ac211ab1df7772ef7a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 82efcff86da99d99807bd1ef3b7d8ed37098cff6..ae05ac1c2d5206c38dd4500f28b9d8308dde31dd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index ad4867d0e92bfb76a3fb42055294cf7fe425cfc7..fd5a8a8866456bd9dee0c0cec4a3c5727c162f11 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index e962313380e380f5da8655b0cd10037e678250e9..385b45c31ae8cd79521a1660055b4bcc627f6ad9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 322d2baf2695378653c61264e36f8e7a22448a34..6cd3892216b4ea4b5317b42722f37a2395969319 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index f4124877494806787ff7287e268523b22bb57d62..f55b556f359a2c4cfeae2c92b615edcca8788dac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a641ec2d02e54e8408fc2991aeeac755f0dfa3e4..79f3ffa0cb62d68de761e18e0df0ea1a01c4b6c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 70827217a255fb26300204d3869c9d620e49e13c..87232c18d85ec622fea1b107f5256e7dc8d248cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 13a9bc6c7f1a751554227987d494c3433a695fa3..662925f1850ff45c5a355ea2878c01ea50e5a2b6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index b52a4624e74c6a60075ea41a88222c3ac70f98b6..2630c85cacc38d3a53887b976e3fd9a73921037f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index d76b1f08bf5440d66caf6db113ec2ebbc34d8e74..4c21e1d192d979cd4c166b575645105247ce31f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 5fb922f20b70b419a966f75f61040265463c0395..736cfc0dd88d554f0e5d58dad94f0988eb8bdcee 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index bda6401f047f8dd40fda16b95948b2531be78654..ce93b70270f7a77207b4559378ebed7e17958caf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index e9b0aec44ae5b27944f71cf8f628d29e52a4ec13..38004be8851389251789eb8f3e6c0080d3798ac8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index de03eeb756443f9ec62510f15d1c8b62aa5b9f71..5c2ddb39c751714b8ef0208cf2ffbc4143b4f859 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index dd87bac2abde019403ae7409da0ff33f9864fcc2..92ab88e8714ef8d3eb87c34679c7dad3f853f7e3 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index ef037e43db15db41d1773014f7b44315d39d4c90..a51df1a66b413676b3c7b75b0812139cca2debe5 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 631758fcfec9b4c2b31c6dbb3c6b7ea75f075bc7..4e4ecc86ae120588305825a498b947fd4621db5a 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index bf3dc0eb49208bdd358018caa0ed2fa05c432c9d..8c20eef2f2255f939a11982059713ba59d150c2c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index cc8a50a9defc14bf5e0e0a7fcaeea22d3574142a..8f8b43d3a6aa8babf1dae62541f2c12e66f2e188 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a6464d6412b4d774a7892755c310448638014015..48bf43175e34f0a7bffeb3a72405118ad1849ca8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a194b53626ab652d7ed2503689516bf52536b9b5..0431849f45e3b0bc8b1f71ebb54bafe6ccf7bf03 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 3143ae9a3a884f5e35d22dbc24fca0f6ee7f6af9..e58d875fde02f2640369534ec382b470b69a989e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index cdce932aa5a5a00b968584f64db2bf179f153e4e..db66778da2fa3ba120bc03f3ff204358e1d2b0eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 760fb1b7e37f391539fce1023ac24d6543903249..e4e29cb398d8156197570c85e709e12e1abea344 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index f59c181c0c83b81725383101e4cf3e65fb29ec0c..36e4aff5e99afe41174dcd21600cb5caab7bef5d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 31c91c6164d86814ef6c82c80702ced9a94f1976..5adf2f62ede25d2db250b221e6c56db1aed7fa4c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 34176bcf0e969651c4b328fd3d58ca1fc02fd0ae..78ad836241b053430ed25a1b9049649526b74616 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index af96896e80b3f854462b66ef05c5d75877160ddc..aaf06d532f470e8008e321693b65b0a57e5c4861 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index deb7c926a7eea0ac21e23a02eb110c6889e2d081..1c1340c0f87c79b65d8e94f307a0d3d4dafc6b1b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 5f5d67fc68c2080bce97a0f35611f8146cd8e331..7208380d2195116acdf818a5a14d2a12bfc5c3de 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index f0434fac769db638c67ea11a4acbf3b7e6bea1b7..9dc8782c41cf455340ab916b8026b32be2acf472 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index e180367e98548aaa9a48f8492ef9b6acb2c0d099..4974b8ff0a6c95e4631f40477dd875a0ce65931e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 4a54ed85cb95bad43b0811161c191e08ac7b7901..a3af3e19d532de10722cd7807d117a8f128b95ae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index b2ee59cbee77617b1409e609d91dcc60fb3bb18f..30136172a13a898bf252e707f391cdd247805ca4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 8129d233772225ee2bde243634940c39764f75d1..ce3df76b1bb81319f51c0569e81aa56b0b3a3eb7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 75f1bbaaf99edd1fdccc2d64efa68ce2f970d8c7..1da494b522dddb827a63ca60195573e66dbcf0a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index df0e9635c64f56bfb5e464eb5407b3c5621c3bf6..2bcfcd95cff31c4b4ab9132ab822fad03695c8d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 608cc809baad7daa4bea2b92f04822ab805affdf..80b4c0a4b15b835e86d9334b175f5246599ab89e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index ec382b412d01270071f7c032910d3bfd70d75bb5..042d9c870debd6f6a39c3372732010450bce286a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index ca48ca578788f0e4b99da84662b375a2ba15729f..f0e1f03d0e48d1b42c19ba7c9511214bbb827888 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index f1a75923d14950554bc9307fc043b229723d4f2c..f877772ed2fc4bf6f254feb9b5a0503f91637816 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 5ffd304773fe988907f1fdce3a26a3737a8a0490..9136ae2f2f7b41f7819a13cb804cbd0417f8288a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 0c995eb6fa1b7813e0bf403fbb57f3b6e11aba59..ebef2a29d5d3e49778df95d3ed64650407a23ae0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 3d7c067fc8965e61a84c8163377b35466067fcf7..1d6303767d7d537bd75fc92c955a8b863ec6302c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 47c0ea64d0eea74804b075d6ffbc0d032ae80485..87f5ba40f240ef46bb8da48e90e73ab9e36b48ff 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index dfc589b4244a83d76c23da51ca9f1885eedbe9ba..cc39f25821239a056aac1a148a26dd6222fa766e 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 8e3d2140b80ee2e7ccfe42c0a90036c70d3fd31f..95005506ab56a6424a302ad0b65c7a5d75569f9c 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 0ca4887c74b75b565b20ffb1ccc6ed15b243f334..26bd9e3e3b597d5a194110361b8bca3c4627a93d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a08a138286f21a2e6a2757d1e08b0f13636d1d29..3fee5c3f9410f29eb672f89009d3ee33f3cd4783 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index ca5d7eece1a03b46a469841e02f2bc9afe25371e..7d6fdecaca6afdb9f7d9363f315aca4c45903c9e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 5cd1ce8d0528f10ec47b273642219aa96447d450..62481eafc84ea46a2e2aaf156b37365815dae951 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 3cfcee40c30c38ccf093904280a4399717d1276c..2a32c2ba3bd93bb6c719fcb9380cf6be7c461e7b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 90776521fdd0163762ffe9e1a9252400790d2220..60946b37692ec9db5502dc71445c342b065e2ee6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 79250959c5b21c52ceebcb74e7bc964f62181e5d..129cc8f5ba2cfd4df5ac811357c43635edea225a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 26c0aaa2093cc3b2ec8d66d95a12917e54d703c8..3b7d9b969a3f86e875f8986d7ea9437263553d3b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index e111e60cd78e834db583ac35c5213418eced4f3d..ff60956e7f8bb8b4d4b3206cac7beeda72a91787 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index d3f5e05824ec01815019f1c709dab235dff14e08..aacb4d14c99085743143ad3db1bc604ee691b75a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 36217ae9dded792cda0653376d0966c95df3db35..33dd117fd92a18ec9f2aded2df4152ce408de635 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 3b5c2e79ff89368cfe9f403daa3b8270cef59c5a..393990970201e8a64bacd77f9419d19d3059b1bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 2716bcedf236a7fc7e96d2286bc4944061b9d4cd..32cc891e2853af7254d96b94eb213f7e4140b4b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 5ec61fb7cbde11bcdcca26155625e098000c50e8..22b76eb384823242b20bdfb308af5f06dc4006f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 72685887f1427a9b8b1e988e62c3b0ff391a48f6..ad340a4d50f154f990c2135db751d1b68cd06472 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 053a05c31776b2451b9d04b16dafdd31fea38c56..891cb053a98acfeee6e474d859d9dad47abc7e8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index cb104de3883485ce41b39995008d9cd57afc9f66..44ce23f612c8d7b23b7c4f9d90935b759c5b26b9 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index d536496afa1c78a340992c17f7eb1d367046f192..6ee522c2370c9e277da58717139ba6fa85ace3d0 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index c53a93f68cf2fb4980b054f7e11cea1ec7608e85..f4858f9f7ffdd0b886e2e8d7efdcdf68dc52b555 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 44742f1220e95187879b300c9fa85301d73347e2..21b2eb7e1f0797830dae446380aeede1f4a8c898 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index d7023fd33a176c4367e707879ad6ce6d92600c05..aec4a84830622a5815de609574b9ad0154def658 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 0b93847e880b6057ad8c1546ff40c2c129dd6849..215b9ec35757e1d5fe556d38e6f0a59d447c768d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 7ac6e0dfadf619819c12ad9e8ee311f9b88ffdc0..5c854bd66171425165808e82e3916388b708b697 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 0fa9ce94b572862e4c50d592add6b2549b6c5614..8cafa21553a707f33c7a68c4f7e0fb1f1661e724 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 239991cf5c88e5344eef4b94caf492c9fc0d4b0f..9b413fe68c01af7860536564bbc37cb1a964f7d6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 7aeb8dcf53444056752231b2f4bbd23683d0ec54..a555931a289e524b47fac97eea5fd8afb8e9e932 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 08bf8b37cbff34781c0d59ee87c7052f0ff04d2b..20af2723d737fdb353bcd680bd95938b4ee04e52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index d349dbcd90bb841350cc46be88fc0fd3cad3a6aa..733e317ef42bbab9709babe332499579acebd41f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index ec2cd4d46102dabc818f377ed7a7a3a9c33de2b4..6c255ca524af0be1d0057cb6b0c6820f96a75840 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index b93a124589a08d6da49f57254ad5ebf8b5238acd..08ef5a5866b3607c07f397f3cc739df4ff77e6e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 643aed1e9d33dd376e3b9f60df6c9565bcdc61ca..71e757dd0f6cc81e7e807e653f623d9865019c88 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 617ca31edba7bad398c35fb090aff6b197e75c11..320f53ef143f7f6e83c8a326b0fb63f1970eebf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 59f6c93c02a8b37b8d561d601c8eaba9d60efbb3..3a7fb48728c0f087ac5aa65948482768ceaef5b4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 2b4ec8e28b3e3429e60bb8d04452d4c011d2475e..7e67092a164fc180b35f171e155fcea1d16dd37c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index bf7513ac61b9e8c1b3215f03e200eb3a3caf4416..c017e078e97b4b594faea0f94e68b2569237d56a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 474e7575256873e282299350f823184bdf90ad09..23a0f280316f295987f46cd2ac4088fe29c7ab31 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index cf5e4fd1e8e4949e77deb7fc82586ae4978005b4..85140ccfccacc17cdc70f97b53e782f8b69a1949 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index b3f25d9d2ebb182450c88f4e18d6b28b66b44b14..4426bb9375b76c669d75f313554566d9ae963689 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 8b0a6dd93b2c6dc3d9daa53ed2bb451cf053fb0f..4e59d60578fe6ad976af9f28369d4d71fe32c761 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 4a4d75ef4929d0fc238e63cb14e01bb370c30119..7fa1c5bf4e3225d4d3216b713af1e3fb801c1842 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index be8860d1422aa7d0de428c9b0a118e09a032310d..7d44421dad0737502e51c0a1965f8cb04e9ecac6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 276776e004082de8522751bdedd3d297889e613e..08fbaf536efc2f9791e05ab7bb5d0dc292d42f00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 9b9152eee99af8956a524c5fe8aef0ffe94b1604..c072f9ef5c518c4f5b19ca3071ec7a13d43d0437 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index e8b17350e2f2f72269e7e1c4a64af0134fe34939..a4ffb0ee875c8d87a4eb617991bd0f32f88eb993 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 25038631fad07d857c15f2d058f8b30417ac17c7..8b5e748a66056a80dcbf784a7ff6095b5843d96e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 12882917da90440616f499e4bb7529393df6ea03..c37481c7f5f1a338b59ff70cf8cb90ee9f0cfd19 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index bf5000880ff31c7d0b9c3500e205380c17324abc..8d0600eaca4c61c67adaafc9c03268654b6b644b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 60004363ce8067aeddca0507440f6154c9b97f1d..be462c91b67a3c46463b21753901959dae1adf15 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 7e8ac3c5403ab3b78ac5f964c44880f9babf49c1..d06413122d632259c4ba4ac9436c8381febdcd8e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index a607175033ad735cb849de5fb71a7149e8edbc2d..440c7e4fbaae8412096a56d2802651f743bcf310 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 2a0bde3aff0ef15c1d48d258acfd79a2d887c4da..9c68223e159beee85b6aa2c6598481b0d8cfbaea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 7f969660765a189a7ea64df8553d7f94420bc03e..5802eeb6a9ac737e2930734738373878f32044d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 50b9124caea6eec6ec1fe4c2e4add65606b9c156..591f6ff1926d102c414990d21f15010b58a5b0a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 62294146209d7915c14a3a9f3b16facd5c21772a..e9c617ca51eb504f283773c07852048b6d8e564b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index f9a3cfda2d845923979cf6b0ada72f1310c413ad..949decb7949c2fb843b2a092343c7b4a42e32c71 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index eb28094a9715127c014cdc01ac2dade75a36511f..7b4156fb813de8814859e9dd7cd93d0e66466765 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 56d5b777fc43c9d44f2a40fdc34295b98f39cbf4..2a7f2fc9f7df40b7fae7fecd8fecc6afec8e7159 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
  */
-#ifndef nb_kernel_sse4_1_double_h
-#define nb_kernel_sse4_1_double_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse4_1_double;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_sse4_1_double_size = sizeof(kernellist_sse4_1_double)/sizeof(kernellist_sse4_1_double[0]);
-
-#endif
index 49113b2ab6d81242a403f25e858fbf104de6a733..413731884191ccc165b24fa86ece4760848074e9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_sse4_1_double_h
 #define nb_kernel_sse4_1_double_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index c313e80fedd6bf54f378a61aef4f9c8aacdee5f3..70671c7a615e1fb116641fe8313326dd7643ff11 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_double.h"
 #include "kernelutil_x86_sse4_1_double.h"
index 45f2a7b5f250852048835f8d278d10d1326ecf0a..7028cef224036fb9503a4f664d324f69ae0fbd1e 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _kernelutil_x86_sse4_1_single_h_
 #define _kernelutil_x86_sse4_1_single_h_
 
+#include "config.h"
+
 #include <math.h>
 
 #undef gmx_restrict
index 450d40e9f8bba956743cc9c1f7443c4a12d5d229..a376f9c23779eff5d812faac453750efa395d3e7 100755 (executable)
@@ -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')
+FileHeader = create_copyright_header('2012,2013,2014')
 FileHeader += """/*
  * Note: this file was generated by the GROMACS """+Arch+""" kernel generator.
  */
@@ -428,8 +428,7 @@ numKernels = 0
 
 fpdecl = open('nb_kernel_' + Arch + '.c','w')
 fpdecl.write( FileHeader )
-fpdecl.write( '#ifndef nb_kernel_' + Arch + '_h\n' )
-fpdecl.write( '#define nb_kernel_' + Arch + '_h\n\n' )
+fpdecl.write( '#include "gmxpre.h"\n\n' )
 fpdecl.write( '#include "../nb_kernel.h"\n\n' )
 
 for KernelElec in ElectrostaticsList:
@@ -512,6 +511,5 @@ for decl in kerneldecl[0:-1]:
 fpdecl.write( kerneldecl[-1] + '\n' )
 fpdecl.write( '};\n\n' )
 fpdecl.write( 'int\n' )
-fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n\n')
-fpdecl.write( '#endif\n')
+fpdecl.write( '    kernellist_'+Arch+'_size = sizeof(kernellist_'+Arch+')/sizeof(kernellist_'+Arch+'[0]);\n')
 fpdecl.close()
index 0dde89400676c8b4c6d678b15648e8083d9d7655..43765245bda42d168c15083b45ede0ce7aa5dcfc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 9f05188548f4e6a6b909d508e1454c34a2498818..b8e72a607e4d7f49125b2432b0282a9d6572bc23 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 50b4b59710e6e8d596fbca4ac3c036aa7a402c66..b2e6ccde64a1020a90597b5291143e9e82fedc28 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5f135877fed6a0c2dbae9a1ee4a815ce02ccc433..e07f8fcba807247727d645d2df21b1a3ddae366a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 08114a675fc07cc53c2a0b83a2c69c46050caac7..ce7eb9f3ad1b68043b6d34ce70594f53b158b4dd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index f62a1ea1671ce76eb108206325878635d0a882da..6cc9759e422c2635d910d8782d75e8108bae5b53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d5b89f9efe9f400b87fd2574f46ea42f276d2a4b..6400ff6bc2f9dc890a9f61f2fd69d2c0ff92e832 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 3b0f1465aa8e53ea2e0f0b661477827eef6d10da..aa399e71044603b9e15c7952f8a18cc9caf25856 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 34e25c2a4fad779a820ebf16afa9541854f83e44..8ad52029ce7e1694cf55aea13715c32ab6420a54 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 995467b6a2389dd13a0352f18fcb111fc6d58232..9f3b5d7b207e1e059331184eeb11aaa1c01b1a00 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 015bbf03eb621c934b6b56da9c230bd8ba485ca5..2ee9b98a3f2a4413e119d202a4de34f83c27049c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d5d81656a5724981fd7de4c155ab0a51f951de4c..cc047944de188c9d7678abc1a99d540a5aa7790e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 769c16b42e7fb4952f26a6783f44e6d625ed7c36..2b86508706dceeee3a7fc273b0fe9725d75b6826 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 2786360113258badc68526e29734f912af1bec65..3ffda8d358592b28aa6cc1a483f9a9b9317ecd9d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index ba96babbf56ab4ce5aec310a332194ea4e7f73a0..f85dfcb91c7aa1042c904ef099ba0b2b46ee3d3d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d8c401dc51ff6f5f362a038889ac6f83ad736bec..5e2ae641c168a8fd8aaf7503b5e4223260f62e27 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d37127e7fea131f12ad500ef2dedd2a524c2a567..a90fd1e0d3e9f7f1d6769a01872eddf95605f744 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index cce787ac64bae59ee804e9d1898516b9b3112c22..a247f55e12a0c092958538fdec7e633d449d4c59 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index cfa9c23cc3e7aac7acc9ed6f1d3180532cb67798..d6d0f12b5eb14a9ac4aad7216574f6735df46f67 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 7fbfd65bff6d530bd7707ae31cb5f25c07321e01..8b28dc20f39318804679b5d0fd24ee1ccdaccb52 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b947708b59c0e3defe24d2a53783e254006810ad..b1f0d5aa609ae9bda75f94dadf9c6f6a91ec1fba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index a2882b798f43c905c11e54c6dbdae100b57cfd91..6034d6537f8a46ee67aa9df63070fbee8e25e384 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 385ae34ed61e8e6b6e2e18644615af7341cbcad9..f5722d0feaaeda6c7f2e8b65a04c9549f626c745 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c9035c010d5d50a4005303ca21fc8131388244a3..04997ef4d865ccf1af0626d9aec42f47f0869a91 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5f8b4b6ad559fa64c837bf100b654cac45d1242b..db8b18bfd7c4bb1d0f6be45b4e2e408ceba3692c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index ca8227218a75f0f4c1f06cf9d5de9a362ba35c88..74dc97d9da5732e1c1e57730644449b41ef84ad6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b49dc64faa47f114f7a439eea64d88e02a0c8b80..41427b72662b32bd8fe4e0ad262a03418999181d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index dbf099afe6a9e4c3eba82abf2acad1d096fa321b..ccc1b2a87c06e18c326f704dc820f862f4548460 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d42357763522bb77746779a4150765f547c6a9c4..0f7044f547b9275d0c4aa9665d7bebfba41082ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 329319b26d9dc3de8aaa973365f6b86bcf403506..ef9734ff0c39eebe71d3de16b45c2c3f36696b42 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 8e94d9c143e5a7e0072eb8995a79e917c5e68ec1..24d2053360207ba78c40ba4a79f465fc29e81234 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 0aaae2811adb5a2b3fc370df92c6aa5e6e489b15..e463cc6901a9206b7cc87a0a26a42baa38dbecf0 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 31ed9d2dcf8a9e12a12f9ab8dca0b90b300f9c9a..dfb43c5a6778b695d6d32c7468e4e4554c50a2ca 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 74230d5c8645d0c50499a0c9a48ffac355087493..3221f6515af45b7c5ee1acb623289a0b212d114d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 15806e7f6a10cc4bba7cc1222e40396d875879c8..12b30a204822583181635776747c58c57988fdc6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 801879aba94881dbaaadf5f939760188fd6b060b..0c6d97b53cf0f4e4ed1cfc9fbdc38a05a77de885 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index ac1f8e49273c0ac77aad7f19a062d864b1920a94..de65927f91cef4a86c89d3973ab10721235c17a9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 1d6fb501a4bec88277af2c781e92415d3526e5c3..4ff84568ad3a434a251351e8368df1e1e9454073 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index a37706ccf07c3bdd70ba697bb582507ed73b1134..e1c15f338a05916cc45459e484a90dc857e8760e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index a9ab3eb4db420f6971c8ba9ebf2561cb4a92bd76..5287d17b7c097ff361424e0e220b00d32b36306f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 0e3e1c05682d7a7845c23e5884e9e7034594efed..0fadfe61d01a5f5b9fe315ff383184e77576746f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b1b4be725558a5b14cfa5b941955808c6857fd92..fcff5a021d70206a82aabe3b82b84d3127a01fe4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b7ff2dbe4093c8b08025d5ddf7f541b4291f013f..945094263e486591e7b2467199a18ff80d721bfd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d2a5248769d6d317f9ea22c4fcfff2a73ffd0b76..fec8538685c0337d3426b9281defecebea210fda 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 8f998843a95a6fe499e33d5578bb30473a401f28..4e4c8987054d7b8f1191e210763d1c233e35cec0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c88b7ece2419537793d51ac8f8fa030d6dc3fffc..153f2b464e10ac6606bfcd48b8da0b049cec9321 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 744845b6069256ccd04f1ef916f1afc18ff8a2da..7bd49464253fc57f6c11894cc1b8c9079f6481b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 866d10ec17e45582aebdca2101c07feca8dfe60a..f35fac4be1e67a9960782c2e38d76c38b6782467 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5c16ed677dee1d465636d46f30c2d4f700204eec..813563ff3d870614b98d5c50b761a28ff56e9cc7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 02be6a2d119d3e41c8420c7a09c87213f66def58..715ba6181392e27d31a6b47338025d7dee5a888d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 784e4012383240b7a6553303f0d98650528afd3c..2bb60ec4991f4b998a553c91fecaef609769ef1c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 3ffa38a33ec7225b90a394d65ae31ae7415d39cc..18e77c8f0da9456055a4ebf521ca726719dd8e50 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b94c40468b64b669b6b93ee7faecaaf679242d8c..20985718c1d9cb35f846332c49454d674c8802b6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index ecc4fa986dc6b4f57a9f1047c9c766aa64df11d7..e721b74a5239a20bd87f45b3d04f6a1a0a5c567d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c095e1f523e113f6f8a8a970babb0adef24afa71..7e1bb0501e8b3703c6fff2be64be6b7669402878 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d48932a96084cc051b20ce734e92076d01995f0e..b50f08da8d340fe7fe8535e5592ac264825180ed 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 469cb62ada4d92c35c8fece8ddddd1d8d5f5612b..1ff9d9ecba1bc901a2dcf6cb5968f919e5f70af2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 4c721af4447510e192f3cee0cf9cc7c4f7f5aedc..33ab639938932e97aeb08a7013002d17a5551286 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index f2553a88bf92b64bbb30d6358fcab453b5fa7d8c..5785d3e9dc0355b52d169532b0089f10ba235f99 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 66ae09b2044e1895fdcc36ee16cf6d4ad08e1d1e..11e5baeb95b2352620414407e213848253b0b9b2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 8aff4f14ce8608a4c4da348154d54a61136c2881..a826217890de652d22f3b631d273f66478e93bc1 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 7f718d372b1b021c2fe7c91ae21b8d7c293e3d0f..45ec13c2ad1a19319b942b6ac998ffc99b8e75b7 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 1d9b2b386d3837d230e7891f5665b8df3e5d18ca..bc43a5c59086897fe5a8d0cf2181f9cd6b5eeb9d 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c160cde1df3db229a3c439beb2dd69e9f61c4c0c..8ef3ba8ff1730291dc50270cdac5d5d256c5244b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 8ba0d492c217000a6f269b42eff7435ecdd97bfe..76feb5f4d3231ce71e4bf961837bf1b6a30d3095 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 17715797e9cc7d83822bb812fdd2af2bd1df2536..8908bcbbebacef2fc508b714202f486e4e9ba666 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index e7358692f36cd6f93b8c69bb4d41de5afe9ef4a4..6a7d818e662f9a9a22e548f61e3adee7ef25ef86 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 0b711d18126873c90c0f2ae23b80120eabec06ca..4d2a3285f9d63a42602df990675577a09ea86e20 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 9d3bf4bbda35abbe4e06b1bb840b2dbad9a2b94a..730983f728444cae6ef463c6d1a11c3cf85465f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 126227ec07c57cf174f233d48677c5a835b0783a..d98e86cbe015ca7d9d2de585ad4b660ec0bf0118 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 09b2c8a189e9d52328cad33a451fe1840b08d555..efc3398f80f9b0510acda58e6ed83b9f531ca264 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 1080c7293bddf4b668aea779060a531f7d207066..172cfc0321a518ae4c65cbd701914c7137479a58 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5792169ef20804db42410960d630605163bb43ec..965229819e47c6b8311b95fb5979fd15b2e9619a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 72aed21c73f23874604b9d106fee836bc9b7f672..55e4dd3d894cd09284f35239b59bb21e926e3129 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 484b96077f3b513f2e3d7574587b70129c56b100..eddf312fc73436ef01dd25d23bcdb67d05ca3a57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index e1d94c6e3dc7e2544af29cdb63e87a293ec83e0a..9874ad9f373299adebcf65fa90194bb2e6148db6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index e561c4030ce4947a62bb47a0af686fea1423cf05..9ca39e2379df16ad02def41edd8fceabeca019e0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 6728516156e07354304d07b0f2494f4ed9214208..c59b96e8311e878cf1e6d7a34adece9a52901160 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b8e6ed800dd1d5e7355cffe7a496a16c98897ec8..c7966d162af0ab3208a6524f2600252c5ae1556c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5fea3001709e647442fa9d5943ef4be8c36711d8..e08da92bcbe0ed4fa52b957e19b1f797d2135d6b 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 43f1be9b1336953139a9b5a338f5532c1bf7ab79..0eb824011301de61f9afbe3bdcfcec7b3a3c07de 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 399a19a3947d6a5907f3b043e6db3bebc8befc77..e6e3d620481050fb10d2d24563b336d7eac0e4b2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d9679e6edfa7f10be768c5d1eea39f377e3b7d03..79ae8ae6877e4800aaf1cd7288a28e71392c84f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 2eb4848df2fe403218b4c4b820dc7fbad4b0c7f3..f817b106ce2350a55ba4a3724d3a692565196d9b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 1afebfa039f8d4ece451def9588ef53bbac9f507..b22eeaa5f9c8395e91907e11a3fac86d9ce5b4e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c2cc9e790ee5f10d339a6469489a4ba3a4824dae..6bd167aeb88fa46ac8872b36edd856f5c1bccf7d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index f2279e463521a60e36e162f1a619805826bc5439..ee8d0db230867c98f1fb06bd4c2707d1f5f1baea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 2b69fbdc0556ee1ab7e631eec31013886892ea1c..d8412ae8a02dca9f2e251026689b9304f02d03b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 209e44ba3477bee799688ddcdd77c560ccbd4d3c..03f57d3fc8a8c631ba1a6beb327e95212660f662 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5691ea3e900e0eb90e33d1fba5e6d447a3f90406..d461b8fe6db31e1a7d1fdfaf76a69b3a67b857b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index da4566ac2b4a02b92dec6c8970679bc7e5791926..cf2aa83797704d41bd007d75cffcc742fa9de75f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index bc8e2cd684a9c4fc6c659be2b97503d96e61586e..70427d9a6ced0a4de5b3f89734ab8e785eaf4fc5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d13e71f27d2d2d83ba5eaf81f736737c99ee0d5d..b03544fb23e46dc24c19bb0781d384df5829940a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 826a2f7af37149019f9e793a332294eccd350296..1b3fae491f8af6958a2e9ad4910f88770b2c9d5c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index fdd483a74bb70e18bdcf05651016b6c4455b23a6..c13d51e0189b31103d7538554cfcac56a9fa48bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 1da9228cbc715f690405485a5c38a4e5883d110c..ec6752defb148621080e88312cfbd94675c02af0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 4766c854850b14f90872935f77e5cbd34c519319..108e9a6db6836247def6690879cf8c20336a6200 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c1fed33908f458514bd98c80765beace4bf47f4e..d1650146ca57211d9318daa67dd49ba37d700043 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b074dbbf266649788f60f9567727450088495e38..3ee4362aa1e28abc334af4acda38046cceec6449 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 6a48bd4057d742a06798ead15724167fb87cd3df..73ca6d784fc8d4f6a2bfc0fe832363e26bcd42a7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index bb2af8fa65ca7287888deeee6359f4005ec3dc4d..c058a2416dd82c67eb779cf34c64eca947760bdb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index bb5881f7841bab95c140741d69919b6dad79d5ff..9f0a7da559bc69a2738dfa875367f0612a51650c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 36b90fc188a9122f672728ebd1e6d9d6fff73e57..ea92b80ef73822e3ca8e1abb40454cd561e1cfe0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index be4854fdb54ce858a8e15b3400259412359fe82d..f7d36faf8c1da20b8dede00cfa5a3b30a45948a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d1c8726f0402d1b408d095bc4526d569580c9192..3cf7e6f05d01efde30b80bef9460a208b4b4b31e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d420c1bbbecf0332221118d5b12e21d994137f91..74a95ef306ac50668970776d566c7e6ab5de37c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5291a56ecfb0e269ad1617f3c8b230d47ca2d424..2d476057ba728b57f61a0735a8bde3fdee14e907 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index c39998025ba1829d6581c4f246f2e9e6bd3a7c74..b280db2beb628a6c018be181f06de519427dda6c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 6797d52fc85727b1fec085dbfbfced7f3f80754d..fb494e02990351d3fcda12ea6cbcc7b72488dbae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 5f9bf92fc29188b5dc5ca338d50beb3679c4e7f6..99cf0847bb80815ed74956bd277a811d61b02ac9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index b423463176b464f87f28552463f4cd2ef4858ba8..ade73613a32556ce2a6816a6db79625f3eafb8a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 4e196decd5744a873dbecea8a0e24d7be515aacf..1a82b3244ac2d3b315f6ad37c50a28723ec71439 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index d1618c5506ef15f02b67d4b40fa96d4cefac8b6a..a693a9670f1457aa5f7d3f328559e90c6e811b73 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 8fd701195ecc26d547debf11853add6858be1cde..d53c11fb4d3201c0cd53efb389cf704492c67df6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 31b42d4e676f0a54db1802c20d2e326a1d9e3935..69eff6bd67bbe18dc3810a4f705deedc03069398 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index ec8d44bd684ed53125773264ad95aff618e4978b..d8f13947f9bfdb47eebf65d10d2380f2724f9c5e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 8b45d77ddd9c47d8322cc449d34e7fd0ad452434..54bcbc6f80d00faa242777f671277f4723ef0552 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 9d629b5e09be72c9b7fd0d5a65435956f821a3d3..48abc0115bcaa0141b3b086d08216f1856de56be 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 232ec1debe63611fdf6a8f5b8a51293efa2d2618..15b9c682f06c255cf0b06245d79d71c104d8e5da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index 811107d564bd277abd218edbc448167cecf6728a..79546e1b1b3f59c015621894bd70de59711012a6 100644 (file)
 /*
  * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
  */
-#ifndef nb_kernel_sse4_1_single_h
-#define nb_kernel_sse4_1_single_h
+#include "gmxpre.h"
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJEw_GeomP1P1_F_sse4_1_single;
@@ -525,5 +524,3 @@ nb_kernel_info_t
 
 int
     kernellist_sse4_1_single_size = sizeof(kernellist_sse4_1_single)/sizeof(kernellist_sse4_1_single[0]);
-
-#endif
index c70ec17440fd8cd625f275d69b7b506b6407885e..22160f86a2cc935251f5414f1692c656478d7a0b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef nb_kernel_sse4_1_single_h
 #define nb_kernel_sse4_1_single_h
 
-#include "../nb_kernel.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
 
 
 /* List of kernels for this architecture with metadata about them */
index 669739d531f191a7c4a2cd1ce05c92d81a5f79cf..b055fa9a6f93e37fcbb5786dbec63cceee12b935 100644 (file)
 #error This file must be processed with the Gromacs pre-preprocessor
 /* #endif */
 /* #if INCLUDE_HEADER */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 #include "../nb_kernel.h"
-#include "types/simple.h"
-#include "vec.h"
-#include "nrnb.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/nrnb.h"
 
 #include "gromacs/simd/math_x86_sse4_1_single.h"
 #include "kernelutil_x86_sse4_1_single.h"
index ab68c47db00a6c05a02e531cb77075475fa546a9..f66f73bb0fcf32f30684a179a9bbbef92e39286d 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/nonbonded.h"
+
+#include "config.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "thread_mpi/threads.h"
 
-#include "typedefs.h"
-#include "txtdump.h"
-#include "gromacs/utility/smalloc.h"
-#include "ns.h"
-#include "vec.h"
+#include "gromacs/gmxlib/nonbonded/nb_free_energy.h"
+#include "gromacs/gmxlib/nonbonded/nb_generic.h"
+#include "gromacs/gmxlib/nonbonded/nb_generic_adress.h"
+#include "gromacs/gmxlib/nonbonded/nb_generic_cg.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/listed-forces/bonded.h"
 #include "gromacs/math/utilities.h"
-#include "macros.h"
-#include "gromacs/utility/cstringutil.h"
-#include "force.h"
-#include "names.h"
-#include "main.h"
-#include "xvgr.h"
-#include "gmx_fatal.h"
-#include "physics.h"
-#include "force.h"
-#include "bondf.h"
-#include "nrnb.h"
-#include "nonbonded.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/simd/simd.h"
-
-#include "nb_kernel.h"
-#include "nb_free_energy.h"
-#include "nb_generic.h"
-#include "nb_generic_cg.h"
-#include "nb_generic_adress.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* Different default (c) and SIMD instructions interaction-specific kernels */
-#include "nb_kernel_c/nb_kernel_c.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_c.h"
 
 #if (defined GMX_SIMD_X86_SSE2) && !(defined GMX_DOUBLE)
-#    include "nb_kernel_sse2_single/nb_kernel_sse2_single.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_sse2_single.h"
 #endif
 #if (defined GMX_SIMD_X86_SSE4_1) && !(defined GMX_DOUBLE)
-#    include "nb_kernel_sse4_1_single/nb_kernel_sse4_1_single.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_sse4_1_single.h"
 #endif
 #if (defined GMX_SIMD_X86_AVX_128_FMA) && !(defined GMX_DOUBLE)
-#    include "nb_kernel_avx_128_fma_single/nb_kernel_avx_128_fma_single.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_avx_128_fma_single.h"
 #endif
 #if (defined GMX_SIMD_X86_AVX_256_OR_HIGHER) && !(defined GMX_DOUBLE)
-#    include "nb_kernel_avx_256_single/nb_kernel_avx_256_single.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_avx_256_single.h"
 #endif
 #if (defined GMX_SIMD_X86_SSE2 && defined GMX_DOUBLE)
-#    include "nb_kernel_sse2_double/nb_kernel_sse2_double.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_sse2_double.h"
 #endif
 #if (defined GMX_SIMD_X86_SSE4_1 && defined GMX_DOUBLE)
-#    include "nb_kernel_sse4_1_double/nb_kernel_sse4_1_double.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_sse4_1_double.h"
 #endif
 #if (defined GMX_SIMD_X86_AVX_128_FMA && defined GMX_DOUBLE)
-#    include "nb_kernel_avx_128_fma_double/nb_kernel_avx_128_fma_double.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_avx_128_fma_double.h"
 #endif
 #if (defined GMX_SIMD_X86_AVX_256_OR_HIGHER && defined GMX_DOUBLE)
-#    include "nb_kernel_avx_256_double/nb_kernel_avx_256_double.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_avx_256_double.h"
 #endif
 #if (defined GMX_SIMD_SPARC64_HPC_ACE && defined GMX_DOUBLE)
-#    include "nb_kernel_sparc64_hpc_ace_double/nb_kernel_sparc64_hpc_ace_double.h"
+#    include "gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_sparc64_hpc_ace_double.h"
 #endif
 
 
@@ -396,7 +395,7 @@ void do_nonbonded(t_forcerec *fr,
                 nlist = nblists->nlist_sr;
                 f                                   = f_shortrange;
             }
-            else if (range == 1)
+            else
             {
                 /* Long-range */
                 if (!(flags & GMX_NONBONDED_DO_LR))
@@ -444,264 +443,3 @@ void do_nonbonded(t_forcerec *fr,
         }
     }
 }
-
-static void
-nb_listed_warning_rlimit(const rvec *x, int ai, int aj, int * global_atom_index, real r, real rlimit)
-{
-    gmx_warning("Listed nonbonded interaction between particles %d and %d\n"
-                "at distance %.3f which is larger than the table limit %.3f nm.\n\n"
-                "This is likely either a 1,4 interaction, or a listed interaction inside\n"
-                "a smaller molecule you are decoupling during a free energy calculation.\n"
-                "Since interactions at distances beyond the table cannot be computed,\n"
-                "they are skipped until they are inside the table limit again. You will\n"
-                "only see this message once, even if it occurs for several interactions.\n\n"
-                "IMPORTANT: This should not happen in a stable simulation, so there is\n"
-                "probably something wrong with your system. Only change the table-extension\n"
-                "distance in the mdp file if you are really sure that is the reason.\n",
-                glatnr(global_atom_index, ai), glatnr(global_atom_index, aj), r, rlimit);
-
-    if (debug)
-    {
-        fprintf(debug,
-                "%8f %8f %8f\n%8f %8f %8f\n1-4 (%d,%d) interaction not within cut-off! r=%g. Ignored\n",
-                x[ai][XX], x[ai][YY], x[ai][ZZ], x[aj][XX], x[aj][YY], x[aj][ZZ],
-                glatnr(global_atom_index, ai), glatnr(global_atom_index, aj), r);
-    }
-}
-
-
-
-/* This might logically belong better in the nb_generic.c module, but it is only
- * used in do_nonbonded_listed(), and we want it to be inlined there to avoid an
- * extra functional call for every single pair listed in the topology.
- */
-static real
-nb_evaluate_single(real r2, real tabscale, real *vftab,
-                   real qq, real c6, real c12, real *velec, real *vvdw)
-{
-    real       rinv, r, rtab, eps, eps2, Y, F, Geps, Heps2, Fp, VVe, FFe, VVd, FFd, VVr, FFr, fscal;
-    int        ntab;
-
-    /* Do the tabulated interactions - first table lookup */
-    rinv             = gmx_invsqrt(r2);
-    r                = r2*rinv;
-    rtab             = r*tabscale;
-    ntab             = rtab;
-    eps              = rtab-ntab;
-    eps2             = eps*eps;
-    ntab             = 12*ntab;
-    /* Electrostatics */
-    Y                = vftab[ntab];
-    F                = vftab[ntab+1];
-    Geps             = eps*vftab[ntab+2];
-    Heps2            = eps2*vftab[ntab+3];
-    Fp               = F+Geps+Heps2;
-    VVe              = Y+eps*Fp;
-    FFe              = Fp+Geps+2.0*Heps2;
-    /* Dispersion */
-    Y                = vftab[ntab+4];
-    F                = vftab[ntab+5];
-    Geps             = eps*vftab[ntab+6];
-    Heps2            = eps2*vftab[ntab+7];
-    Fp               = F+Geps+Heps2;
-    VVd              = Y+eps*Fp;
-    FFd              = Fp+Geps+2.0*Heps2;
-    /* Repulsion */
-    Y                = vftab[ntab+8];
-    F                = vftab[ntab+9];
-    Geps             = eps*vftab[ntab+10];
-    Heps2            = eps2*vftab[ntab+11];
-    Fp               = F+Geps+Heps2;
-    VVr              = Y+eps*Fp;
-    FFr              = Fp+Geps+2.0*Heps2;
-
-    *velec           = qq*VVe;
-    *vvdw            = c6*VVd+c12*VVr;
-
-    fscal            = -(qq*FFe+c6*FFd+c12*FFr)*tabscale*rinv;
-
-    return fscal;
-}
-
-
-real
-do_nonbonded_listed(int ftype, int nbonds,
-                    const t_iatom iatoms[], const t_iparams iparams[],
-                    const rvec x[], rvec f[], rvec fshift[],
-                    const t_pbc *pbc, const t_graph *g,
-                    real *lambda, real *dvdl,
-                    const t_mdatoms *md,
-                    const t_forcerec *fr, gmx_grppairener_t *grppener,
-                    int *global_atom_index)
-{
-    int              ielec, ivdw;
-    real             qq, c6, c12;
-    rvec             dx;
-    ivec             dt;
-    int              i, j, itype, ai, aj, gid;
-    int              fshift_index;
-    real             r2, rinv;
-    real             fscal, velec, vvdw;
-    real *           energygrp_elec;
-    real *           energygrp_vdw;
-    static gmx_bool  warned_rlimit = FALSE;
-    /* Free energy stuff */
-    gmx_bool         bFreeEnergy;
-    real             LFC[2], LFV[2], DLF[2], lfac_coul[2], lfac_vdw[2], dlfac_coul[2], dlfac_vdw[2];
-    real             qqB, c6B, c12B, sigma2_def, sigma2_min;
-
-
-    switch (ftype)
-    {
-        case F_LJ14:
-        case F_LJC14_Q:
-            energygrp_elec = grppener->ener[egCOUL14];
-            energygrp_vdw  = grppener->ener[egLJ14];
-            break;
-        case F_LJC_PAIRS_NB:
-            energygrp_elec = grppener->ener[egCOULSR];
-            energygrp_vdw  = grppener->ener[egLJSR];
-            break;
-        default:
-            energygrp_elec = NULL; /* Keep compiler happy */
-            energygrp_vdw  = NULL; /* Keep compiler happy */
-            gmx_fatal(FARGS, "Unknown function type %d in do_nonbonded14", ftype);
-            break;
-    }
-
-    if (fr->efep != efepNO)
-    {
-        /* Lambda factor for state A=1-lambda and B=lambda */
-        LFC[0] = 1.0 - lambda[efptCOUL];
-        LFV[0] = 1.0 - lambda[efptVDW];
-        LFC[1] = lambda[efptCOUL];
-        LFV[1] = lambda[efptVDW];
-
-        /*derivative of the lambda factor for state A and B */
-        DLF[0] = -1;
-        DLF[1] = 1;
-
-        /* precalculate */
-        sigma2_def = pow(fr->sc_sigma6_def, 1.0/3.0);
-        sigma2_min = pow(fr->sc_sigma6_min, 1.0/3.0);
-
-        for (i = 0; i < 2; i++)
-        {
-            lfac_coul[i]  = (fr->sc_power == 2 ? (1-LFC[i])*(1-LFC[i]) : (1-LFC[i]));
-            dlfac_coul[i] = DLF[i]*fr->sc_power/fr->sc_r_power*(fr->sc_power == 2 ? (1-LFC[i]) : 1);
-            lfac_vdw[i]   = (fr->sc_power == 2 ? (1-LFV[i])*(1-LFV[i]) : (1-LFV[i]));
-            dlfac_vdw[i]  = DLF[i]*fr->sc_power/fr->sc_r_power*(fr->sc_power == 2 ? (1-LFV[i]) : 1);
-        }
-    }
-    else
-    {
-        sigma2_min = sigma2_def = 0;
-    }
-
-    bFreeEnergy = FALSE;
-    for (i = 0; (i < nbonds); )
-    {
-        itype = iatoms[i++];
-        ai    = iatoms[i++];
-        aj    = iatoms[i++];
-        gid   = GID(md->cENER[ai], md->cENER[aj], md->nenergrp);
-
-        /* Get parameters */
-        switch (ftype)
-        {
-            case F_LJ14:
-                bFreeEnergy =
-                    (fr->efep != efepNO &&
-                     ((md->nPerturbed && (md->bPerturbed[ai] || md->bPerturbed[aj])) ||
-                      iparams[itype].lj14.c6A != iparams[itype].lj14.c6B ||
-                      iparams[itype].lj14.c12A != iparams[itype].lj14.c12B));
-                qq               = md->chargeA[ai]*md->chargeA[aj]*fr->epsfac*fr->fudgeQQ;
-                c6               = iparams[itype].lj14.c6A;
-                c12              = iparams[itype].lj14.c12A;
-                break;
-            case F_LJC14_Q:
-                qq               = iparams[itype].ljc14.qi*iparams[itype].ljc14.qj*fr->epsfac*iparams[itype].ljc14.fqq;
-                c6               = iparams[itype].ljc14.c6;
-                c12              = iparams[itype].ljc14.c12;
-                break;
-            case F_LJC_PAIRS_NB:
-                qq               = iparams[itype].ljcnb.qi*iparams[itype].ljcnb.qj*fr->epsfac;
-                c6               = iparams[itype].ljcnb.c6;
-                c12              = iparams[itype].ljcnb.c12;
-                break;
-            default:
-                /* Cannot happen since we called gmx_fatal() above in this case */
-                qq = c6 = c12 = 0; /* Keep compiler happy */
-                break;
-        }
-
-        /* To save flops in the optimized kernels, c6/c12 have 6.0/12.0 derivative prefactors
-         * included in the general nfbp array now. This means the tables are scaled down by the
-         * same factor, so when we use the original c6/c12 parameters from iparams[] they must
-         * be scaled up.
-         */
-        c6  *= 6.0;
-        c12 *= 12.0;
-
-        /* Do we need to apply full periodic boundary conditions? */
-        if (fr->bMolPBC == TRUE)
-        {
-            fshift_index = pbc_dx_aiuc(pbc, x[ai], x[aj], dx);
-        }
-        else
-        {
-            fshift_index = CENTRAL;
-            rvec_sub(x[ai], x[aj], dx);
-        }
-        r2           = norm2(dx);
-
-        if (r2 >= fr->tab14.r*fr->tab14.r)
-        {
-            if (warned_rlimit == FALSE)
-            {
-                nb_listed_warning_rlimit(x, ai, aj, global_atom_index, sqrt(r2), fr->tab14.r);
-                warned_rlimit = TRUE;
-            }
-            continue;
-        }
-
-        if (bFreeEnergy)
-        {
-            /* Currently free energy is only supported for F_LJ14, so no need to check for that if we got here */
-            qqB              = md->chargeB[ai]*md->chargeB[aj]*fr->epsfac*fr->fudgeQQ;
-            c6B              = iparams[itype].lj14.c6B*6.0;
-            c12B             = iparams[itype].lj14.c12B*12.0;
-
-            fscal            = nb_free_energy_evaluate_single(r2, fr->sc_r_power, fr->sc_alphacoul, fr->sc_alphavdw,
-                                                              fr->tab14.scale, fr->tab14.data, qq, c6, c12, qqB, c6B, c12B,
-                                                              LFC, LFV, DLF, lfac_coul, lfac_vdw, dlfac_coul, dlfac_vdw,
-                                                              fr->sc_sigma6_def, fr->sc_sigma6_min, sigma2_def, sigma2_min, &velec, &vvdw, dvdl);
-        }
-        else
-        {
-            /* Evaluate tabulated interaction without free energy */
-            fscal            = nb_evaluate_single(r2, fr->tab14.scale, fr->tab14.data, qq, c6, c12, &velec, &vvdw);
-        }
-
-        energygrp_elec[gid]  += velec;
-        energygrp_vdw[gid]   += vvdw;
-        svmul(fscal, dx, dx);
-
-        /* Add the forces */
-        rvec_inc(f[ai], dx);
-        rvec_dec(f[aj], dx);
-
-        if (g)
-        {
-            /* Correct the shift forces using the graph */
-            ivec_sub(SHIFT_IVEC(g, ai), SHIFT_IVEC(g, aj), dt);
-            fshift_index = IVEC2IS(dt);
-        }
-        if (fshift_index != CENTRAL)
-        {
-            rvec_inc(fshift[fshift_index], dx);
-            rvec_dec(fshift[CENTRAL], dx);
-        }
-    }
-    return 0.0;
-}
index 4df2fb9f792606272fb2a03367a3561a0073b7cc..2a0f677a2d8bc2dddf95b1636acdfe74a39b8b36 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/nrnb.h"
 
+#include <stdlib.h>
 #include <string.h>
-#include "types/commrec.h"
-#include "sysstuff.h"
-#include "names.h"
-#include "macros.h"
-#include "nrnb.h"
-#include "main.h"
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
@@ -438,10 +437,10 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
 }
 
 void print_perf(FILE *out, double time_per_thread, double time_per_node,
-                gmx_int64_t nsteps, real delta_t,
+                gmx_int64_t nsteps, double delta_t,
                 double nbfs, double mflop)
 {
-    real wallclocktime;
+    double wallclocktime;
 
     fprintf(out, "\n");
 
index 01eda5251e052252720b8f6c50a5dea05c5a4e8a..89201b8064ae4e746c653177bcae8a4781eb436b 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.
  */
-#include "oenv.h"
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/legacyheaders/oenv.h"
 
-#include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
 
 struct output_env
 {
@@ -50,7 +51,6 @@ struct output_env
         view        = FALSE;
         xvg_format  = exvgNONE;
         verbosity   = 0;
-        debug_level = 0;
     }
 
     const gmx::ProgramContextInterface  &programContext;
@@ -63,8 +63,6 @@ struct output_env
     xvg_format_t                         xvg_format;
     /* The level of verbosity for this program */
     int                                  verbosity;
-    /* the debug level */
-    int                                  debug_level;
 };
 
 /* The source code in this file should be thread-safe.
@@ -95,7 +93,7 @@ static const char *time_units_xvgr[] = {
 void output_env_init(output_env_t *oenvp,
                      const gmx::ProgramContextInterface &context,
                      time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
-                     int verbosity, int debug_level)
+                     int verbosity)
 {
     try
     {
@@ -105,7 +103,6 @@ void output_env_init(output_env_t *oenvp,
         oenv->view        = view;
         oenv->xvg_format  = xvg_format;
         oenv->verbosity   = verbosity;
-        oenv->debug_level = debug_level;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 }
@@ -131,11 +128,6 @@ int output_env_get_verbosity(const output_env_t oenv)
     return oenv->verbosity;
 }
 
-int output_env_get_debug_level(const output_env_t oenv)
-{
-    return oenv->debug_level;
-}
-
 const char *output_env_get_time_unit(const output_env_t oenv)
 {
     return time_units_str[oenv->time_unit];
@@ -202,42 +194,21 @@ xvg_format_t output_env_get_xvg_format(const output_env_t oenv)
     return oenv->xvg_format;
 }
 
-const char *output_env_get_program_name(const output_env_t oenv)
-{
-    const char *programName = NULL;
-
-    try
-    {
-        programName = oenv->programContext.fullBinaryPath();
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-
-    return programName;
-}
-
-const char *output_env_get_short_program_name(const output_env_t oenv)
+const char *output_env_get_program_display_name(const output_env_t oenv)
 {
-    const char *programName = NULL;
+    const char *displayName = NULL;
 
     try
     {
-        // TODO: Use the display name once it doesn't break anything.
-        programName = oenv->programContext.programName();
+        displayName = oenv->programContext.displayName();
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
-    return programName;
+    return displayName;
 }
 
-const char *output_env_get_cmd_line(const output_env_t oenv)
+const gmx::ProgramContextInterface &
+output_env_get_program_context(const output_env_t oenv)
 {
-    const char *commandLine = NULL;
-
-    try
-    {
-        commandLine = oenv->programContext.commandLine();
-    }
-    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-
-    return commandLine;
+    return oenv->programContext;
 }
index 0b1b2e113e83934346f66929920ef18ab0227578..1d15a6a4cced171f4ff07036b3507da8aec92670 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "orires.h"
-#include "main.h"
-#include "copyrite.h"
-#include "pbc.h"
-#include "mtop_util.h"
+#include "gromacs/legacyheaders/orires.h"
 
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/math/do_fit.h"
-#include "gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
                  rvec xref[],
index 35435d663207d19a2702e09624e9be9be03c8d76..4b0596482c819ae73435dad5656ea08911eb5f0e 100644 (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,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/rbin.h"
 
-#include "typedefs.h"
-#include "main.h"
-#include "network.h"
-#include "rbin.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/smalloc.h"
 
 t_bin *mk_bin(void)
@@ -87,6 +85,10 @@ int add_binr(t_bin *b, int nr, real r[])
     }
     /* Copy pointer */
     rbuf = b->rbuf+b->nreal;
+
+#if (__ICC == 1500 || __ICL == 1500) && defined __MIC__
+#pragma novector /* Work-around for incorrect vectorization */
+#endif
     for (i = 0; (i < nr); i++)
     {
         rbuf[i] = r[i];
index e7cef773eda608b88d20cc2f5bea7280eabd9613..ccc6ccea2b1707b361598fb73d9404f8668eaf8c 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/readinp.h"
 
 #include <stdio.h>
 #include <stdlib.h>
-#include "typedefs.h"
+
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/warninp.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/qsort_threadsafe.h"
 #include "gromacs/utility/smalloc.h"
-#include "readinp.h"
-#include "macros.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "names.h"
-#include "warninp.h"
-#include "gmx_fatal.h"
 
 t_inpfile *read_inpfile(const char *fn, int *ninp,
                         warninp_t wi)
@@ -170,8 +171,8 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
                                 inp[nin-1].count      = 0;
                                 inp[nin-1].bObsolete  = FALSE;
                                 inp[nin-1].bSet       = FALSE;
-                                inp[nin-1].name       = strdup(lbuf);
-                                inp[nin-1].value      = strdup(rbuf);
+                                inp[nin-1].name       = gmx_strdup(lbuf);
+                                inp[nin-1].value      = gmx_strdup(rbuf);
                             }
                             else
                             {
@@ -186,7 +187,7 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
                                 {
                                     /* override */
                                     sfree(inp[found_index].value);
-                                    inp[found_index].value = strdup(rbuf);
+                                    inp[found_index].value = gmx_strdup(rbuf);
                                     sprintf(warn_buf,
                                             "Overriding existing parameter \"%s\" with value \"%s\"\n",
                                             lbuf, rbuf);
@@ -238,7 +239,7 @@ static void sort_inp(int ninp, t_inpfile inp[])
             inp[i].count = mm++;
         }
     }
-    qsort(inp, ninp, (size_t)sizeof(inp[0]), inp_comp);
+    gmx_qsort(inp, ninp, (size_t)sizeof(inp[0]), inp_comp);
 }
 
 void write_inpfile(const char *fn, int ninp, t_inpfile inp[], gmx_bool bHaltOnUnknown,
@@ -296,7 +297,7 @@ void replace_inp_entry(int ninp, t_inpfile *inp, const char *old_entry, const ch
                 fprintf(stderr, "Replacing old mdp entry '%s' by '%s'\n",
                         inp[i].name, new_entry);
                 sfree(inp[i].name);
-                inp[i].name = strdup(new_entry);
+                inp[i].name = gmx_strdup(new_entry);
             }
             else
             {
@@ -344,7 +345,7 @@ static int get_einp(int *ninp, t_inpfile **inp, const char *name)
         notfound = TRUE;
         i        = (*ninp)++;
         srenew(*inp, (*ninp));
-        (*inp)[i].name = strdup(name);
+        (*inp)[i].name = gmx_strdup(name);
         (*inp)[i].bSet = TRUE;
     }
     (*inp)[i].count = (*inp)[0].inp_count++;
@@ -377,7 +378,7 @@ int get_eint(int *ninp, t_inpfile **inp, const char *name, int def,
     if (ii == -1)
     {
         sprintf(buf, "%d", def);
-        (*inp)[(*ninp)-1].value = strdup(buf);
+        (*inp)[(*ninp)-1].value = gmx_strdup(buf);
 
         return def;
     }
@@ -407,7 +408,7 @@ gmx_int64_t get_eint64(int *ninp, t_inpfile **inp,
     if (ii == -1)
     {
         sprintf(buf, "%"GMX_PRId64, def);
-        (*inp)[(*ninp)-1].value = strdup(buf);
+        (*inp)[(*ninp)-1].value = gmx_strdup(buf);
 
         return def;
     }
@@ -436,7 +437,7 @@ double get_ereal(int *ninp, t_inpfile **inp, const char *name, double def,
     if (ii == -1)
     {
         sprintf(buf, "%g", def);
-        (*inp)[(*ninp)-1].value = strdup(buf);
+        (*inp)[(*ninp)-1].value = gmx_strdup(buf);
 
         return def;
     }
@@ -465,7 +466,7 @@ const char *get_estr(int *ninp, t_inpfile **inp, const char *name, const char *d
         if (def)
         {
             sprintf(buf, "%s", def);
-            (*inp)[(*ninp)-1].value = strdup(buf);
+            (*inp)[(*ninp)-1].value = gmx_strdup(buf);
         }
         else
         {
@@ -491,7 +492,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
 
     if (ii == -1)
     {
-        (*inp)[(*ninp)-1].value = strdup(defs[0]);
+        (*inp)[(*ninp)-1].value = gmx_strdup(defs[0]);
 
         return 0;
     }
@@ -524,7 +525,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
             fprintf(stderr, "%s\n", buf);
         }
 
-        (*inp)[ii].value = strdup(defs[0]);
+        (*inp)[ii].value = gmx_strdup(defs[0]);
 
         return 0;
     }
index 841b43e35e89754a9e4c8223fab8ca3d9f46f26b..75ff86caba063cd5da802bd6b82451637c34a5eb 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/sighandler.h"
+
+#include "config.h"
 
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "sighandler.h"
+#include <stdlib.h>
 
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
 
 const char *gmx_stop_cond_name[] =
 {
index 1d98dc2c8d2319c5a8b8a570b4c77305bfd3df06..cb2eb90f6b976fb595d82462a4baaf291760d9c1 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.
  */
-#include "splitter.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gromacs/legacyheaders/splitter.h"
 
 #include <assert.h>
+#include <stdlib.h>
 #include <string.h>
-#include "macros.h"
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "mshift.h"
-#include "gmx_fatal.h"
 
 typedef struct {
     int atom, sid;
index 9743fc16a80a507da78fd471234a4a389d612195..c22bdb311da2f4078c7aa4d03992b64750a2cf02 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 /* This file is completely threadsafe - please keep it that way! */
 
+#include "gromacs/legacyheaders/txtdump.h"
+
 #include <stdio.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "names.h"
-#include "txtdump.h"
-#include "vec.h"
-#include "macros.h"
-
-#include "gmx_fatal.h"
+#include <stdlib.h>
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 int pr_indent(FILE *fp, int n)
@@ -1411,7 +1411,7 @@ void pr_ilist(FILE *fp, int indent, const char *title,
                 j++;
                 for (k = 0; k < interaction_function[ftype].nratoms; k++)
                 {
-                    (void) fprintf(fp, " %u", *(iatoms++));
+                    (void) fprintf(fp, " %d", *(iatoms++));
                 }
                 (void) fprintf(fp, "\n");
                 i += 1+interaction_function[ftype].nratoms;
@@ -1554,13 +1554,13 @@ static void low_pr_blocka(FILE *fp, int indent, const char *title, t_blocka *blo
         for (i = 0; i <= block->nr; i++)
         {
             (void) pr_indent(fp, indent+INDENT);
-            (void) fprintf(fp, "%s->index[%d]=%u\n",
+            (void) fprintf(fp, "%s->index[%d]=%d\n",
                            title, bShowNumbers ? i : -1, block->index[i]);
         }
         for (i = 0; i < block->nra; i++)
         {
             (void) pr_indent(fp, indent+INDENT);
-            (void) fprintf(fp, "%s->a[%d]=%u\n",
+            (void) fprintf(fp, "%s->a[%d]=%d\n",
                            title, bShowNumbers ? i : -1, block->a[i]);
         }
     }
@@ -1641,7 +1641,7 @@ void pr_blocka(FILE *fp, int indent, const char *title, t_blocka *block, gmx_boo
                         (void) fprintf(fp, "\n");
                         size = pr_indent(fp, indent+INDENT);
                     }
-                    size += fprintf(fp, "%u", block->a[j]);
+                    size += fprintf(fp, "%d", block->a[j]);
                 }
                 (void) fprintf(fp, "}\n");
                 start = end;
index 81eab1b2ebf765d19b7f0090a4ae24f106cbb140..134f8c0ca55a3d1e4829d4f7c7550360d5e762f5 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "thread_mpi/threads.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
-#include "gromacs/utility/smalloc.h"
-#include "symtab.h"
-#include "vec.h"
-#include "pbc.h"
-#include "macros.h"
 #include <string.h>
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
+#include "gromacs/utility/smalloc.h"
 
 /* The source code in this file should be thread-safe.
       Please keep it that way. */
 
-
-
-static gmx_bool            bOverAllocDD     = FALSE;
-static tMPI_Thread_mutex_t over_alloc_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
-
-
-void set_over_alloc_dd(gmx_bool set)
-{
-    tMPI_Thread_mutex_lock(&over_alloc_mutex);
-    /* we just make sure that we don't set this at the same time.
-       We don't worry too much about reading this rarely-set variable */
-    bOverAllocDD = set;
-    tMPI_Thread_mutex_unlock(&over_alloc_mutex);
-}
-
-int over_alloc_dd(int n)
-{
-    if (bOverAllocDD)
-    {
-        return OVER_ALLOC_FAC*n + 100;
-    }
-    else
-    {
-        return n;
-    }
-}
-
 int gmx_int64_to_int(gmx_int64_t step, const char *warn)
 {
     int i;
@@ -96,102 +67,6 @@ int gmx_int64_to_int(gmx_int64_t step, const char *warn)
     return i;
 }
 
-char *gmx_step_str(gmx_int64_t i, char *buf)
-{
-    sprintf(buf, "%"GMX_PRId64, i);
-
-    return buf;
-}
-
-void init_block(t_block *block)
-{
-    int i;
-
-    block->nr           = 0;
-    block->nalloc_index = 1;
-    snew(block->index, block->nalloc_index);
-    block->index[0]     = 0;
-}
-
-void init_blocka(t_blocka *block)
-{
-    int i;
-
-    block->nr           = 0;
-    block->nra          = 0;
-    block->nalloc_index = 1;
-    snew(block->index, block->nalloc_index);
-    block->index[0]     = 0;
-    block->nalloc_a     = 0;
-    block->a            = NULL;
-}
-
-void init_atom(t_atoms *at)
-{
-    int i;
-
-    at->nr        = 0;
-    at->nres      = 0;
-    at->atom      = NULL;
-    at->resinfo   = NULL;
-    at->atomname  = NULL;
-    at->atomtype  = NULL;
-    at->atomtypeB = NULL;
-    at->pdbinfo   = NULL;
-}
-
-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;
-}
-
-void init_groups(gmx_groups_t *groups)
-{
-    int g;
-
-    groups->ngrpname = 0;
-    groups->grpname  = NULL;
-    for (g = 0; (g < egcNR); g++)
-    {
-        groups->grps[g].nm_ind = NULL;
-        groups->ngrpnr[g]      = 0;
-        groups->grpnr[g]       = NULL;
-    }
-
-}
-
-void init_mtop(gmx_mtop_t *mtop)
-{
-    mtop->name         = NULL;
-    mtop->nmoltype     = 0;
-    mtop->moltype      = NULL;
-    mtop->nmolblock    = 0;
-    mtop->molblock     = NULL;
-    mtop->maxres_renum = 0;
-    mtop->maxresnr     = -1;
-    init_groups(&mtop->groups);
-    init_block(&mtop->mols);
-    open_symtab(&mtop->symtab);
-}
-
-void init_top(t_topology *top)
-{
-    int i;
-
-    top->name = NULL;
-    init_atom (&(top->atoms));
-    init_atomtypes(&(top->atomtypes));
-    init_block(&top->cgs);
-    init_block(&top->mols);
-    init_blocka(&top->excls);
-    open_symtab(&top->symtab);
-}
-
 void init_inputrec(t_inputrec *ir)
 {
     memset(ir, 0, (size_t)sizeof(*ir));
@@ -200,195 +75,6 @@ void init_inputrec(t_inputrec *ir)
     snew(ir->simtempvals, 1);
 }
 
-void stupid_fill_block(t_block *grp, int natom, gmx_bool bOneIndexGroup)
-{
-    int i;
-
-    if (bOneIndexGroup)
-    {
-        grp->nalloc_index = 2;
-        snew(grp->index, grp->nalloc_index);
-        grp->index[0] = 0;
-        grp->index[1] = natom;
-        grp->nr       = 1;
-    }
-    else
-    {
-        grp->nalloc_index = natom+1;
-        snew(grp->index, grp->nalloc_index);
-        snew(grp->index, natom+1);
-        for (i = 0; (i <= natom); i++)
-        {
-            grp->index[i] = i;
-        }
-        grp->nr = natom;
-    }
-}
-
-void stupid_fill_blocka(t_blocka *grp, int natom)
-{
-    int i;
-
-    grp->nalloc_a = natom;
-    snew(grp->a, grp->nalloc_a);
-    for (i = 0; (i < natom); i++)
-    {
-        grp->a[i] = i;
-    }
-    grp->nra = natom;
-
-    grp->nalloc_index = natom + 1;
-    snew(grp->index, grp->nalloc_index);
-    for (i = 0; (i <= natom); i++)
-    {
-        grp->index[i] = i;
-    }
-    grp->nr = natom;
-}
-
-void copy_blocka(const t_blocka *src, t_blocka *dest)
-{
-    int i;
-
-    dest->nr           = src->nr;
-    dest->nalloc_index = dest->nr + 1;
-    snew(dest->index, dest->nalloc_index);
-    for (i = 0; i < dest->nr+1; i++)
-    {
-        dest->index[i] = src->index[i];
-    }
-    dest->nra      = src->nra;
-    dest->nalloc_a = dest->nra + 1;
-    snew(dest->a, dest->nalloc_a);
-    for (i = 0; i < dest->nra+1; i++)
-    {
-        dest->a[i] = src->a[i];
-    }
-}
-
-void done_block(t_block *block)
-{
-    block->nr    = 0;
-    sfree(block->index);
-    block->nalloc_index = 0;
-}
-
-void done_blocka(t_blocka *block)
-{
-    block->nr    = 0;
-    block->nra   = 0;
-    sfree(block->index);
-    sfree(block->a);
-    block->index        = NULL;
-    block->a            = NULL;
-    block->nalloc_index = 0;
-    block->nalloc_a     = 0;
-}
-
-void done_atom (t_atoms *at)
-{
-    at->nr       = 0;
-    at->nres     = 0;
-    sfree(at->atom);
-    sfree(at->resinfo);
-    sfree(at->atomname);
-    sfree(at->atomtype);
-    sfree(at->atomtypeB);
-    if (at->pdbinfo)
-    {
-        sfree(at->pdbinfo);
-    }
-}
-
-void done_atomtypes(t_atomtypes *atype)
-{
-    atype->nr = 0;
-    sfree(atype->radius);
-    sfree(atype->vol);
-    sfree(atype->surftens);
-    sfree(atype->atomnumber);
-    sfree(atype->gb_radius);
-    sfree(atype->S_hct);
-}
-
-void done_moltype(gmx_moltype_t *molt)
-{
-    int f;
-
-    done_atom(&molt->atoms);
-    done_block(&molt->cgs);
-    done_blocka(&molt->excls);
-
-    for (f = 0; f < F_NRE; f++)
-    {
-        sfree(molt->ilist[f].iatoms);
-        molt->ilist[f].nalloc = 0;
-    }
-}
-
-void done_molblock(gmx_molblock_t *molb)
-{
-    if (molb->nposres_xA > 0)
-    {
-        molb->nposres_xA = 0;
-        free(molb->posres_xA);
-    }
-    if (molb->nposres_xB > 0)
-    {
-        molb->nposres_xB = 0;
-        free(molb->posres_xB);
-    }
-}
-
-void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab)
-{
-    int i;
-
-    if (bDoneSymtab)
-    {
-        done_symtab(&mtop->symtab);
-    }
-
-    sfree(mtop->ffparams.functype);
-    sfree(mtop->ffparams.iparams);
-
-    for (i = 0; i < mtop->nmoltype; i++)
-    {
-        done_moltype(&mtop->moltype[i]);
-    }
-    sfree(mtop->moltype);
-    for (i = 0; i < mtop->nmolblock; i++)
-    {
-        done_molblock(&mtop->molblock[i]);
-    }
-    sfree(mtop->molblock);
-    done_block(&mtop->mols);
-}
-
-void done_top(t_topology *top)
-{
-    int f;
-
-    sfree(top->idef.functype);
-    sfree(top->idef.iparams);
-    for (f = 0; f < F_NRE; ++f)
-    {
-        sfree(top->idef.il[f].iatoms);
-        top->idef.il[f].iatoms = NULL;
-        top->idef.il[f].nalloc = 0;
-    }
-
-    done_atom (&(top->atoms));
-
-    /* For GB */
-    done_atomtypes(&(top->atomtypes));
-
-    done_symtab(&(top->symtab));
-    done_block(&(top->cgs));
-    done_block(&(top->mols));
-    done_blocka(&(top->excls));
-}
-
 static void done_pull_group(t_pull_group *pgrp)
 {
     if (pgrp->nat > 0)
@@ -766,202 +452,6 @@ void preserve_box_shape(t_inputrec *ir, matrix box_rel, matrix b)
     }
 }
 
-void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra)
-{
-    int i;
-
-    if (natom_extra > 0)
-    {
-        srenew(atoms->atomname, atoms->nr+natom_extra);
-        srenew(atoms->atom, atoms->nr+natom_extra);
-        if (NULL != atoms->pdbinfo)
-        {
-            srenew(atoms->pdbinfo, atoms->nr+natom_extra);
-        }
-        if (NULL != atoms->atomtype)
-        {
-            srenew(atoms->atomtype, atoms->nr+natom_extra);
-        }
-        if (NULL != atoms->atomtypeB)
-        {
-            srenew(atoms->atomtypeB, atoms->nr+natom_extra);
-        }
-        for (i = atoms->nr; (i < atoms->nr+natom_extra); i++)
-        {
-            atoms->atomname[i] = NULL;
-            memset(&atoms->atom[i], 0, sizeof(atoms->atom[i]));
-            if (NULL != atoms->pdbinfo)
-            {
-                memset(&atoms->pdbinfo[i], 0, sizeof(atoms->pdbinfo[i]));
-            }
-            if (NULL != atoms->atomtype)
-            {
-                atoms->atomtype[i] = NULL;
-            }
-            if (NULL != atoms->atomtypeB)
-            {
-                atoms->atomtypeB[i] = NULL;
-            }
-        }
-        atoms->nr += natom_extra;
-    }
-    if (nres_extra > 0)
-    {
-        srenew(atoms->resinfo, atoms->nres+nres_extra);
-        for (i = atoms->nres; (i < atoms->nres+nres_extra); i++)
-        {
-            memset(&atoms->resinfo[i], 0, sizeof(atoms->resinfo[i]));
-        }
-        atoms->nres += nres_extra;
-    }
-}
-
-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;
-    snew(atoms->resinfo, natoms);
-    snew(atoms->atom, natoms);
-    if (bPdbinfo)
-    {
-        snew(atoms->pdbinfo, natoms);
-    }
-    else
-    {
-        atoms->pdbinfo = NULL;
-    }
-}
-
-t_atoms *copy_t_atoms(t_atoms *src)
-{
-    t_atoms *dst;
-    int      i;
-
-    snew(dst, 1);
-    init_t_atoms(dst, src->nr, (NULL != src->pdbinfo));
-    dst->nr = src->nr;
-    if (NULL != src->atomname)
-    {
-        snew(dst->atomname, src->nr);
-    }
-    if (NULL != src->atomtype)
-    {
-        snew(dst->atomtype, src->nr);
-    }
-    if (NULL != src->atomtypeB)
-    {
-        snew(dst->atomtypeB, src->nr);
-    }
-    for (i = 0; (i < src->nr); i++)
-    {
-        dst->atom[i] = src->atom[i];
-        if (NULL != src->pdbinfo)
-        {
-            dst->pdbinfo[i] = src->pdbinfo[i];
-        }
-        if (NULL != src->atomname)
-        {
-            dst->atomname[i]  = src->atomname[i];
-        }
-        if (NULL != src->atomtype)
-        {
-            dst->atomtype[i] = src->atomtype[i];
-        }
-        if (NULL != src->atomtypeB)
-        {
-            dst->atomtypeB[i] = src->atomtypeB[i];
-        }
-    }
-    dst->nres = src->nres;
-    for (i = 0; (i < src->nres); i++)
-    {
-        dst->resinfo[i] = src->resinfo[i];
-    }
-    return dst;
-}
-
-void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, t_symtab *symtab,
-                         const char *resname, int resnr, unsigned char ic,
-                         int chainnum, char chainid)
-{
-    t_resinfo *ri;
-
-    ri           = &atoms->resinfo[atoms->atom[atom_ind].resind];
-    ri->name     = put_symtab(symtab, resname);
-    ri->rtp      = NULL;
-    ri->nr       = resnr;
-    ri->ic       = ic;
-    ri->chainnum = chainnum;
-    ri->chainid  = chainid;
-}
-
-void free_t_atoms(t_atoms *atoms, gmx_bool bFreeNames)
-{
-    int i;
-
-    if (bFreeNames && atoms->atomname != NULL)
-    {
-        for (i = 0; i < atoms->nr; i++)
-        {
-            if (atoms->atomname[i] != NULL)
-            {
-                sfree(*atoms->atomname[i]);
-                *atoms->atomname[i] = NULL;
-            }
-        }
-    }
-    if (bFreeNames && atoms->resinfo != NULL)
-    {
-        for (i = 0; i < atoms->nres; i++)
-        {
-            if (atoms->resinfo[i].name != NULL)
-            {
-                sfree(*atoms->resinfo[i].name);
-                *atoms->resinfo[i].name = NULL;
-            }
-        }
-    }
-    if (bFreeNames && atoms->atomtype != NULL)
-    {
-        for (i = 0; i < atoms->nr; i++)
-        {
-            if (atoms->atomtype[i] != NULL)
-            {
-                sfree(*atoms->atomtype[i]);
-                *atoms->atomtype[i] = NULL;
-            }
-        }
-    }
-    if (bFreeNames && atoms->atomtypeB != NULL)
-    {
-        for (i = 0; i < atoms->nr; i++)
-        {
-            if (atoms->atomtypeB[i] != NULL)
-            {
-                sfree(*atoms->atomtypeB[i]);
-                *atoms->atomtypeB[i] = NULL;
-            }
-        }
-    }
-    sfree(atoms->atomname);
-    sfree(atoms->atomtype);
-    sfree(atoms->atomtypeB);
-    sfree(atoms->resinfo);
-    sfree(atoms->atom);
-    sfree(atoms->pdbinfo);
-    atoms->nr        = 0;
-    atoms->nres      = 0;
-    atoms->atomname  = NULL;
-    atoms->atomtype  = NULL;
-    atoms->atomtypeB = NULL;
-    atoms->resinfo   = NULL;
-    atoms->atom      = NULL;
-    atoms->pdbinfo   = NULL;
-}
-
 real max_cutoff(real cutoff1, real cutoff2)
 {
     if (cutoff1 == 0 || cutoff2 == 0)
index 0384bc921f0253c2a7305258879b27bcc5669f23..61f00ae86130c601a17e7e8f44899b0e5e080b2e 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/viewit.h"
+
+#include <stdlib.h>
 #include <string.h>
 
-#include "oenv.h"
-#include "viewit.h"
-#include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/filenm.h"
-#include "macros.h"
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 
 static const int   can_view_ftp[] = {
     0,
@@ -58,7 +58,7 @@ static const char* view_program[] = {
     "ghostview",    "display",      NULL,           "xterm -e rasmol"
 };
 
-int can_view(int ftp)
+static int can_view(int ftp)
 {
     int i;
 
@@ -123,15 +123,10 @@ void do_view(const output_env_t oenv, const char *fn, const char *opts)
             {
                 sprintf(buf, "%s %s %s &", cmd, opts ? opts : "", fn);
                 fprintf(stderr, "Executing '%s'\n", buf);
-#ifdef GMX_NO_SYSTEM
-                printf("Warning-- No calls to system(3) supported on this platform.");
-                printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
-#else
                 if (0 != system(buf) )
                 {
                     gmx_fatal(FARGS, "Failed executing command: %s", buf);
                 }
-#endif
             }
         }
     }
index 0e18160c6b2012948365e17614596d3c44897f2a..1721a470123534f1a1fe8012642d08aa8ac7b931 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/warninp.h"
 
 #include <string.h>
 
-#include "gromacs/utility/smalloc.h"
-#include "copyrite.h"
+#include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
-#include "warninp.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct warninp {
     gmx_bool bAllowWarnings;
index 429e78849cc14f1cdc0d1980cfeeab08abb5906c..cf471c4641e40693d73cef372453199e72c89640 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "grompp-impl.h"
-#include "macros.h"
-#include "toputil.h"
-#include "hackblock.h"
+
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void clear_atom_list(int i0, atom_id a[])
 {
index 71f77d1b6bcab2fb0673676c99b236d2718ffc2b..92a0d8be4d432853825564648e0fa42c5977864a 100644 (file)
@@ -38,8 +38,8 @@
 #ifndef GMX_GMXPREPROCESS_ADD_PAR_H
 #define GMX_GMXPREPROCESS_ADD_PAR_H
 
-#include "typedefs.h"
-#include "pdb2top.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C"
diff --git a/src/gromacs/gmxpreprocess/addconf.c b/src/gromacs/gmxpreprocess/addconf.c
deleted file mode 100644 (file)
index 64f1f28..0000000
+++ /dev/null
@@ -1,671 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 "addconf.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include "vec.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "force.h"
-#include "names.h"
-#include "nsgrid.h"
-#include "mdatoms.h"
-#include "nrnb.h"
-#include "ns.h"
-#include "mtop_util.h"
-#include "chargegroup.h"
-
-static real box_margin;
-
-static real max_dist(rvec *x, real *r, int start, int end)
-{
-    real maxd;
-    int  i, j;
-
-    maxd = 0;
-    for (i = start; i < end; i++)
-    {
-        for (j = i+1; j < end; j++)
-        {
-            maxd = max(maxd, sqrt(distance2(x[i], x[j]))+0.5*(r[i]+r[j]));
-        }
-    }
-
-    return 0.5*maxd;
-}
-
-static gmx_bool outside_box_minus_margin2(rvec x, matrix box)
-{
-    return ( (x[XX] < 2*box_margin) || (x[XX] > box[XX][XX]-2*box_margin) ||
-             (x[YY] < 2*box_margin) || (x[YY] > box[YY][YY]-2*box_margin) ||
-             (x[ZZ] < 2*box_margin) || (x[ZZ] > box[ZZ][ZZ]-2*box_margin) );
-}
-
-static gmx_bool outside_box_plus_margin(rvec x, matrix box)
-{
-    return ( (x[XX] < -box_margin) || (x[XX] > box[XX][XX]+box_margin) ||
-             (x[YY] < -box_margin) || (x[YY] > box[YY][YY]+box_margin) ||
-             (x[ZZ] < -box_margin) || (x[ZZ] > box[ZZ][ZZ]+box_margin) );
-}
-
-static int mark_res(int at, gmx_bool *mark, int natoms, t_atom *atom, int *nmark)
-{
-    int resind;
-
-    resind = atom[at].resind;
-    while ( (at > 0) && (resind == atom[at-1].resind) )
-    {
-        at--;
-    }
-    while ( (at < natoms) && (resind == atom[at].resind) )
-    {
-        if (!mark[at])
-        {
-            mark[at] = TRUE;
-            (*nmark)++;
-        }
-        at++;
-    }
-
-    return at;
-}
-
-static real find_max_real(int n, real radius[])
-{
-    int  i;
-    real rmax;
-
-    rmax = 0;
-    if (n > 0)
-    {
-        rmax = radius[0];
-        for (i = 1; (i < n); i++)
-        {
-            rmax = max(rmax, radius[i]);
-        }
-    }
-    return rmax;
-}
-
-static void combine_atoms(t_atoms *ap, t_atoms *as,
-                          rvec xp[], rvec *vp, rvec xs[], rvec *vs,
-                          t_atoms **a_comb, rvec **x_comb, rvec **v_comb)
-{
-    t_atoms *ac;
-    rvec    *xc, *vc = NULL;
-    int      i, j, natot, res0;
-
-    /* Total number of atoms */
-    natot = ap->nr+as->nr;
-
-    snew(ac, 1);
-    init_t_atoms(ac, natot, FALSE);
-
-    snew(xc, natot);
-    if (vp && vs)
-    {
-        snew(vc, natot);
-    }
-
-    /* Fill the new structures */
-    for (i = j = 0; (i < ap->nr); i++, j++)
-    {
-        copy_rvec(xp[i], xc[j]);
-        if (vc)
-        {
-            copy_rvec(vp[i], vc[j]);
-        }
-        memcpy(&(ac->atom[j]), &(ap->atom[i]), sizeof(ap->atom[i]));
-        ac->atom[j].type = 0;
-    }
-    res0 = ap->nres;
-    for (i = 0; (i < as->nr); i++, j++)
-    {
-        copy_rvec(xs[i], xc[j]);
-        if (vc)
-        {
-            copy_rvec(vs[i], vc[j]);
-        }
-        memcpy(&(ac->atom[j]), &(as->atom[i]), sizeof(as->atom[i]));
-        ac->atom[j].type    = 0;
-        ac->atom[j].resind += res0;
-    }
-    ac->nr   = j;
-    ac->nres = ac->atom[j-1].resind+1;
-    /* Fill all elements to prevent uninitialized memory */
-    for (i = 0; i < ac->nr; i++)
-    {
-        ac->atom[i].m     = 1;
-        ac->atom[i].q     = 0;
-        ac->atom[i].mB    = 1;
-        ac->atom[i].qB    = 0;
-        ac->atom[i].type  = 0;
-        ac->atom[i].typeB = 0;
-        ac->atom[i].ptype = eptAtom;
-    }
-
-    /* Return values */
-    *a_comb = ac;
-    *x_comb = xc;
-    *v_comb = vc;
-}
-
-static t_forcerec *fr = NULL;
-
-static void do_nsgrid(FILE *fp, gmx_bool bVerbose,
-                      matrix box, rvec x[], t_atoms *atoms, real rlong,
-                      const output_env_t oenv)
-{
-    gmx_mtop_t     *mtop;
-    gmx_localtop_t *top;
-    t_mdatoms      *md;
-    t_block        *cgs;
-    t_inputrec     *ir;
-    t_nrnb          nrnb;
-    t_commrec      *cr;
-    int            *cg_index;
-    gmx_moltype_t  *molt;
-    gmx_ffparams_t *ffp;
-    ivec           *nFreeze;
-    int             i, m, natoms;
-    rvec            box_size;
-    real           *lambda, *dvdl;
-
-    natoms = atoms->nr;
-
-    /* Charge group index */
-    snew(cg_index, natoms);
-    for (i = 0; (i < natoms); i++)
-    {
-        cg_index[i] = i;
-    }
-
-    /* Topology needs charge groups and exclusions */
-    snew(mtop, 1);
-    init_mtop(mtop);
-    mtop->natoms = natoms;
-    /* Make one moltype that contains the whol system */
-    mtop->nmoltype = 1;
-    snew(mtop->moltype, mtop->nmoltype);
-    molt        = &mtop->moltype[0];
-    molt->name  = mtop->name;
-    molt->atoms = *atoms;
-    stupid_fill_block(&molt->cgs, mtop->natoms, FALSE);
-    stupid_fill_blocka(&molt->excls, natoms);
-    /* Make one molblock for the whole system */
-    mtop->nmolblock = 1;
-    snew(mtop->molblock, mtop->nmolblock);
-    mtop->molblock[0].type       = 0;
-    mtop->molblock[0].nmol       = 1;
-    mtop->molblock[0].natoms_mol = natoms;
-    /* Initialize a single energy group */
-    mtop->groups.grps[egcENER].nr = 1;
-    mtop->groups.ngrpnr[egcENER]  = 0;
-    mtop->groups.grpnr[egcENER]   = NULL;
-
-    ffp = &mtop->ffparams;
-
-    ffp->ntypes = 1;
-    ffp->atnr   = 1;
-    ffp->reppow = 12;
-    snew(ffp->functype, 1);
-    snew(ffp->iparams, 1);
-    ffp->iparams[0].lj.c6  = 1;
-    ffp->iparams[0].lj.c12 = 1;
-
-    /* inputrec structure */
-    snew(ir, 1);
-    ir->cutoff_scheme    = ecutsGROUP;
-    ir->coulomb_modifier = eintmodNONE;
-    ir->vdw_modifier     = eintmodNONE;
-    ir->coulombtype      = eelCUT;
-    ir->vdwtype          = evdwCUT;
-    ir->ns_type          = ensGRID;
-    snew(ir->opts.egp_flags, 1);
-
-    top = gmx_mtop_generate_local_top(mtop, ir);
-
-    /* Some nasty shortcuts */
-    cgs  = &(top->cgs);
-
-    /* mdatoms structure */
-    snew(nFreeze, 2);
-    snew(md, 1);
-    md = init_mdatoms(fp, mtop, FALSE);
-    atoms2md(mtop, ir, 0, NULL, mtop->natoms, md);
-    sfree(nFreeze);
-
-    /* forcerec structure */
-    if (fr == NULL)
-    {
-        fr = mk_forcerec();
-    }
-    snew(cr, 1);
-    cr->nnodes   = 1;
-    /* cr->nthreads = 1; */
-
-    /*    ir->rlist       = ir->rcoulomb = ir->rvdw = rlong;
-       printf("Neighborsearching with a cut-off of %g\n",rlong);
-       init_forcerec(stdout,fr,ir,top,cr,md,box,FALSE,NULL,NULL,NULL,TRUE);*/
-    fr->cg0     = 0;
-    fr->hcg     = top->cgs.nr;
-    fr->nWatMol = 0;
-
-    /* Prepare for neighboursearching */
-    init_nrnb(&nrnb);
-
-    /* Init things dependent on parameters */
-    ir->rlistlong = ir->rlist = ir->rcoulomb = ir->rvdw = rlong;
-    /* create free energy data to avoid NULLs */
-    snew(ir->fepvals, 1);
-    printf("Neighborsearching with a cut-off of %g\n", rlong);
-    init_forcerec(stdout, oenv, fr, NULL, ir, mtop, cr, box,
-                  NULL, NULL, NULL, NULL, NULL, TRUE, -1);
-    if (debug)
-    {
-        pr_forcerec(debug, fr);
-    }
-
-    /* Calculate new stuff dependent on coords and box */
-    for (m = 0; (m < DIM); m++)
-    {
-        box_size[m] = box[m][m];
-    }
-    calc_shifts(box, fr->shift_vec);
-    put_charge_groups_in_box(fp, 0, cgs->nr, fr->ePBC, box, cgs, x, fr->cg_cm);
-
-    /* Do the actual neighboursearching */
-    snew(lambda, efptNR);
-    snew(dvdl, efptNR);
-    init_neighbor_list(fp, fr, md->homenr);
-    search_neighbours(fp, fr, box, top,
-                      &mtop->groups, cr, &nrnb, md, TRUE, FALSE);
-
-    if (debug)
-    {
-        dump_nblist(debug, cr, fr, 0);
-    }
-
-    if (bVerbose)
-    {
-        fprintf(stderr, "Successfully made neighbourlist\n");
-    }
-}
-
-static gmx_bool bXor(gmx_bool b1, gmx_bool b2)
-{
-    return (b1 && !b2) || (b2 && !b1);
-}
-
-void add_conf(t_atoms *atoms, rvec **x, rvec **v, real **r, gmx_bool bSrenew,
-              int ePBC, matrix box, gmx_bool bInsert,
-              t_atoms *atoms_solvt, rvec *x_solvt, rvec *v_solvt, real *r_solvt,
-              gmx_bool bVerbose, real rshell, int max_sol, const output_env_t oenv)
-{
-    t_nblist       *nlist;
-    t_atoms        *atoms_all;
-    real            max_vdw, *r_prot, *r_all, n2, r2, ib1, ib2;
-    int             natoms_prot, natoms_solvt;
-    int             i, j, jj, m, j0, j1, jjj, jnres, jnr, inr, iprot, is1, is2;
-    int             prev, resnr, nresadd, d, k, ncells, maxincell;
-    int             dx0, dx1, dy0, dy1, dz0, dz1;
-    int             ntest, nremove, nkeep;
-    rvec            dx, xi, xj, xpp, *x_all, *v_all;
-    gmx_bool       *remove, *keep;
-    int             bSolSol;
-
-    natoms_prot  = atoms->nr;
-    natoms_solvt = atoms_solvt->nr;
-    if (natoms_solvt <= 0)
-    {
-        fprintf(stderr, "WARNING: Nothing to add\n");
-        return;
-    }
-
-    if (ePBC == epbcSCREW)
-    {
-        gmx_fatal(FARGS, "Sorry, %s pbc is not yet supported", epbc_names[ePBC]);
-    }
-
-    if (bVerbose)
-    {
-        fprintf(stderr, "Calculating Overlap...\n");
-    }
-
-    /* Set margin around box edges to largest solvent dimension.
-     * The maximum distance between atoms in a solvent molecule should
-     * be calculated. At the moment a fudge factor of 3 is used.
-     */
-    r_prot     = *r;
-    box_margin = 3*find_max_real(natoms_solvt, r_solvt);
-    max_vdw    = max(3*find_max_real(natoms_prot, r_prot), box_margin);
-    fprintf(stderr, "box_margin = %g\n", box_margin);
-
-    snew(remove, natoms_solvt);
-
-    nremove = 0;
-    if (!bInsert)
-    {
-        for (i = 0; i < atoms_solvt->nr; i++)
-        {
-            if (outside_box_plus_margin(x_solvt[i], box) )
-            {
-                i = mark_res(i, remove, atoms_solvt->nr, atoms_solvt->atom, &nremove);
-            }
-        }
-        fprintf(stderr, "Removed %d atoms that were outside the box\n", nremove);
-    }
-
-    /* Define grid stuff */
-    /* Largest VDW radius */
-    snew(r_all, natoms_prot+natoms_solvt);
-    for (i = j = 0; i < natoms_prot; i++, j++)
-    {
-        r_all[j] = r_prot[i];
-    }
-    for (i = 0; i < natoms_solvt; i++, j++)
-    {
-        r_all[j] = r_solvt[i];
-    }
-
-    /* Combine arrays */
-    combine_atoms(atoms, atoms_solvt, *x, v ? *v : NULL, x_solvt, v_solvt,
-                  &atoms_all, &x_all, &v_all);
-
-    /* Do neighboursearching step */
-    do_nsgrid(stdout, bVerbose, box, x_all, atoms_all, max_vdw, oenv);
-
-    /* check solvent with solute */
-    nlist = &(fr->nblists[0].nlist_sr[eNL_VDW]);
-    fprintf(stderr, "nri = %d, nrj = %d\n", nlist->nri, nlist->nrj);
-    for (bSolSol = 0; (bSolSol <= (bInsert ? 0 : 1)); bSolSol++)
-    {
-        ntest = nremove = 0;
-        fprintf(stderr, "Checking %s-Solvent overlap:",
-                bSolSol ? "Solvent" : "Protein");
-        for (i = 0; (i < nlist->nri && nremove < natoms_solvt); i++)
-        {
-            inr = nlist->iinr[i];
-            j0  = nlist->jindex[i];
-            j1  = nlist->jindex[i+1];
-            rvec_add(x_all[inr], fr->shift_vec[nlist->shift[i]], xi);
-
-            for (j = j0; (j < j1 && nremove < natoms_solvt); j++)
-            {
-                jnr = nlist->jjnr[j];
-                if (jnr < 0)
-                {
-                    /* skip padding */
-                    continue;
-                }
-                copy_rvec(x_all[jnr], xj);
-
-                /* Check solvent-protein and solvent-solvent */
-                is1 = inr-natoms_prot;
-                is2 = jnr-natoms_prot;
-
-                /* Check if at least one of the atoms is a solvent that is not yet
-                 * listed for removal, and if both are solvent, that they are not in the
-                 * same residue.
-                 */
-                if ((!bSolSol &&
-                     bXor((is1 >= 0), (is2 >= 0)) && /* One atom is protein */
-                     ((is1 < 0) || ((is1 >= 0) && !remove[is1])) &&
-                     ((is2 < 0) || ((is2 >= 0) && !remove[is2]))) ||
-
-                    (bSolSol  &&
-                     (is1 >= 0) && (!remove[is1]) &&                   /* is1 is solvent */
-                     (is2 >= 0) && (!remove[is2]) &&                   /* is2 is solvent */
-                     (bInsert ||                                       /* when inserting also check inside the box */
-                      (outside_box_minus_margin2(x_solvt[is1], box) && /* is1 on edge */
-                       outside_box_minus_margin2(x_solvt[is2], box))   /* is2 on edge */
-                     ) &&
-                     (atoms_solvt->atom[is1].resind !=                 /* Not the same residue */
-                      atoms_solvt->atom[is2].resind)))
-                {
-
-                    ntest++;
-                    rvec_sub(xi, xj, dx);
-                    n2 = norm2(dx);
-                    r2 = sqr(r_all[inr]+r_all[jnr]);
-                    if (n2 < r2)
-                    {
-                        if (bInsert)
-                        {
-                            nremove = natoms_solvt;
-                            for (k = 0; k < nremove; k++)
-                            {
-                                remove[k] = TRUE;
-                            }
-                        }
-                        /* Need only remove one of the solvents... */
-                        if (is2 >= 0)
-                        {
-                            (void) mark_res(is2, remove, natoms_solvt, atoms_solvt->atom,
-                                            &nremove);
-                        }
-                        else if (is1 >= 0)
-                        {
-                            (void) mark_res(is1, remove, natoms_solvt, atoms_solvt->atom,
-                                            &nremove);
-                        }
-                        else
-                        {
-                            fprintf(stderr, "Neither atom is solvent%d %d\n", is1, is2);
-                        }
-                    }
-                }
-            }
-        }
-        if (!bInsert)
-        {
-            fprintf(stderr, " tested %d pairs, removed %d atoms.\n", ntest, nremove);
-        }
-    }
-    if (debug)
-    {
-        for (i = 0; i < natoms_solvt; i++)
-        {
-            fprintf(debug, "remove[%5d] = %s\n", i, bool_names[remove[i]]);
-        }
-    }
-
-    /* Search again, now with another cut-off */
-    if (rshell > 0)
-    {
-        do_nsgrid(stdout, bVerbose, box, x_all, atoms_all, rshell, oenv);
-        nlist = &(fr->nblists[0].nlist_sr[eNL_VDW]);
-        fprintf(stderr, "nri = %d, nrj = %d\n", nlist->nri, nlist->nrj);
-        nkeep = 0;
-        snew(keep, natoms_solvt);
-        for (i = 0; i < nlist->nri; i++)
-        {
-            inr = nlist->iinr[i];
-            j0  = nlist->jindex[i];
-            j1  = nlist->jindex[i+1];
-
-            for (j = j0; j < j1; j++)
-            {
-                jnr = nlist->jjnr[j];
-
-                /* Check solvent-protein and solvent-solvent */
-                is1 = inr-natoms_prot;
-                is2 = jnr-natoms_prot;
-
-                /* Check if at least one of the atoms is a solvent that is not yet
-                 * listed for removal, and if both are solvent, that they are not in the
-                 * same residue.
-                 */
-                if (is1 >= 0 && is2 < 0)
-                {
-                    mark_res(is1, keep, natoms_solvt, atoms_solvt->atom, &nkeep);
-                }
-                else if (is1 < 0 && is2 >= 0)
-                {
-                    mark_res(is2, keep, natoms_solvt, atoms_solvt->atom, &nkeep);
-                }
-            }
-        }
-        fprintf(stderr, "Keeping %d solvent atoms after proximity check\n",
-                nkeep);
-        for (i = 0; i < natoms_solvt; i++)
-        {
-            remove[i] = remove[i] || !keep[i];
-        }
-        sfree(keep);
-    }
-    /* count how many atoms and residues will be added and make space */
-    if (bInsert)
-    {
-        j     = atoms_solvt->nr;
-        jnres = atoms_solvt->nres;
-    }
-    else
-    {
-        j     = 0;
-        jnres = 0;
-        for (i = 0; ((i < atoms_solvt->nr) &&
-                     ((max_sol == 0) || (jnres < max_sol))); i++)
-        {
-            if (!remove[i])
-            {
-                j++;
-                if ((i == 0) ||
-                    (atoms_solvt->atom[i].resind != atoms_solvt->atom[i-1].resind))
-                {
-                    jnres++;
-                }
-            }
-        }
-    }
-    if (debug)
-    {
-        fprintf(debug, "Will add %d atoms in %d residues\n", j, jnres);
-    }
-    if (!bInsert)
-    {
-        /* Flag the remaing solvent atoms to be removed */
-        jjj = atoms_solvt->atom[i-1].resind;
-        for (; (i < atoms_solvt->nr); i++)
-        {
-            if (atoms_solvt->atom[i].resind > jjj)
-            {
-                remove[i] = TRUE;
-            }
-            else
-            {
-                j++;
-            }
-        }
-    }
-
-    if (bSrenew)
-    {
-        srenew(atoms->resinfo,  atoms->nres+jnres);
-        srenew(atoms->atomname, atoms->nr+j);
-        srenew(atoms->atom,     atoms->nr+j);
-        srenew(*x,              atoms->nr+j);
-        if (v)
-        {
-            srenew(*v,       atoms->nr+j);
-        }
-        srenew(*r,              atoms->nr+j);
-    }
-
-    /* add the selected atoms_solvt to atoms */
-    if (atoms->nr > 0)
-    {
-        resnr = atoms->resinfo[atoms->atom[atoms->nr-1].resind].nr;
-    }
-    else
-    {
-        resnr = 0;
-    }
-    prev    = -1;
-    nresadd = 0;
-    for (i = 0; i < atoms_solvt->nr; i++)
-    {
-        if (!remove[i])
-        {
-            if (prev == -1 ||
-                atoms_solvt->atom[i].resind != atoms_solvt->atom[prev].resind)
-            {
-                nresadd++;
-                atoms->nres++;
-                resnr++;
-                atoms->resinfo[atoms->nres-1] =
-                    atoms_solvt->resinfo[atoms_solvt->atom[i].resind];
-                atoms->resinfo[atoms->nres-1].nr = resnr;
-                /* calculate shift of the solvent molecule using the first atom */
-                copy_rvec(x_solvt[i], dx);
-                put_atoms_in_box(ePBC, box, 1, &dx);
-                rvec_dec(dx, x_solvt[i]);
-            }
-            atoms->atom[atoms->nr]     = atoms_solvt->atom[i];
-            atoms->atomname[atoms->nr] = atoms_solvt->atomname[i];
-            rvec_add(x_solvt[i], dx, (*x)[atoms->nr]);
-            if (v)
-            {
-                copy_rvec(v_solvt[i], (*v)[atoms->nr]);
-            }
-            (*r)[atoms->nr]               = r_solvt[i];
-            atoms->atom[atoms->nr].resind = atoms->nres-1;
-            atoms->nr++;
-            prev = i;
-        }
-    }
-    if (bSrenew)
-    {
-        srenew(atoms->resinfo,  atoms->nres+nresadd);
-    }
-
-    if (bVerbose)
-    {
-        fprintf(stderr, "Added %d molecules\n", nresadd);
-    }
-
-    sfree(remove);
-    done_atom(atoms_all);
-    sfree(x_all);
-    sfree(v_all);
-}
index 0387dd1483353b22b6f26afddde41037e57d32f8..0116bfeb04215bd6b68169a60994786ce04059d3 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "calc_verletbuf.h"
 
 #include <assert.h>
+#include <math.h>
+#include <stdlib.h>
 
 #include <sys/types.h>
-#include <math.h>
-#include "typedefs.h"
-#include "physics.h"
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/calculate-ewald-splitting-coefficient.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "vec.h"
-#include "coulomb.h"
-#include "calc_verletbuf.h"
-#include "../mdlib/nbnxn_consts.h"
 
 #ifdef GMX_NBNXN_SIMD
 /* The include below sets the SIMD instruction type (precision+width)
@@ -207,7 +208,7 @@ static void get_vsite_masses(const gmx_moltype_t  *moltype,
             for (i = 0; i < il->nr; i += 1+NRAL(ft))
             {
                 const t_iparams *ip;
-                real             cam[5], inv_mass, coeff, m_aj;
+                real             cam[5] = {0}, inv_mass, coeff, m_aj;
                 int              a1, j, aj;
 
                 ip = &ffparams->iparams[il->iatoms[i]];
index 65ef4923506c4fe15eb99da7c653d7575670e4cd..00696edb4ada6ef26be7bc0a3204fe2349bab4c7 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef GMX_GMXPREPROCESS_CALC_VERLETBUF_H
 #define GMX_GMXPREPROCESS_CALC_VERLETBUF_H
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 98%
rename from src/gromacs/gmxlib/calch.c
rename to src/gromacs/gmxpreprocess/calch.c
index 397ab2dba87f198807e7fb6b4141b67e3ff8deb6..d171bbd34b85d99be060f2b883fb38626a834ca6 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "macros.h"
 #include "calch.h"
-#include "gromacs/math/utilities.h"
-#include "vec.h"
-#include "physics.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define xAI xa[0]
 #define xAJ xa[1]
similarity index 93%
rename from src/gromacs/legacyheaders/calch.h
rename to src/gromacs/gmxpreprocess/calch.h
index 7b1fc76d5e9938a7084b0d5e4c8fedbd301717e5..ea6211f4dcd663a503542f2f73599544db4646c1 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_PREPROCESS_CALCH_H
+#define GMX_PREPROCESS_CALCH_H
 
-#ifndef _calch_h
-#define _calch_h
-
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -69,4 +68,4 @@ void calc_h_pos(int nht, rvec xa[], rvec xh[], int *l);
 }
 #endif
 
-#endif  /* _calch_h */
+#endif
index 52b62a10477d4c6da657c49c8848b26e74792dcd..51a73d1a845aa5666dc869041927c29256579b85 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <signal.h>
 #include <stdlib.h>
-#include "typedefs.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 static int div_nsteps(int nsteps, int nst)
 {
index 68e46ad24736630a9eb82d9280caf251f7b6cb0d..c9ff85de9615a36473d2b27da9cb11afa4d37e1c 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_COMPUTE_IO_H
 #define GMX_GMXPREPROCESS_COMPUTE_IO_H
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index fb97126e251b77bac8d21c24c8a1aa72bd01df57..e3bac959634c99ccff527314da7705448b8453cc 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "convparm.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "physics.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "topio.h"
-#include "toputil.h"
-#include "convparm.h"
-#include "names.h"
-#include "gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/topio.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static int round_check(real r, int limit, int ftype, const char *name)
 {
index cf8a39bcdff05818b2a2c29f5ed1896a2a60bb1f..d8c69a250ddc50cf9d72bf416acfb53685523467 100644 (file)
@@ -38,7 +38,8 @@
 #ifndef GMX_GMXPREPROCESS_CONVPARM_H
 #define GMX_GMXPREPROCESS_CONVPARM_H
 
-#include "typedefs.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index f1cdf02aa3c7e75105f37a756caaa48e76d2b68c..f986f5e545afac46530ad7042743a2ed528bbdbc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "fflibutil.h"
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "sysstuff.h"
-#include "network.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include <string>
+#include <vector>
 
-#include "fflibutil.h"
-
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/path.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/datafilefinder.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/directoryenumerator.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 const char *fflib_forcefield_dir_ext()
 {
@@ -102,214 +97,75 @@ void fflib_filename_base(const char *filename, char *filebase, int maxlen)
     }
 }
 
-static void sort_filenames(int n, char **name, char **name2)
-{
-    /* Slow sort, but we usually have tens of names */
-    int   i, j, f;
-    char *tmp;
-
-    for (i = 0; i < n-1; i++)
-    {
-        f = i;
-        for (j = i+1; j < n; j++)
-        {
-            if (strcmp(name[j], name[f]) < 0)
-            {
-                f = j;
-            }
-        }
-        if (f > i)
-        {
-            tmp     = name[i];
-            name[i] = name[f];
-            name[f] = tmp;
-            if (name2 != NULL)
-            {
-                tmp      = name2[i];
-                name2[i] = name2[f];
-                name2[f] = tmp;
-            }
-        }
-    }
-}
-
-static int low_fflib_search_file_end(const char *ffdir,
-                                     gmx_bool    bAddCWD,
-                                     const char *file_end,
-                                     gmx_bool    bFatalError,
-                                     char     ***filenames,
-                                     char     ***filenames_short)
+int fflib_search_file_end(const char *ffdir,
+                          const char *file_end,
+                          gmx_bool    bFatalError,
+                          char     ***filenames)
 {
-    char **fns = NULL, **fns_short = NULL;
-    int    n   = 0;
     try
     {
-        std::vector<std::string> libPaths;
-        bool                     bEnvIsSet = false;
-
-        if (ffdir != NULL)
+        std::string              ffdirFull(gmx::getLibraryFileFinder().findFile(ffdir));
+        std::vector<std::string> result
+            = gmx::DirectoryEnumerator::enumerateFilesWithExtension(
+                        ffdirFull.c_str(), file_end, true);
+        if (result.empty() && bFatalError)
         {
-            /* Search ffdir in current dir and library dirs */
-            libPaths.push_back(gmxlibfn(ffdir));
+            std::string message
+                = gmx::formatString("Could not find any files ending on '%s' "
+                                    "in the force field directory '%s'",
+                                    file_end, ffdir);
+            GMX_THROW(gmx::InvalidInputError(message));
         }
-        else
+        const int count = static_cast<int>(result.size());
+        for (int i = 0; i < count; ++i)
         {
-            /* GMXLIB can be a path now */
-            if (bAddCWD)
-            {
-                libPaths.push_back(".");
-            }
-            const char *lib = getenv("GMXLIB");
-            if (lib != NULL)
-            {
-                bEnvIsSet = true;
-                gmx::Path::splitPathEnvironment(lib, &libPaths);
-            }
-            else
-            {
-                libPaths.push_back(gmx::getProgramContext().defaultLibraryDataPath());
-            }
+            result[i] = gmx::Path::join(ffdir, result[i]);
         }
-
-        const int len_fe = strlen(file_end);
-
-        std::vector<std::string>::const_iterator i;
-        for (i = libPaths.begin(); i != libPaths.end(); ++i)
+        char    **fns;
+        snew(fns, count);
+        for (int i = 0; i < count; ++i)
         {
-            const char      *dir = i->c_str();
-            gmx_directory_t  dirhandle;
-            const int        rc  = gmx_directory_open(&dirhandle, dir);
-            if (rc == 0)
-            {
-                char nextname[STRLEN];
-                int  n_thisdir = 0;
-                while (gmx_directory_nextfile(dirhandle, nextname, STRLEN-1) == 0)
-                {
-                    nextname[STRLEN-1] = 0;
-                    if (debug)
-                    {
-                        fprintf(debug, "dir '%s' %d file '%s'\n",
-                                dir, n_thisdir, nextname);
-                    }
-                    const int len_name = strlen(nextname);
-                    /* What about case sensitivity? */
-                    if (len_name >= len_fe &&
-                        strcmp(nextname+len_name-len_fe, file_end) == 0)
-                    {
-                        char fn_dir[GMX_PATH_MAX];
-                        /* We have a match */
-                        srenew(fns, n+1);
-                        sprintf(fn_dir, "%s%c%s", dir, DIR_SEPARATOR, nextname);
-
-                        /* Copy the file name, possibly including the path. */
-                        fns[n] = strdup(fn_dir);
-
-                        if (ffdir == NULL)
-                        {
-                            /* We are searching in a path.
-                             * Use the relative path when we use share/top
-                             * from the installation.
-                             * Add the full path when we use the current
-                             * working directory of GMXLIB.
-                             */
-                            srenew(fns_short, n+1);
-                            if (strcmp(dir, ".") == 0 || bEnvIsSet)
-                            {
-                                fns_short[n] = strdup(fn_dir);
-                            }
-                            else
-                            {
-                                fns_short[n] = strdup(nextname);
-                            }
-                        }
-                        n++;
-                        n_thisdir++;
-                    }
-                }
-                gmx_directory_close(dirhandle);
-
-                sort_filenames(n_thisdir,
-                               fns+n-n_thisdir,
-                               fns_short == NULL ? NULL : fns_short+n-n_thisdir);
-            }
+            fns[i] = gmx_strdup(result[i].c_str());
         }
+        *filenames = fns;
+        return count;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-
-    if (n == 0 && bFatalError)
-    {
-        if (ffdir != NULL)
-        {
-            gmx_fatal(FARGS, "Could not find any files ending on '%s' in the force field directory '%s'", file_end, ffdir);
-        }
-        else
-        {
-            gmx_fatal(FARGS, "Could not find any files ending on '%s' in the current directory or the GROMACS library search path", file_end);
-        }
-    }
-
-    *filenames = fns;
-    if (ffdir == NULL)
-    {
-        *filenames_short = fns_short;
-    }
-
-    return n;
 }
 
-int fflib_search_file_end(const char *ffdir,
-                          const char *file_end,
-                          gmx_bool    bFatalError,
-                          char     ***filenames)
-{
-    return low_fflib_search_file_end(ffdir, FALSE, file_end, bFatalError,
-                                     filenames, NULL);
-}
-
-int fflib_search_file_in_dirend(const char *filename, const char *dirend,
-                                char ***dirnames)
+std::vector<gmx::DataFileInfo> fflib_enumerate_forcefields()
 {
-    int             nf, i;
-    char          **f, **f_short;
-    int             n;
-    char          **dns;
-    gmx_directory_t dirhandle;
-    char            nextname[STRLEN];
-    int             rc;
-
-    /* Find all files (not only dir's) ending on dirend */
-    nf = low_fflib_search_file_end(NULL, TRUE, dirend, FALSE, &f, &f_short);
-
-    n   = 0;
-    dns = NULL;
-    for (i = 0; i < nf; i++)
+    const char *const              dirend   = fflib_forcefield_dir_ext();
+    const char *const              filename = fflib_forcefield_itp();
+    std::vector<gmx::DataFileInfo> candidates
+        = gmx::getLibraryFileFinder().enumerateFiles(
+                    gmx::DataFileOptions(dirend)
+                        .throwIfNotFound(false));
+
+    std::vector<gmx::DataFileInfo> result;
+    for (size_t i = 0; i < candidates.size(); ++i)
     {
-        rc = gmx_directory_open(&dirhandle, f[i]);
-
-        if (rc == 0)
+        std::string testPath(gmx::Path::join(
+                                     candidates[i].dir, candidates[i].name, filename));
+        // TODO: Consider also checking that the directory can be listed.
+        if (gmx::File::exists(testPath))
         {
-            while (gmx_directory_nextfile(dirhandle, nextname, STRLEN-1) == 0)
-            {
-                nextname[STRLEN-1] = 0;
-                if (strcmp(nextname, filename) == 0)
-                {
-                    /* We have a match */
-                    srenew(dns, n+1);
-                    dns[n] = strdup(f_short[i]);
-                    n++;
-                }
-            }
-            gmx_directory_close(dirhandle);
+            result.push_back(candidates[i]);
         }
-        sfree(f[i]);
-        sfree(f_short[i]);
     }
-    sfree(f);
-    sfree(f_short);
 
-    *dirnames = dns;
+    // TODO: Consider merging this into enumerateFiles(), such that the error
+    // could also list the directories searched.
+    if (result.empty())
+    {
+        std::string message
+            = gmx::formatString("No force fields found (files with name '%s' "
+                                "in subdirectories ending on '%s')",
+                                filename, dirend);
+        GMX_THROW(gmx::InvalidInputError(message));
+    }
 
-    return n;
+    return result;
 }
 
 gmx_bool fflib_fexist(const char *file)
index 4d54ec40057110c99adc75f43352b7c424cbac3d..572235eee9b412c6b2d2ac92d2c816624fba4c55 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_GMXPREPROCESS_FFLIBUTIL_H
 #define GMX_GMXPREPROCESS_FFLIBUTIL_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
+#include <vector>
+
+#include "gromacs/utility/datafilefinder.h"
+
+/*! \brief
+ * Enumerates forcefields in the data directories.
+ */
+std::vector<gmx::DataFileInfo> fflib_enumerate_forcefields();
+
 extern "C" {
 #endif
 
@@ -71,12 +77,6 @@ int fflib_search_file_end(const char *ffdir,
  * Return the number of files and the file names in filenames.
  */
 
-int fflib_search_file_in_dirend(const char *filename, const char *dirend,
-                                char ***dirnames);
-/* Search for files with name filename in subdirectories with names
- * ending on dirend.
- * Return the number of files and the directory names in dirnames.
- */
 gmx_bool fflib_fexist(const char *file);
 /* Check if a file exists in the force field library */
 
index 4fb527ac0a53a5e32e74ab57906f579fe854a08e..61dc0f9cd71054b75324978d805b6e2249525407 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gen_ad.h"
 
 #include <ctype.h>
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/cstringutil.h"
 #include "gromacs/fileio/confio.h"
-#include "vec.h"
-#include "pbc.h"
-#include "toputil.h"
-#include "topio.h"
-#include "gpp_nextnb.h"
-#include "symtab.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "pgutil.h"
-#include "resall.h"
-#include "gen_ad.h"
+#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/topio.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define DIHEDRAL_WAS_SET_IN_RTP 0
 static gmx_bool was_dihedral_set_in_rtp(t_param *dih)
@@ -210,7 +206,7 @@ static void rm2par(t_param p[], int *np, peq eq)
             {
                 fprintf(debug,
                         "Something VERY strange is going on in rm2par (gen_ad.c)\n"
-                        "a[0] %u a[1] %u a[2] %u a[3] %u\n",
+                        "a[0] %d a[1] %d a[2] %d a[3] %d\n",
                         p[i].a[0], p[i].a[1], p[i].a[2], p[i].a[3]);
             }
             strcpy(p[i].s, "");
index 80ae02e989b40221ffe9f34dc6783211355c9d73..e8814a5cabe8491f960b7b543bafe0dfa9ad9712 100644 (file)
 #ifndef GMX_GMXPREPROCESS_GEN_AD_H
 #define GMX_GMXPREPROCESS_GEN_AD_H
 
-#include "typedefs.h"
-#include "toputil.h"
-#include "gpp_nextnb.h"
-#include "resall.h"
+#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 73326ac08fab1d321db7962b213803cac3c75571..02522be85facfea72c534ecfbc500d2fcfff594e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gen_maxwell_velocities.h"
 
 #include <math.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
-#include "sysstuff.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "gen_maxwell_velocities.h"
-#include "mtop_util.h"
 
 static void low_mspeed(real tempi,
                        gmx_mtop_t *mtop, rvec v[], gmx_rng_t rng)
@@ -107,7 +106,7 @@ void maxwell_speed(real tempi, unsigned int seed, gmx_mtop_t *mtop, rvec v[])
     if (seed == 0)
     {
         seed = gmx_rng_make_seed();
-        fprintf(stderr, "Using random seed %d for generating velocities\n", seed);
+        fprintf(stderr, "Using random seed %u for generating velocities\n", seed);
     }
 
     rng = gmx_rng_init(seed);
index 9752ca71ce65c42597b70a1b9240a707cb0c9766..2679948ceddcb28c7d200d3345baf1ea8ba87fd9 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_MAXWELL_VELOCITIES
 #define GMX_MAXWELL_VELOCITIES
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 4afe493cb3c097e6fa19e3108d41bf06944702aa..4d0e990044c17b47b9faf3c0d269383e98ceef72 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gen_vsite.h"
 
 #include <math.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
+#include "gromacs/gmxpreprocess/add_par.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gen_vsite.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "resall.h"
-#include "add_par.h"
-#include "vec.h"
-#include "toputil.h"
-#include "physics.h"
-#include "index.h"
-#include "names.h"
-#include "gromacs/fileio/futil.h"
-#include "gpp_atomtype.h"
-#include "fflibutil.h"
-#include "macros.h"
-
-#include "gmx_fatal.h"
 
 #define MAXNAME 32
 #define OPENDIR     '[' /* starting sign for directive         */
@@ -509,7 +508,7 @@ static void print_bonds(FILE *fp, int o2n[],
 }
 
 static int get_atype(int atom, t_atoms *at, int nrtp, t_restp rtp[],
-                     gmx_residuetype_t rt)
+                     gmx_residuetype_t *rt)
 {
     int      type;
     gmx_bool bNterm;
@@ -547,7 +546,7 @@ static int vsite_nm2type(const char *name, gpp_atomtype_t atype)
 }
 
 static real get_amass(int atom, t_atoms *at, int nrtp, t_restp rtp[],
-                      gmx_residuetype_t rt)
+                      gmx_residuetype_t *rt)
 {
     real     mass;
     gmx_bool bNterm;
@@ -1571,7 +1570,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
     char            **db;
     int               nvsiteconf, nvsitetop, cmplength;
     gmx_bool          isN, planarN, bFound;
-    gmx_residuetype_t rt;
+    gmx_residuetype_t*rt;
 
     t_vsiteconf      *vsiteconflist;
     /* pointer to a list of CH3/NH3/NH2 configuration entries.
@@ -2155,7 +2154,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
                 {
                     if (debug)
                     {
-                        fprintf(debug, " [%u -> %u]", params->param[i].a[j],
+                        fprintf(debug, " [%d -> %d]", params->param[i].a[j],
                                 params->param[i].a[j]-add_shift);
                     }
                     params->param[i].a[j] = params->param[i].a[j]-add_shift;
@@ -2164,7 +2163,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
                 {
                     if (debug)
                     {
-                        fprintf(debug, " [%u -> %d]", params->param[i].a[j],
+                        fprintf(debug, " [%d -> %d]", params->param[i].a[j],
                                 o2n[params->param[i].a[j]]);
                     }
                     params->param[i].a[j] = o2n[params->param[i].a[j]];
index 19f119211b27db9b9574ca3f09db05d8133038c6..6a350ef7093b373f8e8eded985adee4b06f76078 100644 (file)
 #ifndef GMX_GMXPREPROCESS_GEN_VSITE_H
 #define GMX_GMXPREPROCESS_GEN_VSITE_H
 
-#include "typedefs.h"
-#include "grompp-impl.h"
-#include "gpp_atomtype.h"
-#include "hackblock.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -51,7 +51,7 @@ extern "C"
 /* stuff for pdb2gmx */
 
 void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
-               t_atoms *at, t_symtab *symtab, rvec *x[],
+               t_atoms *at, struct t_symtab *symtab, rvec *x[],
                t_params plist[], int *dummy_type[], int *cgnr[],
                real mHmult, gmx_bool bVSiteAromatics,
                const char *ffdir);
index 52b7b048b38769c14b51ec8ac8fc23c327918f4b..9f9a57ce8cda8b3f08e81d47b2aa7b9273ffca21 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.
  */
+#include "gmxpre.h"
+
 #include "genconf.h"
 
-#include "gromacs/math/utilities.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "gromacs/fileio/confio.h"
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "gromacs/random/random.h"
-#include "gromacs/math/3dview.h"
-#include "txtdump.h"
-#include "readinp.h"
-#include "names.h"
-#include "sortwater.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/trxio.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/gmxpreprocess/sortwater.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/3dtransforms.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/random/random.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void rand_rot(int natoms, rvec x[], rvec v[], vec4 xrot[], vec4 vrot[],
                      gmx_rng_t rng, rvec max_rot)
@@ -71,27 +71,28 @@ static void rand_rot(int natoms, rvec x[], rvec v[], vec4 xrot[], vec4 vrot[],
     }
     fprintf(stderr, "center of geometry: %f, %f, %f\n", xcm[0], xcm[1], xcm[2]);
 
-    translate(-xcm[XX], -xcm[YY], -xcm[ZZ], mt1); /* move c.o.ma to origin */
+    /* move c.o.ma to origin */
+    gmx_mat4_init_translation(-xcm[XX], -xcm[YY], -xcm[ZZ], mt1);
     for (m = 0; (m < DIM); m++)
     {
         phi = M_PI*max_rot[m]*(2*gmx_rng_uniform_real(rng) - 1)/180;
-        rotate(m, phi, mr[m]);
+        gmx_mat4_init_rotation(m, phi, mr[m]);
     }
-    translate(xcm[XX], xcm[YY], xcm[ZZ], mt2);
+    gmx_mat4_init_translation(xcm[XX], xcm[YY], xcm[ZZ], mt2);
 
-    /* For mult_matrix we need to multiply in the opposite order
+    /* For gmx_mat4_mmul() we need to multiply in the opposite order
      * compared to normal mathematical notation.
      */
-    mult_matrix(mtemp1, mt1, mr[XX]);
-    mult_matrix(mtemp2, mr[YY], mr[ZZ]);
-    mult_matrix(mtemp3, mtemp1, mtemp2);
-    mult_matrix(mxtot, mtemp3, mt2);
-    mult_matrix(mvtot, mr[XX], mtemp2);
+    gmx_mat4_mmul(mtemp1, mt1, mr[XX]);
+    gmx_mat4_mmul(mtemp2, mr[YY], mr[ZZ]);
+    gmx_mat4_mmul(mtemp3, mtemp1, mtemp2);
+    gmx_mat4_mmul(mxtot, mtemp3, mt2);
+    gmx_mat4_mmul(mvtot, mr[XX], mtemp2);
 
     for (i = 0; (i < natoms); i++)
     {
-        m4_op(mxtot, x[i], xrot[i]);
-        m4_op(mvtot, v[i], vrot[i]);
+        gmx_mat4_transform_point(mxtot, x[i], xrot[i]);
+        gmx_mat4_transform_point(mvtot, v[i], vrot[i]);
     }
 }
 
index afcadb43b4b09b5f96df7d4f074426171ccc133f..3a85fa12094f8a8201a5647d3174d605c1619db1 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "genhydro.h"
 
 #include <string.h>
 #include <time.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
 #include "gromacs/fileio/confio.h"
-#include "symtab.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
-#include "physics.h"
-#include "calch.h"
-#include "genhydro.h"
-#include "h_db.h"
-#include "ter_db.h"
-#include "resall.h"
-#include "pgutil.h"
-#include "network.h"
-#include "macros.h"
+#include "gromacs/gmxpreprocess/calch.h"
+#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/ter_db.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void copy_atom(t_atoms *atoms1, int a1, t_atoms *atoms2, int a2)
 {
     atoms2->atom[a2] = atoms1->atom[a1];
     snew(atoms2->atomname[a2], 1);
-    *atoms2->atomname[a2] = strdup(*atoms1->atomname[a1]);
+    *atoms2->atomname[a2] = gmx_strdup(*atoms1->atomname[a1]);
 }
 
 static atom_id pdbasearch_atom(const char *name, int resind, t_atoms *pdba,
@@ -169,7 +166,7 @@ static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
         {
             if (hb[rnr].name == NULL)
             {
-                hb[rnr].name = strdup(ahptr->name);
+                hb[rnr].name = gmx_strdup(ahptr->name);
             }
             merge_hacks(ahptr, &hb[rnr]);
         }
@@ -234,7 +231,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
                 {
                     if ( (*abi)[*nabi + k].oname == NULL)
                     {
-                        (*abi)[*nabi + k].nname    = strdup(atomname);
+                        (*abi)[*nabi + k].nname    = gmx_strdup(atomname);
                         (*abi)[*nabi + k].nname[0] = 'H';
                     }
                 }
@@ -248,7 +245,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
                                 (*abi)[*nabi + k].oname ? (*abi)[*nabi + k].oname : "");
                     }
                     sfree((*abi)[*nabi + k].nname);
-                    (*abi)[*nabi + k].nname = strdup(hbr->hack[j].nname);
+                    (*abi)[*nabi + k].nname = gmx_strdup(hbr->hack[j].nname);
                 }
 
                 if (hbr->hack[j].tp == 10 && k == 2)
@@ -669,7 +666,7 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                                         ab[i][j].nname);
                             }
                             snew(newpdba->atomname[newi], 1);
-                            *newpdba->atomname[newi] = strdup(ab[i][j].nname);
+                            *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; */
 /*        newpdba->atom[newi].q    = ab[i][j].atom->q; */
index ed5b07f37dae5179453313e761b1f2316617ca44..9161a33324d63b8786358f7ed2b5ca285818a0d5 100644 (file)
@@ -39,7 +39,7 @@
 #define GMX_GMXPREPROCESS_GENHYDRO_H
 
 #include "gromacs/fileio/pdbio.h"
-#include "hackblock.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 
 #ifdef __cplusplus
 extern "C" {
index d9265d483192da1f736873455a97df2281008037..90ad4aabcfbb33a3cef904e6896f8effea707880 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <sys/types.h>
+#include "gmxcpp.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
 #include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include <ctype.h>
 
+#include <sys/types.h>
+
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "gmxcpp.h"
 
 typedef struct {
     char *name;
@@ -169,7 +170,7 @@ static void add_include(const char *include)
     {
         nincl++;
         srenew(incl, nincl);
-        incl[nincl-1] = strdup(include);
+        incl[nincl-1] = gmx_strdup(include);
     }
 }
 
@@ -201,7 +202,7 @@ static void add_define(const char *name, const char *value)
         ndef++;
         srenew(defs, ndef);
         i            = ndef - 1;
-        defs[i].name = strdup(name);
+        defs[i].name = gmx_strdup(name);
     }
     else if (defs[i].def)
     {
@@ -213,7 +214,7 @@ static void add_define(const char *name, const char *value)
     }
     if (value && strlen(value) > 0)
     {
-        defs[i].def  = strdup(value);
+        defs[i].def  = gmx_strdup(value);
     }
     else
     {
@@ -284,7 +285,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
     /* Find the file. First check whether it is in the current directory. */
     if (gmx_fexist(filenm))
     {
-        cpp->fn = strdup(filenm);
+        cpp->fn = gmx_strdup(filenm);
     }
     else
     {
@@ -334,7 +335,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
     {
         cpp->path = cpp->fn;
         *ptr      = '\0';
-        cpp->fn   = strdup(ptr+1);
+        cpp->fn   = gmx_strdup(ptr+1);
         snew(cpp->cwd, STRLEN);
 
         gmx_getcwd(cpp->cwd, STRLEN);
@@ -809,5 +810,5 @@ char *cpp_error(gmx_cpp_t *handlep, int status)
             (handle) ? handle->line_nr : -1,
             handle->line ? handle->line : "");
 
-    return strdup(buf);
+    return gmx_strdup(buf);
 }
index 31a39aec157e9438ef17b08ee9464b8bdc2fb43b..4a9c932b0f93c8dd01f095bbc21acf0d006e4108 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gpp_atomtype.h"
 
 #include <math.h>
 #include <string.h>
 
+#include "gromacs/gmxpreprocess/topdirs.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "macros.h"
-#include "topdirs.h"
-#include "toputil.h"
-#include "topdirs.h"
-#include "toputil.h"
-#include "symtab.h"
-#include "gmx_fatal.h"
-#include "txtdump.h"
-#include "gpp_atomtype.h"
 
 typedef struct gpp_atomtype {
     int              nr;           /* The number of atomtypes          */
@@ -372,7 +367,6 @@ void done_atomtype(gpp_atomtype_t ga)
     sfree(ga->atomnumber);
     ga->nr = 0;
     sfree(ga);
-    ga = NULL;
 }
 
 static int search_atomtypes(gpp_atomtype_t ga, int *n, int typelist[],
index fd435f83d289e7568ffee48fea1c15eb36e6d7f0..9dd46548b3ae6fa8eece4e85583559e92ed09e62 100644 (file)
@@ -39,8 +39,9 @@
 #define GMX_GMXPREPROCESS_GPP_ATOMTYPE_H
 
 #include <stdio.h>
-#include "typedefs.h"
-#include "grompp-impl.h"
+
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -82,7 +83,7 @@ gpp_atomtype_t init_atomtype(void);
 void done_atomtype(gpp_atomtype_t at);
 /* Free the memory in the structure */
 
-int set_atomtype(int nt, gpp_atomtype_t at, t_symtab *tab,
+int set_atomtype(int nt, gpp_atomtype_t at, struct t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
                  int bondatomtype,
                  real radius, real vol, real surftens, int atomnumber,
@@ -95,7 +96,7 @@ set_atomtype_gbparam(gpp_atomtype_t at, int i,
                      real radius, real vol, real surftens,
                      real gb_radius, real S_hct);
 
-int add_atomtype(gpp_atomtype_t at, t_symtab *tab,
+int add_atomtype(gpp_atomtype_t at, struct t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
                  int bondatomtype,
                  real radius, real vol, real surftens, real atomnumber,
index ae3657e47673b7fb8df25a73494d6f59e7573fc5..6a39e71f88de1d02f7979549a9bac577772bb61e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "macros.h"
-#include "symtab.h"
-#include "gromacs/utility/cstringutil.h"
 #include "gpp_bond_atomtype.h"
 
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+
 typedef struct {
     int              nr;       /* The number of atomtypes              */
     char          ***atomname; /* Names of the atomtypes               */
index b8e34028678aaad9ac6900f177e9921a48a5c772..c901d9b1f07484ab890e755a1ff22eb92cbb157c 100644 (file)
 #ifndef GMX_GMXPREPROCESS_GPP_BONDATOMTYPE_H
 #define GMX_GMXPREPROCESS_GPP_BONDATOMTYPE_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -64,7 +61,7 @@ t_bond_atomtype init_bond_atomtype(void);
 void done_bond_atomtype(t_bond_atomtype *at);
 /* Free the memory in the structure */
 
-void add_bond_atomtype(t_bond_atomtype at, t_symtab *tab,
+void add_bond_atomtype(t_bond_atomtype at, struct t_symtab *tab,
                        char *name);
 /* Add a complete new atom type to an existing atomtype structure */
 
index b90c82274286efc4b578f09df67a01f91fa47809..ac779b14bdb2489eb34c261b3a3bc26a23597475 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gpp_nextnb.h"
 
-#include "sysstuff.h"
+#include <stdlib.h>
+
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
+
 /* #define DEBUG_NNB */
-#include "gpp_nextnb.h"
-#include "gmx_fatal.h"
-#include "toputil.h"
 
 typedef struct {
     int ai, aj;
index e06a3824171e72b1c8e882013f5ee93432765213..c5dde3865e4d3451ddf8a87fd2b98297d1ed38fc 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_GPP_NEXTNB_H
 #define GMX_GMXPREPROCESS_GPP_NEXTNB_H
 
-#include "grompp-impl.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 
 #ifdef __cplusplus
 extern "C" {
index 8e0cef6d7e39a5a6ac0f44ae8cd942dc7ae08db5..6c1093c50f803e6caadeec8f5e7a053a8cae4539 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_GROMPP_IMPL_H
 #define GMX_GMXPREPROCESS_GROMPP_IMPL_H
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -54,6 +54,28 @@ typedef struct {
  * non-bonded parameter combinations, which will be copied to t_params.
  */
 
+#ifndef __cplusplus
+/*
+ * With the macros below you don't
+ * have to use an index if you don't wan't to. You can eg. use
+ * param.C0 instead of param.c[0].
+ * In a similar fashion, you can use param.AI instead of
+ * param.a[0]
+ *
+ * For C++ those should be replaced with member functions.
+ */
+
+#define AI  a[0]
+#define AJ  a[1]
+#define AK  a[2]
+#define AL  a[3]
+#define AM  a[4]
+
+#define C0  c[0]
+#define C1  c[1]
+#define C2  c[2]
+#endif
+
 typedef struct {
     atom_id    a[MAXATOMLIST];   /* The atom list (eg. bonds: particle */
     /* i = a[0] (AI), j = a[1] (AJ))   */
index 04ee47de4053d37c9ffca49f81165448a4312224..abdb5d1456441de5aa783e6f25e01d2aa9ca80ac 100644 (file)
@@ -3,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,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.
  * 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 "grompp.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "grompp.h"
 
-#include <sys/types.h>
-#include <math.h>
-#include <string.h>
+#include <assert.h>
 #include <errno.h>
 #include <limits.h>
-#include <assert.h>
+#include <math.h>
+#include <string.h>
+
+#include <sys/types.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "readir.h"
-#include "toputil.h"
-#include "topio.h"
-#include "gromacs/fileio/confio.h"
-#include "readir.h"
-#include "symtab.h"
-#include "names.h"
-#include "grompp-impl.h"
-#include "gromacs/random/random.h"
-#include "gromacs/gmxpreprocess/gen_maxwell_velocities.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "splitter.h"
-#include "gromacs/gmxpreprocess/sortwater.h"
-#include "convparm.h"
-#include "gmx_fatal.h"
-#include "warninp.h"
-#include "index.h"
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/trxio.h"
-#include "vsite_parm.h"
-#include "txtdump.h"
-#include "calcgrid.h"
-#include "add_par.h"
-#include "gromacs/fileio/enxio.h"
-#include "perf_est.h"
-#include "compute_io.h"
-#include "gpp_atomtype.h"
-#include "mtop_util.h"
-#include "genborn.h"
-#include "calc_verletbuf.h"
-#include "tomorse.h"
+#include "gromacs/gmxpreprocess/add_par.h"
+#include "gromacs/gmxpreprocess/calc_verletbuf.h"
+#include "gromacs/gmxpreprocess/compute_io.h"
+#include "gromacs/gmxpreprocess/convparm.h"
+#include "gromacs/gmxpreprocess/gen_maxwell_velocities.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/gmxpreprocess/sortwater.h"
+#include "gromacs/gmxpreprocess/tomorse.h"
+#include "gromacs/gmxpreprocess/topio.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/gmxpreprocess/vsite_parm.h"
 #include "gromacs/imd/imd.h"
+#include "gromacs/legacyheaders/calcgrid.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/perf_est.h"
+#include "gromacs/legacyheaders/splitter.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/warninp.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/random/random.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/cstringutil.h"
-
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 static int rm_interactions(int ifunc, int nrmols, t_molinfo mols[])
 {
@@ -405,6 +403,8 @@ static void check_shells_inputrec(gmx_mtop_t *mtop,
     }
 }
 
+/* TODO Decide whether this function can be consolidated with
+ * gmx_mtop_ftype_count */
 static gmx_bool nint_ftype(gmx_mtop_t *mtop, t_molinfo *mi, int ftype)
 {
     int nint, mb;
@@ -627,11 +627,21 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
                     nmismatch, (nmismatch == 1) ? "" : "s", topfile, confin);
             warning(wi, buf);
         }
+
+        /* Do more checks, mostly related to constraints */
         if (bVerbose)
         {
             fprintf(stderr, "double-checking input for internal consistency...\n");
         }
-        double_check(ir, state->box, nint_ftype(sys, molinfo, F_CONSTR), wi);
+        {
+            int bHasNormalConstraints = 0 < (nint_ftype(sys, molinfo, F_CONSTR) +
+                                             nint_ftype(sys, molinfo, F_CONSTRNC));
+            int bHasAnyConstraints = bHasNormalConstraints || 0 < nint_ftype(sys, molinfo, F_SETTLE);
+            double_check(ir, state->box,
+                         bHasNormalConstraints,
+                         bHasAnyConstraints,
+                         wi);
+        }
     }
 
     if (bGenVel)
@@ -1536,7 +1546,7 @@ int gmx_grompp(int argc, char *argv[])
         { efNDX, NULL,  NULL,        ffOPTRD },
         { efTOP, NULL,  NULL,        ffREAD  },
         { efTOP, "-pp", "processed", ffOPTWR },
-        { efTPX, "-o",  NULL,        ffWRITE },
+        { efTPR, "-o",  NULL,        ffWRITE },
         { efTRN, "-t",  NULL,        ffOPTRD },
         { efEDR, "-e",  NULL,        ffOPTRD },
         /* This group is needed by the VMD viewer as the start configuration for IMD sessions: */
@@ -2085,7 +2095,7 @@ int gmx_grompp(int argc, char *argv[])
     }
 
     done_warning(wi, FARGS);
-    write_tpx_state(ftp2fn(efTPX, 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);
index 25ec285e06fe24d57ae029989b7aaddaf0910e4b..f630ae787608c69c80730c6cd01c4e4ce7aee2e2 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "h_db.h"
+
+#include <stdlib.h>
 #include <string.h>
+
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "sysstuff.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "symtab.h"
-#include "h_db.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "fflibutil.h"
-#include "gmx_fatal.h"
-#include "macros.h"
 
 /* Number of control atoms for each 'add' type.
  *
@@ -110,14 +109,14 @@ void read_ab(char *line, const char *fn, t_hack *hack)
     }
     for (i = 0; (i < hack->nctl); i++)
     {
-        hack->a[i] = strdup(a[i]);
+        hack->a[i] = gmx_strdup(a[i]);
     }
     for (; i < 4; i++)
     {
         hack->a[i] = NULL;
     }
     hack->oname = NULL;
-    hack->nname = strdup(hn);
+    hack->nname = gmx_strdup(hn);
     hack->atom  = NULL;
     hack->cgnr  = NOTSET;
     hack->bXSet = FALSE;
@@ -163,8 +162,8 @@ static void read_h_db_file(const char *hfn, int *nahptr, t_hackblock **ah)
         }
         srenew(aah, nah+1);
         clear_t_hackblock(&aah[nah]);
-        aah[nah].name     = strdup(buf);
-        aah[nah].filebase = strdup(filebase);
+        aah[nah].name     = gmx_strdup(buf);
+        aah[nah].filebase = gmx_strdup(filebase);
 
         if (sscanf(line+n, "%d", &nab) == 1)
         {
index 604966552b26d006585b95a01aae4c26dd87ba29..24f873b6c2e3fb913b269d925e7c479f024c92a7 100644 (file)
@@ -38,8 +38,9 @@
 #ifndef GMX_GMXPREPROCESS_H_DB_H
 #define GMX_GMXPREPROCESS_H_DB_H
 
-#include "sysstuff.h"
-#include "hackblock.h"
+#include <stdio.h>
+
+#include "gromacs/gmxpreprocess/hackblock.h"
 
 #ifdef __cplusplus
 extern "C" {
index 0e4e1c1cfa988a8723208fb7e5620eda7d03d1f0..c30a69851b82c6b85476b52c3bab218c1dfd0571 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
 #include "hackblock.h"
+
+#include <string.h>
+
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "macros.h"
-#include "names.h"
 
 /* these MUST correspond to the enum in hackblock.h */
 const char *btsNames[ebtsNR] = { "bonds", "angles", "dihedrals", "impropers", "exclusions", "cmap" };
@@ -94,7 +94,7 @@ void free_t_restp(int nrtp, t_restp **rtp)
             free_t_bondeds(&(*rtp)[i].rb[j]);
         }
     }
-    free(*rtp);
+    sfree(*rtp);
 }
 
 void free_t_hack(int nh, t_hack **h)
@@ -167,7 +167,7 @@ void clear_t_hack(t_hack *hack)
     }
 }
 
-#define safe_strdup(str) ((str != NULL) ? strdup(str) : NULL)
+#define safe_strdup(str) ((str != NULL) ? gmx_strdup(str) : NULL)
 
 static void copy_t_rbonded(t_rbonded *s, t_rbonded *d)
 {
index 4bbbb7d9e5e8690efbe07c9cad3d2147c71c9357..294dcec86c486006856beeae573b874907c00fb9 100644 (file)
 #ifndef GMX_GMXPREPROCESS_HACKBLOCK_H
 #define GMX_GMXPREPROCESS_HACKBLOCK_H
 
-#include "typedefs.h"
-#include "../fileio/pdbio.h"
-#include "grompp-impl.h"
-#include "gpp_atomtype.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/topology/symtab.h"
 
 #ifdef __cplusplus
 extern "C" {
index 4274d779880b47adfd6d1958006918bd3010ec08..0aff84f7a41b04bac8fbf85c3ebeac82ef960f50 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdio.h>
 #include <string.h>
-#include "typedefs.h"
+
 #include "gromacs/fileio/pdbio.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "physics.h"
-#include "toputil.h"
-#include "pdb2top.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/block.h"
 #include "gromacs/utility/cstringutil.h"
-#include "macros.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static int in_strings(char *key, int nstr, const char **str)
 {
@@ -349,7 +348,7 @@ void set_histp(t_atoms *pdba, rvec *x, real angle, real dist)
                 }
 
                 snew(pdba->resinfo[hisind].rtp, 1);
-                *pdba->resinfo[hisind].rtp = strdup(hh[type]);
+                *pdba->resinfo[hisind].rtp = gmx_strdup(hh[type]);
             }
         }
     }
index c60b4d0d03c2678e25e7db81d38669ecabc3905d..14b92616bcbc83518d77f14f399d1b96f44489fe 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.
  */
-#include "insert-molecules.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "insert-molecules.h"
 
+#include <algorithm>
+#include <string>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/math/utilities.h"
+#include "gromacs/commandline/cmdlineoptionsmodule.h"
 #include "gromacs/fileio/confio.h"
-#include "macros.h"
-#include "gromacs/random/random.h"
-#include "gromacs/fileio/futil.h"
-#include "atomprop.h"
-#include "names.h"
-#include "vec.h"
-#include "gmx_fatal.h"
-#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxlib/conformation-utilities.h"
-#include "addconf.h"
-#include "read-conformation.h"
-#include "pbc.h"
-#include "xvgr.h"
-
-static gmx_bool in_box(t_pbc *pbc, rvec x)
-{
-    rvec box_center, dx;
-    int  shift;
-
-    /* pbc_dx_aiuc only works correctly with the rectangular box center */
-    calc_box_center(ecenterRECT, pbc->box, box_center);
+#include "gromacs/gmxpreprocess/read-conformation.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/random/random.h"
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
-    shift = pbc_dx_aiuc(pbc, x, box_center, dx);
+/* enum for random rotations of inserted solutes */
+enum {
+    en_rotXYZ, en_rotZ, en_rotNone
+};
 
-    return (shift == CENTRAL);
+static void center_molecule(int atomCount, rvec x[])
+{
+    rvec center;
+    clear_rvec(center);
+    for (int i = 0; i < atomCount; ++i)
+    {
+        rvec_inc(center, x[i]);
+    }
+    svmul(1.0/atomCount, center, center);
+    for (int i = 0; i < atomCount; ++i)
+    {
+        rvec_dec(x[i], center);
+    }
 }
 
-/* This is a (maybe) slow workaround to avoid the neighbor searching in addconf.c, which
- * leaks memory (May 2012). The function could be deleted as soon as the memory leaks
- * there are fixed.
- * However, when inserting a small molecule in a system containing not too many atoms,
- * allPairsDistOk is probably even faster than the other code.
- */
-static gmx_bool
-allPairsDistOk(t_atoms *atoms, rvec *x, real *exclusionDistances,
-               int ePBC, matrix box,
-               t_atoms *atoms_insrt, rvec *x_n, real *exclusionDistances_insrt)
+static void generate_trial_conf(int atomCount, const rvec xin[],
+                                const rvec offset, int enum_rot, gmx_rng_t rng,
+                                rvec xout[])
 {
-    int   i, j;
-    rvec  dx;
-    real  n2, r2;
-    t_pbc pbc;
+    for (int i = 0; i < atomCount; ++i)
+    {
+        copy_rvec(xin[i], xout[i]);
+    }
+    real alfa = 0.0, beta = 0.0, gamma = 0.0;
+    switch (enum_rot)
+    {
+        case en_rotXYZ:
+            alfa  = 2*M_PI * gmx_rng_uniform_real(rng);
+            beta  = 2*M_PI * gmx_rng_uniform_real(rng);
+            gamma = 2*M_PI * gmx_rng_uniform_real(rng);
+            break;
+        case en_rotZ:
+            alfa  = beta = 0.;
+            gamma = 2*M_PI * gmx_rng_uniform_real(rng);
+            break;
+        case en_rotNone:
+            alfa = beta = gamma = 0.;
+            break;
+    }
+    if (enum_rot == en_rotXYZ || (enum_rot == en_rotZ))
+    {
+        rotate_conf(atomCount, xout, NULL, alfa, beta, gamma);
+    }
+    for (int i = 0; i < atomCount; ++i)
+    {
+        rvec_inc(xout[i], offset);
+    }
+}
 
-    set_pbc(&pbc, ePBC, box);
-    for (i = 0; i < atoms->nr; i++)
+static bool is_insertion_allowed(gmx::AnalysisNeighborhoodSearch *search,
+                                 const real *exclusionDistances,
+                                 int atomCount, const rvec *x,
+                                 const real *exclusionDistances_insrt)
+{
+    gmx::AnalysisNeighborhoodPositions  pos(x, atomCount);
+    gmx::AnalysisNeighborhoodPairSearch pairSearch = search->startPairSearch(pos);
+    gmx::AnalysisNeighborhoodPair       pair;
+    while (pairSearch.findNextPair(&pair))
     {
-        for (j = 0; j < atoms_insrt->nr; j++)
+        const real r1 = exclusionDistances[pair.refIndex()];
+        const real r2 = exclusionDistances_insrt[pair.testIndex()];
+        if (pair.distance2() < sqr(r1 + r2))
         {
-            pbc_dx(&pbc, x[i], x_n[j], dx);
-            n2 = norm2(dx);
-            r2 = sqr(exclusionDistances[i]+exclusionDistances_insrt[j]);
-            if (n2 < r2)
-            {
-                return FALSE;
-            }
+            return false;
         }
     }
-    return TRUE;
+    return true;
 }
 
-/* enum for random rotations of inserted solutes */
-enum {
-    en_rot, en_rotXYZ, en_rotZ, en_rotNone, en_NR
-};
+static void merge_atoms_noalloc(t_atoms *atoms, const t_atoms *atoms_add)
+{
+    int resnr = 0;
+    if (atoms->nr > 0)
+    {
+        resnr = atoms->resinfo[atoms->atom[atoms->nr-1].resind].nr;
+    }
+    int prevResInd = -1;
+    for (int i = 0; i < atoms_add->nr; ++i)
+    {
+        if (atoms_add->atom[i].resind != prevResInd)
+        {
+            prevResInd = atoms_add->atom[i].resind;
+            ++resnr;
+            atoms->resinfo[atoms->nres]    = atoms_add->resinfo[prevResInd];
+            atoms->resinfo[atoms->nres].nr = resnr;
+            ++atoms->nres;
+        }
+        atoms->atom[atoms->nr]        = atoms_add->atom[i];
+        atoms->atomname[atoms->nr]    = atoms_add->atomname[i];
+        atoms->atom[atoms->nr].resind = atoms->nres-1;
+        ++atoms->nr;
+    }
+}
 
-static char *insert_mols(const char *mol_insrt, int nmol_insrt, int ntry, int seed,
-                         t_atoms *atoms, rvec **x, real **exclusionDistances, int ePBC, matrix box,
-                         gmx_atomprop_t aps,
-                         real defaultDistance, real scaleFactor, real rshell,
-                         const output_env_t oenv,
-                         const char* posfn, const rvec deltaR, int enum_rot,
-                         gmx_bool bCheckAllPairDist)
+static void insert_mols(int nmol_insrt, int ntry, int seed,
+                        real defaultDistance, real scaleFactor,
+                        t_atoms *atoms, rvec **x,
+                        const t_atoms *atoms_insrt, const rvec *x_insrt,
+                        int ePBC, matrix box,
+                        const std::string &posfn, const rvec deltaR, int enum_rot)
 {
     t_pbc            pbc;
-    static  char    *title_insrt;
-    t_atoms          atoms_insrt;
-    rvec            *x_insrt, *x_n;
-    real            *exclusionDistances_insrt;
-    int              ePBC_insrt;
-    matrix           box_insrt;
-    int              i, mol, onr, ncol;
-    real             alfa = 0., beta = 0., gamma = 0.;
-    rvec             offset_x;
-    int              trial;
-    double         **rpos;
-    gmx_rng_t        rng;
-
-    rng = gmx_rng_init(seed);
-    set_pbc(&pbc, ePBC, box);
+    rvec            *x_n;
+
+    fprintf(stderr, "Initialising inter-atomic distances...\n");
+    gmx_atomprop_t   aps = gmx_atomprop_init();
+    real            *exclusionDistances
+        = makeExclusionDistances(atoms, aps, defaultDistance, scaleFactor);
+    real            *exclusionDistances_insrt
+        = makeExclusionDistances(atoms_insrt, aps, defaultDistance, scaleFactor);
+    gmx_atomprop_destroy(aps);
 
-    /* read number of atoms of insert molecules */
+    const real       maxInsertRadius
+        = *std::max_element(exclusionDistances_insrt,
+                            exclusionDistances_insrt + atoms_insrt->nr);
+    real             maxRadius = maxInsertRadius;
+    if (atoms->nr > 0)
     {
-        int natoms;
-        get_stx_coordnum(mol_insrt, &natoms);
-        if (natoms == 0)
-        {
-            gmx_fatal(FARGS, "No molecule in %s, please check your input\n", mol_insrt);
-        }
-        init_t_atoms(&atoms_insrt, natoms, FALSE);
+        const real maxExistingRadius
+            = *std::max_element(exclusionDistances,
+                                exclusionDistances + atoms->nr);
+        maxRadius = std::max(maxInsertRadius, maxExistingRadius);
     }
-    /* allocate memory for atom coordinates of insert molecules */
-    snew(x_insrt, atoms_insrt.nr);
-    snew(atoms_insrt.resinfo, atoms_insrt.nr);
-    snew(atoms_insrt.atomname, atoms_insrt.nr);
-    snew(atoms_insrt.atom, atoms_insrt.nr);
-    atoms_insrt.pdbinfo = NULL;
-    snew(x_n, atoms_insrt.nr);
-    snew(title_insrt, STRLEN);
-
-    /* read residue number, residue names, atomnames, coordinates etc. */
-    fprintf(stderr, "Reading molecule configuration \n");
-    read_stx_conf(mol_insrt, title_insrt, &atoms_insrt, x_insrt, NULL,
-                  &ePBC_insrt, box_insrt);
-    fprintf(stderr, "%s\nContaining %d atoms in %d residue\n",
-            title_insrt, atoms_insrt.nr, atoms_insrt.nres);
-    srenew(atoms_insrt.resinfo, atoms_insrt.nres);
-
-    /* initialise distance arrays for inserted molecules */
-    exclusionDistances_insrt = makeExclusionDistances(&atoms_insrt, aps, defaultDistance, scaleFactor);
+
+    // TODO: Make all of this exception-safe.
+    gmx::AnalysisNeighborhood nb;
+    nb.setCutoff(maxInsertRadius + maxRadius);
+
+    gmx_rng_t        rng = gmx_rng_init(seed);
+    set_pbc(&pbc, ePBC, box);
+
+    snew(x_n, atoms_insrt->nr);
 
     /* With -ip, take nmol_insrt from file posfn */
-    if (posfn != NULL)
+    double         **rpos = NULL;
+    if (!posfn.empty())
     {
-        nmol_insrt = read_xvg(posfn, &rpos, &ncol);
+        int ncol;
+        nmol_insrt = read_xvg(posfn.c_str(), &rpos, &ncol);
         if (ncol != 3)
         {
-            gmx_fatal(FARGS, "Expected 3 columns (x/y/z coordinates) in file %s\n", ncol, posfn);
+            gmx_fatal(FARGS, "Expected 3 columns (x/y/z coordinates) in file %s\n",
+                      posfn.c_str());
         }
-        fprintf(stderr, "Read %d positions from file %s\n\n", nmol_insrt, posfn);
+        fprintf(stderr, "Read %d positions from file %s\n\n",
+                nmol_insrt, posfn.c_str());
     }
 
-    srenew(atoms->resinfo, (atoms->nres+nmol_insrt*atoms_insrt.nres));
-    srenew(atoms->atomname, (atoms->nr+atoms_insrt.nr*nmol_insrt));
-    srenew(atoms->atom, (atoms->nr+atoms_insrt.nr*nmol_insrt));
-    srenew(*x, (atoms->nr+atoms_insrt.nr*nmol_insrt));
-    srenew(*exclusionDistances, (atoms->nr+atoms_insrt.nr*nmol_insrt));
+    {
+        const int finalAtomCount    = atoms->nr + nmol_insrt * atoms_insrt->nr;
+        const int finalResidueCount = atoms->nres + nmol_insrt * atoms_insrt->nres;
+        srenew(atoms->resinfo,      finalResidueCount);
+        srenew(atoms->atomname,     finalAtomCount);
+        srenew(atoms->atom,         finalAtomCount);
+        srenew(*x,                  finalAtomCount);
+        srenew(exclusionDistances,  finalAtomCount);
+    }
 
-    trial = mol = 0;
+    int mol        = 0;
+    int trial      = 0;
+    int firstTrial = 0;
+    int failed     = 0;
     while ((mol < nmol_insrt) && (trial < ntry*nmol_insrt))
     {
-        fprintf(stderr, "\rTry %d", trial++);
-        for (i = 0; (i < atoms_insrt.nr); i++)
-        {
-            copy_rvec(x_insrt[i], x_n[i]);
-        }
-        switch (enum_rot)
-        {
-            case en_rotXYZ:
-                alfa  = 2*M_PI * gmx_rng_uniform_real(rng);
-                beta  = 2*M_PI * gmx_rng_uniform_real(rng);
-                gamma = 2*M_PI * gmx_rng_uniform_real(rng);
-                break;
-            case en_rotZ:
-                alfa  = beta = 0.;
-                gamma = 2*M_PI * gmx_rng_uniform_real(rng);
-                break;
-            case en_rotNone:
-                alfa = beta = gamma = 0.;
-                break;
-        }
-        if (enum_rot == en_rotXYZ || (enum_rot == en_rotZ))
-        {
-            rotate_conf(atoms_insrt.nr, x_n, NULL, alfa, beta, gamma);
-        }
-        if (posfn == NULL)
+        rvec offset_x;
+        if (posfn.empty())
         {
-            /* insert at random positions */
+            // Insert at random positions.
             offset_x[XX] = box[XX][XX] * gmx_rng_uniform_real(rng);
             offset_x[YY] = box[YY][YY] * gmx_rng_uniform_real(rng);
             offset_x[ZZ] = box[ZZ][ZZ] * gmx_rng_uniform_real(rng);
-            make_new_box(atoms_insrt.nr, x_n, box_insrt, offset_x, TRUE);
-            if (!in_box(&pbc, x_n[0]) || !in_box(&pbc, x_n[atoms_insrt.nr-1]))
-            {
-                continue;
-            }
         }
         else
         {
-            /* Insert at positions taken from option -ip file */
+            // Skip a position if ntry trials were not successful.
+            if (trial >= firstTrial + ntry)
+            {
+                fprintf(stderr, " skipped position (%.3f, %.3f, %.3f)\n",
+                        rpos[XX][mol], rpos[YY][mol], rpos[ZZ][mol]);
+                ++mol;
+                ++failed;
+            }
+            // Insert at positions taken from option -ip file.
             offset_x[XX] = rpos[XX][mol] + deltaR[XX]*(2 * gmx_rng_uniform_real(rng)-1);
             offset_x[YY] = rpos[YY][mol] + deltaR[YY]*(2 * gmx_rng_uniform_real(rng)-1);
             offset_x[ZZ] = rpos[ZZ][mol] + deltaR[ZZ]*(2 * gmx_rng_uniform_real(rng)-1);
-            for (i = 0; i < atoms_insrt.nr; i++)
-            {
-                rvec_inc(x_n[i], offset_x);
-            }
         }
-
-        onr = atoms->nr;
-
-        /* This is a (maybe) slow workaround to avoid too many calls of add_conf, which
-         * leaks memory (status May 2012). If the momory leaks in add_conf() are fixed,
-         * this check could be removed. Note, however, that allPairsDistOk is probably
-         * even faster than add_conf() when inserting a small molecule into a moderately
-         * small system.
-         */
-        if (bCheckAllPairDist && !allPairsDistOk(atoms, *x, *exclusionDistances, ePBC, box, &atoms_insrt, x_n, exclusionDistances_insrt))
+        fprintf(stderr, "\rTry %d", ++trial);
+        generate_trial_conf(atoms_insrt->nr, x_insrt, offset_x, enum_rot, rng,
+                            x_n);
+        gmx::AnalysisNeighborhoodPositions pos(*x, atoms->nr);
+        gmx::AnalysisNeighborhoodSearch    search = nb.initSearch(&pbc, pos);
+        if (is_insertion_allowed(&search, exclusionDistances, atoms_insrt->nr,
+                                 x_n, exclusionDistances_insrt))
         {
-            continue;
-        }
-
-        add_conf(atoms, x, NULL, exclusionDistances, FALSE, ePBC, box, TRUE,
-                 &atoms_insrt, x_n, NULL, exclusionDistances_insrt, FALSE, rshell, 0, oenv);
-
-        if (atoms->nr == (atoms_insrt.nr+onr))
-        {
-            mol++;
+            const int firstIndex = atoms->nr;
+            for (int i = 0; i < atoms_insrt->nr; ++i)
+            {
+                copy_rvec(x_n[i], (*x)[firstIndex + i]);
+                exclusionDistances[firstIndex + i] = exclusionDistances_insrt[i];
+            }
+            merge_atoms_noalloc(atoms, atoms_insrt);
+            ++mol;
+            firstTrial = trial;
             fprintf(stderr, " success (now %d atoms)!\n", atoms->nr);
         }
     }
@@ -261,23 +278,70 @@ static char *insert_mols(const char *mol_insrt, int nmol_insrt, int ntry, int se
     srenew(atoms->atomname, atoms->nr);
     srenew(atoms->atom,     atoms->nr);
     srenew(*x,              atoms->nr);
-    srenew(*exclusionDistances, atoms->nr);
 
     fprintf(stderr, "\n");
     /* print number of molecules added */
-    fprintf(stderr, "Added %d molecules (out of %d requested) of %s\n",
-            mol, nmol_insrt, *atoms_insrt.resinfo[0].name);
+    fprintf(stderr, "Added %d molecules (out of %d requested)\n",
+            mol - failed, nmol_insrt);
 
     sfree(x_n);
+    sfree(exclusionDistances);
     sfree(exclusionDistances_insrt);
-    done_atom(&atoms_insrt);
-
-    return title_insrt;
+    if (rpos != NULL)
+    {
+        for (int i = 0; i < DIM; ++i)
+        {
+            sfree(rpos[i]);
+        }
+        sfree(rpos);
+    }
 }
 
-int gmx_insert_molecules(int argc, char *argv[])
+namespace gmx
+{
+
+namespace
 {
-    const char *desc[] = {
+
+class InsertMolecules : public CommandLineOptionsModuleInterface
+{
+    public:
+        InsertMolecules()
+            : bBox_(false), nmolIns_(0), nmolTry_(10), seed_(1997),
+              defaultDistance_(0.105), scaleFactor_(0.57), enumRot_(en_rotXYZ)
+        {
+            clear_rvec(newBox_);
+            clear_rvec(deltaR_);
+        }
+
+        virtual void init(CommandLineModuleSettings * /*settings*/)
+        {
+        }
+
+        virtual void initOptions(Options *options);
+        virtual void optionsFinished(Options *options);
+
+        virtual int run();
+
+    private:
+        std::string inputConfFile_;
+        std::string insertConfFile_;
+        std::string positionFile_;
+        std::string outputConfFile_;
+        rvec        newBox_;
+        bool        bBox_;
+        int         nmolIns_;
+        int         nmolTry_;
+        int         seed_;
+        real        defaultDistance_;
+        real        scaleFactor_;
+        rvec        deltaR_;
+        int         enumRot_;
+};
+
+void InsertMolecules::initOptions(Options *options)
+{
+    const char *const desc[] = {
         "[THISMODULE] inserts [TT]-nmol[tt] copies of the system specified in",
         "the [TT]-ci[tt] input file. The insertions take place either into",
         "vacant space in the solute conformation given with [TT]-f[tt], or",
@@ -309,118 +373,107 @@ int gmx_insert_molecules(int argc, char *argv[])
         "[THISMODULE] (e.g. from [gmx-editconf] [TT]-center[tt]).",
         "Comments in that file starting with # are ignored. Option [TT]-dr[tt]",
         "defines the maximally allowed displacements during insertial trials.",
-        "[TT]-try[tt] and [TT]-rot[tt] work as in the default mode (see above).",
-        "[PAR]",
-    };
-
-    const char *bugs[] = {
-        "Molecules must be whole in the initial configurations.",
-        "Many repeated neighbor searchings with -ci blows up the allocated memory. "
-        "Option -allpair avoids this using all-to-all distance checks (slow for large systems)"
+        "[TT]-try[tt] and [TT]-rot[tt] work as in the default mode (see above)."
     };
 
-    /* parameter data */
-    gmx_bool       bProt, bBox;
-    const char    *conf_prot, *confout;
-    real          *exclusionDistances = NULL;
-    char          *title_ins          = NULL;
-    gmx_atomprop_t aps;
-
-    /* protein configuration data */
-    char          *title = NULL;
-    t_atoms       *atoms;
-    rvec          *x    = NULL;
-    int            ePBC = -1;
-    matrix         box;
-
-    t_filenm       fnm[] = {
-        { efSTX, "-f", "protein", ffOPTRD },
-        { efSTX, "-ci", "insert",  ffREAD},
-        { efDAT, "-ip", "positions",  ffOPTRD},
-        { efSTO, NULL,  NULL,      ffWRITE},
-    };
-#define NFILE asize(fnm)
-
-    static int      nmol_ins               = 0, nmol_try = 10, seed = 1997, enum_rot;
-    static real     defaultDistance        = 0.105, scaleFactor = 0.57;
-    static rvec     new_box                = {0.0, 0.0, 0.0}, deltaR = {0.0, 0.0, 0.0};
-    static gmx_bool bCheckAllPairDist      = FALSE;
-    output_env_t    oenv;
-    const char     *enum_rot_string[] = {NULL, "xyz", "z", "none", NULL};
-    t_pargs         pa[]              = {
-        { "-box",    FALSE, etRVEC, {new_box},
-          "Box size (in nm)" },
-        { "-nmol",   FALSE, etINT, {&nmol_ins},
-          "Number of extra molecules to insert" },
-        { "-try",    FALSE, etINT, {&nmol_try},
-          "Try inserting [TT]-nmol[tt] times [TT]-try[tt] times" },
-        { "-seed",   FALSE, etINT, {&seed},
-          "Random generator seed"},
-        { "-radius",   FALSE, etREAL, {&defaultDistance},
-          "Default van der Waals distance"},
-        { "-scale", FALSE, etREAL, {&scaleFactor},
-          "Scale factor to multiply Van der Waals radii from the database in share/gromacs/top/vdwradii.dat. The default value of 0.57 yields density close to 1000 g/l for proteins in water." },
-        { "-dr",    FALSE, etRVEC, {deltaR},
-          "Allowed displacement in x/y/z from positions in [TT]-ip[tt] file" },
-        { "-rot", FALSE,  etENUM, {enum_rot_string},
-          "rotate inserted molecules randomly" },
-        { "-allpair",    FALSE, etBOOL, {&bCheckAllPairDist},
-          "Avoid momory leaks during neighbor searching with option -ci. May be slow for large systems." },
-    };
+    options->setDescription(desc);
+
+    // TODO: Replace use of legacyType.
+    options->addOption(FileNameOption("f")
+                           .legacyType(efSTX).inputFile()
+                           .store(&inputConfFile_)
+                           .defaultBasename("protein")
+                           .description("Existing configuration to insert into"));
+    options->addOption(FileNameOption("ci")
+                           .legacyType(efSTX).inputFile().required()
+                           .store(&insertConfFile_)
+                           .defaultBasename("insert")
+                           .description("Configuration to insert"));
+    options->addOption(FileNameOption("ip")
+                           .filetype(eftGenericData).inputFile()
+                           .store(&positionFile_)
+                           .defaultBasename("positions")
+                           .description("Predefined insertion trial positions"));
+    options->addOption(FileNameOption("o")
+                           .legacyType(efSTO).outputFile().required()
+                           .store(&outputConfFile_)
+                           .defaultBasename("out")
+                           .description("Output configuration after insertion"));
+
+    options->addOption(RealOption("box").vector()
+                           .store(newBox_)
+                           .description("Box size (in nm)"));
+    options->addOption(IntegerOption("nmol")
+                           .store(&nmolIns_)
+                           .description("Number of extra molecules to insert"));
+    options->addOption(IntegerOption("try")
+                           .store(&nmolTry_)
+                           .description("Try inserting [TT]-nmol[tt] times [TT]-try[tt] times"));
+    options->addOption(IntegerOption("seed")
+                           .store(&seed_)
+                           .description("Random generator seed"));
+    options->addOption(RealOption("radius")
+                           .store(&defaultDistance_)
+                           .description("Default van der Waals distance"));
+    options->addOption(RealOption("scale")
+                           .store(&scaleFactor_)
+                           .description("Scale factor to multiply Van der Waals radii from the database in share/gromacs/top/vdwradii.dat. The default value of 0.57 yields density close to 1000 g/l for proteins in water."));
+    options->addOption(RealOption("dr").vector()
+                           .store(deltaR_)
+                           .description("Allowed displacement in x/y/z from positions in [TT]-ip[tt] file"));
+    const char *const cRotationEnum[] = {"xyz", "z", "none"};
+    options->addOption(StringOption("rot").enumValue(cRotationEnum)
+                           .storeEnumIndex(&enumRot_)
+                           .description("Rotate inserted molecules randomly"));
+}
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, asize(bugs), bugs, &oenv))
-    {
-        return 0;
-    }
+void InsertMolecules::optionsFinished(Options *options)
+{
+    bBox_ = options->isSet("box");
+}
 
-    bProt     = opt2bSet("-f", NFILE, fnm);
-    bBox      = opt2parg_bSet("-box", asize(pa), pa);
-    enum_rot  = nenum(enum_rot_string);
+int InsertMolecules::run()
+{
+    const bool bProt = !inputConfFile_.empty();
 
     /* check input */
-    const char *insertionMoleculeFileName = opt2fn("-ci", NFILE, fnm);
-    if (!gmx_fexist(insertionMoleculeFileName))
-    {
-        gmx_fatal(FARGS,
-                  "A molecule conformation to insert is required in -ci. %s was not found!",
-                  insertionMoleculeFileName);
-    }
-    if (nmol_ins <= 0 && !opt2bSet("-ip", NFILE, fnm))
+    if (nmolIns_ <= 0 && positionFile_.empty())
     {
         gmx_fatal(FARGS, "Either -nmol must be larger than 0, "
                   "or positions must be given with -ip");
     }
-    if (!bProt && !bBox)
+    if (!bProt && !bBox_)
     {
         gmx_fatal(FARGS, "When no solute (-f) is specified, "
                   "a box size (-box) must be specified");
     }
 
-    aps = gmx_atomprop_init();
-
+    char    *title = NULL;
+    t_atoms *atoms;
+    rvec    *x = NULL;
+    matrix   box;
+    int      ePBC = -1;
     snew(atoms, 1);
     init_t_atoms(atoms, 0, FALSE);
     if (bProt)
     {
         /* Generate a solute configuration */
-        conf_prot = opt2fn("-f", NFILE, fnm);
-        title     = readConformation(conf_prot, atoms, &x, NULL,
-                                     &ePBC, box);
-        exclusionDistances = makeExclusionDistances(atoms, aps, defaultDistance, scaleFactor);
+        title = readConformation(inputConfFile_.c_str(), atoms, &x, NULL,
+                                 &ePBC, box, "solute");
         if (atoms->nr == 0)
         {
-            fprintf(stderr, "Note: no atoms in %s\n", conf_prot);
-            bProt = FALSE;
+            fprintf(stderr, "Note: no atoms in %s\n", inputConfFile_.c_str());
+            sfree(title);
+            title = NULL;
         }
     }
-    if (bBox)
+    if (bBox_)
     {
         ePBC = epbcXYZ;
         clear_mat(box);
-        box[XX][XX] = new_box[XX];
-        box[YY][YY] = new_box[YY];
-        box[ZZ][ZZ] = new_box[ZZ];
+        box[XX][XX] = newBox_[XX];
+        box[YY][YY] = newBox_[YY];
+        box[ZZ][ZZ] = newBox_[ZZ];
     }
     if (det(box) == 0)
     {
@@ -428,37 +481,69 @@ int gmx_insert_molecules(int argc, char *argv[])
                   "or give explicit -box command line option");
     }
 
+    t_atoms *atoms_insrt;
+    rvec    *x_insrt = NULL;
+    snew(atoms_insrt, 1);
+    init_t_atoms(atoms_insrt, 0, FALSE);
+    {
+        int         ePBC_dummy;
+        matrix      box_dummy;
+        char       *title_ins
+            = readConformation(insertConfFile_.c_str(), atoms_insrt, &x_insrt,
+                               NULL, &ePBC_dummy, box_dummy, "molecule");
+        if (atoms_insrt->nr == 0)
+        {
+            gmx_fatal(FARGS, "No molecule in %s, please check your input",
+                      insertConfFile_.c_str());
+        }
+        if (title == NULL)
+        {
+            title = title_ins;
+        }
+        else
+        {
+            sfree(title_ins);
+        }
+        if (positionFile_.empty())
+        {
+            center_molecule(atoms_insrt->nr, x_insrt);
+        }
+    }
+
     /* add nmol_ins molecules of atoms_ins
        in random orientation at random place */
-    title_ins = insert_mols(insertionMoleculeFileName, nmol_ins, nmol_try, seed,
-                            atoms, &x, &exclusionDistances, ePBC, box, aps,
-                            defaultDistance, scaleFactor, 0,
-                            oenv, opt2fn_null("-ip", NFILE, fnm), deltaR, enum_rot,
-                            bCheckAllPairDist);
+    insert_mols(nmolIns_, nmolTry_, seed_, defaultDistance_, scaleFactor_,
+                atoms, &x, atoms_insrt, x_insrt,
+                ePBC, box, positionFile_, deltaR_, enumRot_);
 
     /* write new configuration to file confout */
-    confout = ftp2fn(efSTO, NFILE, fnm);
-    fprintf(stderr, "Writing generated configuration to %s\n", confout);
-    if (bProt)
-    {
-        write_sto_conf(confout, title, atoms, x, NULL, ePBC, box);
-        /* print box sizes and box type to stderr */
-        fprintf(stderr, "%s\n", title);
-    }
-    else
-    {
-        write_sto_conf(confout, title_ins, atoms, x, NULL, ePBC, box);
-    }
+    fprintf(stderr, "Writing generated configuration to %s\n",
+            outputConfFile_.c_str());
+    write_sto_conf(outputConfFile_.c_str(), title, atoms, x, NULL, ePBC, box);
 
     /* print size of generated configuration */
     fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
             atoms->nr, atoms->nres);
 
-    gmx_atomprop_destroy(aps);
-    sfree(exclusionDistances);
     sfree(x);
+    sfree(x_insrt);
     done_atom(atoms);
+    done_atom(atoms_insrt);
     sfree(atoms);
+    sfree(atoms_insrt);
+    sfree(title);
 
     return 0;
 }
+
+}   // namespace
+
+const char InsertMoleculesInfo::name[]             = "insert-molecules";
+const char InsertMoleculesInfo::shortDescription[] =
+    "Insert molecules into existing vacancies";
+CommandLineOptionsModuleInterface *InsertMoleculesInfo::create()
+{
+    return new InsertMolecules();
+}
+
+} // namespace gmx
index 8b7d728bda84c223602634453f66cc54ccacfebb..fd1552dfcd873786add9101520e40ea402428ef1 100644 (file)
 #ifndef GMX_GMXPREPROCESS_INSERT_MOLECULES_H
 #define GMX_GMXPREPROCESS_INSERT_MOLECULES_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
+namespace gmx
+{
 
-int gmx_insert_molecules(int argc, char *argv[]);
+class CommandLineOptionsModuleInterface;
 
-#ifdef __cplusplus
-}
-#endif
+class InsertMoleculesInfo
+{
+    public:
+        static const char name[];
+        static const char shortDescription[];
+        static CommandLineOptionsModuleInterface *create();
+};
+
+} // namespace gmx
 
 #endif
index e9dd3961f18f3935f578f4c48f472923257bc2d2..41882302acdcf05967b850243e6ed6fdc053f8ad 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nm2type.h"
 
 #include <string.h>
 
+#include "gromacs/fileio/confio.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/gmxpreprocess/toppush.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/math/utilities.h"
-#include "macros.h"
-#include "bondf.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "gromacs/fileio/confio.h"
-#include "physics.h"
-#include "vec.h"
-#include "gromacs/math/3dview.h"
-#include "txtdump.h"
-#include "readinp.h"
-#include "names.h"
-#include "toppush.h"
-#include "pdb2top.h"
-#include "gpp_nextnb.h"
-#include "gpp_atomtype.h"
-#include "fflibutil.h"
-
-#include "nm2type.h"
-
-#include "gmx_fatal.h"
 
 static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
 {
@@ -110,7 +103,7 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
                         {
                             gmx_fatal(FARGS, "Error on line %d of %s", line, libfilename);
                         }
-                        newbuf[i] = strdup(nbbuf);
+                        newbuf[i] = gmx_strdup(nbbuf);
                         strcat(format, "%*s%*s");
                     }
                 }
@@ -118,8 +111,8 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
                 {
                     newbuf = NULL;
                 }
-                nm2t[nnnm].elem   = strdup(elem);
-                nm2t[nnnm].type   = strdup(type);
+                nm2t[nnnm].elem   = gmx_strdup(elem);
+                nm2t[nnnm].type   = gmx_strdup(type);
                 nm2t[nnnm].q      = qq;
                 nm2t[nnnm].m      = mm;
                 nm2t[nnnm].nbonds = nb;
@@ -201,7 +194,7 @@ static int match_str(const char *atom, const char *template_string)
     }
 }
 
-int nm2type(int nnm, t_nm2type nm2t[], t_symtab *tab, t_atoms *atoms,
+int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
             gpp_atomtype_t atype, int *nbonds, t_params *bonds)
 {
     int      cur = 0;
index ab30e26e7e91b91f11e3dc87fd93bbf20e33e23f..4f8505ed04bf7817835db8ab72f0a51da5bc164a 100644 (file)
 
 #include <stdio.h>
 
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/topology/atoms.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -59,7 +63,7 @@ t_nm2type *rd_nm2type(const char *ffdir, int *nnm);
 void dump_nm2type(FILE *fp, int nnm, t_nm2type nm2t[]);
 /* Dump the database for debugging. Can be reread by the program */
 
-int nm2type(int nnm, t_nm2type nm2t[], t_symtab *tab, t_atoms *atoms,
+int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
             gpp_atomtype_t atype, int *nbonds, t_params *bond);
 /* Try to determine the atomtype (force field dependent) for the atoms
  * with help of the bond list
index 3e26de80b6d4aa36f2fc41ebb6e6d1ccdc2e4c77..e8b895c66a2ac6c65bde5efe6a6d5ffe63d49d96 100644 (file)
@@ -3,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,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.
  * 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 "pdb2gmx.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "pdb2gmx.h"
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/utility/smalloc.h"
-#include "copyrite.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/confio.h"
-#include "symtab.h"
-#include "vec.h"
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "toputil.h"
-#include "h_db.h"
-#include "physics.h"
-#include "pgutil.h"
-#include "calch.h"
-#include "resall.h"
-#include "pdb2top.h"
-#include "ter_db.h"
-#include "gromacs/gmxlib/conformation-utilities.h"
-#include "genhydro.h"
-#include "readinp.h"
-#include "atomprop.h"
-#include "index.h"
-#include "fflibutil.h"
-#include "macros.h"
-
 #include "gromacs/fileio/strdb.h"
-
-#include "hizzie.h"
-#include "specbond.h"
-#include "xlate.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/genhydro.h"
+#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hizzie.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/specbond.h"
+#include "gromacs/gmxpreprocess/ter_db.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/gmxpreprocess/xlate.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     char gmx[6];
@@ -515,7 +511,7 @@ void write_posres(char *fn, t_atoms *pdba, real fc)
 static int read_pdball(const char *inf, const char *outf, char *title,
                        t_atoms *atoms, rvec **x,
                        int *ePBC, matrix box, gmx_bool bRemoveH,
-                       t_symtab *symtab, gmx_residuetype_t rt, const char *watres,
+                       t_symtab *symtab, gmx_residuetype_t *rt, const char *watres,
                        gmx_atomprop_t aps, gmx_bool bVerbose)
 /* Read a pdb file. (containing proteins) */
 {
@@ -836,7 +832,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)
+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;
@@ -1232,7 +1229,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     t_hackblock      *ah;
     t_symtab          symtab;
     gpp_atomtype_t    atype;
-    gmx_residuetype_t rt;
+    gmx_residuetype_t*rt;
     const char       *top_fn;
     char              fn[256], itp_fn[STRLEN], posre_fn[STRLEN], buf_fn[STRLEN];
     char              molname[STRLEN], title[STRLEN], quote[STRLEN];
@@ -1682,7 +1679,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             chains[i].pdba->atom[j] = pdba_all.atom[pdb_ch[si].start+j];
             snew(chains[i].pdba->atomname[j], 1);
             *chains[i].pdba->atomname[j] =
-                strdup(*pdba_all.atomname[pdb_ch[si].start+j]);
+                gmx_strdup(*pdba_all.atomname[pdb_ch[si].start+j]);
             chains[i].pdba->pdbinfo[j] = pdba_all.pdbinfo[pdb_ch[si].start+j];
             copy_rvec(pdbx[pdb_ch[si].start+j], chains[i].x[j]);
         }
@@ -1699,7 +1696,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
         {
             chains[i].pdba->resinfo[j] = pdba_all.resinfo[k+j];
             snew(chains[i].pdba->resinfo[j].name, 1);
-            *chains[i].pdba->resinfo[j].name = strdup(*pdba_all.resinfo[k+j].name);
+            *chains[i].pdba->resinfo[j].name = gmx_strdup(*pdba_all.resinfo[k+j].name);
             /* make all chain identifiers equal to that of the chain */
             chains[i].pdba->resinfo[j].chainid = pdb_ch[si].chainid;
         }
@@ -2057,7 +2054,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
             nincl++;
             srenew(incls, nincl);
-            incls[nincl-1] = strdup(itp_fn);
+            incls[nincl-1] = gmx_strdup(itp_fn);
             itp_file       = gmx_fio_fopen(itp_fn, "w");
         }
         else
@@ -2068,12 +2065,12 @@ int gmx_pdb2gmx(int argc, char *argv[])
         srenew(mols, nmol+1);
         if (cc->bAllWat)
         {
-            mols[nmol].name = strdup("SOL");
+            mols[nmol].name = gmx_strdup("SOL");
             mols[nmol].nr   = pdba->nres;
         }
         else
         {
-            mols[nmol].name = strdup(molname);
+            mols[nmol].name = gmx_strdup(molname);
             mols[nmol].nr   = 1;
         }
         nmol++;
index 85eb9c4c9b569a1224681eba5444b0b16518ed16..dfae1420ef96e2b3e4c74e95a68c5fc2011ae7ca 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "pdb2top.h"
 
-#include <stdio.h>
-#include <math.h>
 #include <ctype.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
 
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "symtab.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
-#include "pdb2top.h"
-#include "gpp_nextnb.h"
-#include "topdirs.h"
-#include "toputil.h"
-#include "h_db.h"
-#include "pgutil.h"
-#include "resall.h"
-#include "topio.h"
-#include "gromacs/utility/cstringutil.h"
-#include "physics.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gen_ad.h"
-#include "gromacs/fileio/filenm.h"
-#include "index.h"
-#include "gen_vsite.h"
-#include "add_par.h"
-#include "toputil.h"
-#include "fflibutil.h"
-#include "copyrite.h"
+#include <algorithm>
+#include <string>
+#include <vector>
 
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/strdb.h"
+#include "gromacs/gmxpreprocess/add_par.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gen_ad.h"
+#include "gromacs/gmxpreprocess/gen_vsite.h"
+#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/topdirs.h"
+#include "gromacs/gmxpreprocess/topio.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 /* this must correspond to enum in pdb2top.h */
 const char *hh[ehisNR]   = { "HISD", "HISE", "HISH", "HIS1" };
@@ -123,89 +128,47 @@ gmx_bool is_int(double x)
     return (fabs(x-ix) < tol);
 }
 
-static void swap_strings(char **s, int i, int j)
-{
-    char *tmp;
-
-    tmp  = s[i];
-    s[i] = s[j];
-    s[j] = tmp;
-}
-
-void
-choose_ff(const char *ffsel,
-          char *forcefield, int ff_maxlen,
-          char *ffdir, int ffdir_maxlen)
+static void
+choose_ff_impl(const char *ffsel,
+               char *forcefield, int ff_maxlen,
+               char *ffdir, int ffdir_maxlen)
 {
-    int    nff;
-    char **ffdirs, **ffs, **ffs_dir, *ptr;
-    int    i, j, sel, cwdsel, nfound;
-    char   buf[STRLEN], **desc;
-    FILE  *fp;
-    char  *pret;
-
-    nff = fflib_search_file_in_dirend(fflib_forcefield_itp(),
-                                      fflib_forcefield_dir_ext(),
-                                      &ffdirs);
-
-    if (nff == 0)
-    {
-        gmx_fatal(FARGS, "No force fields found (files with name '%s' in subdirectories ending on '%s')",
-                  fflib_forcefield_itp(), fflib_forcefield_dir_ext());
-    }
+    std::vector<gmx::DataFileInfo> ffdirs = fflib_enumerate_forcefields();
+    const int nff = static_cast<int>(ffdirs.size());
 
     /* Replace with unix path separators */
     if (DIR_SEPARATOR != '/')
     {
-        for (i = 0; i < nff; i++)
+        for (int i = 0; i < nff; ++i)
         {
-            while ( (ptr = strchr(ffdirs[i], DIR_SEPARATOR)) != NULL)
-            {
-                *ptr = '/';
-            }
+            std::replace(ffdirs[i].dir.begin(), ffdirs[i].dir.end(), DIR_SEPARATOR, '/');
         }
     }
 
     /* Store the force field names in ffs */
-    snew(ffs, nff);
-    snew(ffs_dir, nff);
-    for (i = 0; i < nff; i++)
+    std::vector<std::string> ffs;
+    ffs.reserve(ffdirs.size());
+    for (int i = 0; i < nff; ++i)
     {
-        /* Remove the path from the ffdir name - use our unix standard here! */
-        ptr = strrchr(ffdirs[i], '/');
-        if (ptr == NULL)
-        {
-            ffs[i]     = strdup(ffdirs[i]);
-            ffs_dir[i] = low_gmxlibfn(ffdirs[i], FALSE, FALSE);
-            if (ffs_dir[i] == NULL)
-            {
-                gmx_fatal(FARGS, "Can no longer find file '%s'", ffdirs[i]);
-            }
-        }
-        else
-        {
-            ffs[i]     = strdup(ptr+1);
-            ffs_dir[i] = strdup(ffdirs[i]);
-        }
-        ffs_dir[i][strlen(ffs_dir[i])-strlen(ffs[i])-1] = '\0';
-        /* Remove the extension from the ffdir name */
-        ffs[i][strlen(ffs[i])-strlen(fflib_forcefield_dir_ext())] = '\0';
+        ffs.push_back(gmx::stripSuffixIfPresent(ffdirs[i].name,
+                                                fflib_forcefield_dir_ext()));
     }
 
+    int sel;
     if (ffsel != NULL)
     {
-        sel     = -1;
-        cwdsel  = -1;
-        nfound  = 0;
-        for (i = 0; i < nff; i++)
+        sel         = -1;
+        int cwdsel  = -1;
+        int nfound  = 0;
+        for (int i = 0; i < nff; ++i)
         {
-            if (strcmp(ffs[i], ffsel) == 0)
+            if (ffs[i] == ffsel)
             {
                 /* Matching ff name */
                 sel = i;
                 nfound++;
 
-                if (strncmp(ffs_dir[i], ".", 1) == 0)
+                if (ffdirs[i].dir == ".")
                 {
                     cwdsel = i;
                 }
@@ -228,77 +191,88 @@ choose_ff(const char *ffsel,
             }
             else
             {
-                gmx_fatal(FARGS,
-                          "Force field '%s' occurs in %d places, but not in the current directory.\n"
-                          "Run without the -ff switch and select the force field interactively.", ffsel, nfound);
+                std::string message = gmx::formatString(
+                            "Force field '%s' occurs in %d places, but not in "
+                            "the current directory.\n"
+                            "Run without the -ff switch and select the force "
+                            "field interactively.", ffsel, nfound);
+                GMX_THROW(gmx::InconsistentInputError(message));
             }
         }
         else if (nfound == 0)
         {
-            gmx_fatal(FARGS, "Could not find force field '%s' in current directory, install tree or GMXDATA path.", ffsel);
+            std::string message = gmx::formatString(
+                        "Could not find force field '%s' in current directory, "
+                        "install tree or GMXLIB path.", ffsel);
+            GMX_THROW(gmx::InconsistentInputError(message));
         }
     }
     else if (nff > 1)
     {
-        snew(desc, nff);
-        for (i = 0; (i < nff); i++)
+        std::vector<std::string> desc;
+        desc.reserve(ffdirs.size());
+        for (int i = 0; i < nff; ++i)
         {
-            sprintf(buf, "%s%c%s%s%c%s",
-                    ffs_dir[i], DIR_SEPARATOR,
-                    ffs[i], fflib_forcefield_dir_ext(), DIR_SEPARATOR,
-                    fflib_forcefield_doc());
-            if (gmx_fexist(buf))
+            std::string docFileName(
+                    gmx::Path::join(ffdirs[i].dir, ffdirs[i].name,
+                                    fflib_forcefield_doc()));
+            // TODO: Just try to open the file with a method that does not
+            // throw/bail out with a fatal error instead of multiple checks.
+            if (gmx::File::exists(docFileName))
             {
+                // TODO: Use a C++ API without such an intermediate/fixed-length buffer.
+                char  buf[STRLEN];
                 /* We don't use fflib_open, because we don't want printf's */
-                fp = gmx_ffopen(buf, "r");
-                snew(desc[i], STRLEN);
-                get_a_line(fp, desc[i], STRLEN);
+                FILE *fp = gmx_ffopen(docFileName.c_str(), "r");
+                get_a_line(fp, buf, STRLEN);
                 gmx_ffclose(fp);
+                desc.push_back(buf);
             }
             else
             {
-                desc[i] = strdup(ffs[i]);
+                desc.push_back(ffs[i]);
             }
         }
         /* Order force fields from the same dir alphabetically
          * and put deprecated force fields at the end.
          */
-        for (i = 0; (i < nff); i++)
+        for (int i = 0; i < nff; ++i)
         {
-            for (j = i+1; (j < nff); j++)
+            for (int j = i + 1; j < nff; ++j)
             {
-                if (strcmp(ffs_dir[i], ffs_dir[j]) == 0 &&
+                if (ffdirs[i].dir == ffdirs[j].dir &&
                     ((desc[i][0] == '[' && desc[j][0] != '[') ||
                      ((desc[i][0] == '[' || desc[j][0] != '[') &&
-                      gmx_strcasecmp(desc[i], desc[j]) > 0)))
+                      gmx_strcasecmp(desc[i].c_str(), desc[j].c_str()) > 0)))
                 {
-                    swap_strings(ffdirs, i, j);
-                    swap_strings(ffs, i, j);
-                    swap_strings(desc, i, j);
+                    std::swap(ffdirs[i].name, ffdirs[j].name);
+                    std::swap(ffs[i], ffs[j]);
+                    std::swap(desc[i], desc[j]);
                 }
             }
         }
 
         printf("\nSelect the Force Field:\n");
-        for (i = 0; (i < nff); i++)
+        for (int i = 0; i < nff; ++i)
         {
-            if (i == 0 || strcmp(ffs_dir[i-1], ffs_dir[i]) != 0)
+            if (i == 0 || ffdirs[i-1].dir != ffdirs[i].dir)
             {
-                if (strcmp(ffs_dir[i], ".") == 0)
+                if (ffdirs[i].dir == ".")
                 {
                     printf("From current directory:\n");
                 }
                 else
                 {
-                    printf("From '%s':\n", ffs_dir[i]);
+                    printf("From '%s':\n", ffdirs[i].dir.c_str());
                 }
             }
-            printf("%2d: %s\n", i+1, desc[i]);
-            sfree(desc[i]);
+            printf("%2d: %s\n", i+1, desc[i].c_str());
         }
-        sfree(desc);
 
         sel = -1;
+        // TODO: Add a C++ API for this.
+        char   buf[STRLEN];
+        char  *pret;
         do
         {
             pret = fgets(buf, STRLEN, stdin);
@@ -316,12 +290,20 @@ choose_ff(const char *ffsel,
          * This check assumes that the order of ffs matches the order
          * in which fflib_open searches ff library files.
          */
-        for (i = 0; i < sel; i++)
+        for (int i = 0; i < sel; i++)
         {
-            if (strcmp(ffs[i], ffs[sel]) == 0)
+            if (ffs[i] == ffs[sel])
             {
-                gmx_fatal(FARGS, "Can only select the first of multiple force field entries with directory name '%s%s' in the list. If you want to use the next entry, run pdb2gmx in a different directory or rename or move the force field directory present in the current working directory.",
-                          ffs[sel], fflib_forcefield_dir_ext());
+                std::string message = gmx::formatString(
+                            "Can only select the first of multiple force "
+                            "field entries with directory name '%s%s' in "
+                            "the list. If you want to use the next entry, "
+                            "run pdb2gmx in a different directory, set GMXLIB "
+                            "to point to the desired force field first, and/or "
+                            "rename or move the force field directory present "
+                            "in the current working directory.",
+                            ffs[sel].c_str(), fflib_forcefield_dir_ext());
+                GMX_THROW(gmx::NotImplementedError(message));
             }
         }
     }
@@ -330,29 +312,44 @@ choose_ff(const char *ffsel,
         sel = 0;
     }
 
-    if (strlen(ffs[sel]) >= (size_t)ff_maxlen)
+    if (ffs[sel].length() >= static_cast<size_t>(ff_maxlen))
     {
-        gmx_fatal(FARGS, "Length of force field name (%d) >= maxlen (%d)",
-                  strlen(ffs[sel]), ff_maxlen);
+        std::string message = gmx::formatString(
+                    "Length of force field name (%d) >= maxlen (%d)",
+                    static_cast<int>(ffs[sel].length()), ff_maxlen);
+        GMX_THROW(gmx::InvalidInputError(message));
     }
-    strcpy(forcefield, ffs[sel]);
+    strcpy(forcefield, ffs[sel].c_str());
 
-    if (strlen(ffdirs[sel]) >= (size_t)ffdir_maxlen)
+    std::string ffpath;
+    if (ffdirs[sel].bFromDefaultDir)
     {
-        gmx_fatal(FARGS, "Length of force field dir (%d) >= maxlen (%d)",
-                  strlen(ffdirs[sel]), ffdir_maxlen);
+        ffpath = ffdirs[sel].name;
     }
-    strcpy(ffdir, ffdirs[sel]);
+    else
+    {
+        ffpath = gmx::Path::join(ffdirs[sel].dir, ffdirs[sel].name);
+    }
+    if (ffpath.length() >= static_cast<size_t>(ffdir_maxlen))
+    {
+        std::string message = gmx::formatString(
+                    "Length of force field dir (%d) >= maxlen (%d)",
+                    static_cast<int>(ffpath.length()), ffdir_maxlen);
+        GMX_THROW(gmx::InvalidInputError(message));
+    }
+    strcpy(ffdir, ffpath.c_str());
+}
 
-    for (i = 0; (i < nff); i++)
+void
+choose_ff(const char *ffsel,
+          char *forcefield, int ff_maxlen,
+          char *ffdir, int ffdir_maxlen)
+{
+    try
     {
-        sfree(ffdirs[i]);
-        sfree(ffs[i]);
-        sfree(ffs_dir[i]);
+        choose_ff_impl(ffsel, forcefield, ff_maxlen, ffdir, ffdir_maxlen);
     }
-    sfree(ffdirs);
-    sfree(ffs);
-    sfree(ffs_dir);
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 }
 
 void choose_watermodel(const char *wmsel, const char *ffdir,
@@ -374,7 +371,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     }
     else if (strcmp(wmsel, "select") != 0)
     {
-        *watermodel = strdup(wmsel);
+        *watermodel = gmx_strdup(wmsel);
 
         return;
     }
@@ -432,7 +429,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     }
     else
     {
-        *watermodel = strdup(model[sel]);
+        *watermodel = gmx_strdup(model[sel]);
     }
 
     for (i = 0; i < nwm; i++)
@@ -443,7 +440,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
 }
 
 static int name2type(t_atoms *at, int **cgnr,
-                     t_restp restp[], gmx_residuetype_t rt)
+                     t_restp restp[], gmx_residuetype_t *rt)
 {
     int         i, j, prevresind, resind, i0, prevcg, cg, curcg;
     char       *name;
@@ -1003,7 +1000,7 @@ void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack)
         }
         snew( restp->atomname[at_start+1+k], 1);
         restp->atom     [at_start+1+k] = *hack->atom;
-        *restp->atomname[at_start+1+k] = strdup(buf);
+        *restp->atomname[at_start+1+k] = gmx_strdup(buf);
         if (hack->cgnr != NOTSET)
         {
             restp->cgnr   [at_start+1+k] = hack->cgnr;
@@ -1177,7 +1174,7 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                             }
                             snew( (*restp)[i].atomname[l], 1);
                             (*restp)[i].atom[l]      =       *(*hb)[i].hack[j].atom;
-                            *(*restp)[i].atomname[l] = strdup((*hb)[i].hack[j].nname);
+                            *(*restp)[i].atomname[l] = gmx_strdup((*hb)[i].hack[j].nname);
                             if ( (*hb)[i].hack[j].cgnr != NOTSET)
                             {
                                 (*restp)[i].cgnr   [l] = (*hb)[i].hack[j].cgnr;
@@ -1334,7 +1331,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
             }
             /* Rename the atom in pdba */
             snew(pdba->atomname[atind], 1);
-            *pdba->atomname[atind] = strdup(newnm);
+            *pdba->atomname[atind] = gmx_strdup(newnm);
         }
         else if (hbr->hack[j].oname != NULL && hbr->hack[j].nname == NULL &&
                  gmx_strcasecmp(oldnm, hbr->hack[j].oname) == 0)
@@ -1553,7 +1550,7 @@ void pdb2top(FILE *top_file, char *posre_fn, char *molname,
     int              *vsite_type;
     int               i, nmissat;
     int               bts[ebtsNR];
-    gmx_residuetype_t rt;
+    gmx_residuetype_t*rt;
 
     init_plist(plist);
     gmx_residuetype_init(&rt);
index bcefb9750529d91a6eb475e7f4a63f5b266e6d41..cfbc800c879048746709698f1a4deac9228f09b8 100644 (file)
 #ifndef GMX_GMXPREPROCESS_PDB2TOP_H
 #define GMX_GMXPREPROCESS_PDB2TOP_H
 
-#include "typedefs.h"
-#include "grompp-impl.h"
-#include "gpp_atomtype.h"
-#include "toputil.h"
-#include "hackblock.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -112,7 +112,7 @@ void write_top(FILE *out, char *pr, char *molname,
 
 void pdb2top(FILE *top_file, char *posre_fn, char *molname,
              t_atoms *atoms, rvec **x,
-             gpp_atomtype_t atype, t_symtab *tab,
+             gpp_atomtype_t atype, struct t_symtab *tab,
              int nrtp, t_restp rtp[],
              t_restp *restp, t_hackblock *hb,
              gmx_bool bAllowMissing,
index 76ea6c83b40e11ab2b066acbe068565f30525113..8c84e98d41624150e7f01992db60d1bcb8125b8d 100644 (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,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.
  */
 /* This file is completely threadsafe - keep it that way! */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "gromacs/utility/cstringutil.h"
+#include "gmxpre.h"
+
 #include "pgutil.h"
+
 #include <string.h>
-#include "gmx_fatal.h"
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/snprintf.h"
 
 #define BUFSIZE 1024
 static void atom_not_found(int fatal_errno, const char *file, int line,
index 8a5a622fc4a09b6366e00317f0144082c0b7ba38..b9ebce727a120ee843584bee155085d0c1b28a07 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_PGUTIL_H
 #define GMX_GMXPREPROCESS_PGUTIL_H
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C"
index 38bf7cdc97bf5adcffe1c84f491ec2557da7aefe..4b73ff2760088291247b6ee7a5381e70f1bbb495 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.
  */
-#include "protonate.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "protonate.h"
 
 #include <math.h>
-#include "gromacs/utility/cstringutil.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
+
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/fileio/confio.h"
-#include "genhydro.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "index.h"
-#include "vec.h"
-#include "hackblock.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/gmxpreprocess/genhydro.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 int gmx_protonate(int argc, char *argv[])
 {
index 64fa909de44387d358105fd555d18b4a8936c54d..900c719eb945720e7da8ce9d38aaaff499ce0d59 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.
  */
+#include "gmxpre.h"
+
 #include "read-conformation.h"
 
 #include "gromacs/fileio/confio.h"
-#include "atomprop.h"
-#include "types/simple.h"
-#include "types/atoms.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
 
 real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
@@ -49,7 +53,6 @@ real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
     snew(exclusionDistances, a->nr);
     /* initialise arrays with distances usually based on van der Waals
        radii */
-    fprintf(stderr, "Initialising inter-atomic distances...\n");
     for (i = 0; (i < a->nr); i++)
     {
         if (!gmx_atomprop_query(aps, epropVDW,
@@ -67,7 +70,7 @@ real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
 }
 
 char *readConformation(const char *confin, t_atoms *atoms, rvec **x, rvec **v,
-                       int *ePBC, matrix box)
+                       int *ePBC, matrix box, const char *statusTitle)
 {
     char *title;
     int   natoms;
@@ -84,7 +87,7 @@ char *readConformation(const char *confin, t_atoms *atoms, rvec **x, rvec **v,
     init_t_atoms(atoms, natoms, FALSE);
 
     /* read residue number, residue names, atomnames, coordinates etc. */
-    fprintf(stderr, "Reading solute configuration%s\n", v ? " and velocities" : "");
+    fprintf(stderr, "Reading %s configuration%s\n", statusTitle, v ? " and velocities" : "");
     read_stx_conf(confin, title, atoms, *x, v ? *v : NULL, ePBC, box);
     fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
             title, atoms->nr, atoms->nres);
index 13386af2ee369db78be967f3f18bc95000b44a34..5ced52b98b35a37a60d735ca4ca578b153fff953 100644 (file)
 #ifndef GMX_GMXPREPROCESS_READ_CONFORMATION_H
 #define GMX_GMXPREPROCESS_READ_CONFORMATION_H
 
-#include "types/simple.h"
-#include "types/atoms.h"
-#include "atomprop.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_atomprop;
+struct t_atoms;
+
 /*! \brief Allocate and fill an array of inter-atomic half distances
  *
  * These are either scaled VDW radii taken from vdwradii.dat, or the
  * default value. Used directly and indirectly by solvate and
  * insert-molecules for deciding whether molecules clash. The return
  * pointer should be freed by the caller. */
-real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
+real *makeExclusionDistances(const struct t_atoms *a, struct gmx_atomprop *aps,
                              real defaultDistance, real scaleFactor);
 
 /*! \brief Read a conformation from a file, allocate and fill data structures.
@@ -57,8 +58,8 @@ real *makeExclusionDistances(const t_atoms *a, gmx_atomprop_t aps,
  * Used by solvate and insert-molecules. The returned pointers *x and
  * *v should be freed by the caller. atoms should have its destructor
  * called. */
-char *readConformation(const char *confin, t_atoms *atoms, rvec **x, rvec **v,
-                       int *ePBC, matrix box);
+char *readConformation(const char *confin, struct t_atoms *atoms, rvec **x, rvec **v,
+                       int *ePBC, matrix box, const char *statusTitle);
 
 #ifdef __cplusplus
 }
index 7f3668484463f424648eb30a965b4821ef847336..a95374cda85b3e7d873a8804f18ac396778b4570 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.
  */
+#include "gmxpre.h"
+
+#include <stdlib.h>
 #include <string.h>
 
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/legacyheaders/names.h"
 #include "gromacs/utility/cstringutil.h"
-#include "readir.h"
-#include "names.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 
 #define MAXPTR 254
 
index 21ffe3021631070740375553a473667e350c31f2..6b4a6e8caf99c43e96b66fbfa3b93d05e48c10b9 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "readir.h"
 
 #include <ctype.h>
-#include <stdlib.h>
 #include <limits.h>
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "physics.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "index.h"
-#include "symtab.h"
+#include <stdlib.h>
+
+#include "gromacs/gmxpreprocess/calc_verletbuf.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/inputrec.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/warninp.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
-#include "readinp.h"
-#include "warninp.h"
-#include "readir.h"
-#include "toputil.h"
-#include "index.h"
-#include "network.h"
-#include "vec.h"
-#include "pbc.h"
-#include "mtop_util.h"
-#include "chargegroup.h"
-#include "inputrec.h"
-#include "calc_verletbuf.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define MAXPTR 254
 #define NOGID  255
@@ -160,7 +159,7 @@ static void GetSimTemps(int ntemps, t_simtemp *simtemp, double *temperature_lamb
         }
         else if (simtemp->eSimTempScale == esimtempEXPONENTIAL)
         {
-            simtemp->temperatures[i] = simtemp->simtemp_low + (simtemp->simtemp_high-simtemp->simtemp_low)*((exp(temperature_lambdas[i])-1)/(exp(1.0)-1));
+            simtemp->temperatures[i] = simtemp->simtemp_low + (simtemp->simtemp_high-simtemp->simtemp_low)*(gmx_expm1(temperature_lambdas[i])/gmx_expm1(1.0));
         }
         else
         {
@@ -270,6 +269,8 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
     {
         warning_error(wi, "rlist should be >= 0");
     }
+    sprintf(err_buf, "nstlist can not be smaller than 0. (If you were trying to use the heuristic neighbour-list update scheme for efficient buffering for improved energy conservation, please use the Verlet cut-off scheme instead.)");
+    CHECK(ir->nstlist < 0);
 
     process_interaction_modifier(ir, &ir->coulomb_modifier);
     process_interaction_modifier(ir, &ir->vdw_modifier);
@@ -306,9 +307,9 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         {
             warning_error(wi, "rlistlong can not be shorter than rlist");
         }
-        if (IR_TWINRANGE(*ir) && ir->nstlist <= 0)
+        if (IR_TWINRANGE(*ir) && ir->nstlist == 0)
         {
-            warning_error(wi, "Can not have nstlist<=0 with twin-range interactions");
+            warning_error(wi, "Can not have nstlist == 0 with twin-range interactions");
         }
     }
 
@@ -880,10 +881,6 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
               (ir->ePBC     != epbcNONE) ||
               (ir->rcoulomb != 0.0)      || (ir->rvdw != 0.0));
 
-        if (ir->nstlist < 0)
-        {
-            warning_error(wi, "Can not have heuristic neighborlist updates without cut-off");
-        }
         if (ir->nstlist > 0)
         {
             warning_note(wi, "Simulating without cut-offs can be (slightly) faster with nstlist=0, nstype=simple and only one MPI rank");
@@ -1285,8 +1282,7 @@ nd %s",
     if (ir->cutoff_scheme == ecutsGROUP)
     {
         if (((ir->coulomb_modifier != eintmodNONE && ir->rcoulomb == ir->rlist) ||
-             (ir->vdw_modifier != eintmodNONE && ir->rvdw == ir->rlist)) &&
-            ir->nstlist != 1)
+             (ir->vdw_modifier != eintmodNONE && ir->rvdw == ir->rlist)))
         {
             warning_note(wi, "With exact cut-offs, rlist should be "
                          "larger than rcoulomb and rvdw, so that there "
@@ -1313,14 +1309,6 @@ nd %s",
         warning_note(wi, "You have selected user tables with dispersion correction, the dispersion will be corrected to -C6/r^6 beyond rvdw_switch (the tabulated interaction between rvdw_switch and rvdw will not be double counted). Make sure that you really want dispersion correction to -C6/r^6.");
     }
 
-    if (ir->nstlist == -1)
-    {
-        sprintf(err_buf, "With nstlist=-1 rvdw and rcoulomb should be smaller than rlist to account for diffusion and possibly charge-group radii");
-        CHECK(ir->rvdw >= ir->rlist || ir->rcoulomb >= ir->rlist);
-    }
-    sprintf(err_buf, "nstlist can not be smaller than -1");
-    CHECK(ir->nstlist < -1);
-
     if (ir->eI == eiLBFGS && (ir->coulombtype == eelCUT || ir->vdwtype == evdwCUT)
         && ir->rvdw != 0)
     {
@@ -1448,7 +1436,7 @@ int str_nelem(const char *str, int maxptr, char *ptr[])
     int   np = 0;
     char *copy0, *copy;
 
-    copy0 = strdup(str);
+    copy0 = gmx_strdup(str);
     copy  = copy0;
     ltrim(copy);
     while (*copy != '\0')
@@ -1703,7 +1691,7 @@ static void do_wall_params(t_inputrec *ir,
         }
         for (i = 0; i < ir->nwall; i++)
         {
-            opts->wall_atomtype[i] = strdup(names[i]);
+            opts->wall_atomtype[i] = gmx_strdup(names[i]);
         }
 
         if (ir->wall_type == ewt93 || ir->wall_type == ewt104)
@@ -2366,7 +2354,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     {
         if (ir->efep != efepNO)
         {
-            opts->couple_moltype = strdup(is->couple_moltype);
+            opts->couple_moltype = gmx_strdup(is->couple_moltype);
             if (opts->couple_lam0 == opts->couple_lam1)
             {
                 warning(wi, "The lambda=0 and lambda=1 states for coupling are identical");
@@ -2974,7 +2962,7 @@ static void decode_cos(char *s, t_cosines *cosine)
     double  a, phi;
     int     i;
 
-    t = strdup(s);
+    t = gmx_strdup(s);
     trim(t);
 
     cosine->n   = 0;
@@ -3155,7 +3143,7 @@ static void make_swap_groups(
 
 void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames)
 {
-    int      ig = -1, i;
+    int      ig, i;
 
 
     ig            = search_string(IMDgname, grps->nr, gnames);
@@ -3862,7 +3850,15 @@ static gmx_bool absolute_reference(t_inputrec *ir, gmx_mtop_t *sys,
                         case efbposresSPHERE:
                             AbsRef[XX] = AbsRef[YY] = AbsRef[ZZ] = 1;
                             break;
+                        case efbposresCYLINDERX:
+                            AbsRef[YY] = AbsRef[ZZ] = 1;
+                            break;
+                        case efbposresCYLINDERY:
+                            AbsRef[XX] = AbsRef[ZZ] = 1;
+                            break;
                         case efbposresCYLINDER:
+                        /* efbposres is a synonym for efbposresCYLINDERZ for backwards compatibility */
+                        case efbposresCYLINDERZ:
                             AbsRef[XX] = AbsRef[YY] = 1;
                             break;
                         case efbposresX: /* d=XX */
@@ -4285,7 +4281,10 @@ void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
     check_disre(sys);
 }
 
-void double_check(t_inputrec *ir, matrix box, gmx_bool bConstr, warninp_t wi)
+void double_check(t_inputrec *ir, matrix box,
+                  gmx_bool bHasNormalConstraints,
+                  gmx_bool bHasAnyConstraints,
+                  warninp_t wi)
 {
     real        min_size;
     gmx_bool    bTWIN;
@@ -4298,7 +4297,7 @@ void double_check(t_inputrec *ir, matrix box, gmx_bool bConstr, warninp_t wi)
         warning_error(wi, ptr);
     }
 
-    if (bConstr && ir->eConstrAlg == econtSHAKE)
+    if (bHasNormalConstraints && ir->eConstrAlg == econtSHAKE)
     {
         if (ir->shake_tol <= 0.0)
         {
@@ -4321,7 +4320,7 @@ void double_check(t_inputrec *ir, matrix box, gmx_bool bConstr, warninp_t wi)
         }
     }
 
-    if ( (ir->eConstrAlg == econtLINCS) && bConstr)
+    if ( (ir->eConstrAlg == econtLINCS) && bHasNormalConstraints)
     {
         /* If we have Lincs constraints: */
         if (ir->eI == eiMD && ir->etc == etcNO &&
@@ -4342,9 +4341,9 @@ void double_check(t_inputrec *ir, matrix box, gmx_bool bConstr, warninp_t wi)
         }
     }
 
-    if (bConstr && ir->epc == epcMTTK)
+    if (bHasAnyConstraints && ir->epc == epcMTTK)
     {
-        warning_note(wi, "MTTK with constraints is deprecated, and will be removed in GROMACS 5.1");
+        warning_error(wi, "Constraints are not implemented with MTTK pressure control.");
     }
 
     if (ir->LincsWarnAngle > 90.0)
index e3fe4e6be35e708a80d5e7bf64759befe306fa7d..dcfd3fc2fcfd1132769eeaec72aba3d2607ea535 100644 (file)
@@ -38,9 +38,9 @@
 #ifndef GMX_GMXPREPROCESS_READIR_H
 #define GMX_GMXPREPROCESS_READIR_H
 
-#include "typedefs.h"
-#include "readinp.h"
-#include "grompp-impl.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -90,7 +90,9 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
 int search_string(const char *s, int ng, char *gn[]);
 /* Returns the index of string s in the index groups */
 
-void double_check(t_inputrec *ir, matrix box, gmx_bool bConstr,
+void double_check(t_inputrec *ir, matrix box,
+                  gmx_bool bHasNormalConstraints,
+                  gmx_bool bHasAnyConstraints,
                   warninp_t wi);
 /* Do more checks */
 
index 72ea00883255550abdb59beb5105cdad5fbea5bc..eeab07e03133e8e2205cd1e7b986d460f7f1b80e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pulling/pull.h"
 #include "gromacs/utility/cstringutil.h"
-#include "sysstuff.h"
-#include "princ.h"
-#include "gromacs/fileio/futil.h"
-#include "vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "index.h"
-#include "symtab.h"
-#include "readinp.h"
-#include "readir.h"
-#include "mdatoms.h"
-#include "pbc.h"
-#include "gromacs/pulling/pull.h"
 
 
 static char pulldim[STRLEN];
index 237ea878dbafb8bcaac6eda4fdc5b4790b75ea30..5d9715f60deebf0169695e9aee0b0b177e874c9f 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "readir.h"
-#include "names.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/trnio.h"
-#include "txtdump.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static char *RotStr = {"Enforced rotation:"};
 
index a95fb1b27caaa57cf5faa675fec95761f5b6f9c4..fe75e0cc652e8f65294e2c8aab6a8aa960047d47 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "resall.h"
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
-#include "sysstuff.h"
+#include "gromacs/fileio/strdb.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "symtab.h"
-#include "macros.h"
-#include "resall.h"
-#include "pgutil.h"
-#include "fflibutil.h"
-
-#include "gromacs/fileio/strdb.h"
 
 gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
 {
@@ -195,7 +193,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
         {
             if (sscanf(line+n, "%s%n", str, &ni) == 1)
             {
-                rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = strdup(str);
+                rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = gmx_strdup(str);
             }
             else
             {
@@ -212,7 +210,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
             n++;
         }
         rtrim(line+n);
-        rtp->rb[bt].b[rtp->rb[bt].nb].s = strdup(line+n);
+        rtp->rb[bt].b[rtp->rb[bt].nb].s = gmx_strdup(line+n);
         rtp->rb[bt].nb++;
     }
     /* give back unused memory */
@@ -452,8 +450,8 @@ void read_resall(char *rrdb, int *nrtpptr, t_restp **rtp,
         {
             gmx_fatal(FARGS, "in .rtp file at line:\n%s\n", line);
         }
-        rrtp[nrtp].resname  = strdup(header);
-        rrtp[nrtp].filebase = strdup(filebase);
+        rrtp[nrtp].resname  = gmx_strdup(header);
+        rrtp[nrtp].filebase = gmx_strdup(filebase);
 
         get_a_line(in, line, STRLEN);
         bError       = FALSE;
index 3f101f5d5d0953d1f3c15e2cceafe1176442b371..487ed643e2a06febc6b4c69f5c069fffd7cd657f 100644 (file)
 #ifndef GMX_GMXPREPROCESS_RESALL_H
 #define GMX_GMXPREPROCESS_RESALL_H
 
-#include "typedefs.h"
-#include "hackblock.h"
-#include "gpp_atomtype.h"
-#include "grompp-impl.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -58,11 +58,11 @@ t_restp *get_restp(const char *rtpname, int nrtp, t_restp rtp[]);
  * Generates a fatal error when rtpname is not found.
  */
 
-gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab);
+gpp_atomtype_t read_atype(const char *ffdir, struct t_symtab *tab);
 /* read atom type database(s) */
 
 void read_resall(char *resdb, int *nrtp, t_restp **rtp,
-                 gpp_atomtype_t atype, t_symtab *tab,
+                 gpp_atomtype_t atype, struct t_symtab *tab,
                  gmx_bool bAllowOverrideRTP);
 /* read rtp database, append to the existing database */
 
index 27623f165ebfa059dab3cd68761a0c8177b1dd9a..137dd3e720d6cf98ed53684eaaa4763a5944282d 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.
  */
-#include "solvate.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "solvate.h"
 
 #include <string.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/confio.h"
-#include "macros.h"
-#include "gromacs/fileio/futil.h"
-#include "atomprop.h"
-#include "names.h"
-#include "vec.h"
-#include "gmx_fatal.h"
+#include <algorithm>
+
 #include "gromacs/commandline/pargs.h"
-#include "gromacs/gmxlib/conformation-utilities.h"
-#include "addconf.h"
-#include "read-conformation.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/pdbio.h"
-#include "pbc.h"
-
-#ifdef DEBUG
-static void print_stat(rvec *x, int natoms, matrix box)
-{
-    int  i, m;
-    rvec xmin, xmax;
-    for (m = 0; (m < DIM); m++)
-    {
-        xmin[m] = x[0][m];
-        xmax[m] = x[0][m];
-    }
-    for (i = 0; (i < natoms); i++)
-    {
-        for (m = 0; m < DIM; m++)
-        {
-            xmin[m] = min(xmin[m], x[i][m]);
-            xmax[m] = max(xmax[m], x[i][m]);
-        }
-    }
-    for (m = 0; (m < DIM); m++)
-    {
-        fprintf(stderr, "DIM %d XMIN %8.3f XMAX %8.3f BOX %8.3f\n",
-                m, xmin[m], xmax[m], box[m][m]);
-    }
-}
-#endif
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "gromacs/gmxpreprocess/read-conformation.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/atomsbuilder.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     char *name;
@@ -114,16 +88,18 @@ static void sort_molecule(t_atoms **atoms_solvt, rvec *x, rvec *v, real *r)
         if ( (i == 0) || (atoms->atom[i].resind != atoms->atom[i-1].resind) )
         {
             /* see if this was a molecule type we haven't had yet: */
-            moltp = NOTSET;
-            for (j = 0; (j < nrmoltypes) && (moltp == NOTSET); j++)
+            moltp = -1;
+            for (j = 0; (j < nrmoltypes) && (moltp == -1); j++)
             {
-                if (strcmp(*(atoms->resinfo[atoms->atom[i].resind].name),
-                           moltypes[j].name) == 0)
+                /* cppcheck-suppress nullPointer
+                 * moltypes is guaranteed to be allocated because otherwise
+                 * nrmoltypes is 0. */
+                if (strcmp(*(atoms->resinfo[atoms->atom[i].resind].name), moltypes[j].name) == 0)
                 {
                     moltp = j;
                 }
             }
-            if (moltp == NOTSET)
+            if (moltp == -1)
             {
                 moltp = nrmoltypes;
                 nrmoltypes++;
@@ -305,181 +281,422 @@ static void rm_res_pbc(t_atoms *atoms, rvec *x, matrix box)
     }
 }
 
-/* Make a new configuration by adding boxes*/
-static void make_new_conformation(t_atoms *atoms, rvec *x, rvec *v, real *r, matrix box, ivec n_box)
+/*! \brief
+ * Generates a solvent configuration of desired size by stacking solvent boxes.
+ *
+ * \param[in,out] atoms      Solvent atoms.
+ * \param[in,out] x          Solvent positions.
+ * \param[in,out] v          Solvent velocities (`*v` can be NULL).
+ * \param[in,out] r          Solvent exclusion radii.
+ * \param[in]     box        Initial solvent box.
+ * \param[in]     boxTarget  Target box size.
+ *
+ * The solvent box of desired size is created by stacking the initial box in
+ * the smallest k*l*m array that covers the box, and then removing any residue
+ * where all atoms are outside the target box (with a small margin).
+ * This function does not remove overlap between solvent atoms across the
+ * edges.
+ *
+ * Note that the input configuration should be in the rectangular unit cell and
+ * have whole residues.
+ */
+static void replicateSolventBox(t_atoms *atoms, rvec **x, rvec **v, real **r,
+                                const matrix box, const matrix boxTarget)
 {
-    int     i, ix, iy, iz, m, j, imol, offset;
-    rvec    delta;
-    int     nmol;
+    // Calculate the box multiplication factors.
+    ivec n_box;
+    int  nmol = 1;
+    for (int i = 0; i < DIM; ++i)
+    {
+        n_box[i] = 1;
+        while (n_box[i] * box[i][i] < boxTarget[i][i])
+        {
+            n_box[i]++;
+        }
+        nmol *= n_box[i];
+    }
+    fprintf(stderr, "Will generate new solvent configuration of %dx%dx%d boxes\n",
+            n_box[XX], n_box[YY], n_box[ZZ]);
+
+    // Create arrays for storing the generated system (cannot be done in-place
+    // in case the target box is smaller than the original in one dimension,
+    // but not in all).
+    t_atoms           newAtoms;
+    init_t_atoms(&newAtoms, 0, FALSE);
+    gmx::AtomsBuilder builder(&newAtoms);
+    builder.reserve(atoms->nr * nmol, atoms->nres * nmol);
+    rvec             *newX;
+    rvec             *newV = NULL;
+    real             *newR;
+    snew(newX,              atoms->nr * nmol);
+    snew(newR,              atoms->nr * nmol);
+    if (*v)
+    {
+        snew(newV,          atoms->nr * nmol);
+    }
 
-    nmol = n_box[XX]*n_box[YY]*n_box[ZZ];
+    const real maxRadius = *std::max_element(*r, *r + atoms->nr);
+    rvec       boxWithMargin;
+    for (int i = 0; i < DIM; ++i)
+    {
+        // The code below is only interested about the box diagonal.
+        boxWithMargin[i] = boxTarget[i][i] + 3*maxRadius;
+    }
 
-    /*print message*/
-    fprintf(stderr, "Generating configuration\n");
-    imol = 0;
-    for (ix = 0; (ix < n_box[XX]); ix++)
+    for (int ix = 0; ix < n_box[XX]; ++ix)
     {
+        rvec delta;
         delta[XX] = ix*box[XX][XX];
-        for (iy = 0; (iy < n_box[YY]); iy++)
+        for (int iy = 0; iy < n_box[YY]; ++iy)
         {
             delta[YY] = iy*box[YY][YY];
-            for (iz = 0; (iz < n_box[ZZ]); iz++)
+            for (int iz = 0; iz < n_box[ZZ]; ++iz)
             {
                 delta[ZZ] = iz*box[ZZ][ZZ];
-                offset    = imol*atoms->nr;
-                for (i = 0; (i < atoms->nr); i++)
+                bool bKeepResidue     = false;
+                for (int i = 0; i < atoms->nr; ++i)
                 {
-                    for (m = 0; (m < DIM); m++)
+                    const int newIndex  = builder.currentAtomCount();
+                    bool      bKeepAtom = true;
+                    for (int m = 0; m < DIM; ++m)
                     {
-                        x[offset+i][m] = delta[m]+x[i][m];
+                        const real newCoord = delta[m] + (*x)[i][m];
+                        bKeepAtom         = bKeepAtom && (newCoord < boxWithMargin[m]);
+                        newX[newIndex][m] = newCoord;
                     }
-                    if (v)
+                    bKeepResidue = bKeepResidue || bKeepAtom;
+                    if (newV)
                     {
-                        for (m = 0; (m < DIM); m++)
+                        copy_rvec((*v)[i], newV[newIndex]);
+                    }
+                    newR[newIndex] = (*r)[i];
+                    builder.addAtom(*atoms, i);
+                    if (i == atoms->nr - 1
+                        || atoms->atom[i+1].resind != atoms->atom[i].resind)
+                    {
+                        if (bKeepResidue)
+                        {
+                            builder.finishResidue(atoms->resinfo[atoms->atom[i].resind]);
+                        }
+                        else
                         {
-                            v[offset+i][m] = v[i][m];
+                            builder.discardCurrentResidue();
                         }
+                        // Reset state for the next residue.
+                        bKeepResidue     = false;
                     }
-                    r[offset+i] = r[i];
                 }
-                imol++;
             }
         }
     }
-    for (i = 1; (i < nmol); i++)
+    sfree(atoms->atom);
+    sfree(atoms->atomname);
+    sfree(atoms->resinfo);
+    atoms->nr       = newAtoms.nr;
+    atoms->nres     = newAtoms.nres;
+    atoms->atom     = newAtoms.atom;
+    atoms->atomname = newAtoms.atomname;
+    atoms->resinfo  = newAtoms.resinfo;
+    sfree(*x);
+    sfree(*v);
+    sfree(*r);
+    *x = newX;
+    *v = newV;
+    *r = newR;
+    fprintf(stderr, "Solvent box contains %d atoms in %d residues\n",
+            atoms->nr, atoms->nres);
+}
+
+/*! \brief
+ * Removes overlap of solvent atoms across the edges.
+ *
+ * \param[in,out] atoms      Solvent atoms.
+ * \param[in,out] x          Solvent positions.
+ * \param[in,out] v          Solvent velocities (can be NULL).
+ * \param[in,out] r          Solvent exclusion radii.
+ * \param[in]     pbc        PBC information.
+ *
+ * Solvent residues that lay on the edges that do not touch the origin are
+ * removed if they overlap with other solvent atoms across the PBC.
+ * This is done in this way as the assumption is that the input solvent
+ * configuration is already equilibrated, and so does not contain any
+ * undesirable overlap.  The only overlap that should be removed is caused by
+ * cutting the box in half in replicateSolventBox() and leaving a margin of
+ * solvent outside those box edges; these atoms can then overlap with those on
+ * the opposite box edge in a way that is not part of the pre-equilibrated
+ * configuration.
+ */
+static void removeSolventBoxOverlap(t_atoms *atoms, rvec *x, rvec *v, real *r,
+                                    const t_pbc &pbc)
+{
+    gmx::AtomsRemover remover(*atoms);
+
+    // TODO: We could limit the amount of pairs searched significantly,
+    // since we are only interested in pairs where the positions are on
+    // opposite edges.
+    const real maxRadius = *std::max_element(r, r + atoms->nr);
+    gmx::AnalysisNeighborhood           nb;
+    nb.setCutoff(2*maxRadius);
+    gmx::AnalysisNeighborhoodPositions  pos(x, atoms->nr);
+    gmx::AnalysisNeighborhoodSearch     search     = nb.initSearch(&pbc, pos);
+    gmx::AnalysisNeighborhoodPairSearch pairSearch = search.startPairSearch(pos);
+    gmx::AnalysisNeighborhoodPair       pair;
+    while (pairSearch.findNextPair(&pair))
     {
-        int offs    = i*atoms->nr;
-        int offsres = i*atoms->nres;
-        for (j = 0; (j < atoms->nr); j++)
+        const int  i1 = pair.refIndex();
+        const int  i2 = pair.testIndex();
+        if (remover.isMarked(i2))
+        {
+            pairSearch.skipRemainingPairsForTestPosition();
+            continue;
+        }
+        if (remover.isMarked(i1) || atoms->atom[i1].resind == atoms->atom[i2].resind)
         {
-            atoms->atomname[offs+j]                    = atoms->atomname[j];
-            atoms->atom[offs+j].resind                 = atoms->atom[j].resind + offsres;
-            atoms->resinfo[atoms->atom[offs+j].resind] =
-                atoms->resinfo[atoms->atom[j].resind];
-            atoms->resinfo[atoms->atom[offs+j].resind].nr += offsres;
+            continue;
         }
+        if (pair.distance2() < sqr(r[i1] + r[i2]))
+        {
+            rvec dx;
+            rvec_sub(x[i2], x[i1], dx);
+            bool bCandidate1 = false, bCandidate2 = false;
+            // To satisfy Clang static analyzer.
+            GMX_ASSERT(pbc.ndim_ePBC <= DIM, "Too many periodic dimensions");
+            for (int d = 0; d < pbc.ndim_ePBC; ++d)
+            {
+                // If the distance in some dimension is larger than the
+                // cutoff, then it means that the distance has been computed
+                // over the PBC.  Mark the position with a larger coordinate
+                // for potential removal.
+                if (dx[d] > maxRadius)
+                {
+                    bCandidate2 = true;
+                }
+                else if (dx[d] < -maxRadius)
+                {
+                    bCandidate1 = true;
+                }
+            }
+            // Only mark one of the positions for removal if both were
+            // candidates.
+            if (bCandidate2 && (!bCandidate1 || i2 > i1))
+            {
+                remover.markResidue(*atoms, i2, true);
+                pairSearch.skipRemainingPairsForTestPosition();
+            }
+            else if (bCandidate1)
+            {
+                remover.markResidue(*atoms, i1, true);
+            }
+        }
+    }
+
+    remover.removeMarkedVectors(x);
+    if (v != NULL)
+    {
+        remover.removeMarkedVectors(v);
+    }
+    remover.removeMarkedValues(r);
+    const int originalAtomCount = atoms->nr;
+    remover.removeMarkedAtoms(atoms);
+    fprintf(stderr, "Removed %d solvent atoms due to solvent-solvent overlap\n",
+            originalAtomCount - atoms->nr);
+}
+
+/*! \brief
+ * Removes solvent molecules that overlap with the solute, and optionally also
+ * those that are outside a given shell radius from the solute.
+ *
+ * \param[in,out] atoms      Solvent atoms.
+ * \param[in,out] x          Solvent positions.
+ * \param[in,out] v          Solvent velocities (can be NULL).
+ * \param[in,out] r          Solvent exclusion radii.
+ * \param[in]     pbc        PBC information.
+ * \param[in]     soluteAtomCount Number of solute atoms.
+ * \param[in]     x_solute   Solute positions.
+ * \param[in]     r_solute   Solute exclusion radii.
+ * \param[in]     rshell     If >0, only keep solvent atoms within a shell of
+ *     this size from the solute.
+ */
+static void removeSoluteOverlap(t_atoms *atoms, rvec *x, rvec *v, real *r,
+                                const t_pbc &pbc, int soluteAtomCount,
+                                const rvec *x_solute, const real *r_solute,
+                                real rshell)
+{
+    const real                          maxRadius1
+        = *std::max_element(r, r + atoms->nr);
+    const real                          maxRadius2
+        = *std::max_element(r_solute, r_solute + soluteAtomCount);
+
+    gmx::AtomsRemover                   remover(*atoms);
+    // If rshell is >0, the neighborhood search looks at all pairs
+    // within rshell, and unmarks those that are within the cutoff.
+    // This line marks everything, so that solvent outside rshell remains
+    // marked after the loop.
+    // Without rshell, the neighborhood search only marks the overlapping
+    // solvent atoms, and all others are left alone.
+    if (rshell > 0.0)
+    {
+        remover.markAll();
+    }
+
+    gmx::AnalysisNeighborhood           nb;
+    nb.setCutoff(std::max(maxRadius1 + maxRadius2, rshell));
+    gmx::AnalysisNeighborhoodPositions  posSolute(x_solute, soluteAtomCount);
+    gmx::AnalysisNeighborhoodSearch     search     = nb.initSearch(&pbc, posSolute);
+    gmx::AnalysisNeighborhoodPositions  pos(x, atoms->nr);
+    gmx::AnalysisNeighborhoodPairSearch pairSearch = search.startPairSearch(pos);
+    gmx::AnalysisNeighborhoodPair       pair;
+    while (pairSearch.findNextPair(&pair))
+    {
+        if (remover.isMarked(pair.testIndex()))
+        {
+            pairSearch.skipRemainingPairsForTestPosition();
+            continue;
+        }
+        const real r1      = r_solute[pair.refIndex()];
+        const real r2      = r[pair.testIndex()];
+        const bool bRemove = (pair.distance2() < sqr(r1 + r2));
+        remover.markResidue(*atoms, pair.testIndex(), bRemove);
     }
-    atoms->nr   *= nmol;
-    atoms->nres *= nmol;
-    for (i = 0; i < DIM; i++)
+
+    remover.removeMarkedVectors(x);
+    if (v != NULL)
+    {
+        remover.removeMarkedVectors(v);
+    }
+    remover.removeMarkedValues(r);
+    const int originalAtomCount = atoms->nr;
+    remover.removeMarkedAtoms(atoms);
+    fprintf(stderr, "Removed %d solvent atoms due to solute-solvent overlap\n",
+            originalAtomCount - atoms->nr);
+}
+
+/*! \brief
+ * Removes a given number of solvent residues.
+ *
+ * \param[in,out] atoms           Solvent atoms.
+ * \param[in,out] x               Solvent positions.
+ * \param[in,out] v               Solvent velocities (can be NULL).
+ * \param[in]     numberToRemove  Number of residues to remove.
+ *
+ * This function is called last in the process of creating the solvent box,
+ * so it does not operate on the exclusion radii, as no code after this needs
+ * them.
+ */
+static void removeExtraSolventMolecules(t_atoms *atoms, rvec *x, rvec *v,
+                                        int numberToRemove)
+{
+    gmx::AtomsRemover remover(*atoms);
+    // TODO: It might be nicer to remove a random set of residues, but
+    // in practice this should give a roughly uniform spatial distribution.
+    const int stride = atoms->nr / numberToRemove;
+    for (int i = 0; i < numberToRemove; ++i)
     {
-        for (j = 0; j < DIM; j++)
+        int atomIndex = (i+1)*stride - 1;
+        while (remover.isMarked(atomIndex))
         {
-            box[j][i] *= n_box[j];
+            ++atomIndex;
+            if (atomIndex == atoms->nr)
+            {
+                atomIndex = 0;
+            }
         }
+        remover.markResidue(*atoms, atomIndex, true);
+    }
+    remover.removeMarkedVectors(x);
+    if (v != NULL)
+    {
+        remover.removeMarkedVectors(v);
     }
+    remover.removeMarkedAtoms(atoms);
 }
 
-static void add_solv(const char *fn, t_atoms *atoms, rvec **x, rvec **v, real **exclusionDistances,
-                     int ePBC, matrix box,
-                     gmx_atomprop_t aps,
-                     real defaultDistance, real scaleFactor, int *atoms_added,
-                     int *residues_added, real rshell, int max_sol,
-                     const output_env_t oenv)
+static void add_solv(const char *fn, t_atoms *atoms, rvec **x, rvec **v,
+                     int ePBC, matrix box, gmx_atomprop_t aps,
+                     real defaultDistance, real scaleFactor,
+                     real rshell, int max_sol)
 {
-    int      i, nmol;
-    ivec     n_box;
-    char     filename[STRLEN];
-    char     title_solvt[STRLEN];
     t_atoms *atoms_solvt;
     rvec    *x_solvt, *v_solvt = NULL;
-    real    *exclusionDistances_solvt;
     int      ePBC_solvt;
     matrix   box_solvt;
-    int      onr, onres;
-    char    *lfn;
 
-    lfn = gmxlibfn(fn);
-    strncpy(filename, lfn, STRLEN);
-    sfree(lfn);
+    char    *filename = gmxlibfn(fn);
+    snew(atoms_solvt, 1);
+    char    *title_solvt
+        = readConformation(filename, atoms_solvt, &x_solvt, &v_solvt,
+                           &ePBC_solvt, box_solvt, "solvent");
+    sfree(title_solvt);
+    if (0 == atoms_solvt->nr)
     {
-        int natoms;
-        get_stx_coordnum(filename, &natoms);
-        if (0 == natoms)
-        {
-            gmx_fatal(FARGS, "No solvent in %s, please check your input\n", filename);
-        }
-        snew(atoms_solvt, 1);
-        init_t_atoms(atoms_solvt, natoms, FALSE);
-    }
-    snew(x_solvt, atoms_solvt->nr);
-    if (v)
-    {
-        snew(v_solvt, atoms_solvt->nr);
-    }
-    snew(exclusionDistances_solvt, atoms_solvt->nr);
-    snew(atoms_solvt->resinfo, atoms_solvt->nr);
-    snew(atoms_solvt->atomname, atoms_solvt->nr);
-    snew(atoms_solvt->atom, atoms_solvt->nr);
-    atoms_solvt->pdbinfo = NULL;
-    fprintf(stderr, "Reading solvent configuration%s\n",
-            v_solvt ? " and velocities" : "");
-    read_stx_conf(filename, title_solvt, atoms_solvt, x_solvt, v_solvt,
-                  &ePBC_solvt, box_solvt);
-    fprintf(stderr, "\"%s\"\n", title_solvt);
-    fprintf(stderr, "solvent configuration contains %d atoms in %d residues\n",
-            atoms_solvt->nr, atoms_solvt->nres);
+        gmx_fatal(FARGS, "No solvent in %s, please check your input\n", filename);
+    }
+    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 */
-    exclusionDistances_solvt = makeExclusionDistances(atoms_solvt, aps, defaultDistance, scaleFactor);
+    fprintf(stderr, "Initialising inter-atomic distances...\n");
+    real *exclusionDistances
+        = makeExclusionDistances(atoms, aps, defaultDistance, scaleFactor);
+    real *exclusionDistances_solvt
+        = makeExclusionDistances(atoms_solvt, aps, defaultDistance, scaleFactor);
 
-    /* calculate the box multiplication factors n_box[0...DIM] */
-    nmol = 1;
-    for (i = 0; (i < DIM); i++)
+    /* generate a new solvent configuration */
+    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)
     {
-        n_box[i] = 1;
-        while (n_box[i]*box_solvt[i][i] < box[i][i])
-        {
-            n_box[i]++;
-        }
-        nmol *= n_box[i];
+        removeSolventBoxOverlap(atoms_solvt, x_solvt, v_solvt, exclusionDistances_solvt, pbc);
     }
-    fprintf(stderr, "Will generate new solvent configuration of %dx%dx%d boxes\n",
-            n_box[XX], n_box[YY], n_box[ZZ]);
-
-    /* realloc atoms_solvt for the new solvent configuration */
-    srenew(atoms_solvt->resinfo, atoms_solvt->nres*nmol);
-    srenew(atoms_solvt->atomname, atoms_solvt->nr*nmol);
-    srenew(atoms_solvt->atom, atoms_solvt->nr*nmol);
-    srenew(x_solvt, atoms_solvt->nr*nmol);
-    if (v_solvt)
+    if (atoms->nr > 0)
     {
-        srenew(v_solvt, atoms_solvt->nr*nmol);
+        removeSoluteOverlap(atoms_solvt, x_solvt, v_solvt, exclusionDistances_solvt, pbc,
+                            atoms->nr, *x, exclusionDistances, rshell);
     }
-    srenew(exclusionDistances_solvt, atoms_solvt->nr*nmol);
-
-    /* generate a new solvent configuration */
-    make_new_conformation(atoms_solvt, x_solvt, v_solvt, exclusionDistances_solvt, box_solvt, n_box);
 
-#ifdef DEBUG
-    print_stat(x_solvt, atoms_solvt->nr, box_solvt);
-#endif
+    if (max_sol > 0 && atoms_solvt->nres > max_sol)
+    {
+        const int numberToRemove = atoms_solvt->nres - max_sol;
+        removeExtraSolventMolecules(atoms_solvt, x_solvt, v_solvt, numberToRemove);
+    }
 
-#ifdef DEBUG
-    print_stat(x_solvt, atoms_solvt->nr, box_solvt);
-#endif
     /* Sort the solvent mixture, not the protein... */
     sort_molecule(&atoms_solvt, x_solvt, v_solvt, exclusionDistances_solvt);
 
-    /* add the two configurations */
-    onr   = atoms->nr;
-    onres = atoms->nres;
-    add_conf(atoms, x, v, exclusionDistances, TRUE, ePBC, box, FALSE,
-             atoms_solvt, x_solvt, v_solvt, exclusionDistances_solvt, TRUE, rshell, max_sol, oenv);
-    *atoms_added    = atoms->nr-onr;
-    *residues_added = atoms->nres-onres;
+    // Merge the two configurations.
+    srenew(*x, atoms->nr + atoms_solvt->nr);
+    if (v != NULL)
+    {
+        srenew(*v, atoms->nr + atoms_solvt->nr);
+    }
+    for (int i = 0; i < atoms_solvt->nr; ++i)
+    {
+        const int index = atoms->nr + i;
+        copy_rvec(x_solvt[i], (*x)[index]);
+        if (v != NULL)
+        {
+            copy_rvec(v_solvt[i], (*v)[index]);
+        }
+    }
+    {
+        gmx::AtomsBuilder builder(atoms);
+        builder.mergeAtoms(*atoms_solvt);
+    }
+    fprintf(stderr, "Generated solvent containing %d atoms in %d residues\n",
+            atoms_solvt->nr, atoms_solvt->nres);
 
     sfree(x_solvt);
+    sfree(v_solvt);
+    sfree(exclusionDistances);
     sfree(exclusionDistances_solvt);
     done_atom(atoms_solvt);
     sfree(atoms_solvt);
-
-    fprintf(stderr, "Generated solvent containing %d atoms in %d residues\n",
-            *atoms_added, *residues_added);
 }
 
 static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
@@ -655,14 +872,6 @@ int gmx_solvate(int argc, char *argv[])
         "into the box. This can create a void that can cause problems later.",
         "Choose your volume wisely.[PAR]",
 
-        "The program can optionally rotate the solute molecule to align the",
-        "longest molecule axis along a box edge. This way the amount of solvent",
-        "molecules necessary is reduced.",
-        "It should be kept in mind that this only works for",
-        "short simulations, as e.g. an alpha-helical peptide in solution can ",
-        "rotate over 90 degrees, within 500 ps. In general it is therefore ",
-        "better to make a more or less cubic box.[PAR]",
-
         "Setting [TT]-shell[tt] larger than zero will place a layer of water of",
         "the specified thickness (nm) around the solute. Hint: it is a good",
         "idea to put the protein in the center of a box first (using [gmx-editconf]).",
@@ -680,7 +889,6 @@ int gmx_solvate(int argc, char *argv[])
     /* parameter data */
     gmx_bool       bProt, bBox;
     const char    *conf_prot, *confout;
-    real          *exclusionDistances = NULL;
     gmx_atomprop_t aps;
 
     /* protein configuration data */
@@ -690,9 +898,6 @@ int gmx_solvate(int argc, char *argv[])
     int      ePBC = -1;
     matrix   box;
 
-    /* other data types */
-    int      atoms_added, residues_added;
-
     t_filenm fnm[] = {
         { efSTX, "-cp", "protein", ffOPTRD },
         { efSTX, "-cs", "spc216",  ffLIBRD},
@@ -721,7 +926,7 @@ int gmx_solvate(int argc, char *argv[])
           "Keep velocities from input solute and solvent" },
     };
 
-    if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
+    if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
                            asize(desc), desc, asize(bugs), bugs, &oenv))
     {
         return 0;
@@ -747,9 +952,7 @@ int gmx_solvate(int argc, char *argv[])
         /* Generate a solute configuration */
         conf_prot = opt2fn("-cp", NFILE, fnm);
         title     = readConformation(conf_prot, atoms, &x,
-                                     bReadV ? &v : NULL, &ePBC, box);
-        exclusionDistances = makeExclusionDistances(atoms, aps, defaultDistance, scaleFactor);
-
+                                     bReadV ? &v : NULL, &ePBC, box, "solute");
         if (bReadV && !v)
         {
             fprintf(stderr, "Note: no velocities found\n");
@@ -774,9 +977,8 @@ int gmx_solvate(int argc, char *argv[])
                   "or give explicit -box command line option");
     }
 
-    add_solv(solventFileName, atoms, &x, v ? &v : NULL, &exclusionDistances, ePBC, box,
-             aps, defaultDistance, scaleFactor, &atoms_added, &residues_added, r_shell, max_sol,
-             oenv);
+    add_solv(solventFileName, atoms, &x, v ? &v : NULL, ePBC, box,
+             aps, defaultDistance, scaleFactor, r_shell, max_sol);
 
     /* write new configuration 1 to file confout */
     confout = ftp2fn(efSTO, NFILE, fnm);
@@ -784,8 +986,6 @@ int gmx_solvate(int argc, char *argv[])
     if (bProt)
     {
         write_sto_conf(confout, title, atoms, x, v, ePBC, box);
-        /* print box sizes and box type to stderr */
-        fprintf(stderr, "%s\n", title);
     }
     else
     {
@@ -798,11 +998,13 @@ int gmx_solvate(int argc, char *argv[])
     update_top(atoms, box, NFILE, fnm, aps);
 
     gmx_atomprop_destroy(aps);
-    sfree(exclusionDistances);
     sfree(x);
     sfree(v);
     done_atom(atoms);
     sfree(atoms);
+    sfree(title);
+    output_env_done(oenv);
+    done_filenms(NFILE, fnm);
 
     return 0;
 }
index 63834a92585c7fac628a66f597d1c901aecb487d..73c8b5472d8f7be3eb320460be9a0e554c8d7e96 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
+#include "sortwater.h"
+
+#include <stdlib.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "sortwater.h"
 
 static rvec   *xptr, box_1;
 static int     nwat;
index 670e199334c9d14fae5a5fdd681a1dc243d551c4..fc9e704712cadbd20af5733a776972c7cf48e1a2 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef _sortwater_h
 #define _sortwater_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/random/random.h"
 
 #ifdef __cplusplus
index e14d21a9dc8c3714cbd951022c5633eab3ebb2c1..2d1bfcf261425105a6b0effc306a7b22c4201cbf 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "specbond.h"
 
 #include <ctype.h>
 #include <math.h>
 #include <string.h>
 
-#include "typedefs.h"
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/fileio/strdb.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "specbond.h"
-#include "pdb2top.h"
-#include "vec.h"
-#include "macros.h"
 
 gmx_bool yesno(void)
 {
@@ -92,12 +91,12 @@ t_specbond *get_specbonds(int *nspecbond)
         }
         else
         {
-            sb[n].res1    = strdup(r1buf);
-            sb[n].res2    = strdup(r2buf);
-            sb[n].newres1 = strdup(nr1buf);
-            sb[n].newres2 = strdup(nr2buf);
-            sb[n].atom1   = strdup(a1buf);
-            sb[n].atom2   = strdup(a2buf);
+            sb[n].res1    = gmx_strdup(r1buf);
+            sb[n].res2    = gmx_strdup(r2buf);
+            sb[n].newres1 = gmx_strdup(nr1buf);
+            sb[n].newres2 = gmx_strdup(nr2buf);
+            sb[n].atom1   = gmx_strdup(a1buf);
+            sb[n].atom2   = gmx_strdup(a2buf);
             sb[n].nbond1  = nb1;
             sb[n].nbond2  = nb2;
             sb[n].length  = length;
@@ -219,7 +218,7 @@ static void rename_1res(t_atoms *pdba, int resind, char *newres, gmx_bool bVerbo
     }
     /* this used to free *resname, which messes up the symtab! */
     snew(pdba->resinfo[resind].rtp, 1);
-    *pdba->resinfo[resind].rtp = strdup(newres);
+    *pdba->resinfo[resind].rtp = gmx_strdup(newres);
 }
 
 int mk_specbonds(t_atoms *pdba, rvec x[], gmx_bool bInteractive,
@@ -348,8 +347,8 @@ int mk_specbonds(t_atoms *pdba, rvec x[], gmx_bool bInteractive,
                         /* Store the residue numbers in the bonds array */
                         bonds[nbonds].res1 = specp[i];
                         bonds[nbonds].res2 = specp[j];
-                        bonds[nbonds].a1   = strdup(*pdba->atomname[ai]);
-                        bonds[nbonds].a2   = strdup(*pdba->atomname[aj]);
+                        bonds[nbonds].a1   = gmx_strdup(*pdba->atomname[ai]);
+                        bonds[nbonds].a2   = gmx_strdup(*pdba->atomname[aj]);
                         /* rename residues */
                         if (bSwap)
                         {
index cd37ca9af32ddef5aab2746c1c08688bebb1c926..4c8eedc307b62365d1fbb221b286426aad2afa02 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_SPECBOND_H
 #define GMX_GMXPREPROCESS_SPECBOND_H
 
-#include "pdb2top.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
 
 #ifdef __cplusplus
 extern "C" {
index 09758f8e3b497a586881d1245098e1b254b2c10c..df0722c368326e6cb534e58b01efc89cfc981dfb 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "ter_db.h"
 
 #include <ctype.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "symtab.h"
-#include "gromacs/fileio/futil.h"
-#include "resall.h"
-#include "h_db.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
-#include "ter_db.h"
-#include "toputil.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "fflibutil.h"
-
 #include "gromacs/fileio/strdb.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /* use bonded types definitions in hackblock.h */
 #define ekwRepl ebtsNR+1
@@ -122,7 +118,7 @@ static void read_atom(char *line, gmx_bool bAdd,
     {
         if (nr == 4)
         {
-            *nname = strdup(buf[i++]);
+            *nname = gmx_strdup(buf[i++]);
         }
         else
         {
@@ -292,8 +288,8 @@ static void read_ter_db_file(char *fn,
                     srenew(tb, maxnb);
                 }
                 clear_t_hackblock(&tb[nb]);
-                tb[nb].name     = strdup(header);
-                tb[nb].filebase = strdup(filebase);
+                tb[nb].name     = gmx_strdup(header);
+                tb[nb].filebase = gmx_strdup(filebase);
             }
         }
         else
@@ -331,7 +327,7 @@ static void read_ter_db_file(char *fn,
                         gmx_fatal(FARGS, "Reading Termini Database '%s': "
                                   "expected atom name on line\n%s", fn, line);
                     }
-                    tb[nb].hack[nh].oname = strdup(buf);
+                    tb[nb].hack[nh].oname = gmx_strdup(buf);
                     /* we only replace or delete one atom at a time */
                     tb[nb].hack[nh].nr = 1;
                 }
@@ -355,7 +351,7 @@ static void read_ter_db_file(char *fn,
                     {
                         if (tb[nb].hack[nh].oname != NULL)
                         {
-                            tb[nb].hack[nh].nname = strdup(tb[nb].hack[nh].oname);
+                            tb[nb].hack[nh].nname = gmx_strdup(tb[nb].hack[nh].oname);
                         }
                         else
                         {
@@ -373,7 +369,7 @@ static void read_ter_db_file(char *fn,
                 {
                     if (sscanf(line+n, "%s%n", buf, &ni) == 1)
                     {
-                        tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].a[j] = strdup(buf);
+                        tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].a[j] = gmx_strdup(buf);
                     }
                     else
                     {
@@ -387,7 +383,7 @@ static void read_ter_db_file(char *fn,
                 }
                 strcpy(buf, "");
                 sscanf(line+n, "%s", buf);
-                tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].s = strdup(buf);
+                tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].s = gmx_strdup(buf);
                 tb[nb].rb[kwnr].nb++;
             }
             else
index 3f859699af918bef8020991e2462dc603e4b017b..45477d620705a65421430521529d7b2258db012d 100644 (file)
@@ -38,9 +38,8 @@
 #ifndef GMX_GMXPREPROCESS_TER_DB_H
 #define GMX_GMXPREPROCESS_TER_DB_H
 
-#include "sysstuff.h"
-#include "hackblock.h"
-#include "grompp-impl.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
 
 #ifdef __cplusplus
 extern "C" {
index 1e305476112dd49f78478a2a7e87e109118fcbd3..11f5aae91fa42c3879f7e77a747378598f4671d9 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(testname "PreprocessingTests")
-set(exename "preprocessing-tools-test")
-
-gmx_build_unit_test(
-    ${testname}
-    ${exename}
-    # files with code for test fixtures
-    solvate.cpp
-    insert-molecules.cpp
-    )
-gmx_register_integration_test(
-    ${testname}
-    ${exename}
-    )
+gmx_add_unit_test(GmxPreprocessTests gmxpreprocess-test
+                  solvate.cpp
+                  insert-molecules.cpp
+                  )
index 2f535f8241f5d13f48b0532943c164f79fb7965a..763653bf48a747f89e216b097f510d87bb45226e 100644 (file)
  * Tests for insertion of molecules.
  *
  * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
  */
+#include "gmxpre.h"
+
+#include "gromacs/gmxpreprocess/insert-molecules.h"
 
-#include "../insert-molecules.h"
-#include "testutils/integrationtests.h"
 #include "testutils/cmdlinetest.h"
-#include "gromacs/fileio/futil.h"
+#include "testutils/refdata.h"
 
 namespace
 {
 
-//! Helper typedef
-typedef int (*CMainFunction)(int argc, char *argv[]);
+using gmx::test::CommandLine;
 
-//! Test fixture for insert-molecules
-class InsertMoleculesTest : public gmx::test::IntegrationTestFixture
+class InsertMoleculesTest : public gmx::test::CommandLineTestBase
 {
     public:
-        //! Constructor
         InsertMoleculesTest()
-            : ciFileName(fileManager_.getInputFilePath("x.gro")),
-              outputFileName(fileManager_.getTemporaryFilePath("out.gro")),
-              theFunction(gmx_insert_molecules)
         {
-            caller.append("insert-molecules");
-            caller.addOption("-o", outputFileName);
+            setOutputFile("-o", "out.gro");
         }
 
-    public:
-        //! Name of file to use for -ci
-        std::string            ciFileName;
-        //! Name of output file to use for -o
-        std::string            outputFileName;
-        //! Helper object for managing the call to gmx_insert_molecules
-        gmx::test::CommandLine caller;
-        //! Points to the function to be tested
-        CMainFunction          theFunction;
+        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::test::CommandLineTestHelper::runModule(
+                              &gmx::InsertMoleculesInfo::create, &cmdline));
+
+            checkOutputFiles();
+        }
 };
 
-TEST_F(InsertMoleculesTest, f_ci_Works)
+TEST_F(InsertMoleculesTest, InsertsMoleculesIntoExistingConfiguration)
 {
-    caller.addOption("-f", fileManager_.getInputFilePath("spc-and-methanol.gro"));
-    caller.addOption("-nmol", "1");
-    caller.addOption("-ci", ciFileName);
-
-    ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+    const char *const cmdline[] = {
+        "insert-molecules", "-nmol", "1"
+    };
+    setInputFile("-f", "spc-and-methanol.gro");
+    setInputFile("-ci", "x2.gro");
+    runTest(CommandLine(cmdline));
 }
 
-TEST_F(InsertMoleculesTest, box_ci_Works)
+TEST_F(InsertMoleculesTest, InsertsMoleculesIntoEmptyBox)
 {
-    caller.addOption("-box", "4");
-    caller.addOption("-nmol", "5");
-    caller.addOption("-ci", ciFileName);
-
-    ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+    const char *const cmdline[] = {
+        "insert-molecules", "-box", "4", "-nmol", "5"
+    };
+    setInputFile("-ci", "x2.gro");
+    runTest(CommandLine(cmdline));
 }
 
-TEST_F(InsertMoleculesTest, f_box_ci_Works)
+TEST_F(InsertMoleculesTest, InsertsMoleculesIntoEnlargedBox)
 {
-    caller.addOption("-f", fileManager_.getInputFilePath("spc-and-methanol.gro"));
-    caller.addOption("-box", "4");
-    caller.addOption("-nmol", "2");
-    caller.addOption("-ci", ciFileName);
-
-    ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+    const char *const cmdline[] = {
+        "insert-molecules", "-box", "4", "-nmol", "2"
+    };
+    setInputFile("-f", "spc-and-methanol.gro");
+    setInputFile("-ci", "x.gro");
+    runTest(CommandLine(cmdline));
 }
 
-// TODO Someone who knows what -ip is good for should write something
-// to test it
+TEST_F(InsertMoleculesTest, InsertsMoleculesIntoFixedPositions)
+{
+    const char *const cmdline[] = {
+        "insert-molecules", "-box", "4"
+    };
+    const char *const positions[] = {
+        "0.0  0.0  0.0",
+        "1.0  2.0  3.0",
+        "0.99 2.01 3.0",
+        "2.0  1.0  2.0"
+    };
+    setInputFile("-ci", "x0.gro");
+    setInputFileContents("-ip", "dat", positions);
+    runTest(CommandLine(cmdline));
+}
 
 } // namespace
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoEmptyBox.xml b/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoEmptyBox.xml
new file mode 100644 (file)
index 0000000..34456e4
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">insert-molecules -box 4 -nmol 5</String>
+  <OutputFiles Name="Files">
+    <String Name="-o"><![CDATA[
+test two-residue molecule for insertion
+   10
+    1X       X1    1   3.071   2.691   0.351
+    2Y       Y1    2   3.098   2.610   0.247
+    3X       X1    3   3.891   3.308   3.910
+    4Y       Y1    4   3.910   3.371   4.028
+    5X       X1    5   2.401   2.975   2.308
+    6Y       Y1    6   2.489   3.059   2.248
+    7X       X1    7   3.193   2.571   3.486
+    8Y       Y1    8   3.102   2.666   3.516
+    9X       X1    9   3.937   1.138   0.823
+   10Y       Y1   10   3.845   1.125   0.921
+   4.00000   4.00000   4.00000
+]]></String>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoEnlargedBox.xml b/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoEnlargedBox.xml
new file mode 100644 (file)
index 0000000..ee38908
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">insert-molecules -box 4 -nmol 2</String>
+  <OutputFiles Name="Files">
+    <String Name="-o"><![CDATA[
+Test system for solvate/insert-molecules
+   10
+    1MeOH   Me1    1   1.970   1.460   1.209
+    1MeOH    O2    2   1.978   1.415   1.082
+    1MeOH    H3    3   1.905   1.460   1.030
+    2SOL     OW    4   1.555   1.511   0.703
+    2SOL    HW1    5   1.498   1.495   0.784
+    2SOL    HW2    6   1.496   1.521   0.623
+    3X       X1    7   3.071   2.691   0.351
+    3X       X2    8   3.098   2.610   0.247
+    4X       X1    9   3.891   3.308   3.910
+    4X       X2   10   3.910   3.371   4.028
+   4.00000   4.00000   4.00000
+]]></String>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoExistingConfiguration.xml b/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoExistingConfiguration.xml
new file mode 100644 (file)
index 0000000..66153dc
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">insert-molecules -nmol 1</String>
+  <OutputFiles Name="Files">
+    <String Name="-o"><![CDATA[
+Test system for solvate/insert-molecules
+    8
+    1MeOH   Me1    1   1.970   1.460   1.209
+    1MeOH    O2    2   1.978   1.415   1.082
+    1MeOH    H3    3   1.905   1.460   1.030
+    2SOL     OW    4   1.555   1.511   0.703
+    2SOL    HW1    5   1.498   1.495   0.784
+    2SOL    HW2    6   1.496   1.521   0.623
+    3X       X1    7   2.308   2.035   0.277
+    4Y       Y1    8   2.335   1.954   0.173
+   3.01000   3.01000   3.01000
+]]></String>
+  </OutputFiles>
+</ReferenceData>
diff --git a/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoFixedPositions.xml b/src/gromacs/gmxpreprocess/tests/refdata/InsertMoleculesTest_InsertsMoleculesIntoFixedPositions.xml
new file mode 100644 (file)
index 0000000..c6d34ac
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">insert-molecules -box 4</String>
+  <OutputFiles Name="Files">
+    <String Name="-o"><![CDATA[
+test molecule for insertion at origin
+    6
+    1X       X1    1   0.000   0.000   0.000
+    1X       X2    2   0.027  -0.081  -0.104
+    2X       X1    3   1.000   2.000   3.000
+    2X       X2    4   1.019   2.063   3.118
+    3X       X1    5   2.000   1.000   2.000
+    3X       X2    6   1.893   1.048   1.933
+   4.00000   4.00000   4.00000
+]]></String>
+  </OutputFiles>
+</ReferenceData>
index 71202b62ec4091fa85de66a5514c705b65d8ef61..8edf755e621e98dfe7111dd72cd511f638d8c3d9 100644 (file)
  * Tests for solvation.
  *
  * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
  */
 
-#include "../solvate.h"
-#include "testutils/integrationtests.h"
+#include "gmxpre.h"
+
+#include "gromacs/gmxpreprocess/solvate.h"
+
+#include "gromacs/utility/futil.h"
+
 #include "testutils/cmdlinetest.h"
-#include "gromacs/fileio/futil.h"
+#include "testutils/testfilemanager.h"
 
 namespace
 {
 
-//! Helper typedef
-typedef int (*CMainFunction)(int argc, char *argv[]);
+using gmx::test::CommandLine;
 
-//! Test fixture for gmx solvate
-class SolvateTest : public gmx::test::IntegrationTestFixture
+class SolvateTest : public gmx::test::CommandLineTestBase
 {
     public:
-        //! Constructor
         SolvateTest()
-            : cpFileName(fileManager_.getInputFilePath("spc-and-methanol.gro")),
-              topFileName(fileManager_.getInputFilePath("spc-and-methanol.top")),
-              outputFileName(fileManager_.getTemporaryFilePath("out.gro")),
-              theFunction(gmx_solvate)
         {
-            caller.append("solvate");
-            caller.addOption("-o", outputFileName);
+            setOutputFile("-o", "out.gro");
         }
 
-    public:
-        //! Name of file to use for -cp
-        std::string            cpFileName;
-        //! Name of input file to use for -p (if used)
-        std::string            topFileName;
-        //! Name of output file to use for -o
-        std::string            outputFileName;
-        //! Helper object for managing the call to gmx_solvate
-        gmx::test::CommandLine caller;
-        //! Points to the function to be tested
-        CMainFunction          theFunction;
+        void runTest(const CommandLine &args)
+        {
+            CommandLine &cmdline = commandLine();
+            cmdline.merge(args);
+
+            ASSERT_EQ(0, gmx_solvate(cmdline.argc(), cmdline.argv()));
+        }
 };
 
 TEST_F(SolvateTest, cs_box_Works)
 {
-    caller.append("-cs"); // use default solvent box
-    caller.addOption("-box", "1.1");
-
-    ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+    // use default solvent box (-cs without argument)
+    const char *const cmdline[] = {
+        "solvate", "-cs", "-box", "1.1"
+    };
+    runTest(CommandLine(cmdline));
 }
 
 TEST_F(SolvateTest, cs_cp_Works)
 {
-    caller.append("-cs"); // use default solvent box
-    caller.addOption("-cp", cpFileName);
-
-    ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+    // use default solvent box (-cs without argument)
+    const char *const cmdline[] = {
+        "solvate", "-cs"
+    };
+    setInputFile("-cp", "spc-and-methanol.gro");
+    runTest(CommandLine(cmdline));
 }
 
 TEST_F(SolvateTest, cs_cp_p_Works)
 {
-    caller.append("-cs"); // use default solvent box
-    caller.addOption("-cp", cpFileName);
+    // use default solvent box (-cs without argument)
+    const char *const cmdline[] = {
+        "solvate", "-cs"
+    };
+    setInputFile("-cp", "spc-and-methanol.gro");
 
-    std::string modifiableTopFileName = fileManager_.getTemporaryFilePath(".top");
+    // TODO: Consider adding a convenience method for this.
+    std::string topFileName           = fileManager().getInputFilePath("spc-and-methanol.top");
+    std::string modifiableTopFileName = fileManager().getTemporaryFilePath(".top");
     gmx_file_copy(topFileName.c_str(), modifiableTopFileName.c_str(), true);
-    caller.addOption("-p", modifiableTopFileName);
+    commandLine().addOption("-p", modifiableTopFileName);
 
-    ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+    runTest(CommandLine(cmdline));
 }
 
 } // namespace
index 4e937af3f8c456a6cc6823b280b04d8836fb1cd0..cef89116019e9458ba3c0b7c63281b96ce23638e 100644 (file)
@@ -1,4 +1,4 @@
-
+Test system for solvate/insert-molecules
  6
     1MeOH   Me1    1   1.970   1.460   1.209 -0.8587 -0.1344 -0.0643
     1MeOH    O2    2   1.978   1.415   1.082  0.0623 -0.1787  0.0036
diff --git a/src/gromacs/gmxpreprocess/tests/x0.gro b/src/gromacs/gmxpreprocess/tests/x0.gro
new file mode 100644 (file)
index 0000000..1207dc7
--- /dev/null
@@ -0,0 +1,5 @@
+test molecule for insertion at origin
+ 2
+    1X       X1    1   0.000   0.000   0.000
+    1X       X2    2   0.008  -0.045  -0.127
+   3.01000   3.01000   3.01000
diff --git a/src/gromacs/gmxpreprocess/tests/x2.gro b/src/gromacs/gmxpreprocess/tests/x2.gro
new file mode 100644 (file)
index 0000000..c6f61ea
--- /dev/null
@@ -0,0 +1,5 @@
+test two-residue molecule for insertion
+ 2
+    1X       X1    1   1.970   1.460   1.209 -0.8587 -0.1344 -0.0643
+    2Y       Y1    2   1.978   1.415   1.082  0.0623 -0.1787  0.0036
+   3.01000   3.01000   3.01000
index 5bcf84f73756f10bca574acdd659e9ed26a719bb..cd9b793b5fb3b2bc75cd9c8b049cc73668da52cd 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "tomorse.h"
 
 #include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "typedefs.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/cstringutil.h"
-#include "grompp-impl.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "toputil.h"
-#include "gmx_fatal.h"
-#include "gpp_atomtype.h"
-#include "macros.h"
-
-#include "tomorse.h"
 
 typedef struct {
     char *ai, *aj;
@@ -87,8 +84,8 @@ static t_2morse *read_dissociation_energies(int *n2morse)
                 srenew(t2m, maxn2m);
             }
             /* Copy the values */
-            t2m[n2m].ai     = strdup(ai);
-            t2m[n2m].aj     = strdup(aj);
+            t2m[n2m].ai     = gmx_strdup(ai);
+            t2m[n2m].aj     = gmx_strdup(aj);
             t2m[n2m].e_diss = e_diss;
             /* Increment counter */
             n2m++;
index b96e8a02f5e1250d2c48f595860221f7257f8eb5..6a39ea6fd84200e000bbe34358be5c9bd477dcd8 100644 (file)
 #ifndef GMX_GMXPREPROCESS_TOMORSE_H
 #define GMX_GMXPREPROCESS_TOMORSE_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 212bf1ea6fbeed464803ac01731ee1b945bcf31e..1c42dfab2d4513603f229a3a1baa4f2b4d2b3c51 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "topdirs.h"
 
-#include <stdio.h>
 #include <stdarg.h>
+#include <stdio.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
-#include "topdirs.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* Must correspond to the directive enum in grompp-impl.h */
 static const char *directive_names[d_maxdir+1] = {
index f619c8a4ea40f25057425ae0c654d29170951f5f..fa62531eeb70025e794080eab2691cc009a00f9a 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_TOPDIRS_H
 #define GMX_GMXPREPROCESS_TOPDIRS_H
 
-#include "grompp-impl.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 
 #ifdef __cplusplus
 extern "C" {
index 00addd94532138dce23061c1826a464a478e8eca..e09518e8b270c2fc12fb6c2f1d9a3aa7bfb138b6 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "topio.h"
+
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
 #include <math.h>
-#include <sys/types.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <assert.h>
 
-#include "gromacs/fileio/futil.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
+#include <sys/types.h>
+
 #include "gromacs/fileio/gmxfio.h"
-#include "txtdump.h"
-#include "physics.h"
-#include "macros.h"
-#include "names.h"
-#include "gromacs/utility/cstringutil.h"
-#include "symtab.h"
-#include "gmx_fatal.h"
-#include "warninp.h"
-#include "vsite_parm.h"
-
-#include "grompp-impl.h"
-#include "toputil.h"
-#include "toppush.h"
-#include "topdirs.h"
-#include "gpp_nextnb.h"
-#include "topio.h"
-#include "topshake.h"
-#include "gmxcpp.h"
-#include "gpp_bond_atomtype.h"
-#include "genborn.h"
+#include "gromacs/gmxpreprocess/gmxcpp.h"
+#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/topdirs.h"
+#include "gromacs/gmxpreprocess/toppush.h"
+#include "gromacs/gmxpreprocess/topshake.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/gmxpreprocess/vsite_parm.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/warninp.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define OPENDIR     '[' /* starting sign for directive */
 #define CLOSEDIR    ']' /* ending sign for directive   */
@@ -336,7 +336,7 @@ static char ** cpp_opts(const char *define, const char *include,
                     else
                     {
                         srenew(cppopts, ++ncppopts);
-                        cppopts[ncppopts-1] = strdup(buf);
+                        cppopts[ncppopts-1] = gmx_strdup(buf);
                     }
                     sfree(buf);
                     ptr = rptr;
@@ -639,7 +639,7 @@ static char **read_topol(const char *infile, const char *outfile,
 
             set_warning_line(wi, cpp_cur_file(&handle), cpp_cur_linenr(&handle));
 
-            pline = strdup(line);
+            pline = gmx_strdup(line);
 
             /* Strip trailing '\' from pline, if it exists */
             sl = strlen(pline);
@@ -657,7 +657,7 @@ static char **read_topol(const char *infile, const char *outfile,
                 /* Since we depend on the '\' being present to continue to read, we copy line
                  * to a tmp string, strip the '\' from that string, and cat it to pline
                  */
-                tmp_line = strdup(line);
+                tmp_line = gmx_strdup(line);
 
                 sl = strlen(tmp_line);
                 if ((sl > 0) && (tmp_line[sl-1] == CONTINUE))
@@ -696,7 +696,7 @@ static char **read_topol(const char *infile, const char *outfile,
                      * without the brackets into dirstr, then
                      * skip spaces and tabs on either side of directive
                      */
-                    dirstr = strdup((pline+1));
+                    dirstr = gmx_strdup((pline+1));
                     if ((dummy2 = strchr (dirstr, CLOSEDIR)) != NULL)
                     {
                         (*dummy2) = 0;
@@ -995,7 +995,7 @@ static char **read_topol(const char *infile, const char *outfile,
                             break;
                         }
                         default:
-                            fprintf (stderr, "case: %d\n", d);
+                            fprintf (stderr, "case: %d\n", (int)d);
                             gmx_incons("unknown directive");
                     }
                 }
@@ -1360,7 +1360,6 @@ static void generate_qmexcl_moltype(gmx_moltype_t *molt, unsigned char *grpnr,
         j       = 0;
         while (j < molt->ilist[i].nr)
         {
-            bexcl = FALSE;
             a1    = molt->ilist[i].iatoms[j+1];
             a2    = molt->ilist[i].iatoms[j+2];
             bexcl = ((bQMMM[a1] && bQMMM[a2]) ||
index 03b8966bcfad8390a475c700c911fc24516d0191..e03b102aa4dc3da6c8db475d1f2b1a66f4a9c5c9 100644 (file)
 #ifndef GMX_GMXPREPROCESS_TOPIO_H
 #define GMX_GMXPREPROCESS_TOPIO_H
 
-#include "typedefs.h"
-#include "readir.h"
-#include "grompp-impl.h"
-#include "gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -55,7 +55,7 @@ char **do_top(gmx_bool         bVerbose,
               const char      *topppfile,
               t_gromppopts    *opts,
               gmx_bool         bZero,
-              t_symtab        *symtab,
+              struct t_symtab *symtab,
               t_params         plist[],
               int             *combination_rule,
               double          *repulsion_power,
index fab21dda5189c7318f28a6361e689b98f3503fae..832a2a12037fdd70864944b4f56605199393e290 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "toppush.h"
+
+#include <assert.h>
 #include <ctype.h>
 #include <math.h>
-#include <assert.h>
-
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
+#include <stdlib.h>
+
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/gmxpreprocess/topdirs.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/warninp.h"
+#include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
-#include "names.h"
-#include "toputil.h"
-#include "toppush.h"
-#include "topdirs.h"
-#include "readir.h"
-#include "symtab.h"
-#include "gmx_fatal.h"
-#include "warninp.h"
-#include "gpp_atomtype.h"
-#include "gpp_bond_atomtype.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype_t atype,
                        warninp_t wi)
@@ -486,6 +485,7 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
         gmx_fatal(FARGS, "Invalid particle type %s on line %s",
                   ptype, line);
     }
+    /* cppcheck-suppress arrayIndexOutOfBounds #6329 */
     pt = xl[j].ptype;
     if (debug)
     {
index d28a4c5f2575c9919dd3ab37002a1ce0d60e94e2..1e14c57bc72a8db85f7648838bb51aa85790be03 100644 (file)
 #ifndef GMX_GMXPREPROCESS_TOPPUSH_H
 #define GMX_GMXPREPROCESS_TOPPUSH_H
 
-#include "typedefs.h"
-#include "toputil.h"
-#include "gpp_atomtype.h"
-#include "gpp_bond_atomtype.h"
-#include "warninp.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/warninp.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -60,7 +60,7 @@ void generate_nbparams(int comb, int funct, t_params plist[],
                        gpp_atomtype_t atype,
                        warninp_t wi);
 
-void push_at (t_symtab *symtab, gpp_atomtype_t at,
+void push_at (struct t_symtab *symtab, gpp_atomtype_t at,
               t_bond_atomtype bat, char *line, int nb_funct,
               t_nbparam ***nbparam, t_nbparam ***pair,
               warninp_t wi);
@@ -86,13 +86,13 @@ push_gb_params(gpp_atomtype_t atype,
                char          *line,
                warninp_t      wi);
 
-void push_atom(t_symtab      *symtab,
-               t_block       *cgs,
-               t_atoms       *at,
-               gpp_atomtype_t atype,
-               char          *line,
-               int           *lastcg,
-               warninp_t      wi);
+void push_atom(struct t_symtab *symtab,
+               t_block         *cgs,
+               t_atoms         *at,
+               gpp_atomtype_t   atype,
+               char            *line,
+               int             *lastcg,
+               warninp_t        wi);
 
 void push_bond(directive d, t_params bondtype[], t_params bond[],
                t_atoms *at, gpp_atomtype_t atype, char *line,
@@ -112,7 +112,7 @@ void push_mol(int nrmols, t_molinfo mols[], char *pline,
               int *whichmol, int *nrcopies,
               warninp_t wi);
 
-void push_molt(t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
+void push_molt(struct t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
                warninp_t wi);
 
 void init_block2(t_block2 *b2, int natom);
@@ -127,7 +127,7 @@ void b_to_b2(t_blocka *b, t_block2 *b2);
 
 void b2_to_b(t_block2 *b2, t_blocka *b);
 
-int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype_t at,
+int add_atomtype_decoupled(struct t_symtab *symtab, gpp_atomtype_t at,
                            t_nbparam ***nbparam, t_nbparam ***pair);
 /* Add an atom type with all parameters set to zero (no interactions).
  * Returns the atom type number.
index fa00694a6e534e1e702638c33f48149e94a06d4a..bd2662df2ad09d93914160f2a698f7c199a1dec8 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "topshake.h"
 
 #include <ctype.h>
 #include <math.h>
 
-#include "sysstuff.h"
-#include "physics.h"
-#include "macros.h"
-#include "readir.h"
-#include "typedefs.h"
-#include "topshake.h"
-#include "toppush.h"
-#include "toputil.h"
-#include "topdirs.h"
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/gmxpreprocess/topdirs.h"
+#include "gromacs/gmxpreprocess/toppush.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 
 static void copy_bond (t_params *pr, int to, int from)
 /* copies an entry in a bond list to another position.
index 2844b9f4dde13108dd19725ee4d94cda84c69f55..15e09da6623937ebfd8ad444961a9ac9ab27c17f 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef GMX_GMXPREPROCESS_TOPSHAKE_H
 #define GMX_GMXPREPROCESS_TOPSHAKE_H
 
-#include "topio.h"
+#include "gromacs/gmxpreprocess/topio.h"
 
 #ifdef __cplusplus
 extern "C" {
index 3cf53cd7d9acba8fe4b519002e3ff7f4f6f53055..ff567c8ea23070a10f1a68c98e1615f43ea6bab5 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "toputil.h"
 
 #include <assert.h>
 #include <math.h>
 #include <string.h>
 
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/topdirs.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "macros.h"
-#include "topdirs.h"
-#include "toputil.h"
-#include "symtab.h"
-#include "gmx_fatal.h"
-#include "gpp_atomtype.h"
 
 /* UTILITIES */
 
index fd4259440bdc27a5cd203aaeafa1c9d3b20e506c..d7d040effe46e3035391c61b73f57dfa608f48ed 100644 (file)
@@ -38,8 +38,8 @@
 #ifndef GMX_GMXPREPROCESS_TOPUTIL_H
 #define GMX_GMXPREPROCESS_TOPUTIL_H
 
-#include "grompp-impl.h"
-#include "gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
 
 #ifdef __cplusplus
 extern "C" {
index 87b7763c3860c828f864bc6e33f69292fa5c4e26..5a1088711a9db6a80d32897c242eebf8ffdcbf9a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "vsite_parm.h"
 
-#include <stdio.h>
-#include <math.h>
 #include <assert.h>
+#include <math.h>
+#include <stdio.h>
 #include <string.h>
-#include "vsite_parm.h"
-#include "gromacs/utility/smalloc.h"
-#include "resall.h"
-#include "add_par.h"
-#include "vec.h"
-#include "toputil.h"
-#include "physics.h"
-#include "index.h"
-#include "names.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/gmxpreprocess/add_par.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/cstringutil.h"
-#include "physics.h"
-#include "macros.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     t_iatom a[4];
@@ -291,7 +289,7 @@ static void print_bad(FILE *fp,
         fprintf(fp, "bonds:");
         for (i = 0; i < nrbond; i++)
         {
-            fprintf(fp, " %u-%u (%g)",
+            fprintf(fp, " %d-%d (%g)",
                     bonds[i].AI+1, bonds[i].AJ+1, bonds[i].c);
         }
         fprintf(fp, "\n");
@@ -301,7 +299,7 @@ static void print_bad(FILE *fp,
         fprintf(fp, "angles:");
         for (i = 0; i < nrang; i++)
         {
-            fprintf(fp, " %u-%u-%u (%g)",
+            fprintf(fp, " %d-%d-%d (%g)",
                     angles[i].AI+1, angles[i].AJ+1,
                     angles[i].AK+1, angles[i].c);
         }
@@ -312,7 +310,7 @@ static void print_bad(FILE *fp,
         fprintf(fp, "idihs:");
         for (i = 0; i < nridih; i++)
         {
-            fprintf(fp, " %u-%u-%u-%u (%g)",
+            fprintf(fp, " %d-%d-%d-%d (%g)",
                     idihs[i].AI+1, idihs[i].AJ+1,
                     idihs[i].AK+1, idihs[i].AL+1, idihs[i].c);
         }
@@ -424,7 +422,7 @@ static gmx_bool calc_vsite3_param(gpp_atomtype_t atype,
         int i;
         for (i = 0; i < 4; i++)
         {
-            fprintf(debug, "atom %u type %s ",
+            fprintf(debug, "atom %d type %s ",
                     param->a[i]+1,
                     get_atomtype_name_AB(&at->atom[param->a[i]], atype));
         }
@@ -495,7 +493,7 @@ static gmx_bool calc_vsite3_param(gpp_atomtype_t atype,
 
     if (debug)
     {
-        fprintf(debug, "params for vsite3 %u: %g %g\n",
+        fprintf(debug, "params for vsite3 %d: %g %g\n",
                 param->AI+1, param->C0, param->C1);
     }
 
@@ -529,7 +527,7 @@ static gmx_bool calc_vsite3fd_param(t_param *param,
 
     if (debug)
     {
-        fprintf(debug, "params for vsite3fd %u: %g %g\n",
+        fprintf(debug, "params for vsite3fd %d: %g %g\n",
                 param->AI+1, param->C0, param->C1);
     }
     return bError;
@@ -564,7 +562,7 @@ static gmx_bool calc_vsite3fad_param(t_param *param,
 
     if (debug)
     {
-        fprintf(debug, "params for vsite3fad %u: %g %g\n",
+        fprintf(debug, "params for vsite3fad %d: %g %g\n",
                 param->AI+1, param->C0, param->C1);
     }
     return bError;
@@ -591,7 +589,7 @@ static gmx_bool calc_vsite3out_param(gpp_atomtype_t atype,
         int i;
         for (i = 0; i < 4; i++)
         {
-            fprintf(debug, "atom %u type %s ",
+            fprintf(debug, "atom %d type %s ",
                     param->a[i]+1, get_atomtype_name_AB(&at->atom[param->a[i]], atype));
         }
         fprintf(debug, "\n");
@@ -676,7 +674,7 @@ static gmx_bool calc_vsite3out_param(gpp_atomtype_t atype,
     }
     if (debug)
     {
-        fprintf(debug, "params for vsite3out %u: %g %g %g\n",
+        fprintf(debug, "params for vsite3out %d: %g %g %g\n",
                 param->AI+1, param->C0, param->C1, param->C2);
     }
     return bError;
@@ -734,7 +732,7 @@ static gmx_bool calc_vsite4fd_param(t_param *param,
         param->C2 = -bij;
         if (debug)
         {
-            fprintf(debug, "params for vsite4fd %u: %g %g %g\n",
+            fprintf(debug, "params for vsite4fd %d: %g %g %g\n",
                     param->AI+1, param->C0, param->C1, param->C2);
         }
     }
@@ -797,7 +795,7 @@ calc_vsite4fdn_param(t_param *param,
 
         if (debug)
         {
-            fprintf(debug, "params for vsite4fdn %u: %g %g %g\n",
+            fprintf(debug, "params for vsite4fdn %d: %g %g %g\n",
                     param->AI+1, param->C0, param->C1, param->C2);
         }
     }
@@ -868,7 +866,7 @@ int set_vsites(gmx_bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
                     if (debug)
                     {
                         fprintf(debug, "Found %d bonds, %d angles and %d idihs "
-                                "for virtual site %u (%s)\n", nrbond, nrang, nridih,
+                                "for virtual site %d (%s)\n", nrbond, nrang, nridih,
                                 plist[ftype].param[i].AI+1,
                                 interaction_function[ftype].longname);
                         print_bad(debug, nrbond, bonds, nrang, angles, nridih, idihs);
@@ -1000,7 +998,7 @@ static void check_vsite_constraints(t_params *plist,
             atom = ps->param[i].a[k];
             if (vsite_type[atom] != NOTSET)
             {
-                fprintf(stderr, "ERROR: Cannot have constraint (%u-%u) with virtual site (%u)\n",
+                fprintf(stderr, "ERROR: Cannot have constraint (%d-%d) with virtual site (%d)\n",
                         ps->param[i].AI+1, ps->param[i].AJ+1, atom+1);
                 n++;
             }
@@ -1042,7 +1040,7 @@ static void clean_vsite_bonds(t_params *plist, t_pindex pindex[],
         nvsite = 0;
         if (debug)
         {
-            fprintf(debug, "constr %u %u:", ps->param[i].AI+1, ps->param[i].AJ+1);
+            fprintf(debug, "constr %d %d:", ps->param[i].AI+1, ps->param[i].AJ+1);
         }
         for (k = 0; (k < 2) && !bKeep && !bRemove; k++)
         {
@@ -1439,10 +1437,10 @@ static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
                     }
                     if (debug)
                     {
-                        fprintf(debug, "dih w. vsite: %u %u %u %u\n",
+                        fprintf(debug, "dih w. vsite: %d %d %d %d\n",
                                 ps->param[i].AI+1, ps->param[i].AJ+1,
                                 ps->param[i].AK+1, ps->param[i].AL+1);
-                        fprintf(debug, "vsite %u from: %u %u %u\n",
+                        fprintf(debug, "vsite %d from: %d %d %d\n",
                                 atom+1, vsiteatoms[0]+1, vsiteatoms[1]+1, vsiteatoms[2]+1);
                     }
                 }
@@ -1501,7 +1499,7 @@ static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
                     bKeep = TRUE;
                     if (debug)
                     {
-                        fprintf(debug, "unused atom in dih: %u\n", atom+1);
+                        fprintf(debug, "unused atom in dih: %d\n", atom+1);
                     }
                 }
             }
index cbb3bea9600e6032fc74c28a1bc7eccdd44ccf56..3001e74bc0f217665a9b0dc1048df76c894e09d8 100644 (file)
@@ -38,9 +38,9 @@
 #ifndef GMX_GMXPREPROCESS_VSITE_PARM_H
 #define GMX_GMXPREPROCESS_VSITE_PARM_H
 
-#include "typedefs.h"
-#include "grompp-impl.h"
-#include "gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 5a0c27af1bdc6eb6d0497fca0af31fa134a230d3..b7b3f7235f4aba0dca9ebfbfbee9934190d3030b 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.
  */
-#include "x2top.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "x2top.h"
 
 #include <assert.h>
 
-#include "copyrite.h"
-#include "gromacs/math/utilities.h"
-#include "macros.h"
-#include "bondf.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/gmxpreprocess/gen_ad.h"
+#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/gmxpreprocess/nm2type.h"
+#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/gmxpreprocess/toppush.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/symtab.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "gromacs/fileio/confio.h"
-#include "physics.h"
-#include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "gromacs/math/3dview.h"
-#include "txtdump.h"
-#include "readinp.h"
-#include "names.h"
-#include "toppush.h"
-#include "pdb2top.h"
-#include "gen_ad.h"
-#include "gpp_nextnb.h"
-#include "vec.h"
-#include "atomprop.h"
-#include "hackblock.h"
-#include "nm2type.h"
-
-#include "gmx_fatal.h"
 
 char atp[7] = "HCNOSX";
 #define NATP (asize(atp)-1)
@@ -542,7 +537,7 @@ int gmx_x2top(int argc, char *argv[])
     bOPLS = (strcmp(forcefield, "oplsaa") == 0);
 
 
-    mymol.name = strdup(molnm);
+    mymol.name = gmx_strdup(molnm);
     mymol.nr   = 1;
 
     /* Init parameter lists */
@@ -635,10 +630,10 @@ int gmx_x2top(int argc, char *argv[])
         dump_hybridization(debug, atoms, nbonds);
     }
     close_symtab(&symtab);
-    free(mymol.name);
+    sfree(mymol.name);
 
     printf("\nWARNING: topologies generated by %s can not be trusted at face value.\n",
-           ShortProgram());
+           output_env_get_program_display_name(oenv));
     printf("         Please verify atomtypes and charges by comparison to other\n");
     printf("         topologies.\n");
 
index 4391a33b7a78e20f7cb30a605869956c6a58526c..c4d2c7cfe23760334ded99be85c64094a3328b61 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "xlate.h"
 
 #include <ctype.h>
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "symtab.h"
-#include "index.h"
-#include "gromacs/fileio/futil.h"
-#include "fflibutil.h"
-#include "hackblock.h"
-#include "gmx_fatal.h"
-#include "xlate.h"
 
 #include "gromacs/fileio/strdb.h"
+#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     char *filebase;
@@ -91,12 +90,12 @@ static void get_xlatoms(const char *fn, FILE *fp,
         }
 
         srenew(xl, n+1);
-        xl[n].filebase = strdup(filebase);
+        xl[n].filebase = gmx_strdup(filebase);
 
         /* Use wildcards... */
         if (strcmp(rbuf, "*") != 0)
         {
-            xl[n].res = strdup(rbuf);
+            xl[n].res = gmx_strdup(rbuf);
         }
         else
         {
@@ -109,8 +108,8 @@ static void get_xlatoms(const char *fn, FILE *fp,
             *_ptr = ' ';
         }
 
-        xl[n].atom    = strdup(abuf);
-        xl[n].replace = strdup(repbuf);
+        xl[n].atom    = gmx_strdup(abuf);
+        xl[n].replace = gmx_strdup(repbuf);
         n++;
     }
 
@@ -137,7 +136,7 @@ static void done_xlatom(int nxlate, t_xlate_atom *xlatom)
 
 void rename_atoms(const char *xlfile, const char *ffdir,
                   t_atoms *atoms, t_symtab *symtab, const t_restp *restp,
-                  gmx_bool bResname, gmx_residuetype_t rt, gmx_bool bReorderNum,
+                  gmx_bool bResname, gmx_residuetype_t *rt, gmx_bool bReorderNum,
                   gmx_bool bVerbose)
 {
     FILE         *fp;
@@ -238,7 +237,7 @@ void rename_atoms(const char *xlfile, const char *ffdir,
                     /* Don't free the old atomname,
                      * since it might be in the symtab.
                      */
-                    ptr0 = strdup(xlatom[i].replace);
+                    ptr0 = gmx_strdup(xlatom[i].replace);
                     if (bVerbose)
                     {
                         printf("Renaming atom '%s' in residue %d %s to '%s'\n",
index 425c076bcb58b44bc4a27ce5b9adfbd34944f3d4..aa1c61006d4f2e50d1dc426f424e37c976fecbba 100644 (file)
 #ifndef GMX_GMXPREPROCESS_XLATE_H
 #define GMX_GMXPREPROCESS_XLATE_H
 
-#include "index.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_residuetype_t;
+struct t_atoms;
+struct t_symtab;
+
 /* If bResname is true renames atoms based on residue names,
  * otherwise renames atoms based on rtp entry names.
  */
 void rename_atoms(const char *xlfile, const char *ffdir,
-                  t_atoms *atoms, t_symtab *symtab, const t_restp *restp,
-                  gmx_bool bResname, gmx_residuetype_t rt, gmx_bool bReorderNum,
+                  struct t_atoms *atoms, struct t_symtab *symtab, const t_restp *restp,
+                  gmx_bool bResname, struct gmx_residuetype_t *rt, gmx_bool bReorderNum,
                   gmx_bool bVerbose);
 
 #ifdef __cplusplus
diff --git a/src/gromacs/gromacs-config-version.cmake.cmakein b/src/gromacs/gromacs-config-version.cmake.cmakein
new file mode 100644 (file)
index 0000000..c405ebb
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+set(PACKAGE_VERSION "@GMX_VERSION@")
+
+if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
+    set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+    # TODO: Check that major and minor version match.
+    set(PACKAGE_VERSION_COMPATIBLE TRUE)
+    if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
+        set(PACKAGE_VERSION_EXACT TRUE)
+    endif()
+endif()
diff --git a/src/gromacs/gromacs-config.cmake.cmakein b/src/gromacs/gromacs-config.cmake.cmakein
new file mode 100644 (file)
index 0000000..c7dfb0d
--- /dev/null
@@ -0,0 +1,131 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+set(_gmx_cmake_dir ${CMAKE_CURRENT_LIST_DIR})
+get_filename_component(_gmx_root_dir "${_gmx_cmake_dir}" PATH)
+get_filename_component(_gmx_root_dir "${_gmx_root_dir}" PATH)
+get_filename_component(_gmx_root_dir "${_gmx_root_dir}" PATH)
+
+# Find the exported targets (file name depends on whether shared or static
+# libraries were built to allow both to coexist in the same prefix), and
+# import them.
+set(_gmx_import_file ${_gmx_cmake_dir}/libgromacs.cmake)
+if (GROMACS_PREFER_STATIC OR NOT EXISTS ${_gmx_import_file})
+    set(_gmx_import_file_static ${_gmx_cmake_dir}/libgromacs_static.cmake)
+    if (EXISTS ${_gmx_import_file_static})
+        set(_gmx_import_file ${_gmx_import_file_static})
+    endif()
+    unset(_gmx_import_file_static)
+endif()
+if (NOT EXISTS ${_gmx_import_file})
+    message(FATAL_ERROR
+        "The GROMACS installation at ${_gmx_root_dir} does not contain "
+        "libgromacs.cmake or libgromacs_static.cmake to define the imported "
+        "targets.")
+endif()
+include(${_gmx_import_file})
+unset(_gmx_import_file)
+
+set(GROMACS_INCLUDE_DIRS)
+set(_include_dirs "@INSTALLED_HEADER_INCLUDE_DIRS@")
+foreach (_dir ${_include_dirs})
+    if (IS_ABSOLUTE ${_dir})
+        list(APPEND GROMACS_INCLUDE_DIRS ${_dir})
+    else()
+        list(APPEND GROMACS_INCLUDE_DIRS ${_gmx_root_dir}/${_dir})
+    endif()
+endforeach()
+set(GROMACS_LIBRARIES libgromacs)
+set(GROMACS_DEFINITIONS @INSTALLED_HEADER_DEFINITIONS@)
+set(GROMACS_IS_DOUBLE @GMX_DOUBLE@)
+if (DEFINED GROMACS_SUFFIX AND NOT "${GROMACS_SUFFIX}" STREQUAL "@GMX_LIBS_SUFFIX@")
+    message(FATAL_ERROR "GROMACS_SUFFIX is set inconsistently, expected '@GMX_LIBS_SUFFIX@'")
+endif()
+set(GROMACS_SUFFIX "@GMX_LIBS_SUFFIX@")
+set(GROMACS_CXX_COMPILER "@GROMACS_CXX_COMPILER@")
+set(GROMACS_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
+set(GROMACS_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
+
+# Produce a message, since find_package() prints nothing on success.
+include(FindPackageMessage)
+# The version info is set by CMake when it determines whether this file
+# is suitable (by calling the version file, which sets PACKAGE_VERSION).
+# TODO: Make also the full version string available from somewhere.
+set(_gmx_info "${GROMACS_VERSION}")
+if (GROMACS_SUFFIX)
+    set(_gmx_info "${_gmx_info} (suffix: ${GROMACS_SUFFIX})")
+endif()
+find_package_message(GROMACS "Found GROMACS: ${_gmx_info}" "${CMAKE_CURRENT_LIST_FILE}")
+
+unset(_gmx_cmake_dir)
+unset(_gmx_root_dir)
+unset(_gmx_info)
+
+#####################################################################
+# Macros for use in calling code
+
+# This does not work as a function if called as gromacs_check_double(GMX_DOUBLE)
+# (i.e., with the parameter value equal to the formal parameter name) because
+# of scoping rules.
+macro (gromacs_check_double GMX_DOUBLE)
+    if (${GMX_DOUBLE} AND NOT GROMACS_IS_DOUBLE)
+        message(FATAL_ERROR
+            "The found GROMACS installation is compiled in mixed precision, "
+            "but double-precision compilation was requested with ${GMX_DOUBLE}=${${GMX_DOUBLE}}")
+    elseif (NOT ${GMX_DOUBLE} AND GROMACS_IS_DOUBLE)
+        message(FATAL_ERROR
+            "The found GROMACS installation is compiled in double precision, "
+            "but mixed-precision compilation was requested with ${GMX_DOUBLE}=${${GMX_DOUBLE}}")
+    endif()
+endmacro()
+
+function (gromacs_check_compiler LANG)
+    if (NOT LANG STREQUAL CXX)
+        message(FATAL_ERROR
+            "gromacs_check_compiler(CXX) is currently the only supported call")
+    endif()
+    # Deal with possible symlinks (it is fine if one of the used compilers was
+    # a symlink to another one).
+    get_filename_component(_cmake_compiler_realpath ${CMAKE_${LANG}_COMPILER} REALPATH)
+    if (NOT "${_cmake_compiler_realpath}" STREQUAL "${GROMACS_${LANG}_COMPILER}" OR
+        NOT "${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "${GROMACS_${LANG}_COMPILER_ID}" OR
+        NOT "${CMAKE_${LANG}_COMPILER_VERSION}" STREQUAL "${GROMACS_${LANG}_COMPILER_VERSION}")
+        message(WARNING
+            "You are compiling with a different C++ compiler than what was used "
+            "to compile GROMACS. This may lead to linking or runtime problems. "
+            "GROMACS was compiled with "
+            "${GROMACS_${LANG}_COMPILER_ID} ${GROMACS_${LANG}_COMPILER_VERSION} "
+            "(${GROMACS_${LANG}_COMPILER}).")
+    endif()
+endfunction()
index 2e8cbcece8b67194f923e556f0954eb8c5aecd0c..7c608c7bd54d528c546de617a3c85a5d809426e5 100644 (file)
  *
  * \ingroup module_imd
  */
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "imd.h"
 
+#include "config.h"
 
+#include <errno.h>
 #include <string.h>
 
 #ifdef GMX_NATIVE_WINDOWS
 #include <unistd.h>
 #endif
 
-#include "imd.h"
-#include "imdsocket.h"
-#include "gromacs/utility/smalloc.h"
-#include "network.h"
-#include "mdrun.h"
-#include "sighandler.h"
-#include "gmx_ga2la.h"
-#include "xvgr.h"
-#include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/fileio/confio.h"
-#include "mtop_util.h"
-#include "names.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/imd/imdsocket.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/sighandler.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /*! \brief How long shall we wait in seconds until we check for a connection again? */
 #define IMDLOOPWAIT 1
index ea6685c406c6469b395d8b3ea5e882a379e97eb5..01aa585425ac1d3e08e58573692d6cfb8a49d530 100644 (file)
 #ifndef GMX_IMD_IMD_H
 #define GMX_IMD_IMD_H
 
-#include "typedefs.h"
-#include "../fileio/filenm.h"
+#include "config.h"
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef GMX_NATIVE_WINDOWS
 #include <Windows.h>
index 6febf83e55b57d45d739bb681b2bf49d3275e7dc..ef70405d931d6e5f5219c3c5a5bda7ec8462f012 100644 (file)
  * \ingroup module_imd
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "imdsocket.h"
 
+#include "config.h"
 
+#include <errno.h>
 #include <string.h>
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "imdsocket.h"
-#include "imd.h"
 
+#include "gromacs/imd/imd.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #ifdef GMX_NATIVE_WINDOWS
 #ifdef GMX_HAVE_WINSOCK
@@ -78,7 +79,6 @@ extern int imdsock_winsockinit()
 #endif
 #else
 /* On UNIX, we can use nice errors from errno.h */
-#include <errno.h>
 #include <unistd.h>
 #endif
 
@@ -132,7 +132,7 @@ extern IMDSocket* imdsock_create()
 
 extern int imdsock_bind(IMDSocket *sock, int port)
 {
-    int ret = -1;
+    int ret;
 
 
 #ifdef GMX_IMD
@@ -142,6 +142,8 @@ extern int imdsock_bind(IMDSocket *sock, int port)
 
     /* Try to bind to address and port ...*/
     ret = bind(sock->sockfd, (struct sockaddr *) &sock->address, sizeof(sock->address));
+#else
+    ret = -1;
 #endif
 
     if (ret)
@@ -155,12 +157,14 @@ extern int imdsock_bind(IMDSocket *sock, int port)
 
 extern int imd_sock_listen(IMDSocket *sock)
 {
-    int ret = -1;
+    int ret;
 
 
 #ifdef GMX_IMD
     /* Try to set to listening state */
     ret = listen(sock->sockfd, MAXIMDCONNECTIONS);
+#else
+    ret = -1;
 #endif
 
     if (ret)
@@ -174,7 +178,7 @@ extern int imd_sock_listen(IMDSocket *sock)
 
 extern IMDSocket* imdsock_accept(IMDSocket *sock)
 {
-    int       ret = -1;
+    int       ret;
 
 #ifdef GMX_IMD
     socklen_t length;
@@ -206,7 +210,7 @@ extern IMDSocket* imdsock_accept(IMDSocket *sock)
 
 extern int imdsock_getport(IMDSocket *sock, int *port)
 {
-    int                ret = -1;
+    int                ret;
 #ifdef GMX_IMD
     struct sockaddr_in sin;
     socklen_t          len;
index 5903db3cacecf627f22335f66029412f0b2a821e..4effb0c76a91c7a38cfd592ce0669aa69d3b3635 100644 (file)
@@ -51,6 +51,8 @@
 #ifndef GMX_IMD_IMDSOCKET_H
 #define GMX_IMD_IMDSOCKET_H
 
+#include "config.h"
+
 /* Check if we can/should use winsock or standard UNIX sockets. */
 #ifdef GMX_NATIVE_WINDOWS
   #ifdef GMX_HAVE_WINSOCK
@@ -58,8 +60,8 @@
   #define GMX_IMD
   #endif
 #else
-#include <sys/socket.h>
 #include <netinet/in.h>
+#include <sys/socket.h>
 #define GMX_IMD
 #endif
 
index 586797fab9d1a017fe3ad7c66728dd80bf3b74da..bd32dda143b2e5e238876e737dad3ed37d4b8f39 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) 2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # the research papers on the package. Check out http://www.gromacs.org.
 
 # includes: Nothing to build, just installation
-file(GLOB ROOT_LEGACY_HEADERS          *.h)
-file(GLOB ROOT_LEGACY_HEADERS_PRIVATE  thread_mpi.h tmpi.h gmx_hash.h 
-     gmx_ga2la.h gpu_utils.h pmalloc_cuda.h nbnxn_cuda_data_mgmt.h)
-file(GLOB TYPES_LEGACY_HEADERS         types/*.h)
-file(GLOB TYPES_LEGACY_HEADERS_PRIVATE types/commrec.h)
-list(REMOVE_ITEM ROOT_LEGACY_HEADERS   ${ROOT_LEGACY_HEADERS_PRIVATE})
-list(REMOVE_ITEM TYPES_LEGACY_HEADERS  ${TYPES_LEGACY_HEADERS_PRIVATE})
-gmx_install_headers(legacyheaders                   ${ROOT_LEGACY_HEADERS})
-gmx_install_headers(legacyheaders/types             ${TYPES_LEGACY_HEADERS})
+file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
+list(REMOVE_ITEM HEADERS gmx_hash.h gmx_ga2la.h)
+gmx_install_headers(${HEADERS})
+
+add_subdirectory(types)
diff --git a/src/gromacs/legacyheaders/bondf.h b/src/gromacs/legacyheaders/bondf.h
deleted file mode 100644 (file)
index 793aefe..0000000
+++ /dev/null
@@ -1,172 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 _bondf_h
-#define _bondf_h
-
-
-#include <stdio.h>
-#include "typedefs.h"
-#include "nrnb.h"
-#include "pbc.h"
-#include "genborn.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int glatnr(int *global_atom_index, int i);
-/* Returns the global topology atom number belonging to local atom index i.
- * This function is intended for writing ascii output
- * and returns atom numbers starting at 1.
- * When global_atom_index=NULL returns i+1.
- */
-
-void calc_bonds(FILE *fplog, const gmx_multisim_t *ms,
-                const t_idef *idef,
-                rvec x[], history_t *hist,
-                rvec f[], t_forcerec *fr,
-                const t_pbc *pbc, const t_graph *g,
-                gmx_enerdata_t *enerd, t_nrnb *nrnb, real *lambda,
-                const t_mdatoms *md,
-                t_fcdata *fcd, int *ddgatindex,
-                t_atomtypes *atype, gmx_genborn_t *born,
-                int force_flags,
-                gmx_bool bPrintSepPot, gmx_int64_t step);
-/*
- * The function calc_bonds() calculates all bonded force interactions.
- * The "bonds" are specified as follows:
- *   int nbonds
- *         the total number of bonded interactions.
- *   t_iatom *forceatoms
- *     specifies which atoms are involved in a bond of a certain
- *     type, see also struct t_idef.
- *   t_functype *functype
- *         defines for every bonded force type what type of function to
- *     use, see also struct t_idef.
- *   t_iparams *forceparams
- *         defines the parameters for every bond type, see also struct
- *     t_idef.
- *   real epot[NR_F]
- *     total potential energy split up over the function types.
- *   int *ddgatindex
- *     global atom number indices, should be NULL when not using DD.
- *   gmx_bool bPrintSepPot
- *     if TRUE print local potential and dVdlambda for each bonded type.
- *   int step
- *     used with bPrintSepPot
- *   return value:
- *         the total potential energy (sum over epot).
- */
-
-void calc_bonds_lambda(FILE *fplog,
-                       const t_idef *idef,
-                       rvec x[],
-                       t_forcerec *fr,
-                       const t_pbc *pbc, const t_graph *g,
-                       gmx_grppairener_t *grpp, real *epot, t_nrnb *nrnb,
-                       real *lambda,
-                       const t_mdatoms *md,
-                       t_fcdata *fcd, int *global_atom_index);
-/* As calc_bonds, but only determines the potential energy
- * for the perturbed interactions.
- * The shift forces in fr are not affected.
- */
-
-real posres(int nbonds,
-            const t_iatom forceatoms[], const t_iparams forceparams[],
-            const rvec x[], rvec f[], rvec vir_diag,
-            t_pbc *pbc,
-            real lambda, real *dvdlambda,
-            int refcoord_scaling, int ePBC, rvec comA, rvec comB);
-/* Position restraints require a different pbc treatment from other bondeds */
-
-real fbposres(int nbonds,
-              const t_iatom forceatoms[], const t_iparams forceparams[],
-              const rvec x[], rvec f[], rvec vir_diag,
-              t_pbc *pbc, int refcoord_scaling, int ePBC, rvec com);
-/* Flat-bottom posres. Same PBC treatment as in normal position restraints */
-
-real bond_angle(const rvec xi, const rvec xj, const rvec xk,
-                const t_pbc *pbc,
-                rvec r_ij, rvec r_kj, real *costh,
-                int *t1, int *t2);  /* out */
-/* Calculate bond-angle. No PBC is taken into account (use mol-shift) */
-
-real dih_angle(const rvec xi, const rvec xj, const rvec xk, const rvec xl,
-               const t_pbc *pbc,
-               rvec r_ij, rvec r_kj, rvec r_kl, rvec m, rvec n, /* out */
-               real *sign,
-               int *t1, int *t2, int *t3);
-/* Calculate dihedral-angle. No PBC is taken into account (use mol-shift) */
-
-void do_dih_fup(int i, int j, int k, int l, real ddphi,
-                rvec r_ij, rvec r_kj, rvec r_kl,
-                rvec m, rvec n, rvec f[], rvec fshift[],
-                const t_pbc *pbc, const t_graph *g,
-                const rvec *x, int t1, int t2, int t3);
-/* Do an update of the forces for dihedral potentials */
-
-void make_dp_periodic(real *dp);
-/* make a dihedral fall in the range (-pi,pi) */
-
-/*************************************************************************
- *
- *  Bonded force functions
- *
- *************************************************************************/
-t_ifunc bonds, g96bonds, morse_bonds, cubic_bonds, FENE_bonds, restraint_bonds;
-t_ifunc angles, g96angles, cross_bond_bond, cross_bond_angle, urey_bradley, quartic_angles, linear_angles;
-t_ifunc restrangles;
-t_ifunc pdihs, idihs, rbdihs;
-t_ifunc restrdihs, cbtdihs;
-t_ifunc tab_bonds, tab_angles, tab_dihs;
-t_ifunc polarize, anharm_polarize, water_pol, thole_pol, angres, angresz, dihres, unimplemented;
-
-
-/* Divided the bonded interactions over the threads, count=fr->nthreads
- * and set up the bonded thread-force buffer reduction.
- * This should be called each time the bonded setup changes;
- * i.e. at start-up without domain decomposition and at DD.
- */
-void setup_bonded_threading(t_forcerec *fr, t_idef *idef);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* _bondf_h */
index 91ecbe659c5cce20aeba6ddb2d214d36b4b744e0..251b9e3d57bfdc6f3491a1b9314aca51b1479b90 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_LEGACYHEADERS_CALCGRID_H
+#define GMX_LEGACYHEADERS_CALCGRID_H
 
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,3 +57,5 @@ real calc_grid(FILE *fp,
 #ifdef __cplusplus
 }
 #endif
+
+#endif
index 40f73b0b6b87147df77635dfaf92840f918f3a3e..c9ed792d7bfa2cdec0185245eecf02b717d583df 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _calcmu_h
 #define _calcmu_h
 
+#include <stdio.h>
 
-#include "typedefs.h"
-#include "network.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
index 2fab5bc79cc1b21aa934691515a6e9ffc4f9fd59..26c81b081bdf452592934bf6ffa3f181d5ca47eb 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _chargegroup_h
 #define _chargegroup_h
 
-#include "sysstuff.h"
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void calc_chargegroup_radii(const gmx_mtop_t *mtop, rvec *x,
+struct gmx_mtop_t;
+struct t_block;
+
+void calc_chargegroup_radii(const struct gmx_mtop_t *mtop, rvec *x,
                             real *rvdw1, real *rvdw2,
                             real *rcoul1, real *rcoul2);
 /* This routine calculates the two largest charge group radii in x,
  * separately for VdW and Coulomb interactions.
  */
 
-void calc_cgcm(FILE *log, int cg0, int cg1, t_block *cgs,
+void calc_cgcm(FILE *log, int cg0, int cg1, struct t_block *cgs,
                rvec pos[], rvec cg_cm[]);
 /* Routine to compute centers of geometry of charge groups. No periodicity
  * is used.
  */
 
 void put_charge_groups_in_box (FILE *log, int cg0, int cg1,
-                               int ePBC, matrix box, t_block *cgs,
+                               int ePBC, matrix box, struct t_block *cgs,
                                rvec pos[],
                                rvec cg_cm[]);
 /* This routine puts charge groups in the periodic box, keeping them
index 0db48d652738b1b141de5862e33f55768ecd768a..78f329dc232d728fbccc0fea5a932ab7b773f766 100644 (file)
@@ -39,9 +39,9 @@
 #define _checkpoint_h
 
 
-#include "typedefs.h"
-#include "../fileio/gmxfio.h"
-#include "../fileio/filenm.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 074b1bc41659335967a8b5c4b64952aba1451de8..e6b40bdab840614e441bd7dbe815c1bdca41b7b3 100644 (file)
 
 #ifndef _constr_h
 #define _constr_h
-#include "typedefs.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_pbc;
+
 enum
 {
     econqCoord,         /* Constrain coordinates (mass weighted)           */
@@ -82,8 +85,7 @@ gmx_bool bshakef(FILE           *log,          /* Log file                    */
                  gmx_bool        bCalcVir,     /* Calculate r x m delta_r      */
                  tensor          vir_r_m_dr,   /* sum r x m delta_r            */
                  gmx_bool        bDumpOnError, /* Dump debugging stuff on error*/
-                 int             econq,        /* which type of constrainint is occurring */
-                 t_vetavars     *vetavar);     /* veta for pressure control */
+                 int             econq);       /* which type of constraint is occurring */
 /* Shake all the atoms blockwise. It is assumed that all the constraints
  * in the idef->shakes field are sorted, to ascending block nr. The
  * sblock array points into the idef->shakes.iatoms field, with block 0
@@ -97,45 +99,42 @@ gmx_settledata_t settle_init(real mO, real mH, real invmO, real invmH,
                              real dOH, real dHH);
 /* Initializes and returns a structure with SETTLE parameters */
 
-void csettle(gmx_settledata_t settled,
-             int              nsettle,          /* Number of settles            */
-             t_iatom          iatoms[],         /* The settle iatom list        */
-             const t_pbc     *pbc,              /* PBC data pointer, can be NULL  */
-             real             b4[],             /* Old coordinates             */
-             real             after[],          /* New coords, to be settled   */
-             real             invdt,            /* 1/delta_t                    */
-             real            *v,                /* Also constrain v if v!=NULL  */
-             int              calcvir_atom_end, /* Calculate r x m delta_r up to this atom */
-             tensor           vir_r_m_dr,       /* sum r x m delta_r            */
-             int             *xerror,
-             t_vetavars      *vetavar           /* variables for pressure control */
+void csettle(gmx_settledata_t    settled,
+             int                 nsettle,          /* Number of settles            */
+             t_iatom             iatoms[],         /* The settle iatom list        */
+             const struct t_pbc *pbc,              /* PBC data pointer, can be NULL */
+             real                b4[],             /* Old coordinates              */
+             real                after[],          /* New coords, to be settled    */
+             real                invdt,            /* 1/delta_t                    */
+             real               *v,                /* Also constrain v if v!=NULL  */
+             int                 calcvir_atom_end, /* Calculate r x m delta_r up to this atom */
+             tensor              vir_r_m_dr,       /* sum r x m delta_r            */
+             int                *xerror
              );
 
 void settle_proj(gmx_settledata_t settled, int econq,
                  int nsettle, t_iatom iatoms[],
-                 const t_pbc *pbc,   /* PBC data pointer, can be NULL  */
+                 const struct t_pbc *pbc,   /* PBC data pointer, can be NULL  */
                  rvec x[],
                  rvec *der, rvec *derp,
-                 int CalcVirAtomEnd, tensor vir_r_m_dder,
-                 t_vetavars *vetavar);
+                 int CalcVirAtomEnd, tensor vir_r_m_dder);
 /* Analytical algorithm to subtract the components of derivatives
  * of coordinates working on settle type constraint.
  */
 
-void cshake(atom_id iatom[], int ncon, int *nnit, int maxnit,
-            real dist2[], real xp[], real rij[], real m2[], real omega,
-            real invmass[], real tt[], real lagr[], int *nerror);
+void cshake(const atom_id iatom[], int ncon, int *nnit, int maxnit,
+            const real dist2[], real xp[], const real rij[], const real m2[], real omega,
+            const real invmass[], const real tt[], real lagr[], int *nerror);
 /* Regular iterative shake */
 
 void crattle(atom_id iatom[], int ncon, int *nnit, int maxnit,
              real dist2[], real vp[], real rij[], real m2[], real omega,
-             real invmass[], real tt[], real lagr[], int *nerror, real invdt, t_vetavars *vetavar);
+             real invmass[], real tt[], real lagr[], int *nerror, real invdt);
 
 gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
                    gmx_constr_t constr,
                    t_idef *idef,
                    t_inputrec *ir,
-                   gmx_ekindata_t *ekind,
                    t_commrec *cr,
                    gmx_int64_t step, int delta_step,
                    real step_scaling,
@@ -144,7 +143,7 @@ gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
                    gmx_bool bMolPBC, matrix box,
                    real lambda, real *dvdlambda,
                    rvec *v, tensor *vir,
-                   t_nrnb *nrnb, int econq, gmx_bool bPscal, real veta, real vetanew);
+                   t_nrnb *nrnb, int econq);
 /*
  * When econq=econqCoord constrains coordinates xprime using th
  * directions in x, min_proj is not used.
@@ -172,11 +171,6 @@ gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
  *
  * If vir!=NULL calculate the constraint virial.
  *
- * if veta != NULL, constraints are done assuming isotropic pressure control
- * (i.e. constraining rdot.r = (v + veta*r).r = 0 instead of v
- *
- * Init_constraints must have be called once, before calling constrain.
- *
  * Return TRUE if OK, FALSE in case of shake error
  *
  */
@@ -262,7 +256,7 @@ constrain_lincs(FILE *log, gmx_bool bLog, gmx_bool bEner,
                 gmx_lincsdata_t lincsd, t_mdatoms *md,
                 t_commrec *cr,
                 rvec *x, rvec *xprime, rvec *min_proj,
-                matrix box, t_pbc *pbc,
+                matrix box, struct t_pbc *pbc,
                 real lambda, real *dvdlambda,
                 real invdt, rvec *v,
                 gmx_bool bCalcVir, tensor vir_r_m_dr,
index 2b8cfab10cfb876fb53caafe06add1da91eb75c6..3dd0c5ffdab35e51c4684de1d40fbac879f15fc5 100644 (file)
 #ifndef _disre_h
 #define _disre_h
 
-#include "sysstuff.h"
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_pbc;
+
 void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
                  t_inputrec *ir, const t_commrec *cr,
                  t_fcdata *fcd, t_state *state, gmx_bool bIsREMD);
@@ -57,7 +60,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
  */
 
 void calc_disres_R_6(int nfa, const t_iatom *fa, const t_iparams ip[],
-                     const rvec *x, const t_pbc *pbc,
+                     const rvec *x, const struct t_pbc *pbc,
                      t_fcdata *fcd, history_t *hist);
 /* Calculates r and r^-3 (inst. and time averaged) for all pairs
  * and the ensemble averaged r^-6 (inst. and time averaged) for all restraints
index b468a3bc6b6dc1d3881d81758ddc4612108ab8c7..f0bd0e79140d77a73e9a6a13572879725a332ee7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _ebin_h
 #define _ebin_h
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "../fileio/enxio.h"
+#include <stdio.h>
+
+#include "gromacs/fileio/enxio.h"
+#include "gromacs/legacyheaders/types/energy.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
index e053a0de3355a2471ccc292de60d0168abed90c3..ca19eae719da3d070aa2d853434259cd0c64ae18 100644 (file)
 #define _force_h
 
 
-#include "typedefs.h"
-#include "types/force_flags.h"
-#include "pbc.h"
-#include "network.h"
-#include "tgroup.h"
-#include "vsite.h"
-#include "genborn.h"
-
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void gmx_print_sepdvdl(FILE *fplog, const char *s, real v, real dvdlambda);
+struct t_graph;
+struct t_pbc;
 
 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 */
 
 void f_calc_vir(int i0, int i1, rvec x[], rvec f[], tensor vir,
-                t_graph *g, rvec shift_vec[]);
+                struct t_graph *g, rvec shift_vec[]);
 /* Calculate virial taking periodicity into account */
 
-real RF_excl_correction(const t_forcerec *fr, t_graph *g,
+real RF_excl_correction(const t_forcerec *fr, struct t_graph *g,
                         const t_mdatoms *mdatoms, const t_blocka *excl,
-                        rvec x[], rvec f[], rvec *fshift, const t_pbc *pbc,
+                        rvec x[], rvec f[], rvec *fshift, const struct t_pbc *pbc,
                         real lambda, real *dvdlambda);
 /* Calculate the reaction-field energy correction for this node:
  * epsfac q_i q_j (k_rf r_ij^2 - c_rf)
@@ -146,9 +146,9 @@ gmx_bool nbnxn_acceleration_supported(FILE             *fplog,
  * message to fplog/stderr.
  */
 
-gmx_bool uses_simple_tables(int                 cutoff_scheme,
-                            nonbonded_verlet_t *nbv,
-                            int                 group);
+gmx_bool uses_simple_tables(int                        cutoff_scheme,
+                            struct nonbonded_verlet_t *nbv,
+                            int                        group);
 /* Returns whether simple tables (i.e. not for use with GPUs) are used
  * with the type of kernel indicated.
  */
@@ -225,7 +225,7 @@ extern void do_force(FILE *log, t_commrec *cr,
                      tensor vir_force,
                      t_mdatoms *mdatoms,
                      gmx_enerdata_t *enerd, t_fcdata *fcd,
-                     real *lambda, t_graph *graph,
+                     real *lambda, struct t_graph *graph,
                      t_forcerec *fr,
                      gmx_vsite_t *vsite, rvec mu_tot,
                      double t, FILE *field, gmx_edsam_t ed,
@@ -253,9 +253,7 @@ void ns(FILE              *fplog,
         gmx_bool           bDoLongRangeNS);
 /* Call the neighborsearcher */
 
-extern void do_force_lowlevel(FILE         *fplog,
-                              gmx_int64_t   step,
-                              t_forcerec   *fr,
+extern void do_force_lowlevel(t_forcerec   *fr,
                               t_inputrec   *ir,
                               t_idef       *idef,
                               t_commrec    *cr,
@@ -270,18 +268,22 @@ extern void do_force_lowlevel(FILE         *fplog,
                               t_fcdata     *fcd,
                               gmx_localtop_t *top,
                               gmx_genborn_t *born,
-                              t_atomtypes  *atype,
                               gmx_bool         bBornRadii,
                               matrix       box,
                               t_lambda     *fepvals,
                               real         *lambda,
-                              t_graph      *graph,
+                              struct t_graph      *graph,
                               t_blocka     *excl,
                               rvec         mu_tot[2],
                               int          flags,
                               float        *cycles_pme);
 /* Call all the force routines */
 
+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);
+
 #ifdef __cplusplus
 }
 #endif
index 99e2d51513deae7db479b7433943a6fcdc8ad2d9..a23ed2ced0d5db55544ff015582c8f0fe20b2b23 100644 (file)
@@ -39,7 +39,7 @@
 #ifndef _genborn_h
 #define _genborn_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -55,6 +55,8 @@ extern "C" {
 #define STILL_P5INV (1.0/STILL_P5)
 #define STILL_PIP5  (M_PI*STILL_P5)
 
+struct t_graph;
+struct t_pbc;
 
 /* Initialise GB stuff */
 int init_gb(gmx_genborn_t **p_born,
@@ -70,7 +72,8 @@ int calc_gb_rad(t_commrec *cr, t_forcerec *fr, t_inputrec *ir, gmx_localtop_t *t
 /* Bonded GB interactions */
 real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtabscale,
                   real *invsqrta, real *dvda, real *GBtab, t_idef *idef, real epsilon_r,
-                  real gb_epsilon_solvent, real facel, const t_pbc *pbc, const t_graph *graph);
+                  real gb_epsilon_solvent, real facel, const struct t_pbc *pbc,
+                  const struct t_graph *graph);
 
 
 
@@ -79,13 +82,13 @@ real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtab
 void
 calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t *top,
                rvec x[], rvec f[], t_forcerec *fr, t_idef *idef, int gb_algorithm, int sa_algorithm, t_nrnb *nrnb,
-               const t_pbc *pbc, const t_graph *graph, gmx_enerdata_t *enerd);
+               const struct t_pbc *pbc, const struct t_graph *graph, gmx_enerdata_t *enerd);
 
 
 int
 make_gb_nblist(t_commrec *cr, int gb_algorithm,
                rvec x[], matrix box,
-               t_forcerec *fr, t_idef *idef, t_graph *graph, gmx_genborn_t *born);
+               t_forcerec *fr, t_idef *idef, struct t_graph *graph, gmx_genborn_t *born);
 
 void
 make_local_gb(const t_commrec *cr, gmx_genborn_t *born, int gb_algorithm);
index d595c51a373447b2c28d950b6e0824308dae16bc..eba7ba33523d4194afaad8856adc3b48220224d5 100644 (file)
@@ -55,6 +55,7 @@ enum gmx_cpuid_vendor
     GMX_CPUID_VENDOR_AMD,
     GMX_CPUID_VENDOR_FUJITSU,
     GMX_CPUID_VENDOR_IBM,
+    GMX_CPUID_VENDOR_ARM,
     GMX_CPUID_NVENDORS
 };
 
@@ -111,6 +112,11 @@ enum gmx_cpuid_feature
     GMX_CPUID_FEATURE_X86_TDT,           /* TSC deadline timer                           */
     GMX_CPUID_FEATURE_X86_X2APIC,        /* Extended xAPIC Support                       */
     GMX_CPUID_FEATURE_X86_XOP,           /* AMD extended instructions, only AMD for now  */
+    GMX_CPUID_FEATURE_ARM_NEON,          /* 32-bit ARM NEON                              */
+    GMX_CPUID_FEATURE_ARM_NEON_ASIMD,    /* 64-bit ARM AArch64 Advanced SIMD             */
+    GMX_CPUID_FEATURE_IBM_QPX,           /* IBM QPX SIMD (BlueGene/Q and later)          */
+    GMX_CPUID_FEATURE_IBM_VMX,           /* IBM VMX SIMD (Altivec on Power6 and later)   */
+    GMX_CPUID_FEATURE_IBM_VSX,           /* IBM VSX SIMD (Power7 and later)              */
     GMX_CPUID_NFEATURES
 };
 
@@ -132,6 +138,10 @@ enum gmx_cpuid_simd
     GMX_CPUID_SIMD_X86_AVX2_256,
     GMX_CPUID_SIMD_SPARC64_HPC_ACE,
     GMX_CPUID_SIMD_IBM_QPX,
+    GMX_CPUID_SIMD_IBM_VMX,
+    GMX_CPUID_SIMD_IBM_VSX,
+    GMX_CPUID_SIMD_ARM_NEON,
+    GMX_CPUID_SIMD_ARM_NEON_ASIMD,
     GMX_CPUID_NSIMD
 };
 
index 0e638031386cbf609dcaa3eba27a7abe8c10ed3b..4f74e5e061289431ec43850cde9202b19419bc96 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef GMX_HARDWARE_DETECT_H
 #define GMX_HARDWARE_DETECT_H
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -48,7 +48,8 @@ extern "C" {
 /* the init and consistency functions depend on commrec that may not be
    consistent in cuda because MPI types don't exist there.  */
 #ifndef __CUDACC__
-/* return a pointer to a global hwinfo structure. */
+/* Construct the global hwinfo structure and return a pointer to
+   it. Caller is responsible for freeing this pointer. */
 gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
                                    gmx_bool bDetectGPUs);
 
index e5820421df81734d326c9e2e096b7fcbcbc8d9cb..aa141c1404fdb57ac4800d7e7ac6cf12642fa4da 100644 (file)
@@ -37,8 +37,8 @@
 #ifndef _gmx_ga2la_h
 #define _gmx_ga2la_h
 
-#include "typedefs.h"
-#include "types/commrec.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/smalloc.h"
 
 #ifdef __cplusplus
index a241ee0def4f5f4695784237dd20dc978fc3dfe6..5d5a852616d6f906f3b80bca4e9d0a903b19cab5 100644 (file)
 #ifndef _gmx_hash_h
 #define _gmx_hash_h
 
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 
 #ifdef __cplusplus
 extern "C" {
index f4010010dba270082c377b2786c52645cb7a256b..1b7380fdb616733b436c40e16168f0f6e00383ba 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef GMX_OMP_NTHREADS
-#define GMX_OMP_NTHREADS
+#ifndef GMX_OMP_NTHREADS_H
+#define GMX_OMP_NTHREADS_H
 
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -46,7 +47,9 @@ extern "C" {
 }
 #endif
 
-/*! Enum values corresponding to multithreaded algorithmic modules. */
+struct t_commrec;
+
+/** Enum values corresponding to multithreaded algorithmic modules. */
 typedef enum module_nth
 {
     /* Default is meant to be used in OMP regions outside the named
@@ -56,24 +59,31 @@ typedef enum module_nth
     emntNR
 } module_nth_t;
 
-/*! Initializes the per-module thread count. 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,
+/*! \brief
+ * Initializes the per-module thread count.
+ *
+ * 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, struct t_commrec *cr,
                            int nthreads_hw_avail,
                            int omp_nthreads_req,
                            int omp_nthreads_pme_req,
                            gmx_bool bCurrNodePMEOnly,
                            gmx_bool bFullOmpSupport);
 
-/*! Returns the number of threads to be used in the given module m. */
+/*! \brief
+ * Returns the number of threads to be used in the given module \p mod. */
 int gmx_omp_nthreads_get(int mod);
 
-/*! \brief Sets the number of threads to be used in module. Intended
- *  for use in testing. */
+/*! \brief Sets the number of threads to be used in module.
+ *
+ * Intended for use in testing. */
 void gmx_omp_nthreads_set(int mod, int nthreads);
 
-/*! Read the OMP_NUM_THREADS env. var. and check against the value set on the command line. */
+/*! \brief
+ * Read the OMP_NUM_THREADS env. var. and check against the value set on the
+ * command line. */
 void gmx_omp_nthreads_read_env(int     *nthreads_omp,
                                gmx_bool bIsSimMaster);
 
@@ -84,4 +94,4 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
 }
 #endif
 
-#endif /* GMX_OMP_NTHREADS */
+#endif
index 2ee5cfd4e328b03611cfcfa95339586b03d145b0..d2a2ce2b55de4989ed065cc1fa02c15f788975e8 100644 (file)
  */
 #ifndef GMX_THREAD_AFFINITY_H_
 #define GMX_THREAD_AFFINITY_H_
-#include "typedefs.h"
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -43,14 +47,16 @@ extern "C" {
 } /* fixes auto-indentation problems */
 #endif
 
+struct t_commrec;
+
 /* Sets the thread affinity using the requested setting stored in hw_opt.
  * The hardware topologu is requested from hwinfo, when present.
  */
 void
-gmx_set_thread_affinity(FILE                *fplog,
-                        const t_commrec     *cr,
-                        gmx_hw_opt_t        *hw_opt,
-                        const gmx_hw_info_t *hwinfo);
+gmx_set_thread_affinity(FILE                       *fplog,
+                        const struct t_commrec     *cr,
+                        gmx_hw_opt_t               *hw_opt,
+                        const gmx_hw_info_t        *hwinfo);
 
 /* Check the process affinity mask and if it is found to be non-zero,
  * will honor it and disable mdrun internal affinity setting.
@@ -61,9 +67,11 @@ gmx_set_thread_affinity(FILE                *fplog,
  * made by the OpenMP library.
  *
  * Note that this will only work on Linux as we use a GNU feature.
+ * With bAfterOpenmpInit false, it will also detect whether OpenMP environment
+ * variables for setting the affinity are set.
  */
 void
-gmx_check_thread_affinity_set(FILE *fplog, const t_commrec *cr,
+gmx_check_thread_affinity_set(FILE *fplog, const struct t_commrec *cr,
                               gmx_hw_opt_t *hw_opt, int ncpus,
                               gmx_bool bAfterOpenmpInit);
 
index 9bebf01934974388e030ef120fca7c38dc84943c..0b743c4643f3c6a72d721a29fa169503be5c3706 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_INPUTREC_H
 #define GMX_INPUTREC_H
 
-#include "types/inputrec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 
 #ifdef __cplusplus
 extern "C"
index 0d02e7f53ba18694fbfb0425b7951dad667ec6ab..4d7a04763a6b71a606847f30b2da194a6125267a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _macros_h
 #define _macros_h
 
-#include "typedefs.h" /* for real definition only */
-
 /* no extern "C" for this header because it only defines Macros */
 
-/*
- * With the macros below you don't
- * have to use an index if you don't wan't to. You can eg. use
- * angle.C0[23] instead if angle.c[0][23].
- * In a similar fashion, you can use angle.AI[3] instead of
- * angle.a[0][3]
- */
 #ifndef __cplusplus
-#define AI  a[0]
-#define AJ  a[1]
-#define AK  a[2]
-#define AL  a[3]
-#define AM  a[4]
-#define C0  c[0]
-#define C1  c[1]
-#define C2  c[2]
+#include <stdlib.h>
 
 #ifndef min
 #define min(a, b) (((a) < (b)) ? (a) : (b) )
index 58356f6a6a980472b422b8d221e3b3eca32e710b..43329b9d9ae560574f877a5838348d7a8ab1b7f6 100644 (file)
 
 
 #include <stdio.h>
-#include "typedefs.h"
-#include "network.h"
-#include "../fileio/filenm.h"
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int gmx_gethostname(char *name, size_t len);
-/* Sets the hostname to the value given by gethostname, if available,
- * and to "unknown" otherwise. name should have at least size len.
- * Returns 0 on success, -1 on error.
- */
-
 void gmx_log_open(const char *fn, const t_commrec *cr,
-                  gmx_bool bMasterOnly, gmx_bool bAppendFiles, FILE**);
+                  gmx_bool bAppendFiles, FILE**);
 /* Open the log file, if necessary (nprocs > 1) the logfile name is
  * communicated around the ring.
  */
index 9a074b381fa89be3cb945f70e469a2aa1a3d5571..d610c3d573b919b56de2aa9039dd8776b9a7b1f3 100644 (file)
 #define _md_logging_h
 
 #include <stdio.h>
-#include "typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void md_print_info(const t_commrec *cr, FILE *fplog,
+struct t_commrec;
+
+void md_print_info(const struct 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.
@@ -53,7 +54,7 @@ void md_print_info(const t_commrec *cr, FILE *fplog,
  * the arguments after that contain the values to be printed, as in printf.
  */
 
-void md_print_warn(const t_commrec *cr, FILE *fplog,
+void md_print_warn(const struct 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
index 3561cce533b951cceee04797318ba81cd986ecad..eb7cc5907c5a98ae6dd2fde711660a11ffe50102 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _md_support_h
 #define _md_support_h
 
-#include "typedefs.h"
-#include "types/globsig.h"
-#include "sim_util.h"
-#include "vcm.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vcm.h"
+#include "gromacs/legacyheaders/types/globsig.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -67,14 +68,10 @@ extern "C" {
 #define CGLO_PRESSURE       (1<<8)
 /* Sum the constraint term in global computation */
 #define CGLO_CONSTRAINT     (1<<9)
-/* we are using an integrator that requires iteration over some steps - currently not used*/
-#define CGLO_ITERATE        (1<<10)
-/* it is the first time we are iterating (or, only once through is required */
-#define CGLO_FIRSTITERATE   (1<<11)
 /* Reading ekin from the trajectory */
-#define CGLO_READEKIN       (1<<12)
+#define CGLO_READEKIN       (1<<10)
 /* we need to reset the ekin rescaling factor here */
-#define CGLO_SCALEEKIN      (1<<13)
+#define CGLO_SCALEEKIN      (1<<11)
 
 
 /* return the number of steps between global communcations */
index 748c04fe62028337bb64d96d7ce3e8e9700fa76f..18d10ffb1f88243b54639e05c890d69d75c1b7e6 100644 (file)
 #ifndef _mdatoms_h
 #define _mdatoms_h
 
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-t_mdatoms *init_mdatoms(FILE *fp, gmx_mtop_t *mtop, gmx_bool bFreeEnergy);
+struct gmx_mtop_t;
+
+t_mdatoms *init_mdatoms(FILE *fp, struct gmx_mtop_t *mtop, gmx_bool bFreeEnergy);
 
-void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
+void atoms2md(struct gmx_mtop_t *mtop, t_inputrec *ir,
               int nindex, int *index,
               int homenr,
               t_mdatoms *md);
index 4516a07367860787a8e1b72642a58f73d34c0660..ef089de0aedffbc9a9d984a41d476ab13d1250d4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _mdebin_h
 #define _mdebin_h
 
-#include "typedefs.h"
-#include "sysstuff.h"
-#include "ebin.h"
-#include "../fileio/enxio.h"
-#include "types/state.h"
+#include <stdio.h>
+
+#include "gromacs/fileio/enxio.h"
+#include "gromacs/legacyheaders/ebin.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/state.h"
 
 #ifdef __cplusplus
 extern "C" {
index e8cb420bd9034fc29675312127115cc0ead20528..473a5af2fb3da20cbad2fe77f49b40de7026a870 100644 (file)
@@ -3,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,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.
 
 #include <stdio.h>
 #include <time.h>
-#include "typedefs.h"
-#include "network.h"
-#include "sim_util.h"
-#include "tgroup.h"
-#include "../fileio/filenm.h"
-#include "mshift.h"
-#include "mdebin.h"
-#include "vcm.h"
-#include "vsite.h"
-#include "update.h"
-#include "types/membedt.h"
-#include "types/globsig.h"
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/vcm.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/globsig.h"
+#include "gromacs/legacyheaders/types/membedt.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -60,7 +61,6 @@ extern "C" {
 #define MD_POLARISE       (1<<2)
 #define MD_RERUN          (1<<4)
 #define MD_RERUN_VSITE    (1<<5)
-#define MD_SEPPOT         (1<<7)
 #define MD_DDBONDCHECK    (1<<10)
 #define MD_DDBONDCOMM     (1<<11)
 #define MD_CONFOUT        (1<<12)
@@ -72,7 +72,6 @@ extern "C" {
 #define MD_STARTFROMCPT   (1<<18)
 #define MD_RESETCOUNTERSHALFWAY (1<<19)
 #define MD_TUNEPME        (1<<20)
-#define MD_TESTVERLET     (1<<22)
 #define MD_IMDWAIT        (1<<23)
 #define MD_IMDTERM        (1<<24)
 #define MD_IMDPULL        (1<<25)
@@ -163,6 +162,10 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
              const char *deviceOptions, int imdport, unsigned long Flags);
 /* Driver routine, that calls the different methods */
 
+void bcast_state(const struct t_commrec *cr, t_state *state);
+/* Broadcasts state from the master to all nodes in cr->mpi_comm_mygroup.
+ */
+
 #ifdef __cplusplus
 }
 #endif
index 424d69114dc15432c6bfaec66bbe5a1a7ee364e6..9f5039786c65dd56b0f53833e98df5dd5ad6e5f5 100644 (file)
@@ -39,7 +39,7 @@
 #define _names_h
 
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 8db571ea9c36902f880ea3b13cfa4da5daef71a1..0824c6576a231facc2500b714e8d371fc923cd88 100644 (file)
 
 #include <stdio.h>
 
-#include "types/simple.h"
-#include "typedefs.h"
-#include "main.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-t_commrec *init_commrec(void);
+struct gmx_domdec_t;
+struct gmx_multisim_t;
+struct t_commrec;
+
+struct t_commrec *init_commrec(void);
 /* Allocate, initialize and return the commrec. */
 
-t_commrec *reinitialize_commrec_for_this_thread(const t_commrec *cro);
+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
    the individual threads. Copies the original commrec to
    thread-local versions (a small memory leak results because we don't
    deallocate the old shared version).  */
 
-void gmx_fill_commrec_from_mpi(t_commrec *cr);
+void gmx_fill_commrec_from_mpi(struct t_commrec *cr);
 /* Continues t_commrec construction */
 
-int gmx_node_num(void);
-/* return the number of nodes in the ring */
-
-int gmx_node_rank(void);
-/* return the rank of the node */
-
-int gmx_physicalnode_id_hash(void);
-/* Return a non-negative hash that is, hopefully, unique for each physical node.
- * This hash is useful for determining hardware locality.
- */
-
-void gmx_setup_nodecomm(FILE *fplog, t_commrec *cr);
+void gmx_setup_nodecomm(FILE *fplog, struct t_commrec *cr);
 /* Sets up fast global communication for clusters with multi-core nodes */
 
-void gmx_init_intranode_counters(t_commrec *cr);
+void gmx_init_intranode_counters(struct t_commrec *cr);
 /* Initializes intra-physical-node MPI process/thread counts and ID. */
 
-gmx_bool gmx_mpi_initialized(void);
-/* return TRUE when MPI_Init has been called.
- * return FALSE when MPI_Init has not been called OR
- * when GROMACS was compiled without MPI support.
- */
-
-void gmx_barrier(const 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_bcast(int nbytes, void *b, const t_commrec *cr);
+void gmx_bcast(int nbytes, void *b, const struct t_commrec *cr);
 /* Broadcast nbytes bytes from the master to cr->mpi_comm_mygroup */
 
-void gmx_bcast_sim(int nbytes, void *b, const t_commrec *cr);
+void gmx_bcast_sim(int nbytes, void *b, const struct t_commrec *cr);
 /* Broadcast nbytes bytes from the sim master to cr->mpi_comm_mysim */
 
-void gmx_sumi(int nr, int r[], const t_commrec *cr);
+void gmx_sumi(int nr, int r[], const struct t_commrec *cr);
 /* Calculate the global sum of an array of ints */
 
-void gmx_sumli(int nr, gmx_int64_t r[], const t_commrec *cr);
+void gmx_sumli(int nr, gmx_int64_t r[], const struct t_commrec *cr);
 /* Calculate the global sum of an array of large ints */
 
-void gmx_sumf(int nr, float r[], const t_commrec *cr);
+void gmx_sumf(int nr, float r[], const struct t_commrec *cr);
 /* Calculate the global sum of an array of floats */
 
-void gmx_sumd(int nr, double r[], const t_commrec *cr);
+void gmx_sumd(int nr, double r[], const struct t_commrec *cr);
 /* Calculate the global sum of an array of doubles */
 
-void gmx_sumi_sim(int nr, int r[], const gmx_multisim_t *ms);
+void gmx_sumi_sim(int nr, int r[], const struct gmx_multisim_t *ms);
 /* Calculate the sum over the simulations of an array of ints */
 
-void gmx_sumli_sim(int nr, gmx_int64_t r[], const gmx_multisim_t *ms);
+void gmx_sumli_sim(int nr, gmx_int64_t r[], const struct gmx_multisim_t *ms);
 /* Calculate the sum over the simulations of an array of large ints */
 
-void gmx_sumf_sim(int nr, float r[], const gmx_multisim_t *ms);
+void gmx_sumf_sim(int nr, float r[], const struct gmx_multisim_t *ms);
 /* Calculate the sum over the simulations of an array of floats */
 
-void gmx_sumd_sim(int nr, double r[], const gmx_multisim_t *ms);
+void gmx_sumd_sim(int nr, double r[], const struct gmx_multisim_t *ms);
 /* Calculate the sum over the simulations of an array of doubles */
 
-void gmx_abort(int nodeid, int nnodes, int errorno);
-/* Abort the parallel run */
-
 #ifdef GMX_DOUBLE
 #define gmx_sum       gmx_sumd
 #define gmx_sum_sim   gmx_sumd_sim
@@ -134,6 +116,24 @@ void gmx_abort(int nodeid, int nnodes, int errorno);
 #define gmx_sum_sim   gmx_sumf_sim
 #endif
 
+gmx_bool gmx_fexist_master(const char *fname, struct t_commrec *cr);
+/* Return TRUE when fname exists, FALSE otherwise, bcast from master to others */
+
+void
+gmx_fatal_collective(int f_errno, const char *file, int line,
+                     const struct t_commrec *cr, struct gmx_domdec_t *dd,
+                     const char *fmt, ...);
+/* As gmx_fatal declared in utility/fatalerror.h,
+ * but only the master process prints the error message.
+ * This should only be called one of the following two situations:
+ * 1) On all nodes in cr->mpi_comm_mysim, with cr!=NULL,dd==NULL.
+ * 2) On all nodes in dd->mpi_comm_all,   with cr==NULL,dd!=NULL.
+ * This will call MPI_Finalize instead of MPI_Abort when possible,
+ * This is useful for handling errors in code that is executed identically
+ * for all processes.
+ */
+
+/* This doesn't currently work if enabled (needs some header cleanup). */
 #ifdef DEBUG_GMX
 #define debug_gmx() do { FILE *fp = debug ? debug : stderr; \
                          if (bDebugMode()) { fprintf(fp, "rank=%d, %s  %d\n", gmx_mpi_initialized() ? gmx_node_rank() : -1, __FILE__, __LINE__); } fflush(fp); } while (0)
index d05b3e5d7e32c2c2555cdc80c09c3c916b195386..3b7b75e949834f1445e052354918ab1b0d1389e0 100644 (file)
 #ifndef _nonbonded_h
 #define _nonbonded_h
 
-#include "typedefs.h"
-#include "pbc.h"
-#include "network.h"
-#include "tgroup.h"
-#include "genborn.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -51,8 +47,6 @@ extern "C" {
 } /* fixes auto-indentation problems */
 #endif
 
-
-
 void
 gmx_nonbonded_setup(t_forcerec *   fr,
                     gmx_bool       bGenericKernelOnly);
@@ -82,15 +76,6 @@ do_nonbonded(t_forcerec *fr,
              t_nrnb *nrnb, real *lambda, real dvdlambda[],
              int nls, int eNL, int flags);
 
-/* Calculate VdW/charge listed pair interactions (usually 1-4 interactions).
- * global_atom_index is only passed for printing error messages.
- */
-real
-do_nonbonded_listed(int ftype, int nbonds, const t_iatom iatoms[], const t_iparams iparams[],
-                    const rvec x[], rvec f[], rvec fshift[], const t_pbc *pbc, const t_graph *g,
-                    real *lambda, real *dvdl, const t_mdatoms *md, const t_forcerec *fr,
-                    gmx_grppairener_t *grppener, int *global_atom_index);
-
 #ifdef __cplusplus
 }
 #endif
index 464a57b4ead654e53846ca853f29eb485ec6078c..3a13daa04bc6c87742178c47dbbcfa89950274f8 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef _nrnb_h
 #define _nrnb_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -67,7 +67,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop);
  */
 
 void print_perf(FILE *out, double nodetime, double realtime,
-                gmx_int64_t nsteps, real delta_t,
+                gmx_int64_t nsteps, double delta_t,
                 double nbfs, double mflop);
 /* Prints the performance, nbfs and mflop come from print_flop */
 
index dafbfa9f6e7fe64e68da0df51d58d87663095ede..87b25de0f150c7daf09195f623dc29136f7d5c30 100644 (file)
 #define _ns_h
 
 #include <stdio.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "pbc.h"
-#include "tgroup.h"
-#include "network.h"
 
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -96,10 +94,6 @@ void dump_nblist(FILE *out, t_commrec *cr, t_forcerec *fr, int nDNL);
 int read_nblist(FILE *in, FILE *out, int **mat, int natoms, gmx_bool bSymm);
 /* Returns total number of neighbors. If bSymm the matrix is symmetrized. */
 
-int natoms_beyond_ns_buffer(t_inputrec *ir, t_forcerec *fr, t_block *cgs,
-                            matrix scale_tot, rvec *x);
-/* Returns the number of atoms that moved beyond the ns buffer */
-
 void reallocate_nblist(t_nblist *nl);
 /* List reallocation, only exported for Verlet scheme use with FEP */
 
index 833d034bf9dfd6896807545e231daa1bfc183502..728e887654fbdf0ffb5339cca0accea8911fbaed 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define   GRID_STDDEV_FAC  sqrt(3)
-#define NSGRID_STDDEV_FAC  2.0
-/*
- * GRID_STDDEV_FAC * stddev is used to estimate the interaction density.
- * sqrt(3) gives a uniform load for a rectangular block of cg's.
- * For a sphere it is not a bad approximation for 4x1x1 up to 4x2x2.
+/*! \brief Used when estimating the interaction density.
+ *
+ * GRID_STDDEV_FAC * stddev estimates the interaction density. The
+ * value sqrt(3) == 1.73205080757 gives a uniform load for a
+ * rectangular 3D block of charge groups. For a sphere, it is not a
+ * bad approximation for 4x1x1 up to 4x2x2.
  *
- * The extent of the neighborsearch grid is a bit larger than sqrt(3)
+ * \todo It would be nicer to use sqrt(3) here, when all code that
+ * includes this file is in C++, which will let us cope with the
+ * std::sqrt<T> on Windows. */
+static const real GRID_STDDEV_FAC = 1.73205080757;
+
+/*! \brief The extent of the neighborsearch grid is a bit larger than sqrt(3)
  * to account for less dense regions at the edges of the system.
  */
+static const real NSGRID_STDDEV_FAC = 2.0;
 
 #define NSGRID_SIGNAL_MOVED_FAC  4
 /* A cell index of NSGRID_SIGNAL_MOVED_FAC*ncells signals
index c8fdf66b7a05f59ebc42b3fc3df3cf5b1c2c6f3f..ade929e0815d51ed514701487a6ebe453b1248c0 100644 (file)
@@ -38,8 +38,8 @@
 #ifndef _oenv_h
 #define _oenv_h
 
-#include "types/simple.h"
-#include "types/oenv.h"
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -80,9 +80,6 @@ void output_env_done(output_env_t oenv);
 int output_env_get_verbosity(const output_env_t oenv);
 /* return the verbosity */
 
-int output_env_get_debug_level(const output_env_t oenv);
-/* return the debug level */
-
 const char *output_env_get_time_unit(const output_env_t oenv);
 /* return time unit (e.g. ps or ns) */
 
@@ -110,14 +107,10 @@ gmx_bool output_env_get_view(const output_env_t oenv);
 xvg_format_t output_env_get_xvg_format(const output_env_t oenv);
 /* Returns enum (see above) for xvg output formatting */
 
-const char *output_env_get_program_name(const output_env_t oenv);
-/* return the program name */
-
-const char *output_env_get_cmd_line(const output_env_t oenv);
-/* return the command line */
-
-const char *output_env_get_short_program_name(const output_env_t oenv);
-/* get the short version (without path component) of the program name */
+/*! \brief
+ * Returns display name for the currently running program.
+ */
+const char *output_env_get_program_display_name(const output_env_t oenv);
 
 #ifdef __cplusplus
 }
@@ -130,11 +123,18 @@ class ProgramContextInterface;
 void output_env_init(output_env_t *oenvp,
                      const gmx::ProgramContextInterface &context,
                      time_unit_t tmu, gmx_bool view, xvg_format_t xvg_format,
-                     int verbosity, int debug_level);
+                     int verbosity);
 /* initialize an output_env structure, setting the command line,
    the default time value a gmx_boolean view that is set to TRUE when the
    user requests direct viewing of graphs,
    the graph formatting type, the verbosity, and debug level */
+
+/*! \brief
+ * Returns gmx::ProgramContextInterface from an output_env structure.
+ */
+const gmx::ProgramContextInterface &
+output_env_get_program_context(const output_env_t oenv);
+
 #endif
 
 #endif
index deb1bfe7f121985f6bb818698052ec1f3bb4d6a9..ddf1475b3a58523aa59fbff3d13e3dceab0fee34 100644 (file)
 #ifndef _orires_h
 #define _orires_h
 
-#include "sysstuff.h"
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_pbc;
+
 void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
                  rvec x[],
                  const t_inputrec *ir,
@@ -57,7 +60,7 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
 real calc_orires_dev(const gmx_multisim_t *ms,
                      int nfa, const t_iatom fa[], const t_iparams ip[],
                      const t_mdatoms *md, const rvec x[],
-                     const t_pbc *pbc, t_fcdata *fcd, history_t *hist);
+                     const struct t_pbc *pbc, t_fcdata *fcd, history_t *hist);
 /*
  * Calculates the time averaged D matrices, the S matrix for each experiment.
  * Returns the weighted RMS deviation of the orientation restraints.
index 35d1ca3c7b8b0c27cbefe4c39cf57916e3a951ed..67b54dc46f044f09d78749e2e2317047bf6821c3 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _perf_est_h
 #define _perf_est_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int n_bonded_dx(gmx_mtop_t *mtop, gmx_bool bExcl);
+struct gmx_mtop_t;
+
+int n_bonded_dx(struct gmx_mtop_t *mtop, gmx_bool bExcl);
 /* Returns the number of pbc_rvec_sub calls required for bonded interactions.
  * This number is also roughly proportional to the computational cost.
  */
 
-float pme_load_estimate(gmx_mtop_t *mtop, t_inputrec *ir, matrix box);
+float pme_load_estimate(struct gmx_mtop_t *mtop, t_inputrec *ir, matrix box);
 /* Returns an estimate for the relative load of the PME mesh calculation
  * in the total force calculation.
  * This estimate is reasonable for recent Intel and AMD x86_64 CPUs.
index bc31efd1b16b565fad480733107788e795767ff2..d3b5839f86c3b81335118a570f94db75137843cd 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _QMMM_h
 #define _QMMM_h
 
-#include "typedefs.h"
-#include "pbc.h"
-#include "network.h"
-#include "tgroup.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 72f5b4ce1c2f1c880eb16786eace4d58d27c3217..fb0f7d6433847295410f87dcec78351f99b82d02 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _rbin_h
 #define _rbin_h
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "network.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_commrec;
+
 typedef struct {
     int     nreal;
     int     maxreal;
@@ -65,7 +65,7 @@ int add_binr(t_bin *b, int nr, real r[]);
 int add_bind(t_bin *b, int nr, double r[]);
 /* Add reals to the bin. Returns index */
 
-void sum_bin(t_bin *b, t_commrec *cr);
+void sum_bin(t_bin *b, struct t_commrec *cr);
 /* Globally sum the reals in the bin */
 
 void extract_binr(t_bin *b, int index, int nr, real r[]);
index 1c910ac01a9cba9706fede276e8d11998ec9f86e..29b7a65baede5abd32f87c38f36ba5c9539f34d5 100644 (file)
@@ -40,8 +40,8 @@
 
 #include <string.h>
 
-#include "typedefs.h"
-#include "warninp.h"
+#include "gromacs/legacyheaders/warninp.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
index 0c1126e8e5c8bee8c8875eea3e6c9769fd6204a4..47f0d994c9ac0bcc0268340c141f25d3e717cae6 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include "typedefs.h"
-#include "vsite.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_graph;
+
 /* Initialization function, also predicts the initial shell postions.
  * If x!=NULL, the shells are predict for the global coordinates x.
  */
@@ -64,7 +67,7 @@ int relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose,
                         tensor force_vir,
                         t_mdatoms *md,
                         t_nrnb *nrnb, gmx_wallcycle_t wcycle,
-                        t_graph *graph,
+                        struct t_graph *graph,
                         gmx_groups_t *groups,
                         gmx_shellfc_t shfc,
                         t_forcerec *fr,
index 03a6f6e9da5bddfd48b26d05a4bace15f668f763..b2531a67e97960e46bed9624b21b2b0006de4e7f 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,7 +40,7 @@
 
 #include <signal.h>
 
-#include "typedefs.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
index e5eb4685886dbf111cabe9e77311d85fdb7c9ad0..b1c89b790a9c63c410ff1869e5613b51925a4ac0 100644 (file)
 #ifndef _sim_util_h
 #define _sim_util_h
 
-#include "typedefs.h"
-#include "mdebin.h"
-#include "update.h"
-#include "vcm.h"
-#include "../fileio/enxio.h"
-#include "../fileio/mdoutf.h"
-#include "../timing/walltime_accounting.h"
+#include "gromacs/fileio/enxio.h"
+#include "gromacs/fileio/mdoutf.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/vcm.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_graph;
+
 typedef struct gmx_global_stat *gmx_global_stat_t;
 
 void do_pbc_first(FILE *log, matrix box, t_forcerec *fr,
-                  t_graph *graph, rvec x[]);
+                  struct t_graph *graph, rvec x[]);
 
 void do_pbc_first_mtop(FILE *fplog, int ePBC, matrix box,
                        gmx_mtop_t *mtop, rvec x[]);
@@ -106,13 +109,13 @@ void finish_run(FILE *log, t_commrec *cr,
                 t_inputrec *inputrec,
                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
-                wallclock_gpu_t *gputimes,
+                struct nonbonded_verlet_t *nbv,
                 gmx_bool bWriteStat);
 
 void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr);
 
-void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr,
-                   gmx_int64_t step, int natoms,
+void calc_dispcorr(t_inputrec *ir, t_forcerec *fr,
+                   int natoms,
                    matrix box, real lambda, tensor pres, tensor virial,
                    real *prescorr, real *enercorr, real *dvdlcorr);
 
@@ -137,6 +140,8 @@ void init_md(FILE *fplog,
              gmx_wallcycle_t wcycle);
 /* Routine in sim_util.c */
 
+gmx_bool use_GPU(const struct nonbonded_verlet_t *nbv);
+
 #ifdef __cplusplus
 }
 #endif
index 4453714bf5eb2fa28b344abafea5f4929f8b55e7..7db0fcf5ac7980f3fef758b988dd57e844193bd5 100644 (file)
 #ifndef _splitter_h
 #define _splitter_h
 
-#include "typedefs.h"
-#include "types/inputrec.h"
+#include <stdio.h>
+
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_blocka;
+struct t_idef;
+
 void gen_sblocks(FILE *fp, int at_start, int at_end,
-                 t_idef *idef, t_blocka *sblock,
+                 struct t_idef *idef, struct t_blocka *sblock,
                  gmx_bool bSettle);
 /* Generate shake blocks from the constraint list. Set bSettle to yes for shake
  * blocks including settles. You normally do not want this.
index 6f8695aea92f9f1a1ceca19c12f342e59c778f8e..a33250f4463462ace5b594368b21e509a18644cb 100644 (file)
@@ -35,8 +35,8 @@
 
 #ifndef _tables_h
 #define _tables_h
-#include "types/simple.h"
-#include "types/interaction_const.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
index f106f92fd687dd7c831c5af91f61ecedaf0d5790..64cc730fae1f95242f0497baf5e5ac1aaf8ae187 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,8 +38,8 @@
 #ifndef _tgroup_h
 #define _tgroup_h
 
-#include "typedefs.h"
-#include "network.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index ecf99a019fafc92a57ba0f8a0120910b8ce23774..c8a3a086b83b11421b89daa28736982812499b1c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,8 +40,9 @@
 
 
 #include <stdio.h>
-#include "typedefs.h"
-#include "../fileio/tpxio.h"
+
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index eb0b30b563c2d483007ebd35005b6e60da41838e..ad79e254bdc3ddcdbf1f9f2d7d84ccbc180cc382 100644 (file)
 #define NOTSET -12345
 
 #include <sys/types.h>
-#include "sysstuff.h"
-#include "types/simple.h"
-#include "types/enums.h"
-#include "types/block.h"
-#include "types/symtab.h"
-#include "types/idef.h"
-#include "types/atoms.h"
-#include "../fileio/trx.h"
-#include "types/topology.h"
-#include "types/energy.h"
-#include "types/inputrec.h"
-#include "types/ishift.h"
-#include "types/graph.h"
-#include "types/nrnb.h"
-#include "types/nblist.h"
-#include "types/nbnxn_pairlist.h"
-#include "types/nsgrid.h"
-#include "types/forcerec.h"
-#include "types/fcdata.h"
-#include "types/mdatom.h"
-#include "types/pbc.h"
-#include "types/ifunc.h"
-#include "types/group.h"
-#include "types/state.h"
-#include "types/shellfc.h"
-#include "types/constr.h"
-#include "types/matrix.h"
-#include "types/oenv.h"
+
+#include "gromacs/fileio/trx.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/energy.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/fcdata.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/group.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/nblist.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/nsgrid.h"
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/topology/topology.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/*
- * Memory (re)allocation can be VERY slow, especially with some
- * MPI libraries that replace the standard malloc and realloc calls.
- * To avoid slow memory allocation we use over_alloc to set the memory
- * allocation size for large data blocks. Since this scales the size
- * with a factor, we use log(n) realloc calls instead of n.
- * This can reduce allocation times from minutes to seconds.
- */
-/* This factor leads to 4 realloc calls to double the array size */
-#define OVER_ALLOC_FAC 1.19
-
-void set_over_alloc_dd(gmx_bool set);
-/* Turns over allocation for variable size atoms/cg/top arrays on or off,
- * default is off.
- */
-
-int over_alloc_dd(int n);
-/* Returns n when domain decomposition over allocation is off.
- * Returns OVER_ALLOC_FAC*n + 100 when over allocation in on.
- * This is to avoid frequent reallocation
- * during domain decomposition in mdrun.
- */
-
-/* Over allocation for small data types: int, real etc. */
-#define over_alloc_small(n) (int)(OVER_ALLOC_FAC*(n) + 8000)
-
-/* Over allocation for large data types: complex structs */
-#define over_alloc_large(n) (int)(OVER_ALLOC_FAC*(n) + 1000)
-
 int gmx_int64_to_int(gmx_int64_t step, const char *warn);
 /* Convert a gmx_int64_t value to int.
  * If warn!=NULL a warning message will be written
@@ -113,23 +76,9 @@ int gmx_int64_to_int(gmx_int64_t step, const char *warn);
  * "WARNING during %s:", where warn is printed in %s.
  */
 
-#define STEPSTRSIZE 22
-
-char *gmx_step_str(gmx_int64_t i, char *buf);
-/* Prints a gmx_int64_t value in buf and returns the pointer to buf.
- * buf should be large enough to contain i: STEPSTRSIZE (22) chars.
- * When multiple gmx_int64_t values are printed in the same printf call,
- * be sure to call gmx_step_str with different buffers.
- */
-
 /* Functions to initiate and delete structures *
  * These functions are defined in gmxlib/typedefs.c
  */
-void init_block(t_block *block);
-void init_blocka(t_blocka *block);
-void init_atom (t_atoms *at);
-void init_mtop(gmx_mtop_t *mtop);
-void init_top(t_topology *top);
 void init_inputrec(t_inputrec *ir);
 void init_energyhistory(energyhistory_t * enerhist);
 void done_energyhistory(energyhistory_t * enerhist);
@@ -139,16 +88,6 @@ t_state *serial_init_local_state(t_state *state_global);
 void init_df_history(df_history_t *dfhist, int nlambda);
 void done_df_history(df_history_t *dfhist);
 void copy_df_history(df_history_t * df_dest, df_history_t *df_source);
-
-void copy_blocka(const t_blocka *src, t_blocka *dest);
-
-void done_block(t_block *block);
-void done_blocka(t_blocka *block);
-void done_atom (t_atoms *at);
-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_top(t_topology *top);
 void done_inputrec(t_inputrec *ir);
 void done_state(t_state *state);
 
@@ -158,55 +97,9 @@ void set_box_rel(t_inputrec *ir, t_state *state);
 void preserve_box_shape(t_inputrec *ir, matrix box_rel, matrix b);
 /* Preserve the box shape, b can be box or boxv */
 
-void stupid_fill_block(t_block *grp, int natom, gmx_bool bOneIndexGroup);
-/* Fill a block structure with numbers identical to the index
- * (0, 1, 2, .. natom-1)
- * If bOneIndexGroup, then all atoms are  lumped in one index group,
- * otherwise there is one atom per index entry
- */
-
-void stupid_fill_blocka(t_blocka *grp, int natom);
-/* Fill a block structure with numbers identical to the index
- * (0, 1, 2, .. natom-1)
- * There is one atom per index entry
- */
-
-void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo);
-/* allocate memory for the arrays, set nr to natoms and nres to 0
- * set pdbinfo to NULL or allocate memory for it */
-
-t_atoms *copy_t_atoms(t_atoms *src);
-/* copy an atoms struct from src to a new one */
-
-void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra);
-/* allocate extra space for more atoms and or residues */
-
-void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, t_symtab *symtab,
-                         const char *resname, int resnr, unsigned char ic,
-                         int chainnum, char chainid);
-/* Set the residue name, number, insertion code and chain identifier
- * of atom index atom_ind.
- */
-
-void free_t_atoms(t_atoms *atoms, gmx_bool bFreeNames);
-/* Free all the arrays and set the nr and nres to 0.
- * bFreeNames tells if to free the atom and residue name strings,
- * don't free them if they still need to be used in e.g. the topology struct.
- */
-
-t_atoms *mtop2atoms(gmx_mtop_t *mtop);
-/* generate a t_atoms struct for the system from gmx_mtop_t */
-
 real max_cutoff(real cutoff1, real cutoff2);
 /* Returns the maximum of the cut-off's, taking into account that 0=inf. */
 
-/* Following are forward declarations for structures in commrec.h */
-typedef struct t_commrec t_commrec;
-typedef struct gmx_domdec_t gmx_domdec_t;
-typedef struct gmx_multisim_t gmx_multisim_t;
-typedef struct gmx_domdec_zones_t gmx_domdec_zones_t;
-typedef struct gmx_ddbox_t gmx_ddbox_t;
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gromacs/legacyheaders/types/CMakeLists.txt b/src/gromacs/legacyheaders/types/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ee38c56
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+# includes: Nothing to build, just installation
+file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
+list(REMOVE_ITEM HEADERS commrec.h)
+gmx_install_headers(${HEADERS})
index eaad7b4ead41f49b286ea1123f20baa479fb5996..cfc7669a2f1876d0bbd9b55985d4fe15c1ad97ea 100644 (file)
 #ifndef _commrec_h
 #define _commrec_h
 
-#include "../../utility/gmxmpi.h"
-#include "../typedefs.h"
-#include "idef.h"
+#include <stddef.h>
+
+#include "gromacs/legacyheaders/types/commrec_fwd.h" // IWYU pragma: export
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -269,12 +273,12 @@ struct t_commrec {
     gmx_nodecomm_t nc;
 
     /* For domain decomposition */
-    gmx_domdec_t *dd;
+    struct gmx_domdec_t *dd;
 
     /* The duties of this node, see the defines above */
-    int             duty;
+    int                    duty;
 
-    gmx_multisim_t *ms;
+    struct gmx_multisim_t *ms;
 
     /* these buffers are used as destination buffers if MPI_IN_PLACE isn't
        supported.*/
similarity index 80%
rename from src/gromacs/gmxlib/dlb.h
rename to src/gromacs/legacyheaders/types/commrec_fwd.h
index b730bd1473351d73d11afe85365f4944b48af7b7..2a0d88b20d3e8b2fcb6a45239432a802e3894fed 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _dlb_h
-#define _dlb_h
+#ifndef GMX_TYPES_COMMREC_FWD_H
+#define GMX_TYPES_COMMREC_FWD_H
 
-#include "typedefs.h"
+typedef struct t_commrec t_commrec;
+typedef struct gmx_domdec_t gmx_domdec_t;
+typedef struct gmx_multisim_t gmx_multisim_t;
+typedef struct gmx_domdec_zones_t gmx_domdec_zones_t;
+typedef struct gmx_ddbox_t gmx_ddbox_t;
 
-extern void count_nb(t_commrec *cr, t_nsborder *nsb, t_block *cgs, int nns,
-                     int nlr, t_idef *idef, int ngner);
-
-#endif  /* _dlb_h */
+#endif
index 8fce52bb48b8e07ce9988bee1bb2d429ec465842..f11a130f48cd3271d97364d0cd0880bd68537d06 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include "simple.h"
+#ifndef GMX_TYPES_ENERGY_H
+#define GMX_TYPES_ENERGY_H
+
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,3 +53,5 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+
+#endif
index 4b1161a4fa7d10e1b68a355778a64e9fd8c2ec65..8756469d3dd5a19057e7b2acb2ca4e33b30f2216 100644 (file)
@@ -346,7 +346,7 @@ enum {
 /* flat-bottom posres geometries */
 enum {
     efbposresZERO, efbposresSPHERE, efbposresCYLINDER, efbposresX, efbposresY, efbposresZ,
-    efbposresNR
+    efbposresCYLINDERX, efbposresCYLINDERY, efbposresCYLINDERZ, efbposresNR
 };
 
 enum {
index 2c9d605e27ac45a5b109f70c74fad956316b11d0..bde3a322263be7187711aa61884ade468d7e19bb 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _fcdata_h
 #define _fcdata_h
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -98,6 +102,12 @@ typedef struct {
     double **v;
 } t_oriresdata;
 
+typedef struct {
+    int   n;      /* n+1 is the number of points */
+    real  scale;  /* distance between two points */
+    real *data;   /* the actual table data, per point there are 4 numbers */
+} bondedtable_t;
+
 /*
  * Data struct used in the force calculation routines
  * for storing the tables for bonded interactions and
index 51c9382fa5e20372bcff437752308c1402c71648..b8fd1743cbaa912f80f7bfd8875f5356e9361fc9 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,8 +54,8 @@ extern "C" {
 #define GMX_FORCE_NS           (1<<2)
 /* Update long-range neighborlists */
 #define GMX_FORCE_LRNS         (1<<3)
-/* Calculate bonded energies/forces */
-#define GMX_FORCE_BONDED       (1<<4)
+/* Calculate listed energies/forces (e.g. bonds, restraints, 1-4, FEP non-bonded) */
+#define GMX_FORCE_LISTED       (1<<4)
 /* Store long-range forces in a separate array */
 #define GMX_FORCE_SEPLRF       (1<<5)
 /* Calculate non-bonded energies/forces */
@@ -72,7 +72,7 @@ extern "C" {
 #define GMX_FORCE_DO_LR        (1<<11)
 
 /* Normally one want all energy terms and forces */
-#define GMX_FORCE_ALLFORCES    (GMX_FORCE_BONDED | GMX_FORCE_NONBONDED | GMX_FORCE_FORCES)
+#define GMX_FORCE_ALLFORCES    (GMX_FORCE_LISTED | GMX_FORCE_NONBONDED | GMX_FORCE_FORCES)
 
 
 #ifdef __cplusplus
index 71ffd993e1ff8b366906ce9f800f92c0c614ca8b..49f32af748a5fc8812fbf94992fbb0ccb36ec900 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include "ns.h"
-#include "genborn.h"
-#include "qmmmrec.h"
-#include "idef.h"
-#include "nb_verlet.h"
-#include "interaction_const.h"
-#include "hw_info.h"
+#ifndef GMX_LEGACYHEADERS_TYPES_FORCEREC_H
+#define GMX_LEGACYHEADERS_TYPES_FORCEREC_H
+
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/genborn.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/nblist.h"
+#include "gromacs/legacyheaders/types/ns.h"
+#include "gromacs/legacyheaders/types/qmmmrec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,8 +59,7 @@ extern "C" {
 
 /* Abstract type for PME that is defined only in the routine that use them. */
 typedef struct gmx_pme *gmx_pme_t;
-
-
+struct nonbonded_verlet_t;
 
 /* Structure describing the data in a single table */
 typedef struct
@@ -176,22 +182,10 @@ typedef struct {
 } cginfo_mb_t;
 
 
-/* ewald table type */
-typedef struct ewald_tab *ewald_tab_t;
+/* Forward declaration of type for managing Ewald tables */
+struct gmx_ewald_tab_t;
 
-typedef struct {
-    rvec             *f;
-    int               f_nalloc;
-    unsigned          red_mask; /* Mask for marking which parts of f are filled */
-    rvec             *fshift;
-    real              ener[F_NRE];
-    gmx_grppairener_t grpp;
-    real              Vcorr_q;
-    real              Vcorr_lj;
-    real              dvdl[efptNR];
-    tensor            vir_q;
-    tensor            vir_lj;
-} f_thread_t;
+typedef struct f_thread_t f_thread_t;
 
 typedef struct {
     interaction_const_t *ic;
@@ -295,7 +289,6 @@ typedef struct {
     real     sc_r_power;
     real     sc_sigma6_def;
     real     sc_sigma6_min;
-    gmx_bool bSepDVDL;
 
     /* NS Stuff */
     int  eeltype;
@@ -315,13 +308,13 @@ typedef struct {
     rvec        *shift_vec;
 
     /* The neighborlists including tables */
-    int                 nnblists;
-    int                *gid2nblists;
-    t_nblists          *nblists;
+    int                        nnblists;
+    int                       *gid2nblists;
+    t_nblists                 *nblists;
 
-    int                 cutoff_scheme; /* group- or Verlet-style cutoff */
-    gmx_bool            bNonbonded;    /* true if nonbonded calculations are *not* turned off */
-    nonbonded_verlet_t *nbv;
+    int                        cutoff_scheme; /* group- or Verlet-style cutoff */
+    gmx_bool                   bNonbonded;    /* true if nonbonded calculations are *not* turned off */
+    struct nonbonded_verlet_t *nbv;
 
     /* The wall tables (if used) */
     int            nwall;
@@ -362,10 +355,10 @@ typedef struct {
     tensor    vir_lj_recip;
 
     /* PME/Ewald stuff */
-    gmx_bool    bEwald;
-    real        ewaldcoeff_q;
-    real        ewaldcoeff_lj;
-    ewald_tab_t ewald_table;
+    gmx_bool                bEwald;
+    real                    ewaldcoeff_q;
+    real                    ewaldcoeff_lj;
+    struct gmx_ewald_tab_t *ewald_table;
 
     /* Virial Stuff */
     rvec *fshift;
@@ -499,3 +492,4 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+#endif
index 6edf3d75e87ddf0b06f8e83fb19c3c7a9deb5c9e..cfc9b4709ec39989469bae7037aaab7e515832df 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#ifndef GMX_LEGACYHEADERS_TYPES_GENBORN_H
+#define GMX_LEGACYHEADERS_TYPES_GENBORN_H
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include "simple.h"
-
 typedef struct
 {
     int  nbonds;
@@ -113,3 +116,4 @@ gmx_genborn_t;
 #ifdef __cplusplus
 }
 #endif
+#endif
index 37ede0475328b9be3875652a03c9c4d1ed573da4..2c515eca153c15ce319e45e70a3f1559cc2b979b 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,7 +52,7 @@ extern "C" {
    data). This means that the only meaningful values are positive,
    negative or zero. */
 enum {
-    eglsNABNSB, eglsCHKPT, eglsSTOPCOND, eglsRESETCOUNTERS, eglsNR
+    eglsCHKPT, eglsSTOPCOND, eglsRESETCOUNTERS, eglsNR
 };
 
 typedef struct {
diff --git a/src/gromacs/legacyheaders/types/graph.h b/src/gromacs/legacyheaders/types/graph.h
deleted file mode 100644 (file)
index 67cc57a..0000000
+++ /dev/null
@@ -1,74 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 _types_graph_h
-#define _types_graph_h
-
-#include "idef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-typedef enum {
-    egcolWhite, egcolGrey, egcolBlack, egcolNR
-} egCol;
-
-typedef struct {
-    int          at0;       /* The first atom the graph was constructed for */
-    int          at1;       /* The last atom the graph was constructed for */
-    int          nnodes;    /* The number of nodes, nnodes=at_end-at_start     */
-    int          nbound;    /* The number of nodes with edges          */
-    int          at_start;  /* The first connected atom in this graph  */
-    int          at_end;    /* The last+1 connected atom in this graph */
-    int         *nedge;     /* For each node the number of edges               */
-    atom_id    **edge;      /* For each node, the actual edges (bidirect.)     */
-    gmx_bool     bScrewPBC; /* Screw boundary conditions                    */
-    ivec        *ishift;    /* Shift for each particle                  */
-    int          negc;
-    egCol       *egc;       /* color of each node */
-} t_graph;
-
-
-#define SHIFT_IVEC(g, i) ((g)->ishift[i])
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _types_graph_h */
index 89decf94a292f65b6672d4b2d1d21bd2e251fb19..1ad37bad7ffcc97a9a0f7ec39d829372ea975a1b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_LEGACYHEADERS_TYPES_GROUP_H
+#define GMX_LEGACYHEADERS_TYPES_GROUP_H
 
-
-#include "simple.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -90,3 +93,5 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+
+#endif
index d8f51a89fc3ad3cce5aa834aeaa17cb9572417b0..0a8bb4913ff525542e735e4bf7884af22091bc28 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,9 +36,9 @@
 #ifndef HWINFO_H
 #define HWINFO_H
 
-#include "simple.h"
-#include "nbnxn_cuda_types_ext.h"
-#include "../gmx_cpuid.h"
+#include "gromacs/legacyheaders/gmx_cpuid.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -98,11 +98,13 @@ enum {
 /* GPU device selection information -- for now with only CUDA devices */
 typedef struct
 {
-    char     *gpu_id;        /* GPU id's to use, each specified as chars */
-    gmx_bool  bUserSet;      /* true if the GPUs in cuda_dev_use are manually provided by the user */
+    char     *gpu_id;               /* GPU id's to use, each specified as chars */
+    gmx_bool  bUserSet;             /* true if the GPUs in cuda_dev_use are manually provided by the user */
 
-    int       ncuda_dev_use; /* number of device (IDs) selected to be used */
-    int      *cuda_dev_use;  /* device index list providing GPU to PP rank mapping, GPUs can be listed multiple times when ranks share them */
+    int       ncuda_dev_compatible; /* number of compatible GPU devices that could be used */
+    int      *cuda_dev_compatible;  /* array of compatible GPU device IDs, from which automatic selection occurs */
+    int       ncuda_dev_use;        /* number of GPU devices selected to be used, either by the user or automatically */
+    int      *cuda_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;
 
 /* Threading and GPU options, can be set automatically or by the user */
index 7e3cc7cad0a4c9fadcfb71028ab9c9c84ffcad18..25d13c6f58e4544ab69c4e6acfc9e4eff0123d93 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _ifunc_h
 #define _ifunc_h
 
-#include "idef.h"
-#include "mdatom.h"
-#include "fcdata.h"
-#include "graph.h"
-#include "pbc.h"
+#include "gromacs/legacyheaders/types/fcdata.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/topology/idef.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_graph;
+struct t_pbc;
 
 typedef real t_ifunc (int nbonds, const t_iatom iatoms[],
                       const t_iparams iparams[],
                       const rvec x[], rvec f[], rvec fshift[],
-                      const t_pbc *pbc, const t_graph *g,
+                      const struct t_pbc *pbc, const struct t_graph *g,
                       real lambda, real *dvdlambda,
                       const t_mdatoms *md, t_fcdata *fcd,
                       int *ddgatindex);
index 10fa0da0d3e38b70a139ce5731528ee6adba2666..cbfc3e31109eee0e3cc6cd2d17896abf3d4cc6c9 100644 (file)
@@ -3,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,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.
 #ifndef _inputrec_h_
 #define _inputrec_h_
 
+#include <stdio.h>
 
-#include "simple.h"
-#include "enums.h"
-#include "../sysstuff.h"
-#include "../../swap/enums.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/swap/enums.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -283,7 +283,7 @@ typedef struct {
 } t_IMD;
 
 /* Abstract types for position swapping only defined in swapcoords.c */
-typedef struct swap *gmx_swapcoords_t;
+typedef struct t_swap *gmx_swapcoords_t;
 
 typedef struct {
     int              nstswap;           /* Every how many steps a swap is attempted?    */
index 1f1a50ae63c69ad57508c92702ed3d79808edbed..319d6c2a61995b79fcac08c7636bdf1c863d9658 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _INTERACTION_CONST_
-#define _INTERACTION_CONST_
+#ifndef GMX_LEGACYHEADERS_INTERACTION_CONST_H
+#define GMX_LEGACYHEADERS_INTERACTION_CONST_H
+
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -133,4 +135,4 @@ typedef struct {
 }
 #endif
 
-#endif /* _INTERACTION_CONST_ */
+#endif
index 08a2ff54906f203c7883047098d1fa9147d22c17..34179fa88b6a8b83cf6e9702b23a4c4dfee0cb50 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef _mdatom_h
 #define _mdatom_h
 
-#include "simple.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
index f0a8fb9e17f067dff6f7d9a868f90f64547b25bd..af83fa4214cb7fca25109fdb140b91c8c1242d5a 100644 (file)
@@ -133,8 +133,6 @@ typedef struct
 t_nrnb;
 
 
-typedef struct gmx_wallcycle *gmx_wallcycle_t;
-
 #ifdef __cplusplus
 }
 #endif
index 0a01994a217c5bdc1d8b14ad360ae547d5caaff2..e141407525bdb105ca80a144d4d046fbe0e0e217 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include "nsgrid.h"
-#include "nblist.h"
+#ifndef GMX_LEGACYHEADERS_TYPES_NS_H
+#define GMX_LEGACYHEADERS_TYPES_NS_H
+
+#include "gromacs/legacyheaders/types/nblist.h"
+#include "gromacs/legacyheaders/types/nsgrid.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -82,3 +85,4 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+#endif
index 9bcf048eab5365b402211fed629666b699721277..90c6d11d476e2753717cdec585ac3675a0fe05f6 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 #define _nsgrid_h
 
 
-#include "simple.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/gromacs/legacyheaders/types/pbc.h b/src/gromacs/legacyheaders/types/pbc.h
deleted file mode 100644 (file)
index 29419e7..0000000
+++ /dev/null
@@ -1,74 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 _pbc_h
-#define _pbc_h
-
-
-#include "simple.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Maximum number of combinations of single triclinic box vectors
- * required to shift atoms that are within a brick of the size of
- * the diagonal of the box to within the maximum cut-off distance.
- */
-#define MAX_NTRICVEC 12
-
-typedef struct {
-    int        ePBC;
-    int        ndim_ePBC;
-    int        ePBCDX;
-    int        dim;
-    matrix     box;
-    rvec       fbox_diag;
-    rvec       hbox_diag;
-    rvec       mhbox_diag;
-    real       max_cutoff2;
-    gmx_bool   bLimitDistance;
-    real       limit_distance2;
-    int        ntric_vec;
-    ivec       tric_shift[MAX_NTRICVEC];
-    rvec       tric_vec[MAX_NTRICVEC];
-} t_pbc;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index ac8d18536d7683ad9a61f05bd502db1b6531685b..7bbd8806e04bb0de1d8a251aa0ba783a7b859140 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#ifndef GMX_LEGACYHEADERS_TYPES_QMMMREC_H
+#define GMX_LEGACYHEADERS_TYPES_QMMMREC_H
 
-#include "simple.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -109,3 +111,4 @@ typedef struct {
 #ifdef __cplusplus
 }
 #endif
+#endif
similarity index 87%
rename from src/gromacs/legacyheaders/sysstuff.h
rename to src/gromacs/legacyheaders/types/rgb.h
index 7eeb69738cfe1c5b29eb67a8f9ca7fb2d7ed1b98..f754da9231ee1922622783a27253a83beee1cc0e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_LEGACYHEADERS_TYPES_RGB_H
+#define GMX_LEGACYHEADERS_TYPES_RGB_H
 
-#ifndef _sysstuff_h
-#define _sysstuff_h
+#include "gromacs/utility/real.h"
 
-#ifndef _386_
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-#include <errno.h>
-#include <signal.h>
-#include <limits.h>
-#include <time.h>
+typedef struct {
+    real r, g, b;
+} t_rgb;
 
-#endif  /* _sysstuff_h */
+#endif
index de1ebdcb77865105721847e8926eb4158ac4eef7..ec8e23a860a1793dc1b7906a330dbccf41e952b5 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 _simple_h
 #define _simple_h
 
-/* Information about integer data type sizes */
-#include <limits.h>
-#define __STDC_LIMIT_MACROS
-#include <stdint.h>
-#ifndef _MSC_VER
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
-
-#define XX      0           /* Defines for indexing in */
-#define YY      1           /* vectors                 */
-#define ZZ      2
-#define DIM     3           /* Dimension of vectors            */
-#define XXXX    0           /* defines to index matrices */
-#define XXYY    1
-#define XXZZ    2
-#define YYXX    3
-#define YYYY    4
-#define YYZZ    5
-#define ZZXX    6
-#define ZZYY    7
-#define ZZZZ    8
-
-/* There is no standard size for 'bool' in C++, so when
- * we previously defined it to int for C code the data types
- * (and structs) would have different size depending on your compiler,
- * both at gromacs build time and when you use the library.
- * The only way around this is to NOT assume anything about the C++ type,
- * so we cannot use the name 'bool' in our C code anymore.
- */
-
-typedef int gmx_bool;
-
-#ifndef FALSE
-#  define FALSE   0
-#endif
-#ifndef TRUE
-#  define TRUE    1
-#endif
-#define BOOL_NR 2
-
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 typedef int         atom_id;      /* To indicate an atoms id         */
 #define NO_ATID     (atom_id)(~0) /* Use this to indicate invalid atid */
 
-/*! \brief Double precision accuracy */
-#define GMX_DOUBLE_EPS   2.2204460492503131e-16
-
-/*! \brief Maximum double precision value - reduced 1 unit in last digit for MSVC */
-#define GMX_DOUBLE_MAX   1.7976931348623157e+308
-
-/*! \brief Minimum double precision value */
-#define GMX_DOUBLE_MIN   2.2250738585072014e-308
-
-/*! \brief Single precision accuracy */
-#define GMX_FLOAT_EPS    1.19209290e-07F
-
-/*! \brief Maximum single precision value - reduced 1 unit in last digit for MSVC */
-#define GMX_FLOAT_MAX    3.40282346E+38F
-
-/*! \brief Minimum single precision value */
-#define GMX_FLOAT_MIN    1.175494351E-38F
-
-#ifdef __PGI
-/* The portland group x86 C/C++ compilers do not treat negative zero initializers
- * correctly, but "optimizes" them to positive zero, so we implement it explicitly.
- * These constructs are optimized to simple loads at compile time. If you want to
- * use them on other compilers those have to support gcc preprocessor extensions.
- * Note: These initializers might be sensitive to the endianness (which can
- * be different for byte and word order), so check that it works for your platform
- * and add a separate section if necessary before adding to the ifdef above.
- */
-#    define GMX_DOUBLE_NEGZERO  ({ const union { int  di[2]; double d; } _gmx_dzero = {0, -2147483648}; _gmx_dzero.d; })
-#    define GMX_FLOAT_NEGZERO   ({ const union { int  fi; float f; } _gmx_fzero = {-2147483648}; _gmx_fzero.f; })
-#else
-/*! \brief Negative zero in double */
-#    define GMX_DOUBLE_NEGZERO  (-0.0)
-
-/*! \brief Negative zero in float */
-#    define GMX_FLOAT_NEGZERO   (-0.0f)
-#endif
-
-
-/* Check whether we already have a real type! */
-#ifdef GMX_DOUBLE
-
-#ifndef HAVE_REAL
-typedef double      real;
-#define HAVE_REAL
-#endif
-
-#define GMX_MPI_REAL      MPI_DOUBLE
-#define GMX_REAL_EPS      GMX_DOUBLE_EPS
-#define GMX_REAL_MIN      GMX_DOUBLE_MIN
-#define GMX_REAL_MAX      GMX_DOUBLE_MAX
-#define GMX_REAL_NEGZERO  GMX_DOUBLE_NEGZERO
-#define gmx_real_fullprecision_pfmt "%21.14e"
-#else
-
-#ifndef HAVE_REAL
-typedef float           real;
-#define HAVE_REAL
-#endif
-
-#define GMX_MPI_REAL      MPI_FLOAT
-#define GMX_REAL_EPS      GMX_FLOAT_EPS
-#define GMX_REAL_MIN      GMX_FLOAT_MIN
-#define GMX_REAL_MAX      GMX_FLOAT_MAX
-#define GMX_REAL_NEGZERO  GMX_FLOAT_NEGZERO
-#define gmx_real_fullprecision_pfmt "%14.7e"
-#endif
-
-typedef real            rvec[DIM];
-
-typedef double          dvec[DIM];
-
-typedef real            matrix[DIM][DIM];
-
-typedef real            tensor[DIM][DIM];
-
-typedef int             ivec[DIM];
-
-typedef int             imatrix[DIM][DIM];
-
-#ifdef _MSC_VER
-typedef __int32 gmx_int32_t;
-#define GMX_PRId32 "I32d"
-#define GMX_SCNd32 "I32d"
-
-typedef __int64 gmx_int64_t;
-#define GMX_PRId64 "I64d"
-#define GMX_SCNd64 "I64d"
-
-typedef unsigned __int32 gmx_uint32_t;
-#define GMX_PRIu32 "I32u"
-#define GMX_SCNu32 "I32u"
-
-typedef unsigned __int64 gmx_uint64_t;
-#define GMX_PRIu64 "I64u"
-#define GMX_SCNu64 "I64u"
-#else
-typedef int32_t gmx_int32_t;
-#define GMX_PRId32 PRId32
-#define GMX_SCNd32 SCNd32
-
-typedef int64_t gmx_int64_t;
-#define GMX_PRId64 PRId64
-#define GMX_SCNd64 SCNd64
-
-typedef uint32_t gmx_uint32_t;
-#define GMX_PRIu32 PRIu32
-#define GMX_SCNu32 SCNu32
-
-typedef uint64_t gmx_uint64_t;
-#define GMX_PRIu64 PRIu64
-#define GMX_SCNu64 SCNu64
-#endif
-
-#define GMX_INT32_MAX INT32_MAX
-#define GMX_INT32_MIN INT32_MIN
-
-#define GMX_INT64_MAX INT64_MAX
-#define GMX_INT64_MIN INT64_MIN
-
-#define GMX_UINT32_MAX UINT32_MAX
-#define GMX_UINT32_MIN UINT32_MIN
-
-#define GMX_UINT64_MAX UINT64_MAX
-#define GMX_UINT64_MIN UINT64_MIN
-
-#if !defined __cplusplus && _MSC_VER
-#define gmx_inline __inline
-#else
-/* C++ or C99 */
-#define gmx_inline inline
-#endif
-
-/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
- * Any other compiler can be added here. We cannot
- * use restrict because it is in C99 but not in C++ */
-#define gmx_restrict __restrict
-
-/*
- * These attributes suppress compiler warnings about unused function arguments
- * by marking them as possibly unused. Some arguments are unused but
- * have to be retained to preserve a function signature
- * that must match that of another function.
- * Some arguments are only used in *some* code paths (e.g. MPI)
- */
-
-#ifndef gmx_unused
-#ifdef __GNUC__
-/* GCC, clang, and some ICC pretending to be GCC */
-#  define gmx_unused __attribute__ ((unused))
-#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && !defined(_MSC_VER)
-/* ICC on *nix */
-#  define gmx_unused __attribute__ ((unused))
-#elif defined(__PGI)
-/* Portland group compilers */
-#  define gmx_unused __attribute__ ((unused))
-#elif defined _MSC_VER
-/* MSVC */
-#  define gmx_unused /*@unused@*/
-#elif defined(__xlC__)
-/* IBM */
-#  define gmx_unused __attribute__ ((unused))
-#else
-#  define gmx_unused
-#endif
-#endif
-
-/* Standard sizes for char* string buffers */
-#define STRLEN 4096
-#define BIG_STRLEN 1048576
-
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 3418ab189b81ca89527314572a8f90577ab01423..05b9135fe2610c2e6325998eef62e1fe4090db80 100644 (file)
@@ -38,8 +38,8 @@
 #define _state_h_
 
 
-#include "simple.h"
-#include "../../swap/enums.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/swap/enums.h"
 
 #ifdef __cplusplus
 extern "C" {
index e589e725d1153725e64b17708d5983b2934cb3cf..8f3230da2b24252c65b1c2fe708b6523a22813e3 100644 (file)
 #ifndef _update_h
 #define _update_h
 
-#include "typedefs.h"
-#include "mshift.h"
-#include "tgroup.h"
-#include "network.h"
-#include "vec.h"
-
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_graph;
+
 /* Abstract type for stochastic dynamics */
 typedef struct gmx_update *gmx_update_t;
 
@@ -112,11 +112,10 @@ void update_constraints(FILE             *fplog,
                         gmx_int64_t       step,
                         real             *dvdlambda, /* FEP stuff */
                         t_inputrec       *inputrec,  /* input record and box stuff     */
-                        gmx_ekindata_t   *ekind,
                         t_mdatoms        *md,
                         t_state          *state,
                         gmx_bool          bMolPBC,
-                        t_graph          *graph,
+                        struct t_graph   *graph,
                         rvec              force[], /* forces on home particles */
                         t_idef           *idef,
                         tensor            vir_part,
@@ -126,8 +125,7 @@ void update_constraints(FILE             *fplog,
                         gmx_update_t      upd,
                         gmx_constr_t      constr,
                         gmx_bool          bFirstHalf,
-                        gmx_bool          bCalcVir,
-                        real              vetanew);
+                        gmx_bool          bCalcVir);
 
 /* Return TRUE if OK, FALSE in case of Shake Error */
 
@@ -137,14 +135,13 @@ void update_box(FILE             *fplog,
                 t_mdatoms        *md,
                 t_state          *state,
                 rvec              force[], /* forces on home particles */
-                matrix           *scale_tot,
                 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, gmx_bool bSaveOld);
+                  gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel);
 /*
  * Compute the partial kinetic energy for home particles;
  * will be accumulated in the calling routine.
index affebb924fa492e5f3eae6a5325d7e5d37c64b64..aaab02a8064f1da9e803286123fcfbde1c9f5367 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _vcm_h
 #define _vcm_h
 
-#include "sysstuff.h"
-#include "typedefs.h"
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_groups_t;
 
 typedef struct {
     int        nr;             /* Number of groups                    */
@@ -61,7 +67,7 @@ typedef struct {
     char     **group_name;     /* These two are copies to pointers in */
 } t_vcm;
 
-t_vcm *init_vcm(FILE *fp, gmx_groups_t *groups, t_inputrec *ir);
+t_vcm *init_vcm(FILE *fp, struct gmx_groups_t *groups, t_inputrec *ir);
 
 /* Do a per group center of mass things */
 void calc_vcm_grp(int start, int homenr, t_mdatoms *md,
index 04fad52e556a0a1224e79ccdbcd89d0e12a65b1c..e63616706a6cbab38da29270002b5eabe3ee7d2a 100644 (file)
 #ifndef _viewit_h
 #define _viewit_h
 
-#include "typedefs.h"
-#include "../fileio/filenm.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/types/oenv.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-
 void do_view(const output_env_t oenv, const char *fn, const char *opts);
 /* forks off appropriate command to view file.
  * currently eps, xpm, xvg and pdb are supported
index d6b453e3b236cb1a5106118511a463331c7d4e52..6cbecbe391848c82ca8ece2979f755eff43458da 100644 (file)
@@ -39,7 +39,9 @@
 #define _vsite_h
 
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/pbcutil/ishift.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -64,6 +66,8 @@ typedef struct {
     int                 th_ind_nalloc;        /* Size of th_ind                          */
 } gmx_vsite_t;
 
+struct t_graph;
+
 void construct_vsites(gmx_vsite_t *vsite,
                       rvec x[],
                       real dt, rvec v[],
@@ -91,7 +95,7 @@ void spread_vsite_f(gmx_vsite_t *vsite,
                     rvec x[], rvec f[], rvec *fshift,
                     gmx_bool VirCorr, matrix vir,
                     t_nrnb *nrnb, t_idef *idef,
-                    int ePBC, gmx_bool bMolPBC, t_graph *g, matrix box,
+                    int ePBC, gmx_bool bMolPBC, struct t_graph *g, matrix box,
                     t_commrec *cr);
 /* Spread the force operating on the vsite atoms on the surrounding atoms.
  * If fshift!=NULL also update the shift forces.
index be7c8a71cfff6c2f43afd3e9fdf059f9aae107b8..cd3f32c84aa2ed2ec4a11d01cdb04dde8556b288 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 #ifndef _warninp_h
 #define _warninp_h
 
-#include "typedefs.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
index c88b1cb20a62097be9782aef5031578c402e4bf5..a3dc979e09b53dbd28eb747c59a46078309351f4 100644 (file)
@@ -1,12 +1,11 @@
 libdir=@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@
-includedir=@CMAKE_INSTALL_PREFIX@/@INCL_INSTALL_DIR@
 
 Name: libgromacs@GMX_LIBS_SUFFIX@
 Description: Gromacs library
 URL: http://www.gromacs.org
-Version: @PROJECT_VERSION@
+Version: @GMX_VERSION_STRING@
 Requires: @PKG_FFT@ @PKG_XML@
 Libs.private: @CMAKE_THREAD_LIBS_INIT@ @PKG_DL_LIBS@ @OpenMP_LINKER_FLAGS@
 Libs: -L${libdir} -lgromacs@GMX_LIBS_SUFFIX@ @PKG_FFT_LIBS@ -lm
-Cflags: -I${includedir} @PKG_CFLAGS@
+Cflags: @PKG_CFLAGS@
 
index 6a8cc1925555255a37a1cec2069fbf2d6b1cd24d..c0c1ed82f44b9724e2493b0d88d4caffb0f0f7f3 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -48,9 +48,8 @@ set(LINEARALGEBRA_SOURCES
 set(LIBGROMACS_SOURCES
     ${LIBGROMACS_SOURCES} ${LINEARALGEBRA_SOURCES} PARENT_SCOPE)
 
-set(LINEARALGEBRA_PUBLIC_HEADERS
+gmx_install_headers(
     eigensolver.h
     matrix.h
-    mtxio.h
-    sparsematrix.h)
-gmx_install_headers(linearalgebra ${LINEARALGEBRA_PUBLIC_HEADERS})
+    sparsematrix.h
+    )
index a0221be3c7a95407a2eb791659687c6223aaa21f..7d3f0d875492d0510704d645a0c41d1dace2e168 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.
  */
-#include "eigensolver.h"
+#include "gmxpre.h"
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "eigensolver.h"
 
 #include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "gmx_lapack.h"
 #include "gmx_arpack.h"
+#include "gmx_lapack.h"
 
 void
 eigensolver(real *   a,
index 38f880bddf46f21ddb5c6c20b75c44aaec0e0155..0c2b97d92d0cc43330f681e47a4bc0ccc214be91 100644 (file)
@@ -37,9 +37,8 @@
 #ifndef GMX_LINEARALGEBRA_EIGENSOLVER_H
 #define GMX_LINEARALGEBRA_EIGENSOLVER_H
 
-#include "../legacyheaders/types/simple.h"
-
-#include "sparsematrix.h"
+#include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 31894a1c9dbc30ddda0c19b5a55c9c9e8b17a2ca..287f0da282b4839c90b2ed69ee27114b5326c2a8 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2004 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 "gmx_arpack.h"
+
 #include <math.h>
 #include <string.h>
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gmx_arpack.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
 #include "gmx_blas.h"
 #include "gmx_lapack.h"
+
 static void
 F77_FUNC(dstqrb, DSTQRB) (int *      n,
                           double *   d__,
index 1c4fe34384eb035aeab84710b32ba08919bfddb8..dcf556fe0c06c3c85ccdd336c0447a17bc629228 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2004 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,9 +50,7 @@
 #ifndef GMX_ARPACK_H
 #define GMX_ARPACK_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
index 4da2847e69f10f32161d043c2ab778797a321832..991cf8b2e6b1ce8baaaf64f6c487a34afb9dcb6b 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 /*! \cond */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
-/* Suppress Cygwin compiler warnings from using newlib version of
- * ctype.h */
-#ifdef GMX_CYGWIN
-#undef toupper
-#endif
+/* These are not required by this file, but by the internal BLAS
+ * implementation.  In principle, they could be included in each file
+ * that requires them, but this is simpler.  Since the header is internal
+ * to the linearyalgebra/ module, the added complexity may not be worth it. */
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 5aa2340e0e4fa3c9ae627f87385d08f0ab497317..31e7139c5d8f588c4cc34adf80af4fdb0e46518d 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 
index 782d3dcff0d051ea532c297e901ede75f59441c5..124c778626f525ce12bcb7c8cc10547a2c241155 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 #include <ctype.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 
index 6b3b3a4d60793ad6b25c61edce353cae7cc54090..926b53e48023d4d4a37801e4f2bb7c32c0700fc3 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 
index 45d93784be19f8f9e51655c69ddd8fdcdbd48357..251d810c17db8866b25e635e9d71eaa6bd541bb7 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 double
index 0fa6d0fc8bb3def233147440cc077d64b7da2167..1e0b0244ae3888671146bd59ded7146f06b86655 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 4c5290fcb659bdd462f60e95e1bd57d020a0cb59..508f3b29b7b2be71160ea6658a455bee5b05b6d8 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 
index 7fe83d92791d1b2f3769a94d7d61e28649106ae4..e863f5b56cfff88820da32474187cf3ec299b21a 100644 (file)
@@ -2,7 +2,7 @@
 #include <ctype.h>
 
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 71c43bc74471ac141564eefeae355ca6acb948cd..d6ca04250c27fce365314fc1b0b7f1b837da146b 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 
index 959015f80a4a0a330223c42db83ed8858c7337aa..bb3909a8a37acb1070c9aa59c249266f1f4944fd 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void 
index 45d04987b7514b29d2a7204eb917bfca37d32231..52b89b7bf07e4c6985dfbf6e2827ba50bb89462e 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 7b4bb05a6217dc7e5d36fada83e47651b7f444e4..1904f2020734bf36e60731c9ab4d214586d987d9 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index b9a3b5a5884c36e549d8959927cd3f35f0c463ed..1447cd291afee58b70acfa52891ddc07b9e722ce 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index ca7e55806928a69e4fdb3aca83e42bdacb0d7e3f..71947e7222fc4b0e781335502d1969ad7c22304c 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index eaa5cd592133783eed71eebf2d0ed1e5780ef933..bbe11bc76e49b73a3993ee961ac3912512b3a322 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 float
index 8f245dd17749b273f81dd94f71a177b2e848d9fd..579ead06c79d112fe6fcdc16e5b2d1ba0680b432 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 #include <ctype.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 2a9080512dba3d1d55f70180697b7ce70db92249..022ca0908878791d739062f7ac2021bce5c70056 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 1dfae8fcfbb5f419d161256f5229824b8e7b5ae8..335206c72b2523eeed0e2fb2359095a5b6efcded 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 39c9f5b43ceae5e9e9190d6eedfaf5ee8b08f250..7fd95a5489095ff82a7d87b3ce33e0f6d03a1b33 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void 
index 485df5a2854c2ecb9b73f8866d8ab660eeabbef8..41b661c67b332ce4b9741694b5b9d983a68eddae 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void 
index 1b1d57585a6ada4536368541668987bba45f053f..61aaaaba060b4ee1163ea792a1cab8d1d08838bb 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_blas.h"
 
 void
index 36072b70f89100270484b139de1a4f03f6ccfbfc..b29535a6e5194b2251fefaf483ac071ef69ad76f 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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 /*! \cond */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
-/* Suppress Cygwin compiler warnings from using newlib version of
- * ctype.h */
-#ifdef GMX_CYGWIN
-#undef toupper
-#endif
+/* These are not required by this file, but by the internal LAPACK
+ * implementation.  In principle, they could be included in each file
+ * that requires them, but this is simpler.  Since the header is internal
+ * to the linearyalgebra/ module, the added complexity may not be worth it. */
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index d28eccf3afb125d525bece22150cea4d9fe474c8..c51fca591fdcba6f3be8a5e6d24c50fae6834498 100644 (file)
@@ -4,7 +4,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dbdsdc,DBDSDC)(const char *uplo, 
index 3d1cc191af16820f0aa58f31755d7347ad930015..be772eba61039542d9581b7394dbc115de464ee1 100644 (file)
@@ -4,7 +4,7 @@
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(dbdsqr,DBDSQR)(const char *uplo,
index af54358689e6cb5b154076a0ab27a0ea3870d510..b7ab54b67ede4ca06d959efdbd9fa7329ce3cb7e 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 2a0faca7f2f2125e5ea72adec142e57660eb6947..c4b9ee401a33de587751987872f7c34e8ccd6fd7 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index d29b6eee629f98359dc67ffda67c5aa57733eba0..8753f4d0628c0b0da742ac676dcfb2c313ebea9d 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dlaed6,DLAED6)(int *kniter, 
index 66bda5f6d08801358800c48952785fdae61c7b77..56e0c9b98bf38d958898c4bb91716b463f5f1b53 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 
index b8635f549f388efefc18f2aa94cee5ec9419d66d..5214cece641711586475f9ae617d68b11c6e9d76 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index 3f784285884f9775378ff45d9ba53098deb0fb26..09dad0d76a421743d67b6e94e0c49d0b37cbcdb9 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index bb03ffed69ba5b255bb33cd162c7db327ac415e5..d8b59d2fa399a30ceb6a639f8bc877a3d207970f 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 double
 F77_FUNC(dlapy2,DLAPY2)(double * x, double * y)
index 940c62bb19993def2a62f0004dc6c90df02c2e4f..67c9a56f57cd02303ef924e4793de9aa9583d738 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index 7a158cd8fcb967d01da05645b90914e864176722..f8414f6244d68820126315f01f0482557c7d02ca 100644 (file)
@@ -4,7 +4,7 @@
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dlarf,DLARF)(const char *side,
index 030755479e4086d37993e0b1a4b56e9256262f91..ff9bfbe297563e61ecdb30a813bdfaa03d4cf9aa 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 950074cacda6fde6d5178d668c68dd8cdbb00f83..43897c0cf5bdb448c56f4aef06a944252975de34 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 3c4c8b46d84ddd6a5147c1bc9570aff4ef5d346b..bfe4304cd29d74df1e0dbf429ad13144a04350cc 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index e8998f83ab354f312e701fde34eeb68a07fef19e..fc48340a0d5254e3bccfa4dba932bf2f3df5c809 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 #include <ctype.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index cc4d67006dd3aa7ad742735bb21a0955829ad287..35b6a13a08f280e238fe29fd1e3740fa0534d644 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index a9c21bd53dd80ef392ac9c9a4d0692727f794e39..378f21db16e3bca9fdb5315ca58c1a183a3aa2da 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 0e51c5092bc5ba21441597afc03066d207577e7f..92ae0b19ed6b878a91748c4ca87e377fc2a38071 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dlartg,DLARTG)(double *f,
index ba6fe95b269093b289042b9d802f054df8fd49e7..c86f060626e4f266272ae3f70bdf23341a82d91e 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 
index 0cd9aa83ac43a16001aca71e4a34f7c601f3582c..8605da41f6969d1d759bc8c2a208be4475374ca0 100644 (file)
@@ -1,6 +1,6 @@
 #include <ctype.h>
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index 1c87fd9131d87c50392630a3c94fc3f641a45884..613919a7e89df74089eac4501f05b13b3bb4aba5 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(dlasd2,DLASD2)(int *nl, 
index 778a64e8c187c5839719ace183bd5571df089664..d5130dfe9b6f93393aee19b20778dc588800749e 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(dlasd4,DLASD4)(int *n, 
index 23657fa4e2cc8518787a5472159945997feb5433..04c40a65a61c337190721de1916fdab7eacdbde3 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 9a11b8dcee6d795b956e142c52bc34f43750a5a5..569245e7a78b3f5eea5fa9c29b81616904066afa 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dlasq1,DLASQ1)(int *n,
index 4da15558bbe99165b8888cd1554bc745d828dc68..fd82c33d7399c28806b53e3d6676de595831fc08 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #ifdef _MSC_VER
 #pragma warning(disable: 4723) /*division by zero - is used on purpose here*/
index d9ba8eec5838ca9e50aebbff36f7b8b5b068c637..ccd05b1d747787ead344a442cf7ad8acf0999d39 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index 1b24e4a921997ddfe48783c63cb74fb99b4560d8..a9830da008a014b66003f436d334f4c1d408e085 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 
index 3c5cca66bca4db1b2db9e2f1912e6b6aedcabfa4..f06101991fcc2bd7bcf647a0c9a8182b63bd01ba 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(dlasq6,DLASQ6)(int *i0, 
index c265865e4dd108cc64c3d2bafb43e1cb159abd20..dbec294b530fc8d1013008daf9c20d73ba3af8a7 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_lapack.h"
 
 void 
index 300d46c24cd656c4ec86de49d2777cc0b2c22c04..74b22ae67b2d5e10ec8c024d0ee47661503c605e 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_lapack.h"
 
 void
index 7f74ebdde0ab49a12b8c8f5be5817c5b31f02ca4..fc89932cb708cfe2cbb0be34153a1c00c530c6ed 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(dlasv2,DLASV2)(double *f, 
index c02cf834107e306490c0289194bc4cf4a1f5dbb3..b50a1f489ed955d48c9ea082b787e707a89709f3 100644 (file)
@@ -1,6 +1,6 @@
 #include <ctype.h>
 #include "../gmx_lapack.h"
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dorml2,DORML2)(const char *side,
index 0cfd2fa1e36a50f744ad9d00f152bb19ac1ebd66..7cb421e826248e1208100840afd140f74b6655e3 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dstebz,DSTEBZ)(const char *range, 
index 1e2128f0750d1d34c241dfdcb223242638b8e0ea..dbfa8eb7e3e554e24254d9762ed46633841b3b5e 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dstegr,DSTEGR)(const char *jobz, 
index c46d8ca30126e6d28c1c7b675bb5f6e8a232f0bd..52a3e2437bdde233da8bdc8d87d011d200e521b8 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dstein,DSTEIN)(int *n, 
index b7e10363dcffc4f9259233922206cf346046b6db..ead523ba54df4a718473e62113caf1e02d26fbf6 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 71f2e3dd48086989766f25b53c6b3db141fe8ce6..ba43f6dfc8d2ac0086e66306342685f28f39900c 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dsterf,DSTERF)(int *n, 
index 4397832c70722d66578fef4131e5318f455713ba..379c9c94cdff8c6838c687296fdea0343da281f4 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 2e36d03af7a4d294193eb5e1199e448e87da7056..32eb8880f468928a6d6126921fa5388ea336fb20 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 5caebbccb64444d3f79d26b67b78ac49f874f81c..d561269688b9016861e26ecc42933658da4b5511 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(dtrtri,DTRTRI)(const char *uplo,
index 43c00d42dd6840310bae71b95f4fdb742d7372df..f9800626965adbed49d90f6d37aecaac920c6b8d 100644 (file)
@@ -4,7 +4,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(sbdsdc,SBDSDC)(const char *uplo, 
index 702194077006c55bec2bf8434b4a6e1cafe15586..6ba0b466dccf4673fc21ab06c4213a15242094f3 100644 (file)
@@ -4,7 +4,7 @@
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(sbdsqr,SBDSQR)(const char *uplo,
index caad379763ebed1ef740c109bc94ded1b5e1c3e7..48693e9917f4bdc922fb5669476aeff574056a3f 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 
 #include "../gmx_blas.h"
index fc38a8108756300853b5348f17a94c4ddc7ccdd3..4fdce16c8821ee2bf2cf26c33f8a48f6c7b6f3ac 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 20cc211ae9e80d243e5962f9ffb9cdf2e9db36fb..5bb1c4935f41d9d615b777e54d2eb2747ac088d0 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(slaed6,SLAED6)(int *kniter, 
index c47ba0a13f9420a01a9c95ab8909576b9deb2575..9a84c3d6116de39b6b1ac26d3e30268e60d7f279 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 
index 27d096ffa54238cd58cedcc391f9068220fd856e..924a1bcd504f776f915795010a8712b502c7a037 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index ff03ff732de3a3417653f8771ab5f92ab190577f..2b8beb751c78bfd28b47eb61e940ff7575965541 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index e5ba0629a59335e211f7daaf0b4f0a916f7750fa..e7391db05fda7d4fd523e7eab5b282ffad780e87 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 float
 F77_FUNC(slapy2,SLAPY2)(float * x, float * y)
index 8eb82c8a7580f781a1411f5c4e229e0a354bfcad..be09d642a3f55b095d2ab5c69c255375297440b8 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index c822defce0c2ac42ee8337fb26c5fd3270c7a6e2..ee3a03598c23bb406ee280f94cd3f6239a4ce628 100644 (file)
@@ -4,7 +4,7 @@
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(slarf,SLARF)(const char *side,
index 35f3a25e59a2e397913ec11d57b855e0dfbd9774..4ea03cae3012de6759b8d25971b66886b3ac314a 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 9a3b6bff4e1acb9a3606d33bb2f0d57ef8441257..4e6b9a5db0e9116c464bfe70c65b28fe27567b4c 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 2b658263af64b0a556c91fbf9c7108eaf55b9c43..33f2e431fdb6dbe79495e796aac837b1e4388721 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index 9006e506afb3bfab212527a884729da5e88675df..07028ef00d1f6d47bbf200ecf0e176f8b6e42925 100644 (file)
@@ -1,7 +1,7 @@
 #include <math.h>
 #include <ctype.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 9b6565a1e061fee313677ca4ce772d13b796b5bf..65c906d7d342c0d70538b05716321b70d60559ec 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index efc1124b19630a501da4304af3823e0142211f71..296d99bf7f8c87b2c6bcdc88129a3bb1366bd772 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 3ea6a462458a9cb2ec00458123ef00395f8202a4..79f7c20fe9d1e5aa43da12b904728cb1613c1949 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(slartg,SLARTG)(float *f,
index bddecad3ea012c96033076b0f8f3f83848f41120..c660aa8a0d79b160fed1537d868c2cd4bf1ecc79 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 
index 18048e1c23170c4cffd83e6b2dbb80d71b759dc9..e454fc6034111f7c305265ccf3d747bfba9c995e 100644 (file)
@@ -1,6 +1,6 @@
 #include <ctype.h>
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index 4d683f79043873a3e89dbc3e1a3a85b50019ea5b..2f016ff4de1be275997e1b21501e6c43d55a4262 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(slasd2,SLASD2)(int *nl, 
index e87252834ef9294de04f0fed9b83117ab2fac3fe..194a949cf01d2d5be703bfe03efd8542478dd447 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(slasd4,SLASD4)(int *n, 
index 7a70a786640f624c799625f00a55187ed787e470..40e8fed595349802acd6605ab82b8e1c5c198546 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index ac899e8abfa5aaaee37a44fc45b5427bca5b00fb..8aeb32ed0fdd6d78d6a2da7fd5475ac3947930ca 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(slasq1,SLASQ1)(int *n,
index 1f0b32bd18f0eee4820e6ed11c4f45b51b77bf63..14bb265582329ba0c6c05004a7700dce41adbba6 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #ifdef _MSC_VER
 #pragma warning(disable: 4723) /*division by zero - is used on purpose here*/
index 8a8095687f2b26270bb7a348f9bd1a2b425e1eda..0bc291d58ee90e9feee84505cf4d1c5ed81a503e 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
index cc27e42ccd1a73f32b03f906df9dde9ae8bcb9f5..91a13be2b773fdec3eb3385b02f89fddef201eca 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_lapack.h"
 
index 38aae9b9da046e13cc8b79697aa66c3be7de913c..15e24f36a88021259f16a89c325d4121f03bb31d 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(slasq6,SLASQ6)(int *i0, 
index b3c3d8fc842410e652d5f5d0691587bb9d951000..f897011baeb1e551462bb0f1cf484f89b43944e3 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_lapack.h"
 
 void 
index b38ea32a25416f0873da8201e4b6197fa68c1c57..bd6462bb1c27f5a6c3a891a5070a5831df62fa25 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_lapack.h"
 
 void
index 969d7851b99c882d1d6371cb76c1d5fbc2ac584b..84fcefa5cd59ef9e0f8799c1eabf2a478a3c7b7f 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void 
 F77_FUNC(slasv2,SLASV2)(float *f, 
index 7694ed44bfea1c8c702f61cbc597679d6b597007..3d0cd6cf87347fbcd5b6add3e6bce477d639e231 100644 (file)
@@ -1,5 +1,5 @@
 #include <ctype.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 #include "../gmx_lapack.h"
 
 void
index 8b9a8da4889009047868c3a7f1c7df52ba30e9e4..863315bd793db1d12a76fb27bb3f42db89044902 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(sstebz,SSTEBZ)(const char *range, 
index bb4012fae0889dbb9edd804afe4f3210968b6b4f..f2d0cfcb917a885c91751599183457f84baf5ce2 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(sstegr,SSTEGR)(const char *jobz, 
index 29f4cdaaa4ee36db136ae8b26a5ac98dc73baf45..998cbd5069aa8148947ff6babb638f5223d283a3 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(sstein,SSTEIN)(int *n, 
index b6834d3912d554f7c210822b33328380c98f17d1..8d83e3b52b949b2f63a4b2127d68bd332f3ac705 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 8834a31c1f724919e7f0e0cb7bc9850697139a79..277aae9fa1acc97ab198cf7efeac95280c280906 100644 (file)
@@ -2,7 +2,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(ssterf,SSTERF)(int *n, 
index 0db349e1c8264bc256026ae7633ba5d29f44a695..83a079611ec6b6d29c0d817e666688d1ed8f4724 100644 (file)
@@ -1,6 +1,6 @@
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 1f035401314d28ed36d8aa524513a1ab9d84822a..5b719704dfe207b7c2077c444f09ef53726f2a8c 100644 (file)
@@ -1,7 +1,7 @@
 #include <ctype.h>
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 #include "../gmx_blas.h"
 #include "../gmx_lapack.h"
index 5d000c61b3a83df7a137b1a84ef1ea138e4972b5..15b1aaa68b8d5a47a32902a5ff28d275dd4c20c5 100644 (file)
@@ -3,7 +3,7 @@
 #include "../gmx_lapack.h"
 #include "lapack_limits.h"
 
-#include "types/simple.h"
+#include "gromacs/utility/real.h"
 
 void
 F77_FUNC(strtri,STRTRI)(const char *uplo,
index ccbd22ec19a4e4b248ee3ad7ac60a8498040cf28..e646067ed735cc0f013eebe90ea61e66f405465a 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.
  */
+#include "gmxpre.h"
+
 #include "matrix.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <stdio.h>
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/vec.h"
-
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "gmx_lapack.h"
@@ -239,7 +237,7 @@ double multi_regression(FILE *fp, int nrow, double *y, int ncol,
         {
             ax += a0[i]*a[j][i];
         }
-        chi2 += sqr(y[j]-ax);
+        chi2 += (y[j] - ax) * (y[j] - ax);
     }
 
     sfree(atx);
index b5cf7066b4612f26ce79b0962fa8621b6c8a9329..2b023bcd79e84cf36381c4ae022723a1e46aa6e4 100644 (file)
  * 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 "nrjac.h"
 
 #include <math.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 static gmx_inline
index 9e2f625bee5dee231591d51b45eae7db803a51a7..007f3f800dbfe8c264c685c84198e75a2b8b94d9 100644 (file)
@@ -37,7 +37,7 @@
 #ifndef GMX_LINEARALGEBRA_NRJAC_H
 #define GMX_LINEARALGEBRA_NRJAC_H
 
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index d2bb9495f4bc84340a2637f0df45305830b10f93..5b2405c3de99bcefac6c790027f0cd23cfd49e39 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.
  */
+#include "gmxpre.h"
+
 #include "sparsematrix.h"
 
 #include <assert.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "gromacs/utility/smalloc.h"
 
index 7d5d1b125f12a66dfd1965f946f28315b2d899f5..04731f0181fce3403d000db382478eeba3dc069c 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,8 @@
 
 #include <stdio.h>
 
-#include "../legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 75%
rename from cmake/gmxTestCatamount.cmake
rename to src/gromacs/listed-forces/CMakeLists.txt
index 6b1dbd566777191290589cc359f80971b9a673b3..f56c61cb81c9e4d161b427546d5d3a8453289573 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2013, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # 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 function to check we are compiling for CRAY XT catamount
-#
-#  GMX_TEST_CATAMOUNT(VARIABLE)
-#
-#  VARIABLE will be set to true if we are compiling for catamount
-#
+file(GLOB LISTED_FORCES_SOURCES *.cpp)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${LISTED_FORCES_SOURCES} PARENT_SCOPE)
+
+gmx_install_headers(listed-forces.h)
 
-function(GMX_TEST_CATAMOUNT VARIABLE)
-    include(CheckCSourceCompiles)
-    check_c_source_compiles(
-        "int
-main()
-{
-#if defined __QK_USER__
-  return 0;
-#else
-#  error not catamount
-#endif
-}" CATAMOUNT_COMPILE_OK)
-    set(${VARIABLE} ${CATAMOUNT_COMPILE_OK} PARENT_SCOPE)
-endfunction()
+if (BUILD_TESTING)
+#    add_subdirectory(tests)
+endif()
similarity index 79%
rename from src/gromacs/gmxlib/bondfree.c
rename to src/gromacs/listed-forces/bonded.cpp
index 0eb8d55791b983c0b5909786b7dffdb1c5ef462a..63604f20321f0f7af10fdd56611f31ee5de48be9 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+/*! \internal \file
+ *
+ * \brief This file defines low-level functions necessary for
+ * computing energies and forces for listed interactions.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "bonded.h"
 
-#include <math.h>
 #include <assert.h>
-#include "physics.h"
-#include "vec.h"
-#include "gromacs/math/utilities.h"
-#include "txtdump.h"
-#include "bondf.h"
-#include "gromacs/utility/smalloc.h"
-#include "pbc.h"
-#include "ns.h"
-#include "macros.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "mshift.h"
-#include "main.h"
-#include "disre.h"
-#include "orires.h"
-#include "force.h"
-#include "nonbonded.h"
-#include "restcbt.h"
 
+#include <cmath>
+
+#include <algorithm>
+
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/simd_math.h"
 #include "gromacs/simd/vector_operations.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
-/* Find a better place for this? */
+#include "listed-internal.h"
+#include "pairs.h"
+#include "restcbt.h"
+
+/*! \brief Mysterious CMAP coefficient matrix */
 const int cmap_coeff_matrix[] = {
     1, 0, -3,  2, 0, 0,  0,  0, -3,  0,  9, -6,  2,  0, -6,  4,
     0, 0,  0,  0, 0, 0,  0,  0,  3,  0, -9,  6, -2,  0,  6, -4,
@@ -84,23 +89,9 @@ const int cmap_coeff_matrix[] = {
 };
 
 
-
-int glatnr(int *global_atom_index, int i)
-{
-    int atnr;
-
-    if (global_atom_index == NULL)
-    {
-        atnr = i + 1;
-    }
-    else
-    {
-        atnr = global_atom_index[i] + 1;
-    }
-
-    return atnr;
-}
-
+/*! \brief Compute dx = xi - xj, modulo PBC if non-NULL
+ *
+ * \todo This kind of code appears in many places. Consolidate it */
 static int pbc_rvec_sub(const t_pbc *pbc, const rvec xi, const rvec xj, rvec dx)
 {
     if (pbc)
@@ -129,7 +120,7 @@ typedef struct {
     gmx_simd_real_t bxx;
 } pbc_simd_t;
 
-/* Set the SIMD pbc data from a normal t_pbc struct */
+/*! \brief Set the SIMD pbc data from a normal t_pbc struct */
 static void set_pbc_simd(const t_pbc *pbc, pbc_simd_t *pbc_simd)
 {
     rvec inv_bdiag;
@@ -169,7 +160,7 @@ static void set_pbc_simd(const t_pbc *pbc, pbc_simd_t *pbc_simd)
     }
 }
 
-/* Correct distance vector *dx,*dy,*dz for PBC using SIMD */
+/*! \brief Correct distance vector *dx,*dy,*dz for PBC using SIMD */
 static gmx_inline void
 pbc_dx_simd(gmx_simd_real_t *dx, gmx_simd_real_t *dy, gmx_simd_real_t *dz,
             const pbc_simd_t *pbc)
@@ -191,10 +182,9 @@ pbc_dx_simd(gmx_simd_real_t *dx, gmx_simd_real_t *dy, gmx_simd_real_t *dz,
 
 #endif /* GMX_SIMD_HAVE_REAL */
 
-/*
- * Morse potential bond by Frank Everdij
+/*! \brief Morse potential bond
  *
- * Three parameters needed:
+ * By Frank Everdij. Three parameters needed:
  *
  * b0 = equilibrium distance in nm
  * be = beta in nm^-1 (actually, it's nu_e*Sqrt(2*pi*pi*mu/D_e))
@@ -203,7 +193,6 @@ pbc_dx_simd(gmx_simd_real_t *dx, gmx_simd_real_t *dy, gmx_simd_real_t *dz,
  * Note: the potential is referenced to be +cb at infinite separation
  *       and zero at the equilibrium distance!
  */
-
 real morse_bonds(int nbonds,
                  const t_iatom forceatoms[], const t_iparams forceparams[],
                  const rvec x[], rvec f[], rvec fshift[],
@@ -278,6 +267,7 @@ real morse_bonds(int nbonds,
     return vtot;
 }
 
+//! \cond
 real cubic_bonds(int nbonds,
                  const t_iatom forceatoms[], const t_iparams forceparams[],
                  const rvec x[], rvec f[], rvec fshift[],
@@ -351,7 +341,7 @@ real FENE_bonds(int nbonds,
     const real half = 0.5;
     const real one  = 1.0;
     real       bm, kb;
-    real       dr, dr2, bm2, omdr2obm2, fbond, vbond, fij, vtot;
+    real       dr2, bm2, omdr2obm2, fbond, vbond, fij, vtot;
     rvec       dx;
     int        i, m, ki, type, ai, aj;
     ivec       dt;
@@ -751,7 +741,6 @@ real water_pol(int nbonds,
         kk[YY] = sqr(qS)*ONE_4PI_EPS0/forceparams[type0].wpol.al_y;
         kk[ZZ] = sqr(qS)*ONE_4PI_EPS0/forceparams[type0].wpol.al_z;
         r_HH   = 1.0/forceparams[type0].wpol.rHH;
-        r_OD   = 1.0/forceparams[type0].wpol.rOD;
         if (debug)
         {
             fprintf(debug, "WPOL: qS  = %10.5f aS = %5d\n", qS, aS);
@@ -875,7 +864,7 @@ static real do_1_thole(const rvec xi, const rvec xj, rvec fi, rvec fj,
                        rvec fshift[], real afac)
 {
     rvec r12;
-    real r12sq, r12_1, r12n, r12bar, v0, v1, fscal, ebar, fff;
+    real r12sq, r12_1, r12bar, v0, v1, fscal, ebar, fff;
     int  m, t;
 
     t      = pbc_rvec_sub(pbc, xi, xj, r12);                      /*  3 */
@@ -914,9 +903,10 @@ real thole_pol(int nbonds,
                int gmx_unused *global_atom_index)
 {
     /* Interaction between two pairs of particles with opposite charge */
-    int  i, type, a1, da1, a2, da2;
-    real q1, q2, qq, a, al1, al2, afac;
-    real V = 0;
+    int        i, type, a1, da1, a2, da2;
+    real       q1, q2, qq, a, al1, al2, afac;
+    real       V             = 0;
+    const real minusOneOnSix = -1.0/6.0;
 
     for (i = 0; (i < nbonds); )
     {
@@ -931,7 +921,7 @@ real thole_pol(int nbonds,
         al1   = forceparams[type].thole.alpha1;
         al2   = forceparams[type].thole.alpha2;
         qq    = q1*q2;
-        afac  = a*pow(al1*al2, -1.0/6.0);
+        afac  = a*pow(al1*al2, minusOneOnSix);
         V    += do_1_thole(x[a1], x[a2], f[a1], f[a2], pbc, qq, fshift, afac);
         V    += do_1_thole(x[da1], x[a2], f[da1], f[a2], pbc, -qq, fshift, afac);
         V    += do_1_thole(x[a1], x[da2], f[a1], f[da2], pbc, -qq, fshift, afac);
@@ -1047,10 +1037,10 @@ real angles(int nbonds,
 
 #ifdef GMX_SIMD_HAVE_REAL
 
-/* As angles, but using SIMD to calculate many dihedrals at once.
+/* As angles, but using SIMD to calculate many angles at once.
  * This routines does not calculate energies and shift forces.
  */
-static gmx_inline void
+void
 angles_noener_simd(int nbonds,
                    const t_iatom forceatoms[], const t_iparams forceparams[],
                    const rvec x[], rvec f[],
@@ -1716,10 +1706,9 @@ do_dih_fup_noshiftf(int i, int j, int k, int l, real ddphi,
                     rvec m, rvec n, rvec f[])
 {
     rvec f_i, f_j, f_k, f_l;
-    rvec uvec, vvec, svec, dx_jl;
+    rvec uvec, vvec, svec;
     real iprm, iprn, nrkj, nrkj2, nrkj_1, nrkj_2;
     real a, b, p, q, toler;
-    ivec jt, dt_ij, dt_kj, dt_lj;
 
     iprm  = iprod(m, m);       /*  5    */
     iprn  = iprod(n, n);       /*  5   */
@@ -1921,7 +1910,7 @@ void make_dp_periodic(real *dp)  /* 1 flop? */
 }
 
 /* As pdihs above, but without calculating energies and shift forces */
-static void
+void
 pdihs_noener(int nbonds,
              const t_iatom forceatoms[], const t_iparams forceparams[],
              const rvec x[], rvec f[],
@@ -1977,7 +1966,7 @@ pdihs_noener(int nbonds,
 #ifdef GMX_SIMD_HAVE_REAL
 
 /* As pdihs_noner above, but using SIMD to calculate many dihedrals at once */
-static void
+void
 pdihs_noener_simd(int nbonds,
                   const t_iatom forceatoms[], const t_iparams forceparams[],
                   const rvec x[], rvec f[],
@@ -1989,10 +1978,9 @@ pdihs_noener_simd(int nbonds,
     const int             nfa1 = 5;
     int                   i, iu, s;
     int                   type, ai[GMX_SIMD_REAL_WIDTH], aj[GMX_SIMD_REAL_WIDTH], ak[GMX_SIMD_REAL_WIDTH], al[GMX_SIMD_REAL_WIDTH];
-    real                  ddphi;
     real                  dr_array[3*DIM*GMX_SIMD_REAL_WIDTH+GMX_SIMD_REAL_WIDTH], *dr;
     real                  buf_array[7*GMX_SIMD_REAL_WIDTH+GMX_SIMD_REAL_WIDTH], *buf;
-    real                 *cp, *phi0, *mult, *phi, *p, *q, *sf_i, *msf_l;
+    real                 *cp, *phi0, *mult, *p, *q;
     gmx_simd_real_t       phi0_S, phi_S;
     gmx_simd_real_t       mx_S, my_S, mz_S;
     gmx_simd_real_t       nx_S, ny_S, nz_S;
@@ -2013,8 +2001,6 @@ pdihs_noener_simd(int nbonds,
     mult  = buf + 2*GMX_SIMD_REAL_WIDTH;
     p     = buf + 3*GMX_SIMD_REAL_WIDTH;
     q     = buf + 4*GMX_SIMD_REAL_WIDTH;
-    sf_i  = buf + 5*GMX_SIMD_REAL_WIDTH;
-    msf_l = buf + 6*GMX_SIMD_REAL_WIDTH;
 
     set_pbc_simd(pbc, &pbc_simd);
 
@@ -2119,10 +2105,9 @@ rbdihs_noener_simd(int nbonds,
     const int             nfa1 = 5;
     int                   i, iu, s, j;
     int                   type, ai[GMX_SIMD_REAL_WIDTH], aj[GMX_SIMD_REAL_WIDTH], ak[GMX_SIMD_REAL_WIDTH], al[GMX_SIMD_REAL_WIDTH];
-    real                  ddphi;
     real                  dr_array[3*DIM*GMX_SIMD_REAL_WIDTH+GMX_SIMD_REAL_WIDTH], *dr;
     real                  buf_array[(NR_RBDIHS + 4)*GMX_SIMD_REAL_WIDTH+GMX_SIMD_REAL_WIDTH], *buf;
-    real                 *parm, *phi, *p, *q, *sf_i, *msf_l;
+    real                 *parm, *p, *q;
 
     gmx_simd_real_t       phi_S;
     gmx_simd_real_t       ddphi_S, cosfac_S;
@@ -2145,8 +2130,6 @@ rbdihs_noener_simd(int nbonds,
     parm  = buf;
     p     = buf + (NR_RBDIHS + 0)*GMX_SIMD_REAL_WIDTH;
     q     = buf + (NR_RBDIHS + 1)*GMX_SIMD_REAL_WIDTH;
-    sf_i  = buf + (NR_RBDIHS + 2)*GMX_SIMD_REAL_WIDTH;
-    msf_l = buf + (NR_RBDIHS + 3)*GMX_SIMD_REAL_WIDTH;
 
     set_pbc_simd(pbc, &pbc_simd);
 
@@ -2310,7 +2293,7 @@ real idihs(int nbonds,
 
         dvdl_term += 0.5*(kB - kA)*dp2 - kk*dphi0*dp;
 
-        do_dih_fup(ai, aj, ak, al, (real)(-ddphi), r_ij, r_kj, r_kl, m, n,
+        do_dih_fup(ai, aj, ak, al, -ddphi, r_ij, r_kj, r_kl, m, n,
                    f, fshift, pbc, g, x, t1, t2, t3); /* 112           */
         /* 218 TOTAL   */
 #ifdef DEBUG
@@ -2326,274 +2309,6 @@ real idihs(int nbonds,
     return vtot;
 }
 
-
-/*! \brief returns dx, rdist, and dpdl for functions posres() and fbposres()
- */
-static void posres_dx(const rvec x, const rvec pos0A, const rvec pos0B,
-                      const rvec comA_sc, const rvec comB_sc,
-                      real lambda,
-                      t_pbc *pbc, int refcoord_scaling, int npbcdim,
-                      rvec dx, rvec rdist, rvec dpdl)
-{
-    int  m, d;
-    real posA, posB, L1, ref = 0.;
-    rvec pos;
-
-    L1 = 1.0-lambda;
-
-    for (m = 0; m < DIM; m++)
-    {
-        posA = pos0A[m];
-        posB = pos0B[m];
-        if (m < npbcdim)
-        {
-            switch (refcoord_scaling)
-            {
-                case erscNO:
-                    ref      = 0;
-                    rdist[m] = L1*posA + lambda*posB;
-                    dpdl[m]  = posB - posA;
-                    break;
-                case erscALL:
-                    /* Box relative coordinates are stored for dimensions with pbc */
-                    posA *= pbc->box[m][m];
-                    posB *= pbc->box[m][m];
-                    assert(npbcdim <= DIM);
-                    for (d = m+1; d < npbcdim; d++)
-                    {
-                        posA += pos0A[d]*pbc->box[d][m];
-                        posB += pos0B[d]*pbc->box[d][m];
-                    }
-                    ref      = L1*posA + lambda*posB;
-                    rdist[m] = 0;
-                    dpdl[m]  = posB - posA;
-                    break;
-                case erscCOM:
-                    ref      = L1*comA_sc[m] + lambda*comB_sc[m];
-                    rdist[m] = L1*posA       + lambda*posB;
-                    dpdl[m]  = comB_sc[m] - comA_sc[m] + posB - posA;
-                    break;
-                default:
-                    gmx_fatal(FARGS, "No such scaling method implemented");
-            }
-        }
-        else
-        {
-            ref      = L1*posA + lambda*posB;
-            rdist[m] = 0;
-            dpdl[m]  = posB - posA;
-        }
-
-        /* We do pbc_dx with ref+rdist,
-         * since with only ref we can be up to half a box vector wrong.
-         */
-        pos[m] = ref + rdist[m];
-    }
-
-    if (pbc)
-    {
-        pbc_dx(pbc, x, pos, dx);
-    }
-    else
-    {
-        rvec_sub(x, pos, dx);
-    }
-}
-
-/*! \brief Adds forces of flat-bottomed positions restraints to f[]
- *         and fixes vir_diag. Returns the flat-bottomed potential. */
-real fbposres(int nbonds,
-              const t_iatom forceatoms[], const t_iparams forceparams[],
-              const rvec x[], rvec f[], rvec vir_diag,
-              t_pbc *pbc,
-              int refcoord_scaling, int ePBC, rvec com)
-/* compute flat-bottomed positions restraints */
-{
-    int              i, ai, m, d, type, npbcdim = 0, fbdim;
-    const t_iparams *pr;
-    real             vtot, kk, v;
-    real             ref = 0, dr, dr2, rpot, rfb, rfb2, fact, invdr;
-    rvec             com_sc, rdist, pos, dx, dpdl, fm;
-    gmx_bool         bInvert;
-
-    npbcdim = ePBC2npbcdim(ePBC);
-
-    if (refcoord_scaling == erscCOM)
-    {
-        clear_rvec(com_sc);
-        for (m = 0; m < npbcdim; m++)
-        {
-            assert(npbcdim <= DIM);
-            for (d = m; d < npbcdim; d++)
-            {
-                com_sc[m] += com[d]*pbc->box[d][m];
-            }
-        }
-    }
-
-    vtot = 0.0;
-    for (i = 0; (i < nbonds); )
-    {
-        type = forceatoms[i++];
-        ai   = forceatoms[i++];
-        pr   = &forceparams[type];
-
-        /* same calculation as for normal posres, but with identical A and B states, and lambda==0 */
-        posres_dx(x[ai], forceparams[type].fbposres.pos0, forceparams[type].fbposres.pos0,
-                  com_sc, com_sc, 0.0,
-                  pbc, refcoord_scaling, npbcdim,
-                  dx, rdist, dpdl);
-
-        clear_rvec(fm);
-        v = 0.0;
-
-        kk   = pr->fbposres.k;
-        rfb  = pr->fbposres.r;
-        rfb2 = sqr(rfb);
-
-        /* with rfb<0, push particle out of the sphere/cylinder/layer */
-        bInvert = FALSE;
-        if (rfb < 0.)
-        {
-            bInvert = TRUE;
-            rfb     = -rfb;
-        }
-
-        switch (pr->fbposres.geom)
-        {
-            case efbposresSPHERE:
-                /* spherical flat-bottom posres */
-                dr2 = norm2(dx);
-                if (dr2 > 0.0 &&
-                    ( (dr2 > rfb2 && bInvert == FALSE ) || (dr2 < rfb2 && bInvert == TRUE ) )
-                    )
-                {
-                    dr   = sqrt(dr2);
-                    v    = 0.5*kk*sqr(dr - rfb);
-                    fact = -kk*(dr-rfb)/dr; /* Force pointing to the center pos0 */
-                    svmul(fact, dx, fm);
-                }
-                break;
-            case efbposresCYLINDER:
-                /* cylidrical flat-bottom posres in x-y plane. fm[ZZ] = 0. */
-                dr2 = sqr(dx[XX])+sqr(dx[YY]);
-                if  (dr2 > 0.0 &&
-                     ( (dr2 > rfb2 && bInvert == FALSE ) || (dr2 < rfb2 && bInvert == TRUE ) )
-                     )
-                {
-                    dr     = sqrt(dr2);
-                    invdr  = 1./dr;
-                    v      = 0.5*kk*sqr(dr - rfb);
-                    fm[XX] = -kk*(dr-rfb)*dx[XX]*invdr; /* Force pointing to the center */
-                    fm[YY] = -kk*(dr-rfb)*dx[YY]*invdr;
-                }
-                break;
-            case efbposresX: /* fbdim=XX */
-            case efbposresY: /* fbdim=YY */
-            case efbposresZ: /* fbdim=ZZ */
-                /* 1D flat-bottom potential */
-                fbdim = pr->fbposres.geom - efbposresX;
-                dr    = dx[fbdim];
-                if ( ( dr > rfb && bInvert == FALSE ) || ( 0 < dr && dr < rfb && bInvert == TRUE )  )
-                {
-                    v         = 0.5*kk*sqr(dr - rfb);
-                    fm[fbdim] = -kk*(dr - rfb);
-                }
-                else if ( (dr < (-rfb) && bInvert == FALSE ) || ( (-rfb) < dr && dr < 0 && bInvert == TRUE ))
-                {
-                    v         = 0.5*kk*sqr(dr + rfb);
-                    fm[fbdim] = -kk*(dr + rfb);
-                }
-                break;
-        }
-
-        vtot += v;
-
-        for (m = 0; (m < DIM); m++)
-        {
-            f[ai][m]   += fm[m];
-            /* Here we correct for the pbc_dx which included rdist */
-            vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm[m];
-        }
-    }
-
-    return vtot;
-}
-
-
-real posres(int nbonds,
-            const t_iatom forceatoms[], const t_iparams forceparams[],
-            const rvec x[], rvec f[], rvec vir_diag,
-            t_pbc *pbc,
-            real lambda, real *dvdlambda,
-            int refcoord_scaling, int ePBC, rvec comA, rvec comB)
-{
-    int              i, ai, m, d, type, ki, npbcdim = 0;
-    const t_iparams *pr;
-    real             L1;
-    real             vtot, kk, fm;
-    real             posA, posB, ref = 0;
-    rvec             comA_sc, comB_sc, rdist, dpdl, pos, dx;
-    gmx_bool         bForceValid = TRUE;
-
-    if ((f == NULL) || (vir_diag == NULL))    /* should both be null together! */
-    {
-        bForceValid = FALSE;
-    }
-
-    npbcdim = ePBC2npbcdim(ePBC);
-
-    if (refcoord_scaling == erscCOM)
-    {
-        clear_rvec(comA_sc);
-        clear_rvec(comB_sc);
-        for (m = 0; m < npbcdim; m++)
-        {
-            assert(npbcdim <= DIM);
-            for (d = m; d < npbcdim; d++)
-            {
-                comA_sc[m] += comA[d]*pbc->box[d][m];
-                comB_sc[m] += comB[d]*pbc->box[d][m];
-            }
-        }
-    }
-
-    L1 = 1.0 - lambda;
-
-    vtot = 0.0;
-    for (i = 0; (i < nbonds); )
-    {
-        type = forceatoms[i++];
-        ai   = forceatoms[i++];
-        pr   = &forceparams[type];
-
-        /* return dx, rdist, and dpdl */
-        posres_dx(x[ai], forceparams[type].posres.pos0A, forceparams[type].posres.pos0B,
-                  comA_sc, comB_sc, lambda,
-                  pbc, refcoord_scaling, npbcdim,
-                  dx, rdist, dpdl);
-
-        for (m = 0; (m < DIM); m++)
-        {
-            kk          = L1*pr->posres.fcA[m] + lambda*pr->posres.fcB[m];
-            fm          = -kk*dx[m];
-            vtot       += 0.5*kk*dx[m]*dx[m];
-            *dvdlambda +=
-                0.5*(pr->posres.fcB[m] - pr->posres.fcA[m])*dx[m]*dx[m]
-                + fm*dpdl[m];
-
-            /* Here we correct for the pbc_dx which included rdist */
-            if (bForceValid)
-            {
-                f[ai][m]    += fm;
-                vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm;
-            }
-        }
-    }
-
-    return vtot;
-}
-
 static real low_angres(int nbonds,
                        const t_iatom forceatoms[], const t_iparams forceparams[],
                        const rvec x[], rvec f[], rvec fshift[],
@@ -2726,7 +2441,7 @@ real dihres(int nbonds,
     real vtot = 0;
     int  ai, aj, ak, al, i, k, type, t1, t2, t3;
     real phi0A, phi0B, dphiA, dphiB, kfacA, kfacB, phi0, dphi, kfac;
-    real phi, ddphi, ddp, ddp2, dp, sign, d2r, fc, L1;
+    real phi, ddphi, ddp, ddp2, dp, sign, d2r, L1;
     rvec r_ij, r_kj, r_kl, m, n;
 
     L1 = 1.0-lambda;
@@ -2833,7 +2548,6 @@ real restrangles(int nbonds,
 {
     int  i, d, ai, aj, ak, type, m;
     int  t1, t2;
-    rvec r_ij, r_kj;
     real v, vtot;
     ivec jt, dt_ij, dt_kj;
     rvec f_i, f_j, f_k;
@@ -2961,7 +2675,7 @@ real restrdihs(int nbonds,
         t1 = pbc_rvec_sub(pbc, x[ai], x[aj], vec_temp);
         pbc_rvec_sub(pbc, x[aj], x[ai], delta_ante);
         t2 = pbc_rvec_sub(pbc, x[ak], x[aj], delta_crnt);
-        t3 = pbc_rvec_sub(pbc, x[ak], x[al], vec_temp);
+        pbc_rvec_sub(pbc, x[ak], x[al], vec_temp);
         pbc_rvec_sub(pbc, x[al], x[ak], delta_post);
 
         /* This function computes factors needed for restricted angle potential.
@@ -3072,7 +2786,7 @@ real cbtdihs(int nbonds,
         pbc_rvec_sub(pbc, x[aj], x[ai], delta_ante);
         t2 = pbc_rvec_sub(pbc, x[ak], x[aj], vec_temp);
         pbc_rvec_sub(pbc, x[ak], x[aj], delta_crnt);
-        t3 = pbc_rvec_sub(pbc, x[ak], x[al], vec_temp);
+        pbc_rvec_sub(pbc, x[ak], x[al], vec_temp);
         pbc_rvec_sub(pbc, x[al], x[ak], delta_post);
 
         /* \brief Compute factors for CBT potential
@@ -3247,7 +2961,11 @@ real rbdihs(int nbonds,
     return vtot;
 }
 
-int cmap_setup_grid_index(int ip, int grid_spacing, int *ipm1, int *ipp1, int *ipp2)
+//! \endcond
+
+/*! \brief Mysterious undocumented function */
+static int
+cmap_setup_grid_index(int ip, int grid_spacing, int *ipm1, int *ipp1, int *ipp2)
 {
     int im1, ip1, ip2;
 
@@ -3286,14 +3004,15 @@ int cmap_setup_grid_index(int ip, int grid_spacing, int *ipm1, int *ipp1, int *i
 
 }
 
-real cmap_dihs(int nbonds,
-               const t_iatom forceatoms[], const t_iparams forceparams[],
-               const gmx_cmap_t *cmap_grid,
-               const rvec x[], rvec f[], rvec fshift[],
-               const t_pbc *pbc, const t_graph *g,
-               real gmx_unused lambda, real gmx_unused *dvdlambda,
-               const t_mdatoms gmx_unused *md, t_fcdata gmx_unused *fcd,
-               int  gmx_unused *global_atom_index)
+real
+cmap_dihs(int nbonds,
+          const t_iatom forceatoms[], const t_iparams forceparams[],
+          const gmx_cmap_t *cmap_grid,
+          const rvec x[], rvec f[], rvec fshift[],
+          const struct t_pbc *pbc, const struct t_graph *g,
+          real gmx_unused lambda, real gmx_unused *dvdlambda,
+          const t_mdatoms gmx_unused *md, t_fcdata gmx_unused *fcd,
+          int  gmx_unused *global_atom_index)
 {
     int         i, j, k, n, idx;
     int         ai, aj, ak, al, am;
@@ -3302,13 +3021,13 @@ real cmap_dihs(int nbonds,
     int         t11, t21, t31, t12, t22, t32;
     int         iphi1, ip1m1, ip1p1, ip1p2;
     int         iphi2, ip2m1, ip2p1, ip2p2;
-    int         l1, l2, l3, l4;
-    int         pos1, pos2, pos3, pos4, tmp;
+    int         l1, l2, l3;
+    int         pos1, pos2, pos3, pos4;
 
     real        ty[4], ty1[4], ty2[4], ty12[4], tc[16], tx[16];
-    real        phi1, psi1, cos_phi1, sin_phi1, sign1, xphi1;
-    real        phi2, psi2, cos_phi2, sin_phi2, sign2, xphi2;
-    real        dx, xx, tt, tu, e, df1, df2, ddf1, ddf2, ddf12, vtot;
+    real        phi1, cos_phi1, sin_phi1, sign1, xphi1;
+    real        phi2, cos_phi2, sin_phi2, sign2, xphi2;
+    real        dx, xx, tt, tu, e, df1, df2, vtot;
     real        ra21, rb21, rg21, rg1, rgr1, ra2r1, rb2r1, rabr1;
     real        ra22, rb22, rg22, rg2, rgr2, ra2r2, rb2r2, rabr2;
     real        fg1, hg1, fga1, hgb1, gaa1, gbb1;
@@ -3370,7 +3089,7 @@ real cmap_dihs(int nbonds,
         b1[1] = r1_kl[2]*r1_kj[0]-r1_kl[0]*r1_kj[2];
         b1[2] = r1_kl[0]*r1_kj[1]-r1_kl[1]*r1_kj[0]; /* 9 */
 
-        tmp = pbc_rvec_sub(pbc, x[a1l], x[a1k], h1);
+        pbc_rvec_sub(pbc, x[a1l], x[a1k], h1);
 
         ra21  = iprod(a1, a1);       /* 5 */
         rb21  = iprod(b1, b1);       /* 5 */
@@ -3431,7 +3150,7 @@ real cmap_dihs(int nbonds,
         b2[1] = r2_kl[2]*r2_kj[0]-r2_kl[0]*r2_kj[2];
         b2[2] = r2_kl[0]*r2_kj[1]-r2_kl[1]*r2_kj[0]; /* 9 */
 
-        tmp = pbc_rvec_sub(pbc, x[a2l], x[a2k], h2);
+        pbc_rvec_sub(pbc, x[a2l], x[a2k], h2);
 
         ra22  = iprod(a2, a2);         /* 5 */
         rb22  = iprod(b2, b2);         /* 5 */
@@ -3496,8 +3215,8 @@ real cmap_dihs(int nbonds,
         dx = 2*M_PI / cmap_grid->grid_spacing;
 
         /* Where on the grid are we */
-        iphi1 = (int)(xphi1/dx);
-        iphi2 = (int)(xphi2/dx);
+        iphi1 = static_cast<int>(xphi1/dx);
+        iphi2 = static_cast<int>(xphi2/dx);
 
         iphi1 = cmap_setup_grid_index(iphi1, cmap_grid->grid_spacing, &ip1m1, &ip1p1, &ip1p2);
         iphi2 = cmap_setup_grid_index(iphi2, cmap_grid->grid_spacing, &ip2m1, &ip2p1, &ip2p2);
@@ -3562,9 +3281,6 @@ real cmap_dihs(int nbonds,
         e     = 0;
         df1   = 0;
         df2   = 0;
-        ddf1  = 0;
-        ddf2  = 0;
-        ddf12 = 0;
 
         for (i = 3; i >= 0; i--)
         {
@@ -3575,19 +3291,11 @@ real cmap_dihs(int nbonds,
             e     = tt * e    + ((tc[i*4+3]*tu+tc[i*4+2])*tu + tc[i*4+1])*tu+tc[i*4];
             df1   = tu * df1  + (3.0*tc[l1]*tt+2.0*tc[l2])*tt+tc[l3];
             df2   = tt * df2  + (3.0*tc[i*4+3]*tu+2.0*tc[i*4+2])*tu+tc[i*4+1];
-            ddf1  = tu * ddf1 + 2.0*3.0*tc[l1]*tt+2.0*tc[l2];
-            ddf2  = tt * ddf2 + 2.0*3.0*tc[4*i+3]*tu+2.0*tc[4*i+2];
         }
 
-        ddf12 = tc[5] + 2.0*tc[9]*tt + 3.0*tc[13]*tt*tt + 2.0*tu*(tc[6]+2.0*tc[10]*tt+3.0*tc[14]*tt*tt) +
-            3.0*tu*tu*(tc[7]+2.0*tc[11]*tt+3.0*tc[15]*tt*tt);
-
         fac     = RAD2DEG/dx;
         df1     = df1   * fac;
         df2     = df2   * fac;
-        ddf1    = ddf1  * fac * fac;
-        ddf2    = ddf2  * fac * fac;
-        ddf12   = ddf12 * fac * fac;
 
         /* CMAP energy */
         vtot += e;
@@ -3694,7 +3402,7 @@ real cmap_dihs(int nbonds,
 }
 
 
-
+//! \cond
 /***********************************************************
  *
  *   G R O M O S  9 6   F U N C T I O N S
@@ -3953,7 +3661,7 @@ real cross_bond_angle(int nbonds,
     /* Potential from Lawrence and Skimmer, Chem. Phys. Lett. 372 (2003)
      * pp. 842-847
      */
-    int  i, ai, aj, ak, type, m, t1, t2, t3;
+    int  i, ai, aj, ak, type, m, t1, t2;
     rvec r_ij, r_kj, r_ik;
     real vtot, vrt, s1, s2, s3, r1, r2, r3, r1e, r2e, r3e, krt, k1, k2, k3;
     rvec f_i, f_j, f_k;
@@ -3974,7 +3682,7 @@ real cross_bond_angle(int nbonds,
         /* Compute distance vectors ... */
         t1 = pbc_rvec_sub(pbc, x[ai], x[aj], r_ij);
         t2 = pbc_rvec_sub(pbc, x[ak], x[aj], r_kj);
-        t3 = pbc_rvec_sub(pbc, x[ai], x[ak], r_ik);
+        pbc_rvec_sub(pbc, x[ai], x[ak], r_ik);
 
         /* ... and their lengths */
         r1 = norm(r_ij);
@@ -4032,7 +3740,7 @@ static real bonded_tab(const char *type, int table_nr,
 {
     real k, tabscale, *VFtab, rt, eps, eps2, Yt, Ft, Geps, Heps2, Fp, VV, FF;
     int  n0, nnn;
-    real v, f, dvdlambda;
+    real dvdlambda;
 
     k = (1.0 - lambda)*kA + lambda*kB;
 
@@ -4040,7 +3748,7 @@ static real bonded_tab(const char *type, int table_nr,
     VFtab    = table->data;
 
     rt    = r*tabscale;
-    n0    = rt;
+    n0    = static_cast<int>(rt);
     if (n0 >= table->n)
     {
         gmx_fatal(FARGS, "A tabulated %s interaction table number %d is out of the table range: r %f, between table indices %d and %d, table length %d",
@@ -4167,7 +3875,7 @@ real tab_angles(int nbonds,
         if (cos_theta2 < 1)
         {
             int  m;
-            real snt, st, sth;
+            real st, sth;
             real cik, cii, ckk;
             real nrkj2, nrij2;
             rvec f_i, f_j, f_k;
@@ -4261,671 +3969,4 @@ real tab_dihs(int nbonds,
     return vtot;
 }
 
-/* Return if this is a potential calculated in bondfree.c,
- * i.e. an interaction that actually calculates a potential and
- * works on multiple atoms (not e.g. a connection or a position restraint).
- */
-static gmx_inline gmx_bool ftype_is_bonded_potential(int ftype)
-{
-    return
-        (interaction_function[ftype].flags & IF_BOND) &&
-        !(ftype == F_CONNBONDS || ftype == F_POSRES || ftype == F_FBPOSRES) &&
-        (ftype < F_GB12 || ftype > F_GB14);
-}
-
-static void divide_bondeds_over_threads(t_idef *idef, int nthreads)
-{
-    int ftype;
-    int nat1;
-    int t;
-    int il_nr_thread;
-
-    idef->nthreads = nthreads;
-
-    if (F_NRE*(nthreads+1) > idef->il_thread_division_nalloc)
-    {
-        idef->il_thread_division_nalloc = F_NRE*(nthreads+1);
-        snew(idef->il_thread_division, idef->il_thread_division_nalloc);
-    }
-
-    for (ftype = 0; ftype < F_NRE; ftype++)
-    {
-        if (ftype_is_bonded_potential(ftype))
-        {
-            nat1 = interaction_function[ftype].nratoms + 1;
-
-            for (t = 0; t <= nthreads; t++)
-            {
-                /* Divide the interactions equally over the threads.
-                 * When the different types of bonded interactions
-                 * are distributed roughly equally over the threads,
-                 * this should lead to well localized output into
-                 * the force buffer on each thread.
-                 * If this is not the case, a more advanced scheme
-                 * (not implemented yet) will do better.
-                 */
-                il_nr_thread = (((idef->il[ftype].nr/nat1)*t)/nthreads)*nat1;
-
-                /* Ensure that distance restraint pairs with the same label
-                 * end up on the same thread.
-                 * This is slighlty tricky code, since the next for iteration
-                 * may have an initial il_nr_thread lower than the final value
-                 * in the previous iteration, but this will anyhow be increased
-                 * to the approriate value again by this while loop.
-                 */
-                while (ftype == F_DISRES &&
-                       il_nr_thread > 0 &&
-                       il_nr_thread < idef->il[ftype].nr &&
-                       idef->iparams[idef->il[ftype].iatoms[il_nr_thread]].disres.label ==
-                       idef->iparams[idef->il[ftype].iatoms[il_nr_thread-nat1]].disres.label)
-                {
-                    il_nr_thread += nat1;
-                }
-
-                idef->il_thread_division[ftype*(nthreads+1)+t] = il_nr_thread;
-            }
-        }
-    }
-}
-
-static unsigned
-calc_bonded_reduction_mask(const t_idef *idef,
-                           int shift,
-                           int t, int nt)
-{
-    unsigned mask;
-    int      ftype, nb, nat1, nb0, nb1, i, a;
-
-    mask = 0;
-
-    for (ftype = 0; ftype < F_NRE; ftype++)
-    {
-        if (ftype_is_bonded_potential(ftype))
-        {
-            nb = idef->il[ftype].nr;
-            if (nb > 0)
-            {
-                nat1 = interaction_function[ftype].nratoms + 1;
-
-                /* Divide this interaction equally over the threads.
-                 * This is not stored: should match division in calc_bonds.
-                 */
-                nb0 = idef->il_thread_division[ftype*(nt+1)+t];
-                nb1 = idef->il_thread_division[ftype*(nt+1)+t+1];
-
-                for (i = nb0; i < nb1; i += nat1)
-                {
-                    for (a = 1; a < nat1; a++)
-                    {
-                        mask |= (1U << (idef->il[ftype].iatoms[i+a]>>shift));
-                    }
-                }
-            }
-        }
-    }
-
-    return mask;
-}
-
-void setup_bonded_threading(t_forcerec   *fr, t_idef *idef)
-{
-#define MAX_BLOCK_BITS 32
-    int t;
-    int ctot, c, b;
-
-    assert(fr->nthreads >= 1);
-
-    /* Divide the bonded interaction over the threads */
-    divide_bondeds_over_threads(idef, fr->nthreads);
-
-    if (fr->nthreads == 1)
-    {
-        fr->red_nblock = 0;
-
-        return;
-    }
-
-    /* We divide the force array in a maximum of 32 blocks.
-     * Minimum force block reduction size is 2^6=64.
-     */
-    fr->red_ashift = 6;
-    while (fr->natoms_force > (int)(MAX_BLOCK_BITS*(1U<<fr->red_ashift)))
-    {
-        fr->red_ashift++;
-    }
-    if (debug)
-    {
-        fprintf(debug, "bonded force buffer block atom shift %d bits\n",
-                fr->red_ashift);
-    }
-
-    /* Determine to which blocks each thread's bonded force calculation
-     * contributes. Store this is a mask for each thread.
-     */
-#pragma omp parallel for num_threads(fr->nthreads) schedule(static)
-    for (t = 1; t < fr->nthreads; t++)
-    {
-        fr->f_t[t].red_mask =
-            calc_bonded_reduction_mask(idef, fr->red_ashift, t, fr->nthreads);
-    }
-
-    /* Determine the maximum number of blocks we need to reduce over */
-    fr->red_nblock = 0;
-    ctot           = 0;
-    for (t = 0; t < fr->nthreads; t++)
-    {
-        c = 0;
-        for (b = 0; b < MAX_BLOCK_BITS; b++)
-        {
-            if (fr->f_t[t].red_mask & (1U<<b))
-            {
-                fr->red_nblock = max(fr->red_nblock, b+1);
-                c++;
-            }
-        }
-        if (debug)
-        {
-            fprintf(debug, "thread %d flags %x count %d\n",
-                    t, fr->f_t[t].red_mask, c);
-        }
-        ctot += c;
-    }
-    if (debug)
-    {
-        fprintf(debug, "Number of blocks to reduce: %d of size %d\n",
-                fr->red_nblock, 1<<fr->red_ashift);
-        fprintf(debug, "Reduction density %.2f density/#thread %.2f\n",
-                ctot*(1<<fr->red_ashift)/(double)fr->natoms_force,
-                ctot*(1<<fr->red_ashift)/(double)(fr->natoms_force*fr->nthreads));
-    }
-}
-
-static void zero_thread_forces(f_thread_t *f_t, int n,
-                               int nblock, int blocksize)
-{
-    int b, a0, a1, a, i, j;
-
-    if (n > f_t->f_nalloc)
-    {
-        f_t->f_nalloc = over_alloc_large(n);
-        srenew(f_t->f, f_t->f_nalloc);
-    }
-
-    if (f_t->red_mask != 0)
-    {
-        for (b = 0; b < nblock; b++)
-        {
-            if (f_t->red_mask && (1U<<b))
-            {
-                a0 = b*blocksize;
-                a1 = min((b+1)*blocksize, n);
-                for (a = a0; a < a1; a++)
-                {
-                    clear_rvec(f_t->f[a]);
-                }
-            }
-        }
-    }
-    for (i = 0; i < SHIFTS; i++)
-    {
-        clear_rvec(f_t->fshift[i]);
-    }
-    for (i = 0; i < F_NRE; i++)
-    {
-        f_t->ener[i] = 0;
-    }
-    for (i = 0; i < egNR; i++)
-    {
-        for (j = 0; j < f_t->grpp.nener; j++)
-        {
-            f_t->grpp.ener[i][j] = 0;
-        }
-    }
-    for (i = 0; i < efptNR; i++)
-    {
-        f_t->dvdl[i] = 0;
-    }
-}
-
-static void reduce_thread_force_buffer(int n, rvec *f,
-                                       int nthreads, f_thread_t *f_t,
-                                       int nblock, int block_size)
-{
-    /* The max thread number is arbitrary,
-     * we used a fixed number to avoid memory management.
-     * Using more than 16 threads is probably never useful performance wise.
-     */
-#define MAX_BONDED_THREADS 256
-    int b;
-
-    if (nthreads > MAX_BONDED_THREADS)
-    {
-        gmx_fatal(FARGS, "Can not reduce bonded forces on more than %d threads",
-                  MAX_BONDED_THREADS);
-    }
-
-    /* This reduction can run on any number of threads,
-     * independently of nthreads.
-     */
-#pragma omp parallel for num_threads(nthreads) schedule(static)
-    for (b = 0; b < nblock; b++)
-    {
-        rvec *fp[MAX_BONDED_THREADS];
-        int   nfb, ft, fb;
-        int   a0, a1, a;
-
-        /* Determine which threads contribute to this block */
-        nfb = 0;
-        for (ft = 1; ft < nthreads; ft++)
-        {
-            if (f_t[ft].red_mask & (1U<<b))
-            {
-                fp[nfb++] = f_t[ft].f;
-            }
-        }
-        if (nfb > 0)
-        {
-            /* Reduce force buffers for threads that contribute */
-            a0 =  b   *block_size;
-            a1 = (b+1)*block_size;
-            a1 = min(a1, n);
-            for (a = a0; a < a1; a++)
-            {
-                for (fb = 0; fb < nfb; fb++)
-                {
-                    rvec_inc(f[a], fp[fb][a]);
-                }
-            }
-        }
-    }
-}
-
-static void reduce_thread_forces(int n, rvec *f, rvec *fshift,
-                                 real *ener, gmx_grppairener_t *grpp, real *dvdl,
-                                 int nthreads, f_thread_t *f_t,
-                                 int nblock, int block_size,
-                                 gmx_bool bCalcEnerVir,
-                                 gmx_bool bDHDL)
-{
-    if (nblock > 0)
-    {
-        /* Reduce the bonded force buffer */
-        reduce_thread_force_buffer(n, f, nthreads, f_t, nblock, block_size);
-    }
-
-    /* When necessary, reduce energy and virial using one thread only */
-    if (bCalcEnerVir)
-    {
-        int t, i, j;
-
-        for (i = 0; i < SHIFTS; i++)
-        {
-            for (t = 1; t < nthreads; t++)
-            {
-                rvec_inc(fshift[i], f_t[t].fshift[i]);
-            }
-        }
-        for (i = 0; i < F_NRE; i++)
-        {
-            for (t = 1; t < nthreads; t++)
-            {
-                ener[i] += f_t[t].ener[i];
-            }
-        }
-        for (i = 0; i < egNR; i++)
-        {
-            for (j = 0; j < f_t[1].grpp.nener; j++)
-            {
-                for (t = 1; t < nthreads; t++)
-                {
-
-                    grpp->ener[i][j] += f_t[t].grpp.ener[i][j];
-                }
-            }
-        }
-        if (bDHDL)
-        {
-            for (i = 0; i < efptNR; i++)
-            {
-
-                for (t = 1; t < nthreads; t++)
-                {
-                    dvdl[i] += f_t[t].dvdl[i];
-                }
-            }
-        }
-    }
-}
-
-static real calc_one_bond(FILE *fplog, int thread,
-                          int ftype, const t_idef *idef,
-                          rvec x[], rvec f[], rvec fshift[],
-                          t_forcerec *fr,
-                          const t_pbc *pbc, const t_graph *g,
-                          gmx_grppairener_t *grpp,
-                          t_nrnb *nrnb,
-                          real *lambda, real *dvdl,
-                          const t_mdatoms *md, t_fcdata *fcd,
-                          gmx_bool bCalcEnerVir,
-                          int *global_atom_index, gmx_bool bPrintSepPot)
-{
-    int      nat1, nbonds, efptFTYPE;
-    real     v = 0;
-    t_iatom *iatoms;
-    int      nb0, nbn;
-
-    if (IS_RESTRAINT_TYPE(ftype))
-    {
-        efptFTYPE = efptRESTRAINT;
-    }
-    else
-    {
-        efptFTYPE = efptBONDED;
-    }
-
-    nat1      = interaction_function[ftype].nratoms + 1;
-    nbonds    = idef->il[ftype].nr/nat1;
-    iatoms    = idef->il[ftype].iatoms;
-
-    nb0 = idef->il_thread_division[ftype*(idef->nthreads+1)+thread];
-    nbn = idef->il_thread_division[ftype*(idef->nthreads+1)+thread+1] - nb0;
-
-    if (!IS_LISTED_LJ_C(ftype))
-    {
-        if (ftype == F_CMAP)
-        {
-            v = cmap_dihs(nbn, iatoms+nb0,
-                          idef->iparams, &idef->cmap_grid,
-                          (const rvec*)x, f, fshift,
-                          pbc, g, lambda[efptFTYPE], &(dvdl[efptFTYPE]),
-                          md, fcd, global_atom_index);
-        }
-#ifdef GMX_SIMD_HAVE_REAL
-        else if (ftype == F_ANGLES &&
-                 !bCalcEnerVir && fr->efep == efepNO)
-        {
-            /* No energies, shift forces, dvdl */
-            angles_noener_simd(nbn, idef->il[ftype].iatoms+nb0,
-                               idef->iparams,
-                               (const rvec*)x, f,
-                               pbc, g, lambda[efptFTYPE], md, fcd,
-                               global_atom_index);
-            v = 0;
-        }
-#endif
-        else if (ftype == F_PDIHS &&
-                 !bCalcEnerVir && fr->efep == efepNO)
-        {
-            /* No energies, shift forces, dvdl */
-#ifdef GMX_SIMD_HAVE_REAL
-            pdihs_noener_simd
-#else
-            pdihs_noener
-#endif
-                (nbn, idef->il[ftype].iatoms+nb0,
-                idef->iparams,
-                (const rvec*)x, f,
-                pbc, g, lambda[efptFTYPE], md, fcd,
-                global_atom_index);
-            v = 0;
-        }
-#ifdef GMX_SIMD_HAVE_REAL
-        else if (ftype == F_RBDIHS &&
-                 !bCalcEnerVir && fr->efep == efepNO)
-        {
-            /* No energies, shift forces, dvdl */
-            rbdihs_noener_simd(nbn, idef->il[ftype].iatoms+nb0,
-                               idef->iparams,
-                               (const rvec*)x, f,
-                               pbc, g, lambda[efptFTYPE], md, fcd,
-                               global_atom_index);
-            v = 0;
-        }
-#endif
-        else
-        {
-            v = interaction_function[ftype].ifunc(nbn, iatoms+nb0,
-                                                  idef->iparams,
-                                                  (const rvec*)x, f, fshift,
-                                                  pbc, g, lambda[efptFTYPE], &(dvdl[efptFTYPE]),
-                                                  md, fcd, global_atom_index);
-        }
-        if (bPrintSepPot)
-        {
-            fprintf(fplog, "  %-23s #%4d  V %12.5e  dVdl %12.5e\n",
-                    interaction_function[ftype].longname,
-                    nbonds, v, lambda[efptFTYPE]);
-        }
-    }
-    else
-    {
-        v = do_nonbonded_listed(ftype, nbn, iatoms+nb0, idef->iparams, (const rvec*)x, f, fshift,
-                                pbc, g, lambda, dvdl, md, fr, grpp, global_atom_index);
-
-        if (bPrintSepPot)
-        {
-            fprintf(fplog, "  %-5s + %-15s #%4d                  dVdl %12.5e\n",
-                    interaction_function[ftype].longname,
-                    interaction_function[F_LJ14].longname, nbonds, dvdl[efptVDW]);
-            fprintf(fplog, "  %-5s + %-15s #%4d                  dVdl %12.5e\n",
-                    interaction_function[ftype].longname,
-                    interaction_function[F_COUL14].longname, nbonds, dvdl[efptCOUL]);
-        }
-    }
-
-    if (thread == 0)
-    {
-        inc_nrnb(nrnb, interaction_function[ftype].nrnb_ind, nbonds);
-    }
-
-    return v;
-}
-
-void calc_bonds(FILE *fplog, const gmx_multisim_t *ms,
-                const t_idef *idef,
-                rvec x[], history_t *hist,
-                rvec f[], t_forcerec *fr,
-                const t_pbc *pbc, const t_graph *g,
-                gmx_enerdata_t *enerd, t_nrnb *nrnb,
-                real *lambda,
-                const t_mdatoms *md,
-                t_fcdata *fcd, int *global_atom_index,
-                t_atomtypes gmx_unused *atype, gmx_genborn_t gmx_unused *born,
-                int force_flags,
-                gmx_bool bPrintSepPot, gmx_int64_t step)
-{
-    gmx_bool      bCalcEnerVir;
-    int           i;
-    real          v, dvdl[efptNR], dvdl_dum[efptNR]; /* 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*/
-    const  t_pbc *pbc_null;
-    char          buf[22];
-    int           thread;
-
-    assert(fr->nthreads == idef->nthreads);
-
-    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;
-    }
-    if (bPrintSepPot)
-    {
-        fprintf(fplog, "Step %s: bonded V and dVdl for this rank\n",
-                gmx_step_str(step, buf));
-    }
-
-#ifdef DEBUG
-    if (g && debug)
-    {
-        p_graph(debug, "Bondage is fun", g);
-    }
-#endif
-
-    /* Do pre force calculation stuff which might require communication */
-    if (idef->il[F_ORIRES].nr)
-    {
-        enerd->term[F_ORIRESDEV] =
-            calc_orires_dev(ms, idef->il[F_ORIRES].nr,
-                            idef->il[F_ORIRES].iatoms,
-                            idef->iparams, md, (const rvec*)x,
-                            pbc_null, fcd, hist);
-    }
-    if (idef->il[F_DISRES].nr)
-    {
-        calc_disres_R_6(idef->il[F_DISRES].nr,
-                        idef->il[F_DISRES].iatoms,
-                        idef->iparams, (const rvec*)x, pbc_null,
-                        fcd, hist);
-#ifdef GMX_MPI
-        if (fcd->disres.nsystems > 1)
-        {
-            gmx_sum_sim(2*fcd->disres.nres, fcd->disres.Rt_6, ms);
-        }
-#endif
-    }
-
-#pragma omp parallel for num_threads(fr->nthreads) schedule(static)
-    for (thread = 0; thread < fr->nthreads; thread++)
-    {
-        int                ftype;
-        real              *epot, v;
-        /* thread stuff */
-        rvec              *ft, *fshift;
-        real              *dvdlt;
-        gmx_grppairener_t *grpp;
-
-        if (thread == 0)
-        {
-            ft     = f;
-            fshift = fr->fshift;
-            epot   = enerd->term;
-            grpp   = &enerd->grpp;
-            dvdlt  = dvdl;
-        }
-        else
-        {
-            zero_thread_forces(&fr->f_t[thread], fr->natoms_force,
-                               fr->red_nblock, 1<<fr->red_ashift);
-
-            ft     = fr->f_t[thread].f;
-            fshift = fr->f_t[thread].fshift;
-            epot   = fr->f_t[thread].ener;
-            grpp   = &fr->f_t[thread].grpp;
-            dvdlt  = fr->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(fplog, thread, ftype, idef, x,
-                                  ft, fshift, fr, pbc_null, g, grpp,
-                                  nrnb, lambda, dvdlt,
-                                  md, fcd, bCalcEnerVir,
-                                  global_atom_index, bPrintSepPot);
-                epot[ftype] += v;
-            }
-        }
-    }
-    if (fr->nthreads > 1)
-    {
-        reduce_thread_forces(fr->natoms_force, f, fr->fshift,
-                             enerd->term, &enerd->grpp, dvdl,
-                             fr->nthreads, fr->f_t,
-                             fr->red_nblock, 1<<fr->red_ashift,
-                             bCalcEnerVir,
-                             force_flags & GMX_FORCE_DHDL);
-    }
-    if (force_flags & GMX_FORCE_DHDL)
-    {
-        for (i = 0; i < efptNR; i++)
-        {
-            enerd->dvdl_nonlin[i] += dvdl[i];
-        }
-    }
-
-    /* Copy the sum of violations for the distance restraints from fcd */
-    if (fcd)
-    {
-        enerd->term[F_DISRESVIOL] = fcd->disres.sumviol;
-
-    }
-}
-
-void calc_bonds_lambda(FILE *fplog,
-                       const t_idef *idef,
-                       rvec x[],
-                       t_forcerec *fr,
-                       const t_pbc *pbc, const t_graph *g,
-                       gmx_grppairener_t *grpp, real *epot, t_nrnb *nrnb,
-                       real *lambda,
-                       const t_mdatoms *md,
-                       t_fcdata *fcd,
-                       int *global_atom_index)
-{
-    int           i, ftype, nr_nonperturbed, nr;
-    real          v;
-    real          dvdl_dum[efptNR];
-    rvec         *f, *fshift;
-    const  t_pbc *pbc_null;
-    t_idef        idef_fe;
-
-    if (fr->bMolPBC)
-    {
-        pbc_null = pbc;
-    }
-    else
-    {
-        pbc_null = NULL;
-    }
-
-    /* Copy the whole idef, so we can modify the contents locally */
-    idef_fe          = *idef;
-    idef_fe.nthreads = 1;
-    snew(idef_fe.il_thread_division, F_NRE*(idef_fe.nthreads+1));
-
-    /* We already have the forces, so we use temp buffers here */
-    snew(f, fr->natoms_force);
-    snew(fshift, SHIFTS);
-
-    /* Loop over all bonded force types to calculate the bonded energies */
-    for (ftype = 0; (ftype < F_NRE); ftype++)
-    {
-        if (ftype_is_bonded_potential(ftype))
-        {
-            /* Set the work range of thread 0 to the perturbed bondeds only */
-            nr_nonperturbed                       = idef->il[ftype].nr_nonperturbed;
-            nr                                    = idef->il[ftype].nr;
-            idef_fe.il_thread_division[ftype*2+0] = nr_nonperturbed;
-            idef_fe.il_thread_division[ftype*2+1] = nr;
-
-            /* This is only to get the flop count correct */
-            idef_fe.il[ftype].nr = nr - nr_nonperturbed;
-
-            if (nr - nr_nonperturbed > 0)
-            {
-                v = calc_one_bond(fplog, 0, ftype, &idef_fe,
-                                  x, f, fshift, fr, pbc_null, g,
-                                  grpp, nrnb, lambda, dvdl_dum,
-                                  md, fcd, TRUE,
-                                  global_atom_index, FALSE);
-                epot[ftype] += v;
-            }
-        }
-    }
-
-    sfree(fshift);
-    sfree(f);
-
-    sfree(idef_fe.il_thread_division);
-}
+//! \endcond
diff --git a/src/gromacs/listed-forces/bonded.h b/src/gromacs/listed-forces/bonded.h
new file mode 100644 (file)
index 0000000..93e8ed3
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * 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.
+ */
+/*! \libinternal \file
+ *
+ * \brief This file contains declarations necessary for low-level
+ * functions for computing energies and forces for bonded interactions.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_listed-forces
+ */
+
+#ifndef GMX_LISTED_FORCES_BONDED_H
+#define GMX_LISTED_FORCES_BONDED_H
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/fcdata.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/simd/simd.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/utility/basedefinitions.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct gmx_wallcycle;
+struct t_graph;
+struct t_pbc;
+
+/*! \brief Calculate bond-angle. No PBC is taken into account (use mol-shift) */
+real bond_angle(const rvec xi, const rvec xj, const rvec xk,
+                const struct t_pbc *pbc,
+                rvec r_ij, rvec r_kj, real *costh,
+                int *t1, int *t2);  /* out */
+
+/*! \brief Calculate dihedral-angle. No PBC is taken into account (use mol-shift) */
+real dih_angle(const rvec xi, const rvec xj, const rvec xk, const rvec xl,
+               const struct t_pbc *pbc,
+               rvec r_ij, rvec r_kj, rvec r_kl, rvec m, rvec n, /* out */
+               real *sign,
+               int *t1, int *t2, int *t3);
+
+/*! \brief Do an update of the forces for dihedral potentials */
+void do_dih_fup(int i, int j, int k, int l, real ddphi,
+                rvec r_ij, rvec r_kj, rvec r_kl,
+                rvec m, rvec n, rvec f[], rvec fshift[],
+                const struct t_pbc *pbc, const struct t_graph *g,
+                const rvec *x, int t1, int t2, int t3);
+
+/*! \brief Make a dihedral fall in the range (-pi,pi) */
+void make_dp_periodic(real *dp);
+
+/*! \brief Compute CMAP dihedral energies and forces */
+real
+    cmap_dihs(int nbonds,
+              const t_iatom forceatoms[], const t_iparams forceparams[],
+              const gmx_cmap_t *cmap_grid,
+              const rvec x[], rvec f[], rvec fshift[],
+              const struct t_pbc *pbc, const struct t_graph *g,
+              real gmx_unused lambda, real gmx_unused *dvdlambda,
+              const t_mdatoms gmx_unused *md, t_fcdata gmx_unused *fcd,
+              int  gmx_unused *global_atom_index);
+
+//! \cond
+/*************************************************************************
+ *
+ *  Bonded force functions
+ *
+ *************************************************************************/
+t_ifunc bonds, g96bonds, morse_bonds, cubic_bonds, FENE_bonds, restraint_bonds;
+t_ifunc angles, g96angles, cross_bond_bond, cross_bond_angle, urey_bradley, quartic_angles, linear_angles;
+t_ifunc restrangles;
+t_ifunc pdihs, idihs, rbdihs;
+t_ifunc restrdihs, cbtdihs;
+t_ifunc tab_bonds, tab_angles, tab_dihs;
+t_ifunc polarize, anharm_polarize, water_pol, thole_pol, angres, angresz, dihres, unimplemented;
+
+/* As pdihs(), but without calculating energies and shift forces */
+void
+    pdihs_noener(int nbonds,
+                 const t_iatom forceatoms[], const t_iparams forceparams[],
+                 const rvec x[], rvec f[],
+                 const struct t_pbc gmx_unused *pbc,
+                 const struct t_graph gmx_unused *g,
+                 real lambda,
+                 const t_mdatoms gmx_unused *md, t_fcdata gmx_unused *fcd,
+                 int gmx_unused *global_atom_index);
+
+#ifdef GMX_SIMD_HAVE_REAL
+
+/* As angles(), but using SIMD to calculate many angles at once.
+ * This routines does not calculate energies and shift forces.
+ */
+void
+    angles_noener_simd(int nbonds,
+                       const t_iatom forceatoms[], const t_iparams forceparams[],
+                       const rvec x[], rvec f[],
+                       const struct t_pbc *pbc,
+                       const struct t_graph gmx_unused *g,
+                       real gmx_unused lambda,
+                       const t_mdatoms gmx_unused *md, t_fcdata gmx_unused *fcd,
+                       int gmx_unused *global_atom_index);
+
+/* As pdihs_noener(), but using SIMD to calculate many dihedrals at once. */
+void
+    pdihs_noener_simd(int nbonds,
+                      const t_iatom forceatoms[], const t_iparams forceparams[],
+                      const rvec x[], rvec f[],
+                      const struct t_pbc *pbc,
+                      const struct t_graph gmx_unused *g,
+                      real gmx_unused lambda,
+                      const t_mdatoms gmx_unused *md, t_fcdata gmx_unused *fcd,
+                      int gmx_unused *global_atom_index);
+
+#endif
+
+//! \endcond
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/listed-forces/listed-forces.cpp b/src/gromacs/listed-forces/listed-forces.cpp
new file mode 100644 (file)
index 0000000..bc5dc6b
--- /dev/null
@@ -0,0 +1,638 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file defines high-level functions for mdrun to compute
+ * energies and forces for listed interactions.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "listed-forces.h"
+
+#include "config.h"
+
+#include <assert.h>
+
+#include <algorithm>
+
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/listed-forces/position-restraints.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/forcerec-threading.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/simd/simd.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "pairs.h"
+
+namespace
+{
+
+/*! \brief Return true if ftype is an explicit pair-listed LJ or
+ * COULOMB interaction type: bonded LJ (usually 1-4), or special
+ * listed non-bonded for FEP. */
+bool
+isPairInteraction(int ftype)
+{
+    return ((ftype) >= F_LJ14 && (ftype) <= F_LJC_PAIRS_NB);
+}
+
+/*! \brief Zero thread-local force-output buffers */
+void
+zero_thread_forces(f_thread_t *f_t, int n,
+                   int nblock, int blocksize)
+{
+    int b, a0, a1, a, i, j;
+
+    if (n > f_t->f_nalloc)
+    {
+        f_t->f_nalloc = over_alloc_large(n);
+        srenew(f_t->f, f_t->f_nalloc);
+    }
+
+    if (!bitmask_is_zero(f_t->red_mask))
+    {
+        for (b = 0; b < nblock; b++)
+        {
+            if (bitmask_is_set(f_t->red_mask, b))
+            {
+                a0 = b*blocksize;
+                a1 = std::min((b+1)*blocksize, n);
+                for (a = a0; a < a1; a++)
+                {
+                    clear_rvec(f_t->f[a]);
+                }
+            }
+        }
+    }
+    for (i = 0; i < SHIFTS; i++)
+    {
+        clear_rvec(f_t->fshift[i]);
+    }
+    for (i = 0; i < F_NRE; i++)
+    {
+        f_t->ener[i] = 0;
+    }
+    for (i = 0; i < egNR; i++)
+    {
+        for (j = 0; j < f_t->grpp.nener; j++)
+        {
+            f_t->grpp.ener[i][j] = 0;
+        }
+    }
+    for (i = 0; i < efptNR; i++)
+    {
+        f_t->dvdl[i] = 0;
+    }
+}
+
+/*! \brief The max thread number is arbitrary, we used a fixed number
+ * to avoid memory management.  Using more than 16 threads is probably
+ * never useful performance wise. */
+#define MAX_BONDED_THREADS 256
+
+/*! \brief Reduce thread-local force buffers */
+void
+reduce_thread_force_buffer(int n, rvec *f,
+                           int nthreads, f_thread_t *f_t,
+                           int nblock, int block_size)
+{
+    int b;
+
+    if (nthreads > MAX_BONDED_THREADS)
+    {
+        gmx_fatal(FARGS, "Can not reduce bonded forces on more than %d threads",
+                  MAX_BONDED_THREADS);
+    }
+
+    /* This reduction can run on any number of threads,
+     * independently of nthreads.
+     */
+#pragma omp parallel for num_threads(nthreads) schedule(static)
+    for (b = 0; b < nblock; b++)
+    {
+        rvec *fp[MAX_BONDED_THREADS];
+        int   nfb, ft, fb;
+        int   a0, a1, a;
+
+        /* Determine which threads contribute to this block */
+        nfb = 0;
+        for (ft = 1; ft < nthreads; ft++)
+        {
+            if (bitmask_is_set(f_t[ft].red_mask, b))
+            {
+                fp[nfb++] = f_t[ft].f;
+            }
+        }
+        if (nfb > 0)
+        {
+            /* Reduce force buffers for threads that contribute */
+            a0 =  b   *block_size;
+            a1 = (b+1)*block_size;
+            a1 = std::min(a1, n);
+            for (a = a0; a < a1; a++)
+            {
+                for (fb = 0; fb < nfb; fb++)
+                {
+                    rvec_inc(f[a], fp[fb][a]);
+                }
+            }
+        }
+    }
+}
+
+/*! \brief Reduce thread-local forces */
+void
+reduce_thread_forces(int n, rvec *f, rvec *fshift,
+                     real *ener, gmx_grppairener_t *grpp, real *dvdl,
+                     int nthreads, f_thread_t *f_t,
+                     int nblock, int block_size,
+                     gmx_bool bCalcEnerVir,
+                     gmx_bool bDHDL)
+{
+    if (nblock > 0)
+    {
+        /* Reduce the bonded force buffer */
+        reduce_thread_force_buffer(n, f, nthreads, f_t, nblock, block_size);
+    }
+
+    /* When necessary, reduce energy and virial using one thread only */
+    if (bCalcEnerVir)
+    {
+        int t, i, j;
+
+        for (i = 0; i < SHIFTS; i++)
+        {
+            for (t = 1; t < nthreads; t++)
+            {
+                rvec_inc(fshift[i], f_t[t].fshift[i]);
+            }
+        }
+        for (i = 0; i < F_NRE; i++)
+        {
+            for (t = 1; t < nthreads; t++)
+            {
+                ener[i] += f_t[t].ener[i];
+            }
+        }
+        for (i = 0; i < egNR; i++)
+        {
+            for (j = 0; j < f_t[1].grpp.nener; j++)
+            {
+                for (t = 1; t < nthreads; t++)
+                {
+
+                    grpp->ener[i][j] += f_t[t].grpp.ener[i][j];
+                }
+            }
+        }
+        if (bDHDL)
+        {
+            for (i = 0; i < efptNR; i++)
+            {
+
+                for (t = 1; t < nthreads; t++)
+                {
+                    dvdl[i] += f_t[t].dvdl[i];
+                }
+            }
+        }
+    }
+}
+
+/*! \brief Calculate one element of the list of bonded interactions
+    for this thread */
+real
+calc_one_bond(int thread,
+              int ftype, const t_idef *idef,
+              const rvec x[], rvec f[], rvec fshift[],
+              t_forcerec *fr,
+              const t_pbc *pbc, const t_graph *g,
+              gmx_grppairener_t *grpp,
+              t_nrnb *nrnb,
+              real *lambda, real *dvdl,
+              const t_mdatoms *md, t_fcdata *fcd,
+              gmx_bool bCalcEnerVir,
+              int *global_atom_index)
+{
+    int      nat1, nbonds, efptFTYPE;
+    real     v = 0;
+    t_iatom *iatoms;
+    int      nb0, nbn;
+
+    if (IS_RESTRAINT_TYPE(ftype))
+    {
+        efptFTYPE = efptRESTRAINT;
+    }
+    else
+    {
+        efptFTYPE = efptBONDED;
+    }
+
+    nat1      = interaction_function[ftype].nratoms + 1;
+    nbonds    = idef->il[ftype].nr/nat1;
+    iatoms    = idef->il[ftype].iatoms;
+
+    nb0 = idef->il_thread_division[ftype*(idef->nthreads+1)+thread];
+    nbn = idef->il_thread_division[ftype*(idef->nthreads+1)+thread+1] - nb0;
+
+    if (!isPairInteraction(ftype))
+    {
+        if (ftype == F_CMAP)
+        {
+            v = cmap_dihs(nbn, iatoms+nb0,
+                          idef->iparams, &idef->cmap_grid,
+                          x, f, fshift,
+                          pbc, g, lambda[efptFTYPE], &(dvdl[efptFTYPE]),
+                          md, fcd, global_atom_index);
+        }
+#ifdef GMX_SIMD_HAVE_REAL
+        else if (ftype == F_ANGLES &&
+                 !bCalcEnerVir && fr->efep == efepNO)
+        {
+            /* No energies, shift forces, dvdl */
+            angles_noener_simd(nbn, idef->il[ftype].iatoms+nb0,
+                               idef->iparams,
+                               x, f,
+                               pbc, g, lambda[efptFTYPE], md, fcd,
+                               global_atom_index);
+            v = 0;
+        }
+#endif
+        else if (ftype == F_PDIHS &&
+                 !bCalcEnerVir && fr->efep == efepNO)
+        {
+            /* No energies, shift forces, dvdl */
+#ifdef GMX_SIMD_HAVE_REAL
+            pdihs_noener_simd
+#else
+            pdihs_noener
+#endif
+                (nbn, idef->il[ftype].iatoms+nb0,
+                idef->iparams,
+                x, f,
+                pbc, g, lambda[efptFTYPE], md, fcd,
+                global_atom_index);
+            v = 0;
+        }
+        else
+        {
+            v = interaction_function[ftype].ifunc(nbn, iatoms+nb0,
+                                                  idef->iparams,
+                                                  x, f, fshift,
+                                                  pbc, g, lambda[efptFTYPE], &(dvdl[efptFTYPE]),
+                                                  md, fcd, global_atom_index);
+        }
+    }
+    else
+    {
+        v = do_pairs(ftype, nbn, iatoms+nb0, idef->iparams, x, f, fshift,
+                     pbc, g, lambda, dvdl, md, fr, grpp, global_atom_index);
+    }
+
+    if (thread == 0)
+    {
+        inc_nrnb(nrnb, interaction_function[ftype].nrnb_ind, nbonds);
+    }
+
+    return v;
+}
+
+} // namespace
+
+gmx_bool
+ftype_is_bonded_potential(int ftype)
+{
+    return
+        (interaction_function[ftype].flags & IF_BOND) &&
+        !(ftype == F_CONNBONDS || ftype == F_POSRES || ftype == F_FBPOSRES) &&
+        (ftype < F_GB12 || ftype > F_GB14);
+}
+
+void calc_listed(const gmx_multisim_t *ms,
+                 const t_idef *idef,
+                 const rvec x[], history_t *hist,
+                 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,
+                 const t_mdatoms *md,
+                 t_fcdata *fcd, int *global_atom_index,
+                 int force_flags)
+{
+    gmx_bool      bCalcEnerVir;
+    int           i;
+    real          dvdl[efptNR]; /* 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*/
+    const  t_pbc *pbc_null;
+    int           thread;
+
+    assert(fr->nthreads == idef->nthreads);
+
+    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);
+    }
+#endif
+
+    if (idef->il[F_POSRES].nr > 0)
+    {
+        posres_wrapper(nrnb, idef, pbc_full, x, enerd, lambda, fr);
+    }
+
+    if (idef->il[F_FBPOSRES].nr > 0)
+    {
+        fbposres_wrapper(nrnb, idef, pbc_full, x, enerd, fr);
+    }
+
+    /* Do pre force calculation stuff which might require communication */
+    if (idef->il[F_ORIRES].nr)
+    {
+        enerd->term[F_ORIRESDEV] =
+            calc_orires_dev(ms, idef->il[F_ORIRES].nr,
+                            idef->il[F_ORIRES].iatoms,
+                            idef->iparams, md, x,
+                            pbc_null, fcd, hist);
+    }
+    if (idef->il[F_DISRES].nr)
+    {
+        calc_disres_R_6(idef->il[F_DISRES].nr,
+                        idef->il[F_DISRES].iatoms,
+                        idef->iparams, x, pbc_null,
+                        fcd, hist);
+#ifdef GMX_MPI
+        if (fcd->disres.nsystems > 1)
+        {
+            gmx_sum_sim(2*fcd->disres.nres, fcd->disres.Rt_6, ms);
+        }
+#endif
+    }
+
+#pragma omp parallel for num_threads(fr->nthreads) schedule(static)
+    for (thread = 0; thread < fr->nthreads; thread++)
+    {
+        int                ftype;
+        real              *epot, v;
+        /* thread stuff */
+        rvec              *ft, *fshift;
+        real              *dvdlt;
+        gmx_grppairener_t *grpp;
+
+        if (thread == 0)
+        {
+            ft     = f;
+            fshift = fr->fshift;
+            epot   = enerd->term;
+            grpp   = &enerd->grpp;
+            dvdlt  = dvdl;
+        }
+        else
+        {
+            zero_thread_forces(&fr->f_t[thread], fr->natoms_force,
+                               fr->red_nblock, 1<<fr->red_ashift);
+
+            ft     = fr->f_t[thread].f;
+            fshift = fr->f_t[thread].fshift;
+            epot   = fr->f_t[thread].ener;
+            grpp   = &fr->f_t[thread].grpp;
+            dvdlt  = fr->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;
+            }
+        }
+    }
+    if (fr->nthreads > 1)
+    {
+        reduce_thread_forces(fr->natoms_force, f, fr->fshift,
+                             enerd->term, &enerd->grpp, dvdl,
+                             fr->nthreads, fr->f_t,
+                             fr->red_nblock, 1<<fr->red_ashift,
+                             bCalcEnerVir,
+                             force_flags & GMX_FORCE_DHDL);
+    }
+    if (force_flags & GMX_FORCE_DHDL)
+    {
+        for (i = 0; i < efptNR; i++)
+        {
+            enerd->dvdl_nonlin[i] += dvdl[i];
+        }
+    }
+
+    /* Copy the sum of violations for the distance restraints from fcd */
+    if (fcd)
+    {
+        enerd->term[F_DISRESVIOL] = fcd->disres.sumviol;
+
+    }
+}
+
+void calc_listed_lambda(const t_idef *idef,
+                        const rvec x[],
+                        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 t_mdatoms *md,
+                        t_fcdata *fcd,
+                        int *global_atom_index)
+{
+    int           ftype, nr_nonperturbed, nr;
+    real          v;
+    real          dvdl_dum[efptNR] = {0};
+    rvec         *f, *fshift;
+    const  t_pbc *pbc_null;
+    t_idef        idef_fe;
+
+    if (fr->bMolPBC)
+    {
+        pbc_null = pbc;
+    }
+    else
+    {
+        pbc_null = NULL;
+    }
+
+    /* Copy the whole idef, so we can modify the contents locally */
+    idef_fe          = *idef;
+    idef_fe.nthreads = 1;
+    snew(idef_fe.il_thread_division, F_NRE*(idef_fe.nthreads+1));
+
+    /* We already have the forces, so we use temp buffers here */
+    snew(f, fr->natoms_force);
+    snew(fshift, SHIFTS);
+
+    /* Loop over all bonded force types to calculate the bonded energies */
+    for (ftype = 0; (ftype < F_NRE); ftype++)
+    {
+        if (ftype_is_bonded_potential(ftype))
+        {
+            /* Set the work range of thread 0 to the perturbed bondeds only */
+            nr_nonperturbed                       = idef->il[ftype].nr_nonperturbed;
+            nr                                    = idef->il[ftype].nr;
+            idef_fe.il_thread_division[ftype*2+0] = nr_nonperturbed;
+            idef_fe.il_thread_division[ftype*2+1] = nr;
+
+            /* This is only to get the flop count correct */
+            idef_fe.il[ftype].nr = nr - nr_nonperturbed;
+
+            if (nr - nr_nonperturbed > 0)
+            {
+                v = calc_one_bond(0, ftype, &idef_fe,
+                                  x, f, fshift, fr, pbc_null, g,
+                                  grpp, nrnb, lambda, dvdl_dum,
+                                  md, fcd, TRUE,
+                                  global_atom_index);
+                epot[ftype] += v;
+            }
+        }
+    }
+
+    sfree(fshift);
+    sfree(f);
+
+    sfree(idef_fe.il_thread_division);
+}
+
+void
+do_force_listed(gmx_wallcycle        *wcycle,
+                matrix                box,
+                const t_lambda       *fepvals,
+                const gmx_multisim_t *ms,
+                const t_idef         *idef,
+                const rvec            x[],
+                history_t            *hist,
+                rvec                  f[],
+                t_forcerec           *fr,
+                const struct t_pbc   *pbc,
+                const struct t_graph *graph,
+                gmx_enerdata_t       *enerd,
+                t_nrnb               *nrnb,
+                real                 *lambda,
+                const t_mdatoms      *md,
+                t_fcdata             *fcd,
+                int                  *global_atom_index,
+                int                   flags)
+{
+    t_pbc pbc_full; /* Full PBC is needed for position restraints */
+
+    if (!(flags & GMX_FORCE_LISTED))
+    {
+        return;
+    }
+
+    wallcycle_sub_start(wcycle, ewcsLISTED);
+
+    if ((idef->il[F_POSRES].nr > 0) ||
+        (idef->il[F_FBPOSRES].nr > 0))
+    {
+        set_pbc(&pbc_full, fr->ePBC, box);
+    }
+    calc_listed(ms, idef, x, hist, f, fr, pbc, &pbc_full,
+                graph, enerd, nrnb, lambda, md, fcd,
+                global_atom_index, flags);
+
+    /* Check if we have to determine energy differences
+     * at foreign lambda's.
+     */
+    if (fepvals->n_lambda > 0 && (flags & GMX_FORCE_DHDL))
+    {
+        posres_wrapper_lambda(fepvals, idef, &pbc_full, x, enerd, lambda, fr);
+
+        if (idef->ilsort != ilsortNO_FE)
+        {
+            if (idef->ilsort != ilsortFE_SORTED)
+            {
+                gmx_incons("The bonded interactions are not sorted for free energy");
+            }
+            for (int i = 0; i < enerd->n_lambda; i++)
+            {
+                real lam_i[efptNR];
+
+                reset_foreign_enerdata(enerd);
+                for (int j = 0; j < efptNR; j++)
+                {
+                    lam_i[j] = (i == 0 ? lambda[j] : fepvals->all_lambda[j][i-1]);
+                }
+                calc_listed_lambda(idef, x, fr, pbc, graph, &(enerd->foreign_grpp), enerd->foreign_term, nrnb, lam_i, md,
+                                   fcd, global_atom_index);
+                sum_epot(&(enerd->foreign_grpp), enerd->foreign_term);
+                enerd->enerpart_lambda[i] += enerd->foreign_term[F_EPOT];
+            }
+        }
+    }
+    debug_gmx();
+
+    wallcycle_sub_stop(wcycle, ewcsLISTED);
+}
diff --git a/src/gromacs/listed-forces/listed-forces.h b/src/gromacs/listed-forces/listed-forces.h
new file mode 100644 (file)
index 0000000..6bf953a
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \defgroup module_listed-forces Interactions between lists of particles
+ * \ingroup group_mdrun
+ *
+ * \brief Handles computing energies and forces for listed
+ * interactions.
+ *
+ * Located here is the the code for
+ * - computing energies and forces for interactions between a small
+     number of particles, e.g bonds, position restraints and listed
+     non-bonded interactions (e.g. 1-4).
+ * - high-level functions used by mdrun for computing a set of such
+     quantities
+ * - managing thread-wise decomposition, thread-local buffer output,
+     and reduction of output data across threads.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ */
+/*! \file
+ *
+ * \brief This file contains declarations of high-level functions used
+ * by mdrun to compute energies and forces for listed interactions.
+ *
+ * Clients of libgromacs that want to evaluate listed interactions
+ * should call functions declared here.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \inpublicapi
+ * \ingroup module_listed-forces
+ */
+#ifndef GMX_LISTED_FORCES_LISTED_FORCES_H
+#define GMX_LISTED_FORCES_LISTED_FORCES_H
+
+#include "gromacs/legacyheaders/typedefs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Return whether this is an interaction that actually
+ * calculates a potential and works on multiple atoms (not e.g. a
+ * connection or a position restraint).
+ *
+ * \todo This function could go away when idef is not a big bucket of
+ * everything. */
+gmx_bool
+ftype_is_bonded_potential(int ftype);
+
+/*! \brief Calculates all listed force interactions.
+ *
+ * Note that pbc_full is used only for position restraints, and is
+ * not initialized if there are none. */
+void calc_listed(const gmx_multisim_t *ms,
+                 const t_idef *idef,
+                 const rvec x[], history_t *hist,
+                 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,
+                 const t_mdatoms *md,
+                 t_fcdata *fcd, int *ddgatindex,
+                 int force_flags);
+
+/*! \brief As calc_listed(), but only determines the potential energy
+ * for the perturbed interactions.
+ *
+ * The shift forces in fr are not affected. */
+void calc_listed_lambda(const t_idef *idef,
+                        const rvec x[],
+                        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 t_mdatoms *md,
+                        t_fcdata *fcd, int *global_atom_index);
+
+/*! \brief Do all aspects of energy and force calculations for mdrun
+ * on the set of listed interactions */
+void
+do_force_listed(struct gmx_wallcycle     *wcycle,
+                matrix                    box,
+                const t_lambda           *fepvals,
+                const gmx_multisim_t     *ms,
+                const t_idef             *idef,
+                const rvec                x[],
+                history_t                *hist,
+                rvec                      f[],
+                t_forcerec               *fr,
+                const struct t_pbc       *pbc,
+                const struct t_graph     *graph,
+                gmx_enerdata_t           *enerd,
+                t_nrnb                   *nrnb,
+                real                     *lambda,
+                const t_mdatoms          *md,
+                t_fcdata                 *fcd,
+                int                      *global_atom_index,
+                int                       flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/gromacs/listed-forces/listed-internal.cpp b/src/gromacs/listed-forces/listed-internal.cpp
new file mode 100644 (file)
index 0000000..fd69378
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file defines functions needed internally by the module.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "listed-internal.h"
+
+#include <cstdlib>
+
+int glatnr(int *global_atom_index, int i)
+{
+    int atnr;
+
+    if (global_atom_index == NULL)
+    {
+        atnr = i + 1;
+    }
+    else
+    {
+        atnr = global_atom_index[i] + 1;
+    }
+
+    return atnr;
+}
similarity index 72%
rename from src/gromacs/gmxana/correl.h
rename to src/gromacs/listed-forces/listed-internal.h
index 6ce4df4d678d8287e5b26e8e714adb1c63289156..7e2982bc1dae7c000e412464b26c0f7bd80eee13 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-2008, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 This file contains declarations for functions needed
+ * internally by the module.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_listed-forces
+ */
+#ifndef GMX_LISTED_FORCES_LISTED_INTERNAL_H
+#define GMX_LISTED_FORCES_LISTED_INTERNAL_H
 
-
-#ifndef _correl_h
-#define _correl_h
-
-#include "typedefs.h"
-#include "gromacs/fft/fft.h"
-
-typedef struct {
-    int        n;
-    gmx_fft_t  fft_setup;
-    real      *buf1, *buf2, *abuf;
-} correl_t;
-
-extern correl_t *init_correl(int n);
-extern void done_correl(correl_t *c);
-
-extern void correl(real data1[], real data2[], int n, real ans[]);
-extern void four1(real data[], int nn, int isign);
+/*! \brief Returns the global topology atom number belonging to local
+ * atom index i.
+ *
+ * This function is intended for writing ascii output and returns atom
+ * numbers starting at 1.  When global_atom_index=NULL returns i+1.
+ */
+int
+glatnr(int *global_atom_index, int i);
 
 #endif
diff --git a/src/gromacs/listed-forces/manage-threading.cpp b/src/gromacs/listed-forces/manage-threading.cpp
new file mode 100644 (file)
index 0000000..01bed0b
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * 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.
+ */
+/*! \internal \file
+ * \brief This file defines functions for managing threading of listed
+ * interactions.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "manage-threading.h"
+
+#include <assert.h>
+
+#include <algorithm>
+
+#include "gromacs/listed-forces/listed-forces.h"
+#include "gromacs/mdlib/forcerec-threading.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
+
+//! Divides listed interactions over threads
+static void divide_bondeds_over_threads(t_idef *idef, int nthreads)
+{
+    int ftype;
+    int nat1;
+    int t;
+    int il_nr_thread;
+
+    idef->nthreads = nthreads;
+
+    if (F_NRE*(nthreads+1) > idef->il_thread_division_nalloc)
+    {
+        idef->il_thread_division_nalloc = F_NRE*(nthreads+1);
+        snew(idef->il_thread_division, idef->il_thread_division_nalloc);
+    }
+
+    for (ftype = 0; ftype < F_NRE; ftype++)
+    {
+        if (ftype_is_bonded_potential(ftype))
+        {
+            nat1 = interaction_function[ftype].nratoms + 1;
+
+            for (t = 0; t <= nthreads; t++)
+            {
+                /* Divide the interactions equally over the threads.
+                 * When the different types of bonded interactions
+                 * are distributed roughly equally over the threads,
+                 * this should lead to well localized output into
+                 * the force buffer on each thread.
+                 * If this is not the case, a more advanced scheme
+                 * (not implemented yet) will do better.
+                 */
+                il_nr_thread = (((idef->il[ftype].nr/nat1)*t)/nthreads)*nat1;
+
+                /* Ensure that distance restraint pairs with the same label
+                 * end up on the same thread.
+                 * This is slighlty tricky code, since the next for iteration
+                 * may have an initial il_nr_thread lower than the final value
+                 * in the previous iteration, but this will anyhow be increased
+                 * to the approriate value again by this while loop.
+                 */
+                while (ftype == F_DISRES &&
+                       il_nr_thread > 0 &&
+                       il_nr_thread < idef->il[ftype].nr &&
+                       idef->iparams[idef->il[ftype].iatoms[il_nr_thread]].disres.label ==
+                       idef->iparams[idef->il[ftype].iatoms[il_nr_thread-nat1]].disres.label)
+                {
+                    il_nr_thread += nat1;
+                }
+
+                idef->il_thread_division[ftype*(nthreads+1)+t] = il_nr_thread;
+            }
+        }
+    }
+}
+
+//! Construct a reduction mask for which interaction was computed on which thread
+static void
+calc_bonded_reduction_mask(gmx_bitmask_t *mask,
+                           const t_idef *idef,
+                           int shift,
+                           int t, int nt)
+{
+    int           ftype, nb, nat1, nb0, nb1, i, a;
+    bitmask_clear(mask);
+
+    for (ftype = 0; ftype < F_NRE; ftype++)
+    {
+        if (ftype_is_bonded_potential(ftype))
+        {
+            nb = idef->il[ftype].nr;
+            if (nb > 0)
+            {
+                nat1 = interaction_function[ftype].nratoms + 1;
+
+                /* Divide this interaction equally over the threads.
+                 * This is not stored: should match division in calc_bonds.
+                 */
+                nb0 = idef->il_thread_division[ftype*(nt+1)+t];
+                nb1 = idef->il_thread_division[ftype*(nt+1)+t+1];
+
+                for (i = nb0; i < nb1; i += nat1)
+                {
+                    for (a = 1; a < nat1; a++)
+                    {
+                        bitmask_set_bit(mask, idef->il[ftype].iatoms[i+a]>>shift);
+                    }
+                }
+            }
+        }
+    }
+}
+
+
+/*! \brief We divide the force array in a maximum of BITMASK_SIZE (default 32) blocks.
+ * Minimum force block reduction size is thus 2^6=64.
+ */
+const int maxBlockBits = BITMASK_SIZE;
+
+void setup_bonded_threading(t_forcerec   *fr, t_idef *idef)
+{
+    int t;
+    int ctot, c, b;
+
+    assert(fr->nthreads >= 1);
+
+    /* Divide the bonded interaction over the threads */
+    divide_bondeds_over_threads(idef, fr->nthreads);
+
+    if (fr->nthreads == 1)
+    {
+        fr->red_nblock = 0;
+
+        return;
+    }
+
+    fr->red_ashift = 6;
+    while (fr->natoms_force > (int)(maxBlockBits*(1U<<fr->red_ashift)))
+    {
+        fr->red_ashift++;
+    }
+    if (debug)
+    {
+        fprintf(debug, "bonded force buffer block atom shift %d bits\n",
+                fr->red_ashift);
+    }
+
+    /* Determine to which blocks each thread's bonded force calculation
+     * contributes. Store this is a mask for each thread.
+     */
+#pragma omp parallel for num_threads(fr->nthreads) schedule(static)
+    for (t = 1; t < fr->nthreads; t++)
+    {
+        calc_bonded_reduction_mask(&fr->f_t[t].red_mask,
+                                   idef, fr->red_ashift, t, fr->nthreads);
+    }
+
+    /* Determine the maximum number of blocks we need to reduce over */
+    fr->red_nblock = 0;
+    ctot           = 0;
+    for (t = 0; t < fr->nthreads; t++)
+    {
+        c = 0;
+        for (b = 0; b < maxBlockBits; b++)
+        {
+            if (bitmask_is_set(fr->f_t[t].red_mask, b))
+            {
+                fr->red_nblock = std::max(fr->red_nblock, b+1);
+                c++;
+            }
+        }
+        if (debug)
+        {
+#if BITMASK_SIZE <= 64 //move into bitmask when it is C++
+            std::string flags = gmx::formatString("%x", fr->f_t[t].red_mask);
+#else
+            std::string flags = gmx::formatAndJoin(fr->f_t[t].red_mask,
+                                                   fr->f_t[t].red_mask+BITMASK_ALEN,
+                                                   "", gmx::StringFormatter("%x"));
+#endif
+            fprintf(debug, "thread %d flags %s count %d\n",
+                    t, flags.c_str(), c);
+        }
+        ctot += c;
+    }
+    if (debug)
+    {
+        fprintf(debug, "Number of blocks to reduce: %d of size %d\n",
+                fr->red_nblock, 1<<fr->red_ashift);
+        fprintf(debug, "Reduction density %.2f density/#thread %.2f\n",
+                ctot*(1<<fr->red_ashift)/(double)fr->natoms_force,
+                ctot*(1<<fr->red_ashift)/(double)(fr->natoms_force*fr->nthreads));
+    }
+}
similarity index 72%
rename from src/gromacs/gmxpreprocess/addconf.h
rename to src/gromacs/listed-forces/manage-threading.h
index eec41344d4be97929f29d07fe5cda35112e4f444..1cf0844ce27050db4a33d5a1d8243b0977f1213a 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_GMXPREPROCESS_ADDCONF_H
-#define GMX_GMXPREPROCESS_ADDCONF_H
+/*! \libinternal \file
+ * \brief Declares functions for managing threading of listed forces
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_listed-forces
+ */
+#ifndef GMX_LISTED_FORCES_MANAGE_THREADING_H
+#define GMX_LISTED_FORCES_MANAGE_THREADING_H
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/topology/idef.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern
-void add_conf(t_atoms *atoms, rvec **x, rvec **v, real **r, gmx_bool bSrenew,
-              int ePBC, matrix box, gmx_bool bInsert,
-              t_atoms *atoms_solvt, rvec *x_solvt, rvec *v_solvt, real *r_solvt,
-              gmx_bool bVerbose, real rshell, int max_sol, const output_env_t oenv);
-/* Add two conformations together, without generating overlap.
- * When not inserting, don't check overlap in the middle of the box.
- * If rshell > 0, keep all the residues around the protein (0..natoms_prot-1)
- * that are within rshell distance.
- * If max_sol > 0, add max max_sol solvent molecules.
+/*! \brief Divide the listed interactions over the threads
+ *
+ * Uses fr->nthreads for the number of threads, and sets up the
+ * thread-force buffer reduction. This should be called each time the
+ * bonded setup changes; i.e. at start-up without domain decomposition
+ * and at DD.
  */
+void setup_bonded_threading(t_forcerec *fr, t_idef *idef);
 
 #ifdef __cplusplus
 }
diff --git a/src/gromacs/listed-forces/pairs.cpp b/src/gromacs/listed-forces/pairs.cpp
new file mode 100644 (file)
index 0000000..1cb683f
--- /dev/null
@@ -0,0 +1,515 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file defines functions for "pair" interactions
+ * (i.e. listed non-bonded interactions, e.g. 1-4 interactions)
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "pairs.h"
+
+#include <cmath>
+
+#include "gromacs/legacyheaders/types/group.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
+
+#include "listed-internal.h"
+
+namespace
+{
+
+/*! \brief Issue a warning if a listed interaction is beyond a table limit */
+void
+warning_rlimit(const rvec *x, int ai, int aj, int * global_atom_index, real r, real rlimit)
+{
+    gmx_warning("Listed nonbonded interaction between particles %d and %d\n"
+                "at distance %.3f which is larger than the table limit %.3f nm.\n\n"
+                "This is likely either a 1,4 interaction, or a listed interaction inside\n"
+                "a smaller molecule you are decoupling during a free energy calculation.\n"
+                "Since interactions at distances beyond the table cannot be computed,\n"
+                "they are skipped until they are inside the table limit again. You will\n"
+                "only see this message once, even if it occurs for several interactions.\n\n"
+                "IMPORTANT: This should not happen in a stable simulation, so there is\n"
+                "probably something wrong with your system. Only change the table-extension\n"
+                "distance in the mdp file if you are really sure that is the reason.\n",
+                glatnr(global_atom_index, ai), glatnr(global_atom_index, aj), r, rlimit);
+
+    if (debug)
+    {
+        fprintf(debug,
+                "%8f %8f %8f\n%8f %8f %8f\n1-4 (%d,%d) interaction not within cut-off! r=%g. Ignored\n",
+                x[ai][XX], x[ai][YY], x[ai][ZZ], x[aj][XX], x[aj][YY], x[aj][ZZ],
+                glatnr(global_atom_index, ai), glatnr(global_atom_index, aj), r);
+    }
+}
+
+/*! \brief Compute the energy and force for a single pair interaction */
+real
+evaluate_single(real r2, real tabscale, real *vftab,
+                real qq, real c6, real c12, real *velec, real *vvdw)
+{
+    real       rinv, r, rtab, eps, eps2, Y, F, Geps, Heps2, Fp, VVe, FFe, VVd, FFd, VVr, FFr, fscal;
+    int        ntab;
+
+    /* Do the tabulated interactions - first table lookup */
+    rinv             = gmx_invsqrt(r2);
+    r                = r2*rinv;
+    rtab             = r*tabscale;
+    ntab             = static_cast<int>(rtab);
+    eps              = rtab-ntab;
+    eps2             = eps*eps;
+    ntab             = 12*ntab;
+    /* Electrostatics */
+    Y                = vftab[ntab];
+    F                = vftab[ntab+1];
+    Geps             = eps*vftab[ntab+2];
+    Heps2            = eps2*vftab[ntab+3];
+    Fp               = F+Geps+Heps2;
+    VVe              = Y+eps*Fp;
+    FFe              = Fp+Geps+2.0*Heps2;
+    /* Dispersion */
+    Y                = vftab[ntab+4];
+    F                = vftab[ntab+5];
+    Geps             = eps*vftab[ntab+6];
+    Heps2            = eps2*vftab[ntab+7];
+    Fp               = F+Geps+Heps2;
+    VVd              = Y+eps*Fp;
+    FFd              = Fp+Geps+2.0*Heps2;
+    /* Repulsion */
+    Y                = vftab[ntab+8];
+    F                = vftab[ntab+9];
+    Geps             = eps*vftab[ntab+10];
+    Heps2            = eps2*vftab[ntab+11];
+    Fp               = F+Geps+Heps2;
+    VVr              = Y+eps*Fp;
+    FFr              = Fp+Geps+2.0*Heps2;
+
+    *velec           = qq*VVe;
+    *vvdw            = c6*VVd+c12*VVr;
+
+    fscal            = -(qq*FFe+c6*FFd+c12*FFr)*tabscale*rinv;
+
+    return fscal;
+}
+
+/*! \brief Compute the energy and force for a single pair interaction under FEP */
+real
+free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul,
+                            real alpha_vdw, real tabscale, real *vftab,
+                            real qqA, real c6A, real c12A, real qqB,
+                            real c6B, real c12B, real LFC[2], real LFV[2], real DLF[2],
+                            real lfac_coul[2], real lfac_vdw[2], real dlfac_coul[2],
+                            real dlfac_vdw[2], real sigma6_def, real sigma6_min,
+                            real sigma2_def, real sigma2_min,
+                            real *velectot, real *vvdwtot, real *dvdl)
+{
+    real       rp, rpm2, rtab, eps, eps2, Y, F, Geps, Heps2, Fp, VV, FF, fscal;
+    real       qq[2], c6[2], c12[2], sigma6[2], sigma2[2], sigma_pow[2];
+    real       alpha_coul_eff, alpha_vdw_eff, dvdl_coul, dvdl_vdw;
+    real       rpinv, r_coul, r_vdw, velecsum, vvdwsum;
+    real       fscal_vdw[2], fscal_elec[2];
+    real       velec[2], vvdw[2];
+    int        i, ntab;
+    const real half        = 0.5;
+    const real minusOne    = -1.0;
+    const real oneThird    = 1.0 / 3.0;
+    const real one         = 1.0;
+    const real two         = 2.0;
+    const real six         = 6.0;
+    const real fourtyeight = 48.0;
+
+    qq[0]    = qqA;
+    qq[1]    = qqB;
+    c6[0]    = c6A;
+    c6[1]    = c6B;
+    c12[0]   = c12A;
+    c12[1]   = c12B;
+
+    if (sc_r_power == six)
+    {
+        rpm2             = r2*r2;   /* r4 */
+        rp               = rpm2*r2; /* r6 */
+    }
+    else if (sc_r_power == fourtyeight)
+    {
+        rp               = r2*r2*r2; /* r6 */
+        rp               = rp*rp;    /* r12 */
+        rp               = rp*rp;    /* r24 */
+        rp               = rp*rp;    /* r48 */
+        rpm2             = rp/r2;    /* r46 */
+    }
+    else
+    {
+        rp             = std::pow(r2, half * sc_r_power);  /* not currently supported as input, but can handle it */
+        rpm2           = rp/r2;
+    }
+
+    /* Loop over state A(0) and B(1) */
+    for (i = 0; i < 2; i++)
+    {
+        if ((c6[i] > 0) && (c12[i] > 0))
+        {
+            /* The c6 & c12 coefficients now contain the constants 6.0 and 12.0, respectively.
+             * Correct for this by multiplying with (1/12.0)/(1/6.0)=6.0/12.0=0.5.
+             */
+            sigma6[i]       = half*c12[i]/c6[i];
+            sigma2[i]       = std::pow(half*c12[i]/c6[i], oneThird);
+            /* should be able to get rid of this ^^^ internal pow call eventually.  Will require agreement on
+               what data to store externally.  Can't be fixed without larger scale changes, so not 5.0 */
+            if (sigma6[i] < sigma6_min)   /* for disappearing coul and vdw with soft core at the same time */
+            {
+                sigma6[i] = sigma6_min;
+                sigma2[i] = sigma2_min;
+            }
+        }
+        else
+        {
+            sigma6[i]       = sigma6_def;
+            sigma2[i]       = sigma2_def;
+        }
+        if (sc_r_power == six)
+        {
+            sigma_pow[i]    = sigma6[i];
+        }
+        else if (sc_r_power == fourtyeight)
+        {
+            sigma_pow[i]    = sigma6[i]*sigma6[i];       /* sigma^12 */
+            sigma_pow[i]    = sigma_pow[i]*sigma_pow[i]; /* sigma^24 */
+            sigma_pow[i]    = sigma_pow[i]*sigma_pow[i]; /* sigma^48 */
+        }
+        else
+        {       /* not really supported as input, but in here for testing the general case*/
+            sigma_pow[i]    = std::pow(sigma2[i], sc_r_power/2);
+        }
+    }
+
+    /* only use softcore if one of the states has a zero endstate - softcore is for avoiding infinities!*/
+    if ((c12[0] > 0) && (c12[1] > 0))
+    {
+        alpha_vdw_eff    = 0;
+        alpha_coul_eff   = 0;
+    }
+    else
+    {
+        alpha_vdw_eff    = alpha_vdw;
+        alpha_coul_eff   = alpha_coul;
+    }
+
+    /* Loop over A and B states again */
+    for (i = 0; i < 2; i++)
+    {
+        fscal_elec[i] = 0;
+        fscal_vdw[i]  = 0;
+        velec[i]      = 0;
+        vvdw[i]       = 0;
+
+        /* Only spend time on A or B state if it is non-zero */
+        if ( (qq[i] != 0) || (c6[i] != 0) || (c12[i] != 0) )
+        {
+            /* Coulomb */
+            rpinv            = one/(alpha_coul_eff*lfac_coul[i]*sigma_pow[i]+rp);
+            r_coul           = std::pow(rpinv, minusOne / sc_r_power);
+
+            /* Electrostatics table lookup data */
+            rtab             = r_coul*tabscale;
+            ntab             = static_cast<int>(rtab);
+            eps              = rtab-ntab;
+            eps2             = eps*eps;
+            ntab             = 12*ntab;
+            /* Electrostatics */
+            Y                = vftab[ntab];
+            F                = vftab[ntab+1];
+            Geps             = eps*vftab[ntab+2];
+            Heps2            = eps2*vftab[ntab+3];
+            Fp               = F+Geps+Heps2;
+            VV               = Y+eps*Fp;
+            FF               = Fp+Geps+two*Heps2;
+            velec[i]         = qq[i]*VV;
+            fscal_elec[i]    = -qq[i]*FF*r_coul*rpinv*tabscale;
+
+            /* Vdw */
+            rpinv            = one/(alpha_vdw_eff*lfac_vdw[i]*sigma_pow[i]+rp);
+            r_vdw            = std::pow(rpinv, minusOne / sc_r_power);
+            /* Vdw table lookup data */
+            rtab             = r_vdw*tabscale;
+            ntab             = static_cast<int>(rtab);
+            eps              = rtab-ntab;
+            eps2             = eps*eps;
+            ntab             = 12*ntab;
+            /* Dispersion */
+            Y                = vftab[ntab+4];
+            F                = vftab[ntab+5];
+            Geps             = eps*vftab[ntab+6];
+            Heps2            = eps2*vftab[ntab+7];
+            Fp               = F+Geps+Heps2;
+            VV               = Y+eps*Fp;
+            FF               = Fp+Geps+two*Heps2;
+            vvdw[i]          = c6[i]*VV;
+            fscal_vdw[i]     = -c6[i]*FF;
+
+            /* Repulsion */
+            Y                = vftab[ntab+8];
+            F                = vftab[ntab+9];
+            Geps             = eps*vftab[ntab+10];
+            Heps2            = eps2*vftab[ntab+11];
+            Fp               = F+Geps+Heps2;
+            VV               = Y+eps*Fp;
+            FF               = Fp+Geps+two*Heps2;
+            vvdw[i]         += c12[i]*VV;
+            fscal_vdw[i]    -= c12[i]*FF;
+            fscal_vdw[i]    *= r_vdw*rpinv*tabscale;
+        }
+    }
+    /* Now we have velec[i], vvdw[i], and fscal[i] for both states */
+    /* Assemble A and B states */
+    velecsum  = 0;
+    vvdwsum   = 0;
+    dvdl_coul = 0;
+    dvdl_vdw  = 0;
+    fscal     = 0;
+    for (i = 0; i < 2; i++)
+    {
+        velecsum      += LFC[i]*velec[i];
+        vvdwsum       += LFV[i]*vvdw[i];
+
+        fscal         += (LFC[i]*fscal_elec[i]+LFV[i]*fscal_vdw[i])*rpm2;
+
+        dvdl_coul     += velec[i]*DLF[i] + LFC[i]*alpha_coul_eff*dlfac_coul[i]*fscal_elec[i]*sigma_pow[i];
+        dvdl_vdw      += vvdw[i]*DLF[i] + LFV[i]*alpha_vdw_eff*dlfac_vdw[i]*fscal_vdw[i]*sigma_pow[i];
+    }
+
+    dvdl[efptCOUL]     += dvdl_coul;
+    dvdl[efptVDW]      += dvdl_vdw;
+
+    *velectot           = velecsum;
+    *vvdwtot            = vvdwsum;
+
+    return fscal;
+}
+
+} // namespace
+
+real
+do_pairs(int ftype, int nbonds,
+         const t_iatom iatoms[], const t_iparams iparams[],
+         const rvec x[], rvec 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, gmx_grppairener_t *grppener,
+         int *global_atom_index)
+{
+    real             qq, c6, c12;
+    rvec             dx;
+    ivec             dt;
+    int              i, itype, ai, aj, gid;
+    int              fshift_index;
+    real             r2;
+    real             fscal, velec, vvdw;
+    real *           energygrp_elec;
+    real *           energygrp_vdw;
+    static gmx_bool  warned_rlimit = FALSE;
+    /* Free energy stuff */
+    gmx_bool         bFreeEnergy;
+    real             LFC[2], LFV[2], DLF[2], lfac_coul[2], lfac_vdw[2], dlfac_coul[2], dlfac_vdw[2];
+    real             qqB, c6B, c12B, sigma2_def, sigma2_min;
+    const real       oneThird = 1.0 / 3.0;
+
+    switch (ftype)
+    {
+        case F_LJ14:
+        case F_LJC14_Q:
+            energygrp_elec = grppener->ener[egCOUL14];
+            energygrp_vdw  = grppener->ener[egLJ14];
+            break;
+        case F_LJC_PAIRS_NB:
+            energygrp_elec = grppener->ener[egCOULSR];
+            energygrp_vdw  = grppener->ener[egLJSR];
+            break;
+        default:
+            energygrp_elec = NULL; /* Keep compiler happy */
+            energygrp_vdw  = NULL; /* Keep compiler happy */
+            gmx_fatal(FARGS, "Unknown function type %d in do_nonbonded14", ftype);
+            break;
+    }
+
+    if (fr->efep != efepNO)
+    {
+        /* Lambda factor for state A=1-lambda and B=lambda */
+        LFC[0] = 1.0 - lambda[efptCOUL];
+        LFV[0] = 1.0 - lambda[efptVDW];
+        LFC[1] = lambda[efptCOUL];
+        LFV[1] = lambda[efptVDW];
+
+        /*derivative of the lambda factor for state A and B */
+        DLF[0] = -1;
+        DLF[1] = 1;
+
+        /* precalculate */
+        sigma2_def = pow(fr->sc_sigma6_def, oneThird);
+        sigma2_min = pow(fr->sc_sigma6_min, oneThird);
+
+        for (i = 0; i < 2; i++)
+        {
+            lfac_coul[i]  = (fr->sc_power == 2 ? (1-LFC[i])*(1-LFC[i]) : (1-LFC[i]));
+            dlfac_coul[i] = DLF[i]*fr->sc_power/fr->sc_r_power*(fr->sc_power == 2 ? (1-LFC[i]) : 1);
+            lfac_vdw[i]   = (fr->sc_power == 2 ? (1-LFV[i])*(1-LFV[i]) : (1-LFV[i]));
+            dlfac_vdw[i]  = DLF[i]*fr->sc_power/fr->sc_r_power*(fr->sc_power == 2 ? (1-LFV[i]) : 1);
+        }
+    }
+    else
+    {
+        sigma2_min = sigma2_def = 0;
+    }
+
+    bFreeEnergy = FALSE;
+    for (i = 0; (i < nbonds); )
+    {
+        itype = iatoms[i++];
+        ai    = iatoms[i++];
+        aj    = iatoms[i++];
+        gid   = GID(md->cENER[ai], md->cENER[aj], md->nenergrp);
+
+        /* Get parameters */
+        switch (ftype)
+        {
+            case F_LJ14:
+                bFreeEnergy =
+                    (fr->efep != efepNO &&
+                     ((md->nPerturbed && (md->bPerturbed[ai] || md->bPerturbed[aj])) ||
+                      iparams[itype].lj14.c6A != iparams[itype].lj14.c6B ||
+                      iparams[itype].lj14.c12A != iparams[itype].lj14.c12B));
+                qq               = md->chargeA[ai]*md->chargeA[aj]*fr->epsfac*fr->fudgeQQ;
+                c6               = iparams[itype].lj14.c6A;
+                c12              = iparams[itype].lj14.c12A;
+                break;
+            case F_LJC14_Q:
+                qq               = iparams[itype].ljc14.qi*iparams[itype].ljc14.qj*fr->epsfac*iparams[itype].ljc14.fqq;
+                c6               = iparams[itype].ljc14.c6;
+                c12              = iparams[itype].ljc14.c12;
+                break;
+            case F_LJC_PAIRS_NB:
+                qq               = iparams[itype].ljcnb.qi*iparams[itype].ljcnb.qj*fr->epsfac;
+                c6               = iparams[itype].ljcnb.c6;
+                c12              = iparams[itype].ljcnb.c12;
+                break;
+            default:
+                /* Cannot happen since we called gmx_fatal() above in this case */
+                qq = c6 = c12 = 0; /* Keep compiler happy */
+                break;
+        }
+
+        /* To save flops in the optimized kernels, c6/c12 have 6.0/12.0 derivative prefactors
+         * included in the general nfbp array now. This means the tables are scaled down by the
+         * same factor, so when we use the original c6/c12 parameters from iparams[] they must
+         * be scaled up.
+         */
+        c6  *= 6.0;
+        c12 *= 12.0;
+
+        /* Do we need to apply full periodic boundary conditions? */
+        if (fr->bMolPBC == TRUE)
+        {
+            fshift_index = pbc_dx_aiuc(pbc, x[ai], x[aj], dx);
+        }
+        else
+        {
+            fshift_index = CENTRAL;
+            rvec_sub(x[ai], x[aj], dx);
+        }
+        r2           = norm2(dx);
+
+        if (r2 >= fr->tab14.r*fr->tab14.r)
+        {
+            /* This check isn't race free. But it doesn't matter because if a race occurs the only
+             * disadvantage is that the warning is printed twice */
+            if (warned_rlimit == FALSE)
+            {
+                warning_rlimit(x, ai, aj, global_atom_index, sqrt(r2), fr->tab14.r);
+                warned_rlimit = TRUE;
+            }
+            continue;
+        }
+
+        if (bFreeEnergy)
+        {
+            /* Currently free energy is only supported for F_LJ14, so no need to check for that if we got here */
+            qqB              = md->chargeB[ai]*md->chargeB[aj]*fr->epsfac*fr->fudgeQQ;
+            c6B              = iparams[itype].lj14.c6B*6.0;
+            c12B             = iparams[itype].lj14.c12B*12.0;
+
+            fscal            = free_energy_evaluate_single(r2, fr->sc_r_power, fr->sc_alphacoul, fr->sc_alphavdw,
+                                                           fr->tab14.scale, fr->tab14.data, qq, c6, c12, qqB, c6B, c12B,
+                                                           LFC, LFV, DLF, lfac_coul, lfac_vdw, dlfac_coul, dlfac_vdw,
+                                                           fr->sc_sigma6_def, fr->sc_sigma6_min, sigma2_def, sigma2_min, &velec, &vvdw, dvdl);
+        }
+        else
+        {
+            /* Evaluate tabulated interaction without free energy */
+            fscal            = evaluate_single(r2, fr->tab14.scale, fr->tab14.data, qq, c6, c12, &velec, &vvdw);
+        }
+
+        energygrp_elec[gid]  += velec;
+        energygrp_vdw[gid]   += vvdw;
+        svmul(fscal, dx, dx);
+
+        /* Add the forces */
+        rvec_inc(f[ai], dx);
+        rvec_dec(f[aj], dx);
+
+        if (g)
+        {
+            /* Correct the shift forces using the graph */
+            ivec_sub(SHIFT_IVEC(g, ai), SHIFT_IVEC(g, aj), dt);
+            fshift_index = IVEC2IS(dt);
+        }
+        if (fshift_index != CENTRAL)
+        {
+            rvec_inc(fshift[fshift_index], dx);
+            rvec_dec(fshift[CENTRAL], dx);
+        }
+    }
+    return 0.0;
+}
diff --git a/src/gromacs/listed-forces/pairs.h b/src/gromacs/listed-forces/pairs.h
new file mode 100644 (file)
index 0000000..c895f81
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file declares functions for "pair" interactions
+ * (i.e. listed non-bonded interactions, e.g. 1-4 interactions)
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \ingroup module_listed-forces
+ */
+#ifndef GMX_LISTED_FORCES_PAIRS_H
+#define GMX_LISTED_FORCES_PAIRS_H
+
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+struct t_graph;
+struct t_pbc;
+
+/*! \brief Calculate VdW/charge listed pair interactions (usually 1-4
+ * interactions).
+ *
+ * global_atom_index is only passed for printing error messages.
+ */
+real
+do_pairs(int ftype, int nbonds, const t_iatom iatoms[], const t_iparams iparams[],
+         const rvec x[], rvec 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,
+         gmx_grppairener_t *grppener, int *global_atom_index);
+
+#endif
diff --git a/src/gromacs/listed-forces/position-restraints.cpp b/src/gromacs/listed-forces/position-restraints.cpp
new file mode 100644 (file)
index 0000000..7378b20
--- /dev/null
@@ -0,0 +1,453 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ *
+ * \brief This file defines low-level functions necessary for
+ * computing energies and forces for position restraints.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ *
+ * \ingroup module_listed-forces
+ */
+
+#include "gmxpre.h"
+
+#include "position-restraints.h"
+
+#include <assert.h>
+
+#include <cmath>
+
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/utility/basedefinitions.h"
+
+namespace
+{
+
+/*! \brief returns dx, rdist, and dpdl for functions posres() and fbposres()
+ */
+void posres_dx(const rvec x, const rvec pos0A, const rvec pos0B,
+               const rvec comA_sc, const rvec comB_sc,
+               real lambda,
+               const t_pbc *pbc, int refcoord_scaling, int npbcdim,
+               rvec dx, rvec rdist, rvec dpdl)
+{
+    int  m, d;
+    real posA, posB, L1, ref = 0.;
+    rvec pos;
+
+    L1 = 1.0-lambda;
+
+    for (m = 0; m < DIM; m++)
+    {
+        posA = pos0A[m];
+        posB = pos0B[m];
+        if (m < npbcdim)
+        {
+            switch (refcoord_scaling)
+            {
+                case erscNO:
+                    ref      = 0;
+                    rdist[m] = L1*posA + lambda*posB;
+                    dpdl[m]  = posB - posA;
+                    break;
+                case erscALL:
+                    /* Box relative coordinates are stored for dimensions with pbc */
+                    posA *= pbc->box[m][m];
+                    posB *= pbc->box[m][m];
+                    assert(npbcdim <= DIM);
+                    for (d = m+1; d < npbcdim; d++)
+                    {
+                        posA += pos0A[d]*pbc->box[d][m];
+                        posB += pos0B[d]*pbc->box[d][m];
+                    }
+                    ref      = L1*posA + lambda*posB;
+                    rdist[m] = 0;
+                    dpdl[m]  = posB - posA;
+                    break;
+                case erscCOM:
+                    ref      = L1*comA_sc[m] + lambda*comB_sc[m];
+                    rdist[m] = L1*posA       + lambda*posB;
+                    dpdl[m]  = comB_sc[m] - comA_sc[m] + posB - posA;
+                    break;
+                default:
+                    gmx_fatal(FARGS, "No such scaling method implemented");
+            }
+        }
+        else
+        {
+            ref      = L1*posA + lambda*posB;
+            rdist[m] = 0;
+            dpdl[m]  = posB - posA;
+        }
+
+        /* We do pbc_dx with ref+rdist,
+         * since with only ref we can be up to half a box vector wrong.
+         */
+        pos[m] = ref + rdist[m];
+    }
+
+    if (pbc)
+    {
+        pbc_dx(pbc, x, pos, dx);
+    }
+    else
+    {
+        rvec_sub(x, pos, dx);
+    }
+}
+
+/*! \brief Computes forces and potential for flat-bottom cylindrical restraints.
+ *         Returns the flat-bottom potential. */
+real do_fbposres_cylinder(int fbdim, rvec fm, rvec dx, real rfb, real kk, gmx_bool bInvert)
+{
+    int     d;
+    real    dr, dr2, invdr, v, rfb2;
+
+    dr2  = 0.0;
+    rfb2 = sqr(rfb);
+    v    = 0.0;
+
+    for (d = 0; d < DIM; d++)
+    {
+        if (d != fbdim)
+        {
+            dr2 += sqr(dx[d]);
+        }
+    }
+
+    if  (dr2 > 0.0 &&
+         ( (dr2 > rfb2 && bInvert == FALSE ) || (dr2 < rfb2 && bInvert == TRUE ) )
+         )
+    {
+        dr     = sqrt(dr2);
+        invdr  = 1./dr;
+        v      = 0.5*kk*sqr(dr - rfb);
+        for (d = 0; d < DIM; d++)
+        {
+            if (d != fbdim)
+            {
+                fm[d] = -kk*(dr-rfb)*dx[d]*invdr; /* Force pointing to the center */
+            }
+        }
+    }
+
+    return v;
+}
+
+/*! \brief Adds forces of flat-bottomed positions restraints to f[]
+ *         and fixes vir_diag.
+ *
+ * Returns the flat-bottomed potential. Same PBC treatment as in
+ * normal position restraints */
+real fbposres(int nbonds,
+              const t_iatom forceatoms[], const t_iparams forceparams[],
+              const rvec x[], rvec f[], rvec vir_diag,
+              const t_pbc *pbc,
+              int refcoord_scaling, int ePBC, rvec com)
+/* compute flat-bottomed positions restraints */
+{
+    int              i, ai, m, d, type, npbcdim = 0, fbdim;
+    const t_iparams *pr;
+    real             vtot, kk, v;
+    real             dr, dr2, rfb, rfb2, fact;
+    rvec             com_sc, rdist, dx, dpdl, fm;
+    gmx_bool         bInvert;
+
+    npbcdim = ePBC2npbcdim(ePBC);
+
+    if (refcoord_scaling == erscCOM)
+    {
+        clear_rvec(com_sc);
+        for (m = 0; m < npbcdim; m++)
+        {
+            assert(npbcdim <= DIM);
+            for (d = m; d < npbcdim; d++)
+            {
+                com_sc[m] += com[d]*pbc->box[d][m];
+            }
+        }
+    }
+
+    vtot = 0.0;
+    for (i = 0; (i < nbonds); )
+    {
+        type = forceatoms[i++];
+        ai   = forceatoms[i++];
+        pr   = &forceparams[type];
+
+        /* same calculation as for normal posres, but with identical A and B states, and lambda==0 */
+        posres_dx(x[ai], forceparams[type].fbposres.pos0, forceparams[type].fbposres.pos0,
+                  com_sc, com_sc, 0.0,
+                  pbc, refcoord_scaling, npbcdim,
+                  dx, rdist, dpdl);
+
+        clear_rvec(fm);
+        v = 0.0;
+
+        kk   = pr->fbposres.k;
+        rfb  = pr->fbposres.r;
+        rfb2 = sqr(rfb);
+
+        /* with rfb<0, push particle out of the sphere/cylinder/layer */
+        bInvert = FALSE;
+        if (rfb < 0.)
+        {
+            bInvert = TRUE;
+            rfb     = -rfb;
+        }
+
+        switch (pr->fbposres.geom)
+        {
+            case efbposresSPHERE:
+                /* spherical flat-bottom posres */
+                dr2 = norm2(dx);
+                if (dr2 > 0.0 &&
+                    ( (dr2 > rfb2 && bInvert == FALSE ) || (dr2 < rfb2 && bInvert == TRUE ) )
+                    )
+                {
+                    dr   = sqrt(dr2);
+                    v    = 0.5*kk*sqr(dr - rfb);
+                    fact = -kk*(dr-rfb)/dr; /* Force pointing to the center pos0 */
+                    svmul(fact, dx, fm);
+                }
+                break;
+            case efbposresCYLINDERX:
+                /* cylindrical flat-bottom posres in y-z plane. fm[XX] = 0. */
+                fbdim = XX;
+                v     = do_fbposres_cylinder(fbdim, fm, dx, rfb, kk, bInvert);
+                break;
+            case efbposresCYLINDERY:
+                /* cylindrical flat-bottom posres in x-z plane. fm[YY] = 0. */
+                fbdim = YY;
+                v     = do_fbposres_cylinder(fbdim, fm, dx, rfb, kk, bInvert);
+                break;
+            case efbposresCYLINDER:
+            /* equivalent to efbposresCYLINDERZ for backwards compatibility */
+            case efbposresCYLINDERZ:
+                /* cylindrical flat-bottom posres in x-y plane. fm[ZZ] = 0. */
+                fbdim = ZZ;
+                v     = do_fbposres_cylinder(fbdim, fm, dx, rfb, kk, bInvert);
+                break;
+            case efbposresX: /* fbdim=XX */
+            case efbposresY: /* fbdim=YY */
+            case efbposresZ: /* fbdim=ZZ */
+                /* 1D flat-bottom potential */
+                fbdim = pr->fbposres.geom - efbposresX;
+                dr    = dx[fbdim];
+                if ( ( dr > rfb && bInvert == FALSE ) || ( 0 < dr && dr < rfb && bInvert == TRUE )  )
+                {
+                    v         = 0.5*kk*sqr(dr - rfb);
+                    fm[fbdim] = -kk*(dr - rfb);
+                }
+                else if ( (dr < (-rfb) && bInvert == FALSE ) || ( (-rfb) < dr && dr < 0 && bInvert == TRUE ))
+                {
+                    v         = 0.5*kk*sqr(dr + rfb);
+                    fm[fbdim] = -kk*(dr + rfb);
+                }
+                break;
+        }
+
+        vtot += v;
+
+        for (m = 0; (m < DIM); m++)
+        {
+            f[ai][m]   += fm[m];
+            /* Here we correct for the pbc_dx which included rdist */
+            vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm[m];
+        }
+    }
+
+    return vtot;
+}
+
+
+/*! \brief Compute energies and forces for position restraints
+ *
+ * Note that position restraints require a different pbc treatment
+ * from other bondeds */
+real posres(int nbonds,
+            const t_iatom forceatoms[], const t_iparams forceparams[],
+            const rvec x[], rvec f[], rvec vir_diag,
+            const struct t_pbc *pbc,
+            real lambda, real *dvdlambda,
+            int refcoord_scaling, int ePBC, rvec comA, rvec comB)
+{
+    int              i, ai, m, d, type, npbcdim = 0;
+    const t_iparams *pr;
+    real             L1;
+    real             vtot, kk, fm;
+    rvec             comA_sc, comB_sc, rdist, dpdl, dx;
+    gmx_bool         bForceValid = TRUE;
+
+    if ((f == NULL) || (vir_diag == NULL))    /* should both be null together! */
+    {
+        bForceValid = FALSE;
+    }
+
+    npbcdim = ePBC2npbcdim(ePBC);
+
+    if (refcoord_scaling == erscCOM)
+    {
+        clear_rvec(comA_sc);
+        clear_rvec(comB_sc);
+        for (m = 0; m < npbcdim; m++)
+        {
+            assert(npbcdim <= DIM);
+            for (d = m; d < npbcdim; d++)
+            {
+                comA_sc[m] += comA[d]*pbc->box[d][m];
+                comB_sc[m] += comB[d]*pbc->box[d][m];
+            }
+        }
+    }
+
+    L1 = 1.0 - lambda;
+
+    vtot = 0.0;
+    for (i = 0; (i < nbonds); )
+    {
+        type = forceatoms[i++];
+        ai   = forceatoms[i++];
+        pr   = &forceparams[type];
+
+        /* return dx, rdist, and dpdl */
+        posres_dx(x[ai], forceparams[type].posres.pos0A, forceparams[type].posres.pos0B,
+                  comA_sc, comB_sc, lambda,
+                  pbc, refcoord_scaling, npbcdim,
+                  dx, rdist, dpdl);
+
+        for (m = 0; (m < DIM); m++)
+        {
+            kk          = L1*pr->posres.fcA[m] + lambda*pr->posres.fcB[m];
+            fm          = -kk*dx[m];
+            vtot       += 0.5*kk*dx[m]*dx[m];
+            *dvdlambda +=
+                0.5*(pr->posres.fcB[m] - pr->posres.fcA[m])*dx[m]*dx[m]
+                + fm*dpdl[m];
+
+            /* Here we correct for the pbc_dx which included rdist */
+            if (bForceValid)
+            {
+                f[ai][m]    += fm;
+                vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm;
+            }
+        }
+    }
+
+    return vtot;
+}
+
+} // namespace
+
+void
+posres_wrapper(t_nrnb             *nrnb,
+               const t_idef       *idef,
+               const struct t_pbc *pbc,
+               const rvec          x[],
+               gmx_enerdata_t     *enerd,
+               real               *lambda,
+               t_forcerec         *fr)
+{
+    real  v, dvdl;
+
+    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,
+                  lambda[efptRESTRAINT], &dvdl,
+                  fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
+    enerd->term[F_POSRES] += v;
+    /* If just the force constant changes, the FEP term is linear,
+     * but if k changes, it is not.
+     */
+    enerd->dvdl_nonlin[efptRESTRAINT] += dvdl;
+    inc_nrnb(nrnb, eNR_POSRES, idef->il[F_POSRES].nr/2);
+}
+
+void
+posres_wrapper_lambda(const t_lambda     *fepvals,
+                      const t_idef       *idef,
+                      const struct t_pbc *pbc,
+                      const rvec          x[],
+                      gmx_enerdata_t     *enerd,
+                      real               *lambda,
+                      t_forcerec         *fr)
+{
+    real  v;
+    int   i;
+
+    if (0 == idef->il[F_POSRES].nr)
+    {
+        return;
+    }
+
+    for (i = 0; i < enerd->n_lambda; i++)
+    {
+        real dvdl_dum = 0, lambda_dum;
+
+        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,
+                            fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
+        enerd->enerpart_lambda[i] += v;
+    }
+}
+
+/*! \brief Helper function that wraps calls to fbposres for
+    free-energy perturbation */
+void fbposres_wrapper(t_nrnb             *nrnb,
+                      const t_idef       *idef,
+                      const struct t_pbc *pbc,
+                      const rvec          x[],
+                      gmx_enerdata_t     *enerd,
+                      t_forcerec         *fr)
+{
+    real  v;
+
+    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,
+                 fr->rc_scaling, fr->ePBC, fr->posres_com);
+    enerd->term[F_FBPOSRES] += v;
+    inc_nrnb(nrnb, eNR_FBPOSRES, idef->il[F_FBPOSRES].nr/2);
+}
similarity index 53%
rename from src/gromacs/legacyheaders/types/matrix.h
rename to src/gromacs/listed-forces/position-restraints.h
index 9a9aec7a8acdab67578245ca77cc884017a003a2..fea4890ca909a360f7d8fe7b7259cfca8aed3c0c 100644 (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, by the GROMACS development team, led by
+ * 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.
  * 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_LEGACYHEADERS_TYPES_MATRIX_H
-#define GMX_LEGACYHEADERS_TYPES_MATRIX_H
+/*! \libinternal \file
+ *
+ * \brief This file contains declarations necessary for low-level
+ * functions for computing energies and forces for position
+ * restraints.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_listed-forces
+ */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifndef GMX_LISTED_FORCES_POSITION_RESTRAINTS_H
+#define GMX_LISTED_FORCES_POSITION_RESTRAINTS_H
 
-#include "simple.h"
+#include <stdio.h>
 
-typedef struct {
-    real r, g, b;
-} t_rgb;
+#include "gromacs/legacyheaders/typedefs.h"
 
-typedef struct {
-    char c1; /* should all be non-zero (and printable and not '"') */
-    char c2; /*
-              * should all be zero (single char color names: smaller xpm's)
-              * or should all be non-zero (double char color names: more colors)
-              */
-} t_xpmelmt;
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-typedef short t_matelmt;
+struct t_pbc;
 
-typedef struct {
-    t_xpmelmt   code; /* see comment for t_xpmelmt */
-    const char *desc;
-    t_rgb       rgb;
-} t_mapping;
+/*! \brief Helper function that wraps calls to posres */
+void
+posres_wrapper(t_nrnb             *nrnb,
+               const t_idef       *idef,
+               const struct t_pbc *pbc,
+               const rvec          x[],
+               gmx_enerdata_t     *enerd,
+               real               *lambda,
+               t_forcerec         *fr);
 
-#define MAT_SPATIAL_X (1<<0)
-#define MAT_SPATIAL_Y (1<<1)
-/* Defines if x and y are spatial dimensions,
- * when not, there are n axis ticks at the middle of the elements,
- * when set, there are n+1 axis ticks at the edges of the elements.
- */
+/*! \brief Helper function that wraps calls to posres for free-energy
+    pertubation */
+void
+posres_wrapper_lambda(const t_lambda     *fepvals,
+                      const t_idef       *idef,
+                      const struct t_pbc *pbc,
+                      const rvec          x[],
+                      gmx_enerdata_t     *enerd,
+                      real               *lambda,
+                      t_forcerec         *fr);
 
-typedef struct {
-    unsigned int flags; /* The possible flags are defined above */
-    int          nx, ny;
-    int          y0;
-    char         title[256];
-    char         legend[256];
-    char         label_x[256];
-    char         label_y[256];
-    gmx_bool     bDiscrete;
-    real        *axis_x;
-    real        *axis_y;
-    t_matelmt  **matrix;
-    int          nmap;
-    t_mapping   *map;
-} t_matrix;
-/* title      matrix title
- * legend     label for the continuous legend
- * label_x    label for the x-axis
- * label_y    label for the y-axis
- * nx, ny     size of the matrix
- * axis_x[]   the x-ticklabels
- * axis_y[]   the y-ticklables
- * *matrix[]  element x,y is matrix[x][y]
- * nmap       number of color levels for the output(?)
- */
+/*! \brief Helper function that wraps calls to fbposres for
+    free-energy perturbation */
+void fbposres_wrapper(t_nrnb             *nrnb,
+                      const t_idef       *idef,
+                      const struct t_pbc *pbc,
+                      const rvec          x[],
+                      gmx_enerdata_t     *enerd,
+                      t_forcerec         *fr);
 
 #ifdef __cplusplus
 }
similarity index 97%
rename from src/gromacs/gmxlib/restcbt.c
rename to src/gromacs/listed-forces/restcbt.cpp
index 272c9fde1b19ad828bb9e92eafda7e64f94f4899..795c8308a7a3d8d4caf4bf43af48da07ce6c2473 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.
  */
+/*! \internal \file
+ *
+ * \brief
+ * This file contains function definitions necessary
+ * for computations of forces due to restricted angle, restricted dihedral and
+ * combined bending-torsion potentials.
+ *
+ * \author Nicolae Goga
+ *
+ * \ingroup module_listed-forces
+ */
+#include "gmxpre.h"
+
+#include "restcbt.h"
 
 #include <math.h>
-#include <assert.h>
-#include "physics.h"
-#include "vec.h"
+
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "txtdump.h"
-#include "bondf.h"
-#include "gromacs/utility/smalloc.h"
-#include "pbc.h"
-#include "ns.h"
-#include "macros.h"
-#include "names.h"
-#include "mshift.h"
-#include "main.h"
-#include "disre.h"
-#include "orires.h"
-#include "force.h"
-#include "nonbonded.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/idef.h"
 
 /* This function computes factors needed for restricted angle potential.
  * For explanations on formula used see file "restcbt.h" */
@@ -103,7 +105,7 @@ void compute_factors_restrdihs(int type,  const t_iparams forceparams[],
                                real *prefactor_phi, real *v)
 {
 
-    real phi0, sine_phi0, cosine_phi0;
+    real phi0, cosine_phi0;
     real k_torsion;
     real c_self_ante, c_self_crnt, c_self_post;
     real c_cros_ante, c_cros_acrs, c_cros_post;
@@ -111,12 +113,11 @@ void compute_factors_restrdihs(int type,  const t_iparams forceparams[],
     real sine_phi_sq, cosine_phi;
     real delta_cosine, term_phi_phi0;
     real ratio_phi_ante, ratio_phi_post;
-    real cos_phi, norm_phi;
+    real norm_phi;
 
     /* Read parameters phi0 and k_torsion */
     phi0        = forceparams[type].pdihs.phiA * DEG2RAD;
     cosine_phi0 = cos(phi0);
-    sine_phi0   = sin(phi0);
     k_torsion   = forceparams[type].pdihs.cpA;
 
     /* Computation of the cosine of the dihedral angle. The scalar ("dot") product  method
similarity index 97%
rename from src/gromacs/gmxlib/restcbt.h
rename to src/gromacs/listed-forces/restcbt.h
index 62adbda8e4c872d5adbe3e8d0607cda876127bf0..0cb46da0f9c6b49761cc163422ff737171d61b85 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-
-/*! \libinternal \file
+/*! \internal \file
  *
  *
  * \brief
  * This file contains function declarations necessary
    for computations of forces due to restricted angle, restricted dihedral and
    combined bending-torsion potentials.
-
  *
  * \author Nicolae Goga
  *
- * \inlibraryapi
+ * \ingroup module_listed-forces
  */
 
-#ifndef _restcbt_h
-#define _restcbt_h
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifndef GMX_LISTED_FORCES_RESTCBT_H
+#define GMX_LISTED_FORCES_RESTCBT_H
 
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/idef.h"
 
 /*! \brief This function computes factors needed for restricted angle potentials.
  *
@@ -175,9 +171,4 @@ void compute_factors_cbtdihs(int type,  const t_iparams forceparams[],
                              rvec f_theta_post_aj, rvec f_theta_post_ak, rvec f_theta_post_al,
                              real * v);
 
-
-#ifdef __cplusplus
-}
 #endif
-
-#endif  /* _restcbt_h */
diff --git a/src/gromacs/math/3dtransforms.cpp b/src/gromacs/math/3dtransforms.cpp
new file mode 100644 (file)
index 0000000..41e80d6
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * 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) 2010,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#include "gmxpre.h"
+
+#include "3dtransforms.h"
+
+#include <math.h>
+#include <stdio.h>
+
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+
+#define N 4
+
+void gmx_mat4_copy(mat4 a, mat4 b)
+{
+    for (int i = 0; i < N; ++i)
+    {
+        for (int j = 0; j < N; ++j)
+        {
+            b[i][j] = a[i][j];
+        }
+    }
+}
+
+void gmx_mat4_transform_point(mat4 m, rvec x, vec4 v)
+{
+    int i;
+
+    for (i = 0; (i < N); i++)
+    {
+        v[i] = m[XX][i]*x[XX]+m[YY][i]*x[YY]+m[ZZ][i]*x[ZZ]+m[WW][i];
+    }
+}
+
+void gmx_mat4_mmul(mat4 A, mat4 B, mat4 C)
+{
+    int i, j, k;
+
+    for (i = 0; i < N; i++)
+    {
+        for (j = 0; j < N; j++)
+        {
+            A[i][j] = 0;
+            for (k = 0; (k < N); k++)
+            {
+                A[i][j] += B[i][k]*C[k][j];
+            }
+        }
+    }
+}
+
+void gmx_mat4_init_unity(mat4 m)
+{
+    int i, j;
+
+    for (i = 0; (i < N); i++)
+    {
+        for (j = 0; (j < N); j++)
+        {
+            if (i == j)
+            {
+                m[i][j] = 1.0;
+            }
+            else
+            {
+                m[i][j] = 0.0;
+            }
+        }
+    }
+}
+
+void gmx_mat4_init_rotation(int axis, real angle, mat4 A)
+{
+    gmx_mat4_init_unity(A);
+
+    switch (axis)
+    {
+        case XX:
+            A[YY][YY] =  cos(angle);
+            A[YY][ZZ] = -sin(angle);
+            A[ZZ][YY] =  sin(angle);
+            A[ZZ][ZZ] =  cos(angle);
+            break;
+        case YY:
+            A[XX][XX] =  cos(angle);
+            A[XX][ZZ] =  sin(angle);
+            A[ZZ][XX] = -sin(angle);
+            A[ZZ][ZZ] =  cos(angle);
+            break;
+        case ZZ:
+            A[XX][XX] =  cos(angle);
+            A[XX][YY] = -sin(angle);
+            A[YY][XX] =  sin(angle);
+            A[YY][YY] =  cos(angle);
+            break;
+        default:
+            gmx_fatal(FARGS, "Error: invalid axis: %d", axis);
+    }
+}
+
+void gmx_mat4_init_translation(real tx, real ty, real tz, mat4 A)
+{
+    gmx_mat4_init_unity(A);
+    A[3][XX] = tx;
+    A[3][YY] = ty;
+    A[3][ZZ] = tz;
+}
+
+void gmx_mat4_print(FILE *fp, const char *s, mat4 A)
+{
+    int i, j;
+
+    if (fp)
+    {
+        fprintf(fp, "%s: ", s);
+        for (i = 0; i < N; i++)
+        {
+            fprintf(fp, "\t");
+            for (j = 0; j < N; j++)
+            {
+                fprintf(fp, "%10.5f", A[i][j]);
+            }
+            fprintf(fp, "\n");
+        }
+    }
+}
+
+void gmx_vec4_print(FILE *fp, const char *s, vec4 a)
+{
+    int j;
+
+    if (fp)
+    {
+        fprintf(fp, "%s: ", s);
+        for (j = 0; j < N; j++)
+        {
+            fprintf(fp, "%10.5f", a[j]);
+        }
+        fprintf(fp, "\n");
+    }
+}
similarity index 60%
rename from src/gromacs/legacyheaders/types/nlistheuristics.h
rename to src/gromacs/math/3dtransforms.h
index 86cd42c74fe9e65c63c5f92c433e0cfea987801a..40516c60c6aaf73762d8657b3e863bb1500a8a91 100644 (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,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _nlistheuristics_h
-#define _nlistheuristics_h
+#ifndef GMX_MATH_3DTRANSFORMS_H
+#define GMX_MATH_3DTRANSFORMS_H
+
+#include <stdio.h>
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#if 0
-}
-/* Hack to make automatic indenting work */
-#endif
+/** Index for the fourth dimension for `vec4`. */
+#define WW 3
+
+/*! \brief
+ * 4D vector type used in 3D transformations.
+ *
+ * In \Gromacs, only a limited set of 3D transformations are used, and all of
+ * them operate on coordinates, so the fourth element is assumed to be one and
+ * ignored in all contexts.
+ */
+typedef real vec4[4];
+
+/*! \brief
+ * 4D matrix type used in 3D transformations.
+ */
+typedef real mat4[4][4];
+
+void gmx_mat4_copy(mat4 a, mat4 b);
+
+void gmx_mat4_transform_point(mat4 m, rvec x, vec4 v);
+
+/*! \brief
+ * Computes the product of two `mat4` matrices as A = B * C.
+ *
+ * Note that the order of operands is different from mmul() in vec.h!
+ */
+void gmx_mat4_mmul(mat4 A, mat4 B, mat4 C);
 
-typedef struct {
-    gmx_bool        bGStatEveryStep;
-    gmx_int64_t     step_ns;
-    gmx_int64_t     step_nscheck;
-    gmx_int64_t     nns;
-    matrix          scale_tot;
-    int             nabnsb;
-    double          s1;
-    double          s2;
-    double          ab;
-    double          lt_runav;
-    double          lt_runav2;
-} gmx_nlheur_t;
+void gmx_mat4_init_unity(mat4 m);
 
-void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_int64_t step);
+void gmx_mat4_init_rotation(int axis, real angle, mat4 A);
 
-void init_nlistheuristics(gmx_nlheur_t *nlh,
-                          gmx_bool bGStatEveryStep, gmx_int64_t step);
+void gmx_mat4_init_translation(real tx, real ty, real tz, mat4 A);
 
-void update_nliststatistics(gmx_nlheur_t *nlh, gmx_int64_t step);
+void gmx_mat4_print(FILE *fp, const char *s, mat4 A);
 
-void set_nlistheuristics(gmx_nlheur_t *nlh, gmx_bool bReset, gmx_int64_t step);
+void gmx_vec4_print(FILE *fp, const char *s, vec4 a);
 
 #ifdef __cplusplus
 }
index dfaba940839bb735a23240361b01a9f1d1062f16..d05cf8016471f7f7145653ea14564077155652d0 100644 (file)
 file(GLOB MATH_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${MATH_SOURCES} PARENT_SCOPE)
 
-set(MATH_PUBLIC_HEADERS
-    3dview.h
-    gmxcomplex.h
+gmx_install_headers(
+    3dtransforms.h
+    calculate-ewald-splitting-coefficient.h
     do_fit.h
+    gmxcomplex.h
+    units.h
     utilities.h
+    vec.h
+    vectypes.h
     )
-gmx_install_headers(math ${MATH_PUBLIC_HEADERS})
 
 if (BUILD_TESTING)
-#    add_subdirectory(tests)
+    add_subdirectory(tests)
 endif()
diff --git a/src/gromacs/math/calculate-ewald-splitting-coefficient.cpp b/src/gromacs/math/calculate-ewald-splitting-coefficient.cpp
new file mode 100644 (file)
index 0000000..f5b4b76
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "calculate-ewald-splitting-coefficient.h"
+
+#include <cmath>
+
+#include "gromacs/math/utilities.h"
+#include "gromacs/utility/real.h"
+
+real calc_ewaldcoeff_q(real rc, real rtol)
+{
+    real beta = 5, low, high;
+    int  n, i = 0;
+
+    do
+    {
+        i++;
+        beta *= 2;
+    }
+    while (gmx_erfc(beta*rc) > rtol);
+
+    /* Do a binary search with tolerance 2^-60 */
+    n    = i+60;
+    low  = 0;
+    high = beta;
+    for (i = 0; i < n; i++)
+    {
+        beta = (low+high)/2;
+        if (gmx_erfc(beta*rc) > rtol)
+        {
+            low = beta;
+        }
+        else
+        {
+            high = beta;
+        }
+    }
+    return beta;
+}
+
+static real compute_lj_function(real beta, real rc)
+{
+    real xrc, xrc2, xrc4, result;
+    xrc    = beta*rc;
+    xrc2   = xrc*xrc;
+    xrc4   = xrc2*xrc2;
+    result = std::exp(-xrc2)*(1 + xrc2 + xrc4/2.0);
+
+    return result;
+}
+
+real calc_ewaldcoeff_lj(real rc, real rtol)
+{
+    real beta = 5, low, high;
+    int  n, i = 0;
+
+    do
+    {
+        i++;
+        beta *= 2.0;
+    }
+    while (compute_lj_function(beta, rc) > rtol);
+
+    /* Do a binary search with tolerance 2^-60 */
+    n    = i + 60;
+    low  = 0;
+    high = beta;
+    for (i = 0; i < n; ++i)
+    {
+        beta = (low + high) / 2.0;
+        if (compute_lj_function(beta, rc) > rtol)
+        {
+            low = beta;
+        }
+        else
+        {
+            high = beta;
+        }
+    }
+    return beta;
+}
diff --git a/src/gromacs/math/calculate-ewald-splitting-coefficient.h b/src/gromacs/math/calculate-ewald-splitting-coefficient.h
new file mode 100644 (file)
index 0000000..47ebb89
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 functions for computing Ewald splitting coefficients
+ *
+ * These belong in the maths module because they do simple maths and
+ * are used many parts of Gromacs.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ * \inpublicapi
+ */
+#ifndef GMX_MATH_CALCULATE_EWALD_SPLITTING_COEFFICIENT_H
+#define GMX_MATH_CALCULATE_EWALD_SPLITTING_COEFFICIENT_H
+
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief Computes the Ewald splitting coefficient for Coulomb
+ *
+ * Returns a value of beta that satisfies rtol > erfc(beta * rc)
+ * (and is very close to equality). That value is used the same way in
+ * all Coulomb-based Ewald methods.
+ *
+ * \param[in] rc    Cutoff radius
+ * \param[in] rtol  Required maximum value of the short-ranged
+ *                  potential at the cutoff (ie. ewald-rtol)
+ * \return          The value of the splitting coefficient that
+ *                  produces the required dtol at rc.
+ */
+real
+calc_ewaldcoeff_q(real rc, real rtol);
+
+/*! \brief Computes the Ewald splitting coefficient for LJ
+ *
+ * Returns a value of beta that satisfies dtol > erfc(beta * rc) * (1
+ * + beta^2 * rc^2 + 0.5 * beta^4 * rc^4) (and is very close to
+ * equality), which is used in LJ-PME.
+ *
+ * \param[in] rc    Cutoff radius
+ * \param[in] rtol  Required maximum value of the short-ranged
+ *                  potential at the cutoff (ie. ewald-rtol-lj)
+ * \return          The value of the splitting coefficient that
+ *                  produces the required dtol at rc.
+ */
+real
+calc_ewaldcoeff_lj(real rc, real rtol);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 9701f769ab30982c3063c8c84012b2cc89ace86a..ff2f71fa86ed52dbbf6373dd02190234b7b41a97 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.
  */
+#include "gmxpre.h"
+
 #include "do_fit.h"
 
-#include "gromacs/math/utilities.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "txtdump.h"
+#include <math.h>
+#include <stdio.h>
 
 #include "gromacs/linearalgebra/nrjac.h"
-#include "gmx_fatal.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
 real calc_similar_ind(gmx_bool bRho, int nind, atom_id *index, real mass[],
index 9cc02c045a62c5f6a9fc633d3bf6c16d6d767b87..526d4e33137584b121abe742c2c9b41d1bab235d 100644 (file)
 #ifndef GMX_MATH_DO_FIT_H
 #define GMX_MATH_DO_FIT_H
 
-#include "../legacyheaders/types/simple.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index d7d26003f350c32adbdc143cc324b0f8d0509dec..8fa0c8ad6a8570b0fc45cfcbac2d6aa201908e8f 100644 (file)
@@ -38,7 +38,9 @@
 #define GMX_MATH_GMXCOMPLEX_H
 
 #include <math.h>
-#include "../legacyheaders/types/simple.h"
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
 
 typedef struct {
     real re, im;
diff --git a/src/gromacs/math/invsqrt.c b/src/gromacs/math/invsqrt.c
new file mode 100644 (file)
index 0000000..782f656
--- /dev/null
@@ -0,0 +1,624 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "gromacs/math/vec.h"
+
+/** Exponential lookup table - 256 floats */
+const unsigned int gmx_invsqrt_exptab[256] = {
+    0x5f000000, 0x5e800000, 0x5e800000, 0x5e000000,
+    0x5e000000, 0x5d800000, 0x5d800000, 0x5d000000,
+    0x5d000000, 0x5c800000, 0x5c800000, 0x5c000000,
+    0x5c000000, 0x5b800000, 0x5b800000, 0x5b000000,
+    0x5b000000, 0x5a800000, 0x5a800000, 0x5a000000,
+    0x5a000000, 0x59800000, 0x59800000, 0x59000000,
+    0x59000000, 0x58800000, 0x58800000, 0x58000000,
+    0x58000000, 0x57800000, 0x57800000, 0x57000000,
+    0x57000000, 0x56800000, 0x56800000, 0x56000000,
+    0x56000000, 0x55800000, 0x55800000, 0x55000000,
+    0x55000000, 0x54800000, 0x54800000, 0x54000000,
+    0x54000000, 0x53800000, 0x53800000, 0x53000000,
+    0x53000000, 0x52800000, 0x52800000, 0x52000000,
+    0x52000000, 0x51800000, 0x51800000, 0x51000000,
+    0x51000000, 0x50800000, 0x50800000, 0x50000000,
+    0x50000000, 0x4f800000, 0x4f800000, 0x4f000000,
+    0x4f000000, 0x4e800000, 0x4e800000, 0x4e000000,
+    0x4e000000, 0x4d800000, 0x4d800000, 0x4d000000,
+    0x4d000000, 0x4c800000, 0x4c800000, 0x4c000000,
+    0x4c000000, 0x4b800000, 0x4b800000, 0x4b000000,
+    0x4b000000, 0x4a800000, 0x4a800000, 0x4a000000,
+    0x4a000000, 0x49800000, 0x49800000, 0x49000000,
+    0x49000000, 0x48800000, 0x48800000, 0x48000000,
+    0x48000000, 0x47800000, 0x47800000, 0x47000000,
+    0x47000000, 0x46800000, 0x46800000, 0x46000000,
+    0x46000000, 0x45800000, 0x45800000, 0x45000000,
+    0x45000000, 0x44800000, 0x44800000, 0x44000000,
+    0x44000000, 0x43800000, 0x43800000, 0x43000000,
+    0x43000000, 0x42800000, 0x42800000, 0x42000000,
+    0x42000000, 0x41800000, 0x41800000, 0x41000000,
+    0x41000000, 0x40800000, 0x40800000, 0x40000000,
+    0x40000000, 0x3f800000, 0x3f800000, 0x3f000000,
+    0x3f000000, 0x3e800000, 0x3e800000, 0x3e000000,
+    0x3e000000, 0x3d800000, 0x3d800000, 0x3d000000,
+    0x3d000000, 0x3c800000, 0x3c800000, 0x3c000000,
+    0x3c000000, 0x3b800000, 0x3b800000, 0x3b000000,
+    0x3b000000, 0x3a800000, 0x3a800000, 0x3a000000,
+    0x3a000000, 0x39800000, 0x39800000, 0x39000000,
+    0x39000000, 0x38800000, 0x38800000, 0x38000000,
+    0x38000000, 0x37800000, 0x37800000, 0x37000000,
+    0x37000000, 0x36800000, 0x36800000, 0x36000000,
+    0x36000000, 0x35800000, 0x35800000, 0x35000000,
+    0x35000000, 0x34800000, 0x34800000, 0x34000000,
+    0x34000000, 0x33800000, 0x33800000, 0x33000000,
+    0x33000000, 0x32800000, 0x32800000, 0x32000000,
+    0x32000000, 0x31800000, 0x31800000, 0x31000000,
+    0x31000000, 0x30800000, 0x30800000, 0x30000000,
+    0x30000000, 0x2f800000, 0x2f800000, 0x2f000000,
+    0x2f000000, 0x2e800000, 0x2e800000, 0x2e000000,
+    0x2e000000, 0x2d800000, 0x2d800000, 0x2d000000,
+    0x2d000000, 0x2c800000, 0x2c800000, 0x2c000000,
+    0x2c000000, 0x2b800000, 0x2b800000, 0x2b000000,
+    0x2b000000, 0x2a800000, 0x2a800000, 0x2a000000,
+    0x2a000000, 0x29800000, 0x29800000, 0x29000000,
+    0x29000000, 0x28800000, 0x28800000, 0x28000000,
+    0x28000000, 0x27800000, 0x27800000, 0x27000000,
+    0x27000000, 0x26800000, 0x26800000, 0x26000000,
+    0x26000000, 0x25800000, 0x25800000, 0x25000000,
+    0x25000000, 0x24800000, 0x24800000, 0x24000000,
+    0x24000000, 0x23800000, 0x23800000, 0x23000000,
+    0x23000000, 0x22800000, 0x22800000, 0x22000000,
+    0x22000000, 0x21800000, 0x21800000, 0x21000000,
+    0x21000000, 0x20800000, 0x20800000, 0x20000000,
+    0x20000000, 0x1f800000, 0x1f800000, 0x1f000000
+};
+
+/** Mantissa lookup table - 4096 floats */
+const unsigned int gmx_invsqrt_fracttab[4096] = {
+    0x3504f3, 0x34f9a4, 0x34ee57, 0x34e30c, 0x34d7c3, 0x34cc7c, 0x34c137, 0x34b5f5,
+    0x34aab4, 0x349f76, 0x34943a, 0x348900, 0x347dc7, 0x347291, 0x34675e, 0x345c2c,
+    0x3450fc, 0x3445ce, 0x343aa3, 0x342f79, 0x342452, 0x34192c, 0x340e09, 0x3402e8,
+    0x33f7c9, 0x33ecac, 0x33e191, 0x33d678, 0x33cb61, 0x33c04c, 0x33b539, 0x33aa28,
+    0x339f19, 0x33940d, 0x338902, 0x337df9, 0x3372f3, 0x3367ee, 0x335cec, 0x3351eb,
+    0x3346ed, 0x333bf0, 0x3330f6, 0x3325fd, 0x331b07, 0x331013, 0x330520, 0x32fa30,
+    0x32ef41, 0x32e455, 0x32d96b, 0x32ce82, 0x32c39c, 0x32b8b7, 0x32add5, 0x32a2f5,
+    0x329816, 0x328d3a, 0x32825f, 0x327787, 0x326cb0, 0x3261dc, 0x325709, 0x324c38,
+    0x32416a, 0x32369d, 0x322bd2, 0x32210a, 0x321643, 0x320b7e, 0x3200bb, 0x31f5fa,
+    0x31eb3b, 0x31e07e, 0x31d5c3, 0x31cb0a, 0x31c053, 0x31b59d, 0x31aaea, 0x31a038,
+    0x319589, 0x318adb, 0x318030, 0x317586, 0x316ade, 0x316038, 0x315594, 0x314af2,
+    0x314052, 0x3135b4, 0x312b18, 0x31207d, 0x3115e5, 0x310b4e, 0x3100b9, 0x30f627,
+    0x30eb96, 0x30e107, 0x30d67a, 0x30cbee, 0x30c165, 0x30b6dd, 0x30ac58, 0x30a1d4,
+    0x309752, 0x308cd2, 0x308254, 0x3077d8, 0x306d5e, 0x3062e5, 0x30586e, 0x304dfa,
+    0x304387, 0x303916, 0x302ea7, 0x302439, 0x3019ce, 0x300f64, 0x3004fc, 0x2ffa96,
+    0x2ff032, 0x2fe5d0, 0x2fdb6f, 0x2fd111, 0x2fc6b4, 0x2fbc59, 0x2fb200, 0x2fa7a9,
+    0x2f9d53, 0x2f9300, 0x2f88ae, 0x2f7e5e, 0x2f7410, 0x2f69c3, 0x2f5f79, 0x2f5530,
+    0x2f4ae9, 0x2f40a4, 0x2f3661, 0x2f2c1f, 0x2f21df, 0x2f17a1, 0x2f0d65, 0x2f032b,
+    0x2ef8f2, 0x2eeebc, 0x2ee487, 0x2eda53, 0x2ed022, 0x2ec5f2, 0x2ebbc5, 0x2eb199,
+    0x2ea76e, 0x2e9d46, 0x2e931f, 0x2e88fa, 0x2e7ed7, 0x2e74b5, 0x2e6a96, 0x2e6078,
+    0x2e565c, 0x2e4c41, 0x2e4229, 0x2e3812, 0x2e2dfd, 0x2e23e9, 0x2e19d8, 0x2e0fc8,
+    0x2e05ba, 0x2dfbad, 0x2df1a3, 0x2de79a, 0x2ddd93, 0x2dd38d, 0x2dc989, 0x2dbf87,
+    0x2db587, 0x2dab89, 0x2da18c, 0x2d9791, 0x2d8d97, 0x2d83a0, 0x2d79aa, 0x2d6fb6,
+    0x2d65c3, 0x2d5bd2, 0x2d51e3, 0x2d47f6, 0x2d3e0a, 0x2d3420, 0x2d2a38, 0x2d2051,
+    0x2d166c, 0x2d0c89, 0x2d02a8, 0x2cf8c8, 0x2ceeea, 0x2ce50d, 0x2cdb33, 0x2cd15a,
+    0x2cc782, 0x2cbdad, 0x2cb3d9, 0x2caa06, 0x2ca036, 0x2c9667, 0x2c8c99, 0x2c82ce,
+    0x2c7904, 0x2c6f3b, 0x2c6575, 0x2c5bb0, 0x2c51ed, 0x2c482b, 0x2c3e6b, 0x2c34ad,
+    0x2c2af0, 0x2c2135, 0x2c177b, 0x2c0dc4, 0x2c040e, 0x2bfa59, 0x2bf0a6, 0x2be6f5,
+    0x2bdd46, 0x2bd398, 0x2bc9eb, 0x2bc041, 0x2bb698, 0x2bacf0, 0x2ba34b, 0x2b99a6,
+    0x2b9004, 0x2b8663, 0x2b7cc4, 0x2b7326, 0x2b698a, 0x2b5ff0, 0x2b5657, 0x2b4cc0,
+    0x2b432a, 0x2b3996, 0x2b3004, 0x2b2673, 0x2b1ce4, 0x2b1357, 0x2b09cb, 0x2b0040,
+    0x2af6b7, 0x2aed30, 0x2ae3ab, 0x2ada27, 0x2ad0a4, 0x2ac724, 0x2abda4, 0x2ab427,
+    0x2aaaab, 0x2aa130, 0x2a97b7, 0x2a8e40, 0x2a84ca, 0x2a7b56, 0x2a71e3, 0x2a6872,
+    0x2a5f03, 0x2a5595, 0x2a4c29, 0x2a42be, 0x2a3955, 0x2a2fed, 0x2a2687, 0x2a1d23,
+    0x2a13c0, 0x2a0a5e, 0x2a00fe, 0x29f7a0, 0x29ee43, 0x29e4e8, 0x29db8e, 0x29d236,
+    0x29c8e0, 0x29bf8b, 0x29b637, 0x29ace5, 0x29a395, 0x299a46, 0x2990f8, 0x2987ad,
+    0x297e62, 0x297519, 0x296bd2, 0x29628c, 0x295948, 0x295005, 0x2946c4, 0x293d85,
+    0x293446, 0x292b0a, 0x2921cf, 0x291895, 0x290f5d, 0x290626, 0x28fcf1, 0x28f3be,
+    0x28ea8c, 0x28e15b, 0x28d82c, 0x28cefe, 0x28c5d2, 0x28bca8, 0x28b37f, 0x28aa57,
+    0x28a131, 0x28980c, 0x288ee9, 0x2885c7, 0x287ca7, 0x287389, 0x286a6b, 0x286150,
+    0x285835, 0x284f1c, 0x284605, 0x283cef, 0x2833db, 0x282ac8, 0x2821b7, 0x2818a7,
+    0x280f98, 0x28068b, 0x27fd80, 0x27f475, 0x27eb6d, 0x27e266, 0x27d960, 0x27d05c,
+    0x27c759, 0x27be57, 0x27b557, 0x27ac59, 0x27a35c, 0x279a60, 0x279166, 0x27886d,
+    0x277f76, 0x277680, 0x276d8c, 0x276499, 0x275ba7, 0x2752b7, 0x2749c9, 0x2740db,
+    0x2737f0, 0x272f05, 0x27261c, 0x271d35, 0x27144f, 0x270b6a, 0x270287, 0x26f9a5,
+    0x26f0c4, 0x26e7e5, 0x26df08, 0x26d62c, 0x26cd51, 0x26c477, 0x26bba0, 0x26b2c9,
+    0x26a9f4, 0x26a120, 0x26984e, 0x268f7d, 0x2686ad, 0x267ddf, 0x267512, 0x266c47,
+    0x26637d, 0x265ab4, 0x2651ed, 0x264927, 0x264063, 0x2637a0, 0x262ede, 0x26261e,
+    0x261d5f, 0x2614a2, 0x260be6, 0x26032b, 0x25fa72, 0x25f1ba, 0x25e903, 0x25e04e,
+    0x25d79a, 0x25cee7, 0x25c636, 0x25bd87, 0x25b4d8, 0x25ac2b, 0x25a37f, 0x259ad5,
+    0x25922c, 0x258985, 0x2580de, 0x257839, 0x256f96, 0x2566f4, 0x255e53, 0x2555b3,
+    0x254d15, 0x254479, 0x253bdd, 0x253343, 0x252aaa, 0x252213, 0x25197d, 0x2510e8,
+    0x250855, 0x24ffc3, 0x24f732, 0x24eea3, 0x24e615, 0x24dd88, 0x24d4fc, 0x24cc72,
+    0x24c3ea, 0x24bb62, 0x24b2dc, 0x24aa57, 0x24a1d4, 0x249952, 0x2490d1, 0x248852,
+    0x247fd3, 0x247756, 0x246edb, 0x246661, 0x245de8, 0x245570, 0x244cfa, 0x244485,
+    0x243c11, 0x24339f, 0x242b2e, 0x2422be, 0x241a4f, 0x2411e2, 0x240976, 0x24010c,
+    0x23f8a2, 0x23f03a, 0x23e7d4, 0x23df6e, 0x23d70a, 0x23cea7, 0x23c646, 0x23bde6,
+    0x23b587, 0x23ad29, 0x23a4cc, 0x239c71, 0x239417, 0x238bbf, 0x238368, 0x237b12,
+    0x2372bd, 0x236a69, 0x236217, 0x2359c6, 0x235177, 0x234928, 0x2340db, 0x23388f,
+    0x233045, 0x2327fb, 0x231fb3, 0x23176c, 0x230f27, 0x2306e2, 0x22fe9f, 0x22f65e,
+    0x22ee1d, 0x22e5de, 0x22dda0, 0x22d563, 0x22cd28, 0x22c4ed, 0x22bcb4, 0x22b47c,
+    0x22ac46, 0x22a411, 0x229bdd, 0x2293aa, 0x228b78, 0x228348, 0x227b19, 0x2272eb,
+    0x226abe, 0x226293, 0x225a69, 0x225240, 0x224a18, 0x2241f2, 0x2239cc, 0x2231a8,
+    0x222985, 0x222164, 0x221944, 0x221124, 0x220907, 0x2200ea, 0x21f8ce, 0x21f0b4,
+    0x21e89b, 0x21e083, 0x21d86d, 0x21d057, 0x21c843, 0x21c030, 0x21b81e, 0x21b00e,
+    0x21a7fe, 0x219ff0, 0x2197e3, 0x218fd8, 0x2187cd, 0x217fc4, 0x2177bc, 0x216fb5,
+    0x2167af, 0x215faa, 0x2157a7, 0x214fa5, 0x2147a4, 0x213fa4, 0x2137a5, 0x212fa8,
+    0x2127ac, 0x211fb1, 0x2117b7, 0x210fbe, 0x2107c7, 0x20ffd0, 0x20f7db, 0x20efe7,
+    0x20e7f5, 0x20e003, 0x20d813, 0x20d023, 0x20c835, 0x20c048, 0x20b85d, 0x20b072,
+    0x20a889, 0x20a0a1, 0x2098ba, 0x2090d4, 0x2088ef, 0x20810b, 0x207929, 0x207148,
+    0x206968, 0x206189, 0x2059ab, 0x2051cf, 0x2049f3, 0x204219, 0x203a40, 0x203268,
+    0x202a91, 0x2022bb, 0x201ae7, 0x201313, 0x200b41, 0x200370, 0x1ffba0, 0x1ff3d1,
+    0x1fec04, 0x1fe437, 0x1fdc6c, 0x1fd4a2, 0x1fccd9, 0x1fc511, 0x1fbd4a, 0x1fb584,
+    0x1fadc0, 0x1fa5fc, 0x1f9e3a, 0x1f9679, 0x1f8eb9, 0x1f86fa, 0x1f7f3c, 0x1f777f,
+    0x1f6fc4, 0x1f680a, 0x1f6050, 0x1f5898, 0x1f50e1, 0x1f492b, 0x1f4176, 0x1f39c3,
+    0x1f3210, 0x1f2a5f, 0x1f22af, 0x1f1aff, 0x1f1351, 0x1f0ba4, 0x1f03f8, 0x1efc4e,
+    0x1ef4a4, 0x1eecfb, 0x1ee554, 0x1eddae, 0x1ed608, 0x1ece64, 0x1ec6c1, 0x1ebf1f,
+    0x1eb77f, 0x1eafdf, 0x1ea840, 0x1ea0a3, 0x1e9906, 0x1e916b, 0x1e89d1, 0x1e8238,
+    0x1e7aa0, 0x1e7309, 0x1e6b73, 0x1e63de, 0x1e5c4a, 0x1e54b8, 0x1e4d26, 0x1e4596,
+    0x1e3e06, 0x1e3678, 0x1e2eeb, 0x1e275f, 0x1e1fd4, 0x1e184a, 0x1e10c1, 0x1e0939,
+    0x1e01b3, 0x1dfa2d, 0x1df2a8, 0x1deb25, 0x1de3a2, 0x1ddc21, 0x1dd4a1, 0x1dcd22,
+    0x1dc5a3, 0x1dbe26, 0x1db6aa, 0x1daf2f, 0x1da7b6, 0x1da03d, 0x1d98c5, 0x1d914e,
+    0x1d89d9, 0x1d8264, 0x1d7af1, 0x1d737e, 0x1d6c0d, 0x1d649c, 0x1d5d2d, 0x1d55bf,
+    0x1d4e52, 0x1d46e5, 0x1d3f7a, 0x1d3810, 0x1d30a7, 0x1d293f, 0x1d21d8, 0x1d1a73,
+    0x1d130e, 0x1d0baa, 0x1d0447, 0x1cfce6, 0x1cf585, 0x1cee25, 0x1ce6c7, 0x1cdf69,
+    0x1cd80d, 0x1cd0b1, 0x1cc957, 0x1cc1fe, 0x1cbaa5, 0x1cb34e, 0x1cabf8, 0x1ca4a2,
+    0x1c9d4e, 0x1c95fb, 0x1c8ea9, 0x1c8758, 0x1c8008, 0x1c78b8, 0x1c716a, 0x1c6a1d,
+    0x1c62d1, 0x1c5b86, 0x1c543c, 0x1c4cf3, 0x1c45ab, 0x1c3e65, 0x1c371f, 0x1c2fda,
+    0x1c2896, 0x1c2153, 0x1c1a11, 0x1c12d0, 0x1c0b90, 0x1c0452, 0x1bfd14, 0x1bf5d7,
+    0x1bee9b, 0x1be760, 0x1be027, 0x1bd8ee, 0x1bd1b6, 0x1bca7f, 0x1bc349, 0x1bbc15,
+    0x1bb4e1, 0x1badae, 0x1ba67c, 0x1b9f4c, 0x1b981c, 0x1b90ed, 0x1b89bf, 0x1b8292,
+    0x1b7b67, 0x1b743c, 0x1b6d12, 0x1b65e9, 0x1b5ec1, 0x1b579a, 0x1b5074, 0x1b4950,
+    0x1b422c, 0x1b3b09, 0x1b33e7, 0x1b2cc6, 0x1b25a6, 0x1b1e87, 0x1b1769, 0x1b104c,
+    0x1b0930, 0x1b0215, 0x1afafb, 0x1af3e2, 0x1aecc9, 0x1ae5b2, 0x1ade9c, 0x1ad787,
+    0x1ad073, 0x1ac95f, 0x1ac24d, 0x1abb3c, 0x1ab42b, 0x1aad1c, 0x1aa60d, 0x1a9f00,
+    0x1a97f3, 0x1a90e8, 0x1a89dd, 0x1a82d4, 0x1a7bcb, 0x1a74c3, 0x1a6dbd, 0x1a66b7,
+    0x1a5fb2, 0x1a58ae, 0x1a51ab, 0x1a4aa9, 0x1a43a8, 0x1a3ca8, 0x1a35a9, 0x1a2eab,
+    0x1a27ae, 0x1a20b1, 0x1a19b6, 0x1a12bc, 0x1a0bc2, 0x1a04ca, 0x19fdd2, 0x19f6dc,
+    0x19efe6, 0x19e8f2, 0x19e1fe, 0x19db0b, 0x19d419, 0x19cd28, 0x19c638, 0x19bf49,
+    0x19b85b, 0x19b16e, 0x19aa82, 0x19a396, 0x199cac, 0x1995c3, 0x198eda, 0x1987f3,
+    0x19810c, 0x197a26, 0x197342, 0x196c5e, 0x19657b, 0x195e99, 0x1957b8, 0x1950d8,
+    0x1949f8, 0x19431a, 0x193c3d, 0x193560, 0x192e85, 0x1927aa, 0x1920d1, 0x1919f8,
+    0x191320, 0x190c49, 0x190573, 0x18fe9e, 0x18f7ca, 0x18f0f7, 0x18ea24, 0x18e353,
+    0x18dc82, 0x18d5b3, 0x18cee4, 0x18c816, 0x18c149, 0x18ba7d, 0x18b3b2, 0x18ace8,
+    0x18a61f, 0x189f56, 0x18988f, 0x1891c8, 0x188b03, 0x18843e, 0x187d7a, 0x1876b7,
+    0x186ff5, 0x186934, 0x186274, 0x185bb4, 0x1854f6, 0x184e38, 0x18477c, 0x1840c0,
+    0x183a05, 0x18334b, 0x182c92, 0x1825da, 0x181f23, 0x18186c, 0x1811b7, 0x180b02,
+    0x18044e, 0x17fd9b, 0x17f6e9, 0x17f038, 0x17e988, 0x17e2d9, 0x17dc2a, 0x17d57d,
+    0x17ced0, 0x17c824, 0x17c179, 0x17bacf, 0x17b426, 0x17ad7e, 0x17a6d6, 0x17a030,
+    0x17998a, 0x1792e5, 0x178c41, 0x17859e, 0x177efc, 0x17785b, 0x1771ba, 0x176b1b,
+    0x17647c, 0x175dde, 0x175741, 0x1750a5, 0x174a0a, 0x17436f, 0x173cd6, 0x17363d,
+    0x172fa5, 0x17290f, 0x172278, 0x171be3, 0x17154f, 0x170ebb, 0x170829, 0x170197,
+    0x16fb06, 0x16f476, 0x16ede7, 0x16e759, 0x16e0cb, 0x16da3e, 0x16d3b3, 0x16cd28,
+    0x16c69e, 0x16c014, 0x16b98c, 0x16b305, 0x16ac7e, 0x16a5f8, 0x169f73, 0x1698ef,
+    0x16926c, 0x168be9, 0x168568, 0x167ee7, 0x167867, 0x1671e8, 0x166b6a, 0x1664ec,
+    0x165e70, 0x1657f4, 0x165179, 0x164aff, 0x164486, 0x163e0d, 0x163796, 0x16311f,
+    0x162aa9, 0x162434, 0x161dc0, 0x16174d, 0x1610da, 0x160a68, 0x1603f8, 0x15fd88,
+    0x15f718, 0x15f0aa, 0x15ea3c, 0x15e3d0, 0x15dd64, 0x15d6f9, 0x15d08e, 0x15ca25,
+    0x15c3bc, 0x15bd55, 0x15b6ee, 0x15b087, 0x15aa22, 0x15a3be, 0x159d5a, 0x1596f7,
+    0x159095, 0x158a34, 0x1583d3, 0x157d74, 0x157715, 0x1570b7, 0x156a5a, 0x1563fd,
+    0x155da2, 0x155747, 0x1550ed, 0x154a94, 0x15443c, 0x153de4, 0x15378e, 0x153138,
+    0x152ae3, 0x15248e, 0x151e3b, 0x1517e8, 0x151197, 0x150b45, 0x1504f5, 0x14fea6,
+    0x14f857, 0x14f209, 0x14ebbc, 0x14e570, 0x14df25, 0x14d8da, 0x14d290, 0x14cc47,
+    0x14c5ff, 0x14bfb7, 0x14b971, 0x14b32b, 0x14ace6, 0x14a6a1, 0x14a05e, 0x149a1b,
+    0x1493d9, 0x148d98, 0x148758, 0x148118, 0x147ada, 0x14749c, 0x146e5f, 0x146822,
+    0x1461e7, 0x145bac, 0x145572, 0x144f38, 0x144900, 0x1442c8, 0x143c91, 0x14365b,
+    0x143026, 0x1429f1, 0x1423be, 0x141d8b, 0x141758, 0x141127, 0x140af6, 0x1404c6,
+    0x13fe97, 0x13f869, 0x13f23b, 0x13ec0f, 0x13e5e3, 0x13dfb7, 0x13d98d, 0x13d363,
+    0x13cd3a, 0x13c712, 0x13c0eb, 0x13bac4, 0x13b49e, 0x13ae79, 0x13a855, 0x13a231,
+    0x139c0e, 0x1395ec, 0x138fcb, 0x1389ab, 0x13838b, 0x137d6c, 0x13774e, 0x137130,
+    0x136b13, 0x1364f8, 0x135edc, 0x1358c2, 0x1352a8, 0x134c8f, 0x134677, 0x134060,
+    0x133a49, 0x133433, 0x132e1e, 0x13280a, 0x1321f6, 0x131be3, 0x1315d1, 0x130fc0,
+    0x1309af, 0x13039f, 0x12fd90, 0x12f782, 0x12f174, 0x12eb67, 0x12e55b, 0x12df50,
+    0x12d945, 0x12d33b, 0x12cd32, 0x12c72a, 0x12c122, 0x12bb1b, 0x12b515, 0x12af10,
+    0x12a90b, 0x12a307, 0x129d04, 0x129702, 0x129100, 0x128aff, 0x1284ff, 0x127eff,
+    0x127900, 0x127302, 0x126d05, 0x126708, 0x12610d, 0x125b11, 0x125517, 0x124f1d,
+    0x124925, 0x12432c, 0x123d35, 0x12373e, 0x123148, 0x122b53, 0x12255e, 0x121f6b,
+    0x121978, 0x121385, 0x120d94, 0x1207a3, 0x1201b3, 0x11fbc3, 0x11f5d4, 0x11efe6,
+    0x11e9f9, 0x11e40d, 0x11de21, 0x11d836, 0x11d24b, 0x11cc62, 0x11c679, 0x11c090,
+    0x11baa9, 0x11b4c2, 0x11aedc, 0x11a8f7, 0x11a312, 0x119d2e, 0x11974b, 0x119168,
+    0x118b87, 0x1185a6, 0x117fc5, 0x1179e5, 0x117407, 0x116e28, 0x11684b, 0x11626e,
+    0x115c92, 0x1156b6, 0x1150dc, 0x114b02, 0x114529, 0x113f50, 0x113978, 0x1133a1,
+    0x112dca, 0x1127f5, 0x112220, 0x111c4b, 0x111678, 0x1110a5, 0x110ad3, 0x110501,
+    0x10ff30, 0x10f960, 0x10f391, 0x10edc2, 0x10e7f4, 0x10e226, 0x10dc5a, 0x10d68e,
+    0x10d0c3, 0x10caf8, 0x10c52e, 0x10bf65, 0x10b99c, 0x10b3d5, 0x10ae0e, 0x10a847,
+    0x10a281, 0x109cbc, 0x1096f8, 0x109134, 0x108b72, 0x1085af, 0x107fee, 0x107a2d,
+    0x10746d, 0x106ead, 0x1068ee, 0x106330, 0x105d73, 0x1057b6, 0x1051fa, 0x104c3e,
+    0x104684, 0x1040ca, 0x103b10, 0x103558, 0x102fa0, 0x1029e8, 0x102432, 0x101e7c,
+    0x1018c6, 0x101312, 0x100d5e, 0x1007ab, 0x1001f8, 0xffc46, 0xff695, 0xff0e4,
+    0xfeb35, 0xfe585, 0xfdfd7, 0xfda29, 0xfd47c, 0xfcecf, 0xfc923, 0xfc378,
+    0xfbdce, 0xfb824, 0xfb27b, 0xfacd2, 0xfa72a, 0xfa183, 0xf9bdd, 0xf9637,
+    0xf9092, 0xf8aed, 0xf854a, 0xf7fa6, 0xf7a04, 0xf7462, 0xf6ec1, 0xf6920,
+    0xf6381, 0xf5de1, 0xf5843, 0xf52a5, 0xf4d08, 0xf476b, 0xf41cf, 0xf3c34,
+    0xf369a, 0xf3100, 0xf2b66, 0xf25ce, 0xf2036, 0xf1a9f, 0xf1508, 0xf0f72,
+    0xf09dd, 0xf0448, 0xefeb4, 0xef921, 0xef38e, 0xeedfc, 0xee86b, 0xee2da,
+    0xedd4a, 0xed7ba, 0xed22b, 0xecc9d, 0xec710, 0xec183, 0xebbf7, 0xeb66b,
+    0xeb0e0, 0xeab56, 0xea5cc, 0xea043, 0xe9abb, 0xe9533, 0xe8fac, 0xe8a26,
+    0xe84a0, 0xe7f1b, 0xe7996, 0xe7413, 0xe6e8f, 0xe690d, 0xe638b, 0xe5e0a,
+    0xe5889, 0xe5309, 0xe4d8a, 0xe480b, 0xe428d, 0xe3d0f, 0xe3792, 0xe3216,
+    0xe2c9b, 0xe2720, 0xe21a5, 0xe1c2c, 0xe16b3, 0xe113a, 0xe0bc3, 0xe064c,
+    0xe00d5, 0xdfb5f, 0xdf5ea, 0xdf075, 0xdeb01, 0xde58e, 0xde01b, 0xddaa9,
+    0xdd538, 0xdcfc7, 0xdca57, 0xdc4e7, 0xdbf78, 0xdba0a, 0xdb49c, 0xdaf2f,
+    0xda9c2, 0xda457, 0xd9eeb, 0xd9981, 0xd9417, 0xd8ead, 0xd8945, 0xd83dc,
+    0xd7e75, 0xd790e, 0xd73a8, 0xd6e42, 0xd68dd, 0xd6379, 0xd5e15, 0xd58b2,
+    0xd534f, 0xd4ded, 0xd488c, 0xd432b, 0xd3dcb, 0xd386c, 0xd330d, 0xd2dae,
+    0xd2851, 0xd22f4, 0xd1d97, 0xd183b, 0xd12e0, 0xd0d86, 0xd082c, 0xd02d2,
+    0xcfd79, 0xcf821, 0xcf2ca, 0xced73, 0xce81c, 0xce2c7, 0xcdd72, 0xcd81d,
+    0xcd2c9, 0xccd76, 0xcc823, 0xcc2d1, 0xcbd7f, 0xcb82f, 0xcb2de, 0xcad8f,
+    0xca83f, 0xca2f1, 0xc9da3, 0xc9856, 0xc9309, 0xc8dbd, 0xc8871, 0xc8326,
+    0xc7ddc, 0xc7892, 0xc7349, 0xc6e01, 0xc68b9, 0xc6372, 0xc5e2b, 0xc58e5,
+    0xc539f, 0xc4e5a, 0xc4916, 0xc43d2, 0xc3e8f, 0xc394c, 0xc340a, 0xc2ec9,
+    0xc2988, 0xc2448, 0xc1f08, 0xc19c9, 0xc148b, 0xc0f4d, 0xc0a10, 0xc04d3,
+    0xbff97, 0xbfa5b, 0xbf521, 0xbefe6, 0xbeaad, 0xbe573, 0xbe03b, 0xbdb03,
+    0xbd5cb, 0xbd095, 0xbcb5e, 0xbc629, 0xbc0f4, 0xbbbbf, 0xbb68b, 0xbb158,
+    0xbac25, 0xba6f3, 0xba1c1, 0xb9c90, 0xb9760, 0xb9230, 0xb8d01, 0xb87d2,
+    0xb82a4, 0xb7d76, 0xb7849, 0xb731d, 0xb6df1, 0xb68c6, 0xb639b, 0xb5e71,
+    0xb5948, 0xb541f, 0xb4ef6, 0xb49cf, 0xb44a7, 0xb3f81, 0xb3a5b, 0xb3535,
+    0xb3010, 0xb2aec, 0xb25c8, 0xb20a5, 0xb1b82, 0xb1660, 0xb113e, 0xb0c1d,
+    0xb06fd, 0xb01dd, 0xafcbe, 0xaf79f, 0xaf281, 0xaed64, 0xae847, 0xae32a,
+    0xade0e, 0xad8f3, 0xad3d8, 0xacebe, 0xac9a4, 0xac48b, 0xabf73, 0xaba5b,
+    0xab544, 0xab02d, 0xaab17, 0xaa601, 0xaa0ec, 0xa9bd7, 0xa96c3, 0xa91b0,
+    0xa8c9d, 0xa878a, 0xa8279, 0xa7d67, 0xa7857, 0xa7347, 0xa6e37, 0xa6928,
+    0xa641a, 0xa5f0c, 0xa59fe, 0xa54f2, 0xa4fe5, 0xa4ada, 0xa45ce, 0xa40c4,
+    0xa3bba, 0xa36b0, 0xa31a7, 0xa2c9f, 0xa2797, 0xa2290, 0xa1d89, 0xa1883,
+    0xa137d, 0xa0e78, 0xa0974, 0xa0470, 0x9ff6c, 0x9fa69, 0x9f567, 0x9f065,
+    0x9eb64, 0x9e663, 0x9e163, 0x9dc63, 0x9d764, 0x9d266, 0x9cd68, 0x9c86a,
+    0x9c36d, 0x9be71, 0x9b975, 0x9b47a, 0x9af7f, 0x9aa85, 0x9a58b, 0x9a092,
+    0x99b9a, 0x996a1, 0x991aa, 0x98cb3, 0x987bd, 0x982c7, 0x97dd1, 0x978dc,
+    0x973e8, 0x96ef4, 0x96a01, 0x9650e, 0x9601c, 0x95b2b, 0x9563a, 0x95149,
+    0x94c59, 0x94769, 0x9427a, 0x93d8c, 0x9389e, 0x933b1, 0x92ec4, 0x929d8,
+    0x924ec, 0x92001, 0x91b16, 0x9162c, 0x91142, 0x90c59, 0x90770, 0x90288,
+    0x8fda1, 0x8f8ba, 0x8f3d3, 0x8eeed, 0x8ea08, 0x8e523, 0x8e03e, 0x8db5b,
+    0x8d677, 0x8d194, 0x8ccb2, 0x8c7d0, 0x8c2ef, 0x8be0e, 0x8b92e, 0x8b44e,
+    0x8af6f, 0x8aa91, 0x8a5b2, 0x8a0d5, 0x89bf8, 0x8971b, 0x8923f, 0x88d64,
+    0x88889, 0x883ae, 0x87ed4, 0x879fb, 0x87522, 0x87049, 0x86b71, 0x8669a,
+    0x861c3, 0x85ced, 0x85817, 0x85341, 0x84e6d, 0x84998, 0x844c5, 0x83ff1,
+    0x83b1e, 0x8364c, 0x8317a, 0x82ca9, 0x827d8, 0x82308, 0x81e39, 0x81969,
+    0x8149b, 0x80fcd, 0x80aff, 0x80632, 0x80165, 0x7fc99, 0x7f7cd, 0x7f302,
+    0x7ee37, 0x7e96d, 0x7e4a4, 0x7dfdb, 0x7db12, 0x7d64a, 0x7d182, 0x7ccbb,
+    0x7c7f5, 0x7c32f, 0x7be69, 0x7b9a4, 0x7b4df, 0x7b01b, 0x7ab58, 0x7a695,
+    0x7a1d2, 0x79d10, 0x7984f, 0x7938e, 0x78ecd, 0x78a0d, 0x7854d, 0x7808e,
+    0x77bd0, 0x77712, 0x77254, 0x76d97, 0x768da, 0x7641e, 0x75f63, 0x75aa8,
+    0x755ed, 0x75133, 0x74c79, 0x747c0, 0x74308, 0x73e50, 0x73998, 0x734e1,
+    0x7302a, 0x72b74, 0x726be, 0x72209, 0x71d55, 0x718a0, 0x713ed, 0x70f3a,
+    0x70a87, 0x705d5, 0x70123, 0x6fc72, 0x6f7c1, 0x6f311, 0x6ee61, 0x6e9b2,
+    0x6e503, 0x6e055, 0x6dba7, 0x6d6f9, 0x6d24d, 0x6cda0, 0x6c8f4, 0x6c449,
+    0x6bf9e, 0x6baf4, 0x6b64a, 0x6b1a0, 0x6acf7, 0x6a84f, 0x6a3a7, 0x69eff,
+    0x69a58, 0x695b2, 0x6910c, 0x68c66, 0x687c1, 0x6831d, 0x67e78, 0x679d5,
+    0x67532, 0x6708f, 0x66bed, 0x6674b, 0x662aa, 0x65e09, 0x65969, 0x654c9,
+    0x65029, 0x64b8a, 0x646ec, 0x6424e, 0x63db1, 0x63914, 0x63477, 0x62fdb,
+    0x62b40, 0x626a5, 0x6220a, 0x61d70, 0x618d6, 0x6143d, 0x60fa4, 0x60b0c,
+    0x60674, 0x601dd, 0x5fd46, 0x5f8b0, 0x5f41a, 0x5ef85, 0x5eaf0, 0x5e65b,
+    0x5e1c7, 0x5dd34, 0x5d8a1, 0x5d40e, 0x5cf7c, 0x5caea, 0x5c659, 0x5c1c9,
+    0x5bd38, 0x5b8a9, 0x5b419, 0x5af8a, 0x5aafc, 0x5a66e, 0x5a1e1, 0x59d54,
+    0x598c7, 0x5943b, 0x58fb0, 0x58b24, 0x5869a, 0x58210, 0x57d86, 0x578fd,
+    0x57474, 0x56feb, 0x56b64, 0x566dc, 0x56255, 0x55dcf, 0x55949, 0x554c3,
+    0x5503e, 0x54bb9, 0x54735, 0x542b1, 0x53e2e, 0x539ab, 0x53529, 0x530a7,
+    0x52c25, 0x527a4, 0x52324, 0x51ea4, 0x51a24, 0x515a5, 0x51126, 0x50ca8,
+    0x5082a, 0x503ad, 0x4ff30, 0x4fab4, 0x4f638, 0x4f1bc, 0x4ed41, 0x4e8c6,
+    0x4e44c, 0x4dfd3, 0x4db59, 0x4d6e0, 0x4d268, 0x4cdf0, 0x4c979, 0x4c502,
+    0x4c08b, 0x4bc15, 0x4b79f, 0x4b32a, 0x4aeb5, 0x4aa41, 0x4a5cd, 0x4a15a,
+    0x49ce7, 0x49874, 0x49402, 0x48f91, 0x48b1f, 0x486af, 0x4823e, 0x47dce,
+    0x4795f, 0x474f0, 0x47082, 0x46c14, 0x467a6, 0x46339, 0x45ecc, 0x45a60,
+    0x455f4, 0x45189, 0x44d1e, 0x448b3, 0x44449, 0x43fdf, 0x43b76, 0x4370d,
+    0x432a5, 0x42e3d, 0x429d6, 0x4256f, 0x42108, 0x41ca2, 0x4183c, 0x413d7,
+    0x40f72, 0x40b0e, 0x406aa, 0x40247, 0x3fde4, 0x3f981, 0x3f51f, 0x3f0bd,
+    0x3ec5c, 0x3e7fb, 0x3e39b, 0x3df3b, 0x3dadb, 0x3d67c, 0x3d21d, 0x3cdbf,
+    0x3c961, 0x3c504, 0x3c0a7, 0x3bc4a, 0x3b7ee, 0x3b393, 0x3af37, 0x3aadd,
+    0x3a682, 0x3a228, 0x39dcf, 0x39976, 0x3951d, 0x390c5, 0x38c6d, 0x38816,
+    0x383bf, 0x37f69, 0x37b13, 0x376bd, 0x37268, 0x36e13, 0x369bf, 0x3656b,
+    0x36117, 0x35cc4, 0x35872, 0x3541f, 0x34fce, 0x34b7c, 0x3472b, 0x342db,
+    0x33e8b, 0x33a3b, 0x335ec, 0x3319d, 0x32d4f, 0x32901, 0x324b3, 0x32066,
+    0x31c1a, 0x317cd, 0x31381, 0x30f36, 0x30aeb, 0x306a1, 0x30256, 0x2fe0d,
+    0x2f9c3, 0x2f57a, 0x2f132, 0x2ecea, 0x2e8a2, 0x2e45b, 0x2e014, 0x2dbce,
+    0x2d788, 0x2d343, 0x2cefd, 0x2cab9, 0x2c675, 0x2c231, 0x2bded, 0x2b9aa,
+    0x2b568, 0x2b125, 0x2ace4, 0x2a8a2, 0x2a461, 0x2a021, 0x29be1, 0x297a1,
+    0x29362, 0x28f23, 0x28ae4, 0x286a6, 0x28269, 0x27e2c, 0x279ef, 0x275b2,
+    0x27176, 0x26d3b, 0x26900, 0x264c5, 0x2608b, 0x25c51, 0x25817, 0x253de,
+    0x24fa6, 0x24b6d, 0x24735, 0x242fe, 0x23ec7, 0x23a90, 0x2365a, 0x23224,
+    0x22def, 0x229ba, 0x22585, 0x22151, 0x21d1d, 0x218ea, 0x214b7, 0x21084,
+    0x20c52, 0x20821, 0x203ef, 0x1ffbe, 0x1fb8e, 0x1f75e, 0x1f32e, 0x1eeff,
+    0x1ead0, 0x1e6a1, 0x1e273, 0x1de45, 0x1da18, 0x1d5eb, 0x1d1bf, 0x1cd93,
+    0x1c967, 0x1c53c, 0x1c111, 0x1bce6, 0x1b8bc, 0x1b493, 0x1b069, 0x1ac40,
+    0x1a818, 0x1a3f0, 0x19fc8, 0x19ba1, 0x1977a, 0x19354, 0x18f2d, 0x18b08,
+    0x186e2, 0x182be, 0x17e99, 0x17a75, 0x17651, 0x1722e, 0x16e0b, 0x169e9,
+    0x165c6, 0x161a5, 0x15d83, 0x15963, 0x15542, 0x15122, 0x14d02, 0x148e3,
+    0x144c4, 0x140a5, 0x13c87, 0x13869, 0x1344c, 0x1302f, 0x12c12, 0x127f6,
+    0x123da, 0x11fbf, 0x11ba4, 0x11789, 0x1136f, 0x10f55, 0x10b3c, 0x10723,
+    0x1030a, 0xfef2, 0xfada, 0xf6c2, 0xf2ab, 0xee95, 0xea7e, 0xe668,
+    0xe253, 0xde3e, 0xda29, 0xd614, 0xd200, 0xcded, 0xc9da, 0xc5c7,
+    0xc1b4, 0xbda2, 0xb990, 0xb57f, 0xb16e, 0xad5e, 0xa94e, 0xa53e,
+    0xa12e, 0x9d1f, 0x9911, 0x9503, 0x90f5, 0x8ce7, 0x88da, 0x84ce,
+    0x80c1, 0x7cb5, 0x78aa, 0x749f, 0x7094, 0x6c89, 0x687f, 0x6476,
+    0x606d, 0x5c64, 0x585b, 0x5453, 0x504b, 0x4c44, 0x483d, 0x4436,
+    0x4030, 0x3c2a, 0x3825, 0x3420, 0x301b, 0x2c17, 0x2813, 0x240f,
+    0x200c, 0x1c09, 0x1807, 0x1405, 0x1003, 0xc02, 0x801, 0x400,
+    0x7fffff, 0x7ff001, 0x7fe006, 0x7fd00d, 0x7fc018, 0x7fb025, 0x7fa036, 0x7f9049,
+    0x7f8060, 0x7f7079, 0x7f6095, 0x7f50b5, 0x7f40d7, 0x7f30fc, 0x7f2124, 0x7f114f,
+    0x7f017e, 0x7ef1af, 0x7ee1e2, 0x7ed219, 0x7ec253, 0x7eb290, 0x7ea2d0, 0x7e9312,
+    0x7e8358, 0x7e73a0, 0x7e63eb, 0x7e543a, 0x7e448b, 0x7e34df, 0x7e2536, 0x7e1590,
+    0x7e05ec, 0x7df64c, 0x7de6ae, 0x7dd714, 0x7dc77c, 0x7db7e7, 0x7da855, 0x7d98c6,
+    0x7d893a, 0x7d79b0, 0x7d6a2a, 0x7d5aa6, 0x7d4b25, 0x7d3ba7, 0x7d2c2c, 0x7d1cb3,
+    0x7d0d3e, 0x7cfdcb, 0x7cee5b, 0x7cdeee, 0x7ccf84, 0x7cc01d, 0x7cb0b8, 0x7ca156,
+    0x7c91f7, 0x7c829b, 0x7c7342, 0x7c63eb, 0x7c5497, 0x7c4546, 0x7c35f8, 0x7c26ad,
+    0x7c1764, 0x7c081e, 0x7bf8db, 0x7be99b, 0x7bda5d, 0x7bcb23, 0x7bbbeb, 0x7bacb5,
+    0x7b9d83, 0x7b8e53, 0x7b7f26, 0x7b6ffc, 0x7b60d4, 0x7b51b0, 0x7b428e, 0x7b336e,
+    0x7b2452, 0x7b1538, 0x7b0621, 0x7af70c, 0x7ae7fb, 0x7ad8ec, 0x7ac9e0, 0x7abad6,
+    0x7aabcf, 0x7a9ccb, 0x7a8dca, 0x7a7ecb, 0x7a6fcf, 0x7a60d5, 0x7a51df, 0x7a42eb,
+    0x7a33f9, 0x7a250b, 0x7a161f, 0x7a0735, 0x79f84f, 0x79e96b, 0x79da89, 0x79cbab,
+    0x79bccf, 0x79adf5, 0x799f1f, 0x79904a, 0x798179, 0x7972aa, 0x7963de, 0x795515,
+    0x79464e, 0x793789, 0x7928c8, 0x791a09, 0x790b4c, 0x78fc92, 0x78eddb, 0x78df27,
+    0x78d075, 0x78c1c5, 0x78b319, 0x78a46e, 0x7895c7, 0x788722, 0x78787f, 0x7869e0,
+    0x785b42, 0x784ca8, 0x783e10, 0x782f7a, 0x7820e7, 0x781257, 0x7803c9, 0x77f53e,
+    0x77e6b5, 0x77d82f, 0x77c9ab, 0x77bb2a, 0x77acac, 0x779e30, 0x778fb6, 0x77813f,
+    0x7772cb, 0x776459, 0x7755ea, 0x77477d, 0x773913, 0x772aab, 0x771c46, 0x770de3,
+    0x76ff83, 0x76f125, 0x76e2ca, 0x76d472, 0x76c61b, 0x76b7c8, 0x76a977, 0x769b28,
+    0x768cdc, 0x767e92, 0x76704b, 0x766206, 0x7653c4, 0x764584, 0x763747, 0x76290c,
+    0x761ad3, 0x760c9d, 0x75fe6a, 0x75f039, 0x75e20a, 0x75d3de, 0x75c5b5, 0x75b78e,
+    0x75a969, 0x759b46, 0x758d27, 0x757f09, 0x7570ee, 0x7562d6, 0x7554bf, 0x7546ac,
+    0x75389a, 0x752a8c, 0x751c7f, 0x750e75, 0x75006d, 0x74f268, 0x74e465, 0x74d665,
+    0x74c867, 0x74ba6b, 0x74ac72, 0x749e7b, 0x749087, 0x748295, 0x7474a5, 0x7466b8,
+    0x7458cd, 0x744ae4, 0x743cfe, 0x742f1a, 0x742139, 0x74135a, 0x74057d, 0x73f7a3,
+    0x73e9cb, 0x73dbf5, 0x73ce22, 0x73c051, 0x73b282, 0x73a4b6, 0x7396ec, 0x738925,
+    0x737b60, 0x736d9d, 0x735fdc, 0x73521e, 0x734462, 0x7336a9, 0x7328f1, 0x731b3c,
+    0x730d8a, 0x72ffd9, 0x72f22c, 0x72e480, 0x72d6d7, 0x72c92f, 0x72bb8b, 0x72ade8,
+    0x72a048, 0x7292aa, 0x72850f, 0x727775, 0x7269de, 0x725c4a, 0x724eb7, 0x724127,
+    0x723399, 0x72260e, 0x721884, 0x720afd, 0x71fd79, 0x71eff6, 0x71e276, 0x71d4f8,
+    0x71c77c, 0x71ba02, 0x71ac8b, 0x719f16, 0x7191a3, 0x718433, 0x7176c5, 0x716959,
+    0x715bef, 0x714e87, 0x714122, 0x7133bf, 0x71265e, 0x711900, 0x710ba3, 0x70fe49,
+    0x70f0f1, 0x70e39b, 0x70d648, 0x70c8f6, 0x70bba7, 0x70ae5a, 0x70a110, 0x7093c7,
+    0x708681, 0x70793d, 0x706bfb, 0x705ebb, 0x70517d, 0x704442, 0x703709, 0x7029d2,
+    0x701c9d, 0x700f6a, 0x70023a, 0x6ff50c, 0x6fe7e0, 0x6fdab6, 0x6fcd8e, 0x6fc068,
+    0x6fb345, 0x6fa624, 0x6f9904, 0x6f8be7, 0x6f7ecd, 0x6f71b4, 0x6f649d, 0x6f5789,
+    0x6f4a77, 0x6f3d67, 0x6f3059, 0x6f234d, 0x6f1643, 0x6f093c, 0x6efc36, 0x6eef33,
+    0x6ee232, 0x6ed533, 0x6ec836, 0x6ebb3b, 0x6eae42, 0x6ea14c, 0x6e9457, 0x6e8765,
+    0x6e7a74, 0x6e6d86, 0x6e609a, 0x6e53b0, 0x6e46c8, 0x6e39e3, 0x6e2cff, 0x6e201d,
+    0x6e133e, 0x6e0661, 0x6df985, 0x6decac, 0x6ddfd5, 0x6dd300, 0x6dc62d, 0x6db95c,
+    0x6dac8d, 0x6d9fc0, 0x6d92f5, 0x6d862d, 0x6d7966, 0x6d6ca2, 0x6d5fdf, 0x6d531f,
+    0x6d4660, 0x6d39a4, 0x6d2cea, 0x6d2032, 0x6d137c, 0x6d06c7, 0x6cfa15, 0x6ced65,
+    0x6ce0b7, 0x6cd40b, 0x6cc761, 0x6cbab9, 0x6cae14, 0x6ca170, 0x6c94ce, 0x6c882e,
+    0x6c7b90, 0x6c6ef5, 0x6c625b, 0x6c55c3, 0x6c492d, 0x6c3c9a, 0x6c3008, 0x6c2378,
+    0x6c16ea, 0x6c0a5f, 0x6bfdd5, 0x6bf14d, 0x6be4c8, 0x6bd844, 0x6bcbc2, 0x6bbf42,
+    0x6bb2c5, 0x6ba649, 0x6b99cf, 0x6b8d57, 0x6b80e2, 0x6b746e, 0x6b67fc, 0x6b5b8c,
+    0x6b4f1e, 0x6b42b2, 0x6b3648, 0x6b29e0, 0x6b1d7a, 0x6b1116, 0x6b04b4, 0x6af854,
+    0x6aebf5, 0x6adf99, 0x6ad33f, 0x6ac6e6, 0x6aba90, 0x6aae3b, 0x6aa1e9, 0x6a9598,
+    0x6a8949, 0x6a7cfd, 0x6a70b2, 0x6a6469, 0x6a5822, 0x6a4bdd, 0x6a3f9a, 0x6a3359,
+    0x6a271a, 0x6a1adc, 0x6a0ea1, 0x6a0267, 0x69f630, 0x69e9fa, 0x69ddc6, 0x69d195,
+    0x69c565, 0x69b937, 0x69ad0b, 0x69a0e0, 0x6994b8, 0x698892, 0x697c6d, 0x69704a,
+    0x69642a, 0x69580b, 0x694bee, 0x693fd3, 0x6933ba, 0x6927a2, 0x691b8d, 0x690f79,
+    0x690368, 0x68f758, 0x68eb4a, 0x68df3e, 0x68d334, 0x68c72b, 0x68bb25, 0x68af20,
+    0x68a31d, 0x68971d, 0x688b1d, 0x687f20, 0x687325, 0x68672c, 0x685b34, 0x684f3e,
+    0x68434a, 0x683758, 0x682b68, 0x681f7a, 0x68138d, 0x6807a2, 0x67fbb9, 0x67efd2,
+    0x67e3ed, 0x67d80a, 0x67cc28, 0x67c048, 0x67b46a, 0x67a88e, 0x679cb4, 0x6790dc,
+    0x678505, 0x677930, 0x676d5d, 0x67618c, 0x6755bd, 0x6749ef, 0x673e23, 0x673259,
+    0x672691, 0x671acb, 0x670f06, 0x670343, 0x66f782, 0x66ebc3, 0x66e006, 0x66d44a,
+    0x66c891, 0x66bcd8, 0x66b122, 0x66a56e, 0x6699bb, 0x668e0a, 0x66825b, 0x6676ae,
+    0x666b02, 0x665f58, 0x6653b0, 0x66480a, 0x663c66, 0x6630c3, 0x662522, 0x661983,
+    0x660de5, 0x66024a, 0x65f6b0, 0x65eb17, 0x65df81, 0x65d3ec, 0x65c859, 0x65bcc8,
+    0x65b139, 0x65a5ab, 0x659a1f, 0x658e95, 0x65830d, 0x657786, 0x656c01, 0x65607e,
+    0x6554fc, 0x65497c, 0x653dfe, 0x653282, 0x652707, 0x651b8e, 0x651017, 0x6504a2,
+    0x64f92e, 0x64edbc, 0x64e24c, 0x64d6dd, 0x64cb70, 0x64c005, 0x64b49c, 0x64a934,
+    0x649dce, 0x64926a, 0x648707, 0x647ba6, 0x647047, 0x6464ea, 0x64598e, 0x644e34,
+    0x6442db, 0x643784, 0x642c2f, 0x6420dc, 0x64158a, 0x640a3a, 0x63feec, 0x63f39f,
+    0x63e854, 0x63dd0b, 0x63d1c3, 0x63c67d, 0x63bb39, 0x63aff7, 0x63a4b6, 0x639976,
+    0x638e39, 0x6382fd, 0x6377c3, 0x636c8a, 0x636153, 0x63561e, 0x634aea, 0x633fb8,
+    0x633488, 0x632959, 0x631e2c, 0x631301, 0x6307d7, 0x62fcaf, 0x62f189, 0x62e664,
+    0x62db41, 0x62d01f, 0x62c500, 0x62b9e1, 0x62aec5, 0x62a3aa, 0x629890, 0x628d79,
+    0x628263, 0x62774e, 0x626c3b, 0x62612a, 0x62561b, 0x624b0d, 0x624000, 0x6234f6,
+    0x6229ed, 0x621ee5, 0x6213df, 0x6208db, 0x61fdd8, 0x61f2d7, 0x61e7d8, 0x61dcda,
+    0x61d1de, 0x61c6e3, 0x61bbea, 0x61b0f3, 0x61a5fd, 0x619b09, 0x619016, 0x618525,
+    0x617a36, 0x616f48, 0x61645b, 0x615971, 0x614e88, 0x6143a0, 0x6138ba, 0x612dd6,
+    0x6122f3, 0x611812, 0x610d32, 0x610254, 0x60f778, 0x60ec9d, 0x60e1c4, 0x60d6ec,
+    0x60cc16, 0x60c141, 0x60b66e, 0x60ab9c, 0x60a0cc, 0x6095fe, 0x608b31, 0x608066,
+    0x60759c, 0x606ad4, 0x60600e, 0x605549, 0x604a85, 0x603fc3, 0x603503, 0x602a44,
+    0x601f87, 0x6014cb, 0x600a11, 0x5fff58, 0x5ff4a1, 0x5fe9eb, 0x5fdf37, 0x5fd485,
+    0x5fc9d4, 0x5fbf24, 0x5fb476, 0x5fa9ca, 0x5f9f1f, 0x5f9476, 0x5f89ce, 0x5f7f28,
+    0x5f7483, 0x5f69df, 0x5f5f3e, 0x5f549d, 0x5f49ff, 0x5f3f62, 0x5f34c6, 0x5f2a2c,
+    0x5f1f93, 0x5f14fc, 0x5f0a66, 0x5effd2, 0x5ef53f, 0x5eeaae, 0x5ee01f, 0x5ed591,
+    0x5ecb04, 0x5ec079, 0x5eb5ef, 0x5eab67, 0x5ea0e0, 0x5e965b, 0x5e8bd8, 0x5e8155,
+    0x5e76d5, 0x5e6c55, 0x5e61d8, 0x5e575c, 0x5e4ce1, 0x5e4268, 0x5e37f0, 0x5e2d79,
+    0x5e2305, 0x5e1891, 0x5e0e1f, 0x5e03af, 0x5df940, 0x5deed3, 0x5de467, 0x5dd9fc,
+    0x5dcf93, 0x5dc52b, 0x5dbac5, 0x5db061, 0x5da5fd, 0x5d9b9c, 0x5d913b, 0x5d86dc,
+    0x5d7c7f, 0x5d7223, 0x5d67c9, 0x5d5d70, 0x5d5318, 0x5d48c2, 0x5d3e6d, 0x5d341a,
+    0x5d29c8, 0x5d1f78, 0x5d1529, 0x5d0adc, 0x5d0090, 0x5cf645, 0x5cebfc, 0x5ce1b4,
+    0x5cd76e, 0x5ccd29, 0x5cc2e6, 0x5cb8a4, 0x5cae63, 0x5ca424, 0x5c99e6, 0x5c8faa,
+    0x5c856f, 0x5c7b36, 0x5c70fe, 0x5c66c7, 0x5c5c92, 0x5c525e, 0x5c482c, 0x5c3dfb,
+    0x5c33cc, 0x5c299d, 0x5c1f71, 0x5c1546, 0x5c0b1c, 0x5c00f3, 0x5bf6cc, 0x5beca7,
+    0x5be282, 0x5bd85f, 0x5bce3e, 0x5bc41e, 0x5bb9ff, 0x5bafe2, 0x5ba5c6, 0x5b9bac,
+    0x5b9193, 0x5b877b, 0x5b7d65, 0x5b7350, 0x5b693d, 0x5b5f2a, 0x5b551a, 0x5b4b0a,
+    0x5b40fd, 0x5b36f0, 0x5b2ce5, 0x5b22db, 0x5b18d3, 0x5b0ecc, 0x5b04c6, 0x5afac2,
+    0x5af0bf, 0x5ae6bd, 0x5adcbd, 0x5ad2be, 0x5ac8c1, 0x5abec5, 0x5ab4ca, 0x5aaad1,
+    0x5aa0d9, 0x5a96e2, 0x5a8ced, 0x5a82f9, 0x5a7906, 0x5a6f15, 0x5a6525, 0x5a5b37,
+    0x5a514a, 0x5a475e, 0x5a3d74, 0x5a338b, 0x5a29a3, 0x5a1fbd, 0x5a15d8, 0x5a0bf4,
+    0x5a0212, 0x59f831, 0x59ee51, 0x59e473, 0x59da96, 0x59d0ba, 0x59c6e0, 0x59bd07,
+    0x59b330, 0x59a959, 0x599f84, 0x5995b1, 0x598bde, 0x59820e, 0x59783e, 0x596e70,
+    0x5964a3, 0x595ad7, 0x59510d, 0x594744, 0x593d7c, 0x5933b6, 0x5929f1, 0x59202d,
+    0x59166b, 0x590caa, 0x5902ea, 0x58f92b, 0x58ef6e, 0x58e5b3, 0x58dbf8, 0x58d23f,
+    0x58c887, 0x58bed0, 0x58b51b, 0x58ab67, 0x58a1b4, 0x589803, 0x588e53, 0x5884a4,
+    0x587af7, 0x58714b, 0x5867a0, 0x585df6, 0x58544e, 0x584aa7, 0x584101, 0x58375d,
+    0x582dba, 0x582418, 0x581a77, 0x5810d8, 0x58073a, 0x57fd9d, 0x57f402, 0x57ea68,
+    0x57e0cf, 0x57d737, 0x57cda1, 0x57c40c, 0x57ba78, 0x57b0e6, 0x57a754, 0x579dc5,
+    0x579436, 0x578aa9, 0x57811c, 0x577792, 0x576e08, 0x576480, 0x575af9, 0x575173,
+    0x5747ee, 0x573e6b, 0x5734e9, 0x572b68, 0x5721e9, 0x57186b, 0x570eee, 0x570572,
+    0x56fbf8, 0x56f27e, 0x56e906, 0x56df90, 0x56d61a, 0x56cca6, 0x56c333, 0x56b9c1,
+    0x56b051, 0x56a6e2, 0x569d74, 0x569407, 0x568a9b, 0x568131, 0x5677c8, 0x566e60,
+    0x5664fa, 0x565b95, 0x565231, 0x5648ce, 0x563f6c, 0x56360c, 0x562cad, 0x56234f,
+    0x5619f2, 0x561097, 0x56073c, 0x55fde3, 0x55f48c, 0x55eb35, 0x55e1e0, 0x55d88c,
+    0x55cf39, 0x55c5e7, 0x55bc97, 0x55b347, 0x55a9f9, 0x55a0ad, 0x559761, 0x558e17,
+    0x5584cd, 0x557b86, 0x55723f, 0x5568f9, 0x555fb5, 0x555672, 0x554d30, 0x5543ef,
+    0x553ab0, 0x553171, 0x552834, 0x551ef8, 0x5515be, 0x550c84, 0x55034c, 0x54fa15,
+    0x54f0df, 0x54e7aa, 0x54de77, 0x54d544, 0x54cc13, 0x54c2e3, 0x54b9b4, 0x54b087,
+    0x54a75a, 0x549e2f, 0x549505, 0x548bdc, 0x5482b5, 0x54798e, 0x547069, 0x546745,
+    0x545e22, 0x545500, 0x544be0, 0x5442c0, 0x5439a2, 0x543085, 0x542769, 0x541e4f,
+    0x541535, 0x540c1d, 0x540306, 0x53f9f0, 0x53f0db, 0x53e7c7, 0x53deb5, 0x53d5a3,
+    0x53cc93, 0x53c384, 0x53ba76, 0x53b169, 0x53a85e, 0x539f54, 0x53964a, 0x538d42,
+    0x53843b, 0x537b36, 0x537231, 0x53692e, 0x53602b, 0x53572a, 0x534e2a, 0x53452b,
+    0x533c2e, 0x533331, 0x532a36, 0x53213b, 0x531842, 0x530f4a, 0x530654, 0x52fd5e,
+    0x52f469, 0x52eb76, 0x52e284, 0x52d993, 0x52d0a3, 0x52c7b4, 0x52bec6, 0x52b5d9,
+    0x52acee, 0x52a404, 0x529b1b, 0x529233, 0x52894c, 0x528066, 0x527781, 0x526e9e,
+    0x5265bb, 0x525cda, 0x5253fa, 0x524b1b, 0x52423d, 0x523960, 0x523084, 0x5227aa,
+    0x521ed0, 0x5215f8, 0x520d21, 0x52044b, 0x51fb76, 0x51f2a2, 0x51e9cf, 0x51e0fe,
+    0x51d82d, 0x51cf5e, 0x51c68f, 0x51bdc2, 0x51b4f6, 0x51ac2b, 0x51a361, 0x519a98,
+    0x5191d1, 0x51890a, 0x518045, 0x517780, 0x516ebd, 0x5165fb, 0x515d3a, 0x51547a,
+    0x514bbb, 0x5142fd, 0x513a41, 0x513185, 0x5128cb, 0x512011, 0x511759, 0x510ea2,
+    0x5105ec, 0x50fd36, 0x50f483, 0x50ebd0, 0x50e31e, 0x50da6d, 0x50d1be, 0x50c90f,
+    0x50c062, 0x50b7b5, 0x50af0a, 0x50a660, 0x509db7, 0x50950f, 0x508c68, 0x5083c2,
+    0x507b1d, 0x507279, 0x5069d7, 0x506135, 0x505894, 0x504ff5, 0x504757, 0x503eb9,
+    0x50361d, 0x502d82, 0x5024e8, 0x501c4f, 0x5013b7, 0x500b20, 0x50028a, 0x4ff9f5,
+    0x4ff162, 0x4fe8cf, 0x4fe03d, 0x4fd7ad, 0x4fcf1d, 0x4fc68f, 0x4fbe01, 0x4fb575,
+    0x4facea, 0x4fa460, 0x4f9bd7, 0x4f934e, 0x4f8ac7, 0x4f8241, 0x4f79bc, 0x4f7139,
+    0x4f68b6, 0x4f6034, 0x4f57b3, 0x4f4f33, 0x4f46b5, 0x4f3e37, 0x4f35bb, 0x4f2d3f,
+    0x4f24c5, 0x4f1c4b, 0x4f13d3, 0x4f0b5b, 0x4f02e5, 0x4efa70, 0x4ef1fb, 0x4ee988,
+    0x4ee116, 0x4ed8a5, 0x4ed035, 0x4ec7c6, 0x4ebf58, 0x4eb6ea, 0x4eae7e, 0x4ea613,
+    0x4e9daa, 0x4e9541, 0x4e8cd9, 0x4e8472, 0x4e7c0c, 0x4e73a7, 0x4e6b43, 0x4e62e1,
+    0x4e5a7f, 0x4e521e, 0x4e49be, 0x4e4160, 0x4e3902, 0x4e30a5, 0x4e284a, 0x4e1fef,
+    0x4e1796, 0x4e0f3d, 0x4e06e5, 0x4dfe8f, 0x4df639, 0x4dede5, 0x4de591, 0x4ddd3f,
+    0x4dd4ed, 0x4dcc9d, 0x4dc44d, 0x4dbbff, 0x4db3b1, 0x4dab65, 0x4da319, 0x4d9acf,
+    0x4d9285, 0x4d8a3d, 0x4d81f5, 0x4d79af, 0x4d7169, 0x4d6925, 0x4d60e2, 0x4d589f,
+    0x4d505e, 0x4d481d, 0x4d3fde, 0x4d379f, 0x4d2f62, 0x4d2725, 0x4d1eea, 0x4d16af,
+    0x4d0e76, 0x4d063d, 0x4cfe05, 0x4cf5cf, 0x4ced99, 0x4ce565, 0x4cdd31, 0x4cd4fe,
+    0x4ccccd, 0x4cc49c, 0x4cbc6c, 0x4cb43e, 0x4cac10, 0x4ca3e3, 0x4c9bb8, 0x4c938d,
+    0x4c8b63, 0x4c833a, 0x4c7b12, 0x4c72eb, 0x4c6ac6, 0x4c62a1, 0x4c5a7d, 0x4c525a,
+    0x4c4a38, 0x4c4217, 0x4c39f7, 0x4c31d7, 0x4c29b9, 0x4c219c, 0x4c1980, 0x4c1165,
+    0x4c094b, 0x4c0131, 0x4bf919, 0x4bf102, 0x4be8eb, 0x4be0d6, 0x4bd8c1, 0x4bd0ae,
+    0x4bc89b, 0x4bc089, 0x4bb879, 0x4bb069, 0x4ba85a, 0x4ba04d, 0x4b9840, 0x4b9034,
+    0x4b8829, 0x4b801f, 0x4b7816, 0x4b700e, 0x4b6807, 0x4b6001, 0x4b57fc, 0x4b4ff7,
+    0x4b47f4, 0x4b3ff2, 0x4b37f0, 0x4b2ff0, 0x4b27f0, 0x4b1ff2, 0x4b17f4, 0x4b0ff7,
+    0x4b07fc, 0x4b0001, 0x4af807, 0x4af00e, 0x4ae816, 0x4ae01f, 0x4ad829, 0x4ad034,
+    0x4ac83f, 0x4ac04c, 0x4ab85a, 0x4ab068, 0x4aa878, 0x4aa088, 0x4a989a, 0x4a90ac,
+    0x4a88bf, 0x4a80d3, 0x4a78e8, 0x4a70fe, 0x4a6915, 0x4a612d, 0x4a5946, 0x4a5160,
+    0x4a497a, 0x4a4196, 0x4a39b2, 0x4a31d0, 0x4a29ee, 0x4a220d, 0x4a1a2d, 0x4a124f,
+    0x4a0a71, 0x4a0294, 0x49fab7, 0x49f2dc, 0x49eb02, 0x49e328, 0x49db50, 0x49d378,
+    0x49cba2, 0x49c3cc, 0x49bbf7, 0x49b423, 0x49ac50, 0x49a47e, 0x499cad, 0x4994dd,
+    0x498d0d, 0x49853f, 0x497d71, 0x4975a5, 0x496dd9, 0x49660e, 0x495e44, 0x49567b,
+    0x494eb3, 0x4946ec, 0x493f25, 0x493760, 0x492f9b, 0x4927d8, 0x492015, 0x491853,
+    0x491092, 0x4908d2, 0x490113, 0x48f955, 0x48f198, 0x48e9db, 0x48e21f, 0x48da65,
+    0x48d2ab, 0x48caf2, 0x48c33a, 0x48bb83, 0x48b3cd, 0x48ac18, 0x48a463, 0x489cb0,
+    0x4894fd, 0x488d4b, 0x48859a, 0x487dea, 0x48763b, 0x486e8d, 0x4866df, 0x485f33,
+    0x485787, 0x484fdd, 0x484833, 0x48408a, 0x4838e2, 0x48313b, 0x482994, 0x4821ef,
+    0x481a4a, 0x4812a6, 0x480b04, 0x480362, 0x47fbc1, 0x47f420, 0x47ec81, 0x47e4e3,
+    0x47dd45, 0x47d5a8, 0x47ce0c, 0x47c672, 0x47bed7, 0x47b73e, 0x47afa6, 0x47a80e,
+    0x47a078, 0x4798e2, 0x47914d, 0x4789b9, 0x478226, 0x477a93, 0x477302, 0x476b71,
+    0x4763e2, 0x475c53, 0x4754c5, 0x474d37, 0x4745ab, 0x473e20, 0x473695, 0x472f0b,
+    0x472783, 0x471ffa, 0x471873, 0x4710ed, 0x470968, 0x4701e3, 0x46fa5f, 0x46f2dc,
+    0x46eb5a, 0x46e3d9, 0x46dc59, 0x46d4d9, 0x46cd5a, 0x46c5dd, 0x46be60, 0x46b6e4,
+    0x46af68, 0x46a7ee, 0x46a074, 0x4698fb, 0x469184, 0x468a0c, 0x468296, 0x467b21,
+    0x4673ac, 0x466c39, 0x4664c6, 0x465d54, 0x4655e3, 0x464e72, 0x464703, 0x463f94,
+    0x463826, 0x4630b9, 0x46294d, 0x4621e2, 0x461a77, 0x46130e, 0x460ba5, 0x46043d,
+    0x45fcd6, 0x45f56f, 0x45ee0a, 0x45e6a5, 0x45df41, 0x45d7de, 0x45d07c, 0x45c91a,
+    0x45c1ba, 0x45ba5a, 0x45b2fb, 0x45ab9d, 0x45a440, 0x459ce4, 0x459588, 0x458e2d,
+    0x4586d3, 0x457f7a, 0x457822, 0x4570ca, 0x456974, 0x45621e, 0x455ac9, 0x455374,
+    0x454c21, 0x4544ce, 0x453d7d, 0x45362c, 0x452edb, 0x45278c, 0x45203e, 0x4518f0,
+    0x4511a3, 0x450a57, 0x45030c, 0x44fbc1, 0x44f477, 0x44ed2e, 0x44e5e6, 0x44de9f,
+    0x44d759, 0x44d013, 0x44c8ce, 0x44c18a, 0x44ba47, 0x44b305, 0x44abc3, 0x44a482,
+    0x449d42, 0x449603, 0x448ec5, 0x448787, 0x44804a, 0x44790e, 0x4471d3, 0x446a99,
+    0x44635f, 0x445c26, 0x4454ee, 0x444db7, 0x444681, 0x443f4b, 0x443816, 0x4430e2,
+    0x4429af, 0x44227c, 0x441b4b, 0x44141a, 0x440cea, 0x4405ba, 0x43fe8c, 0x43f75e,
+    0x43f031, 0x43e905, 0x43e1da, 0x43daaf, 0x43d385, 0x43cc5c, 0x43c534, 0x43be0d,
+    0x43b6e6, 0x43afc0, 0x43a89b, 0x43a177, 0x439a54, 0x439331, 0x438c0f, 0x4384ee,
+    0x437dcd, 0x4376ae, 0x436f8f, 0x436871, 0x436154, 0x435a37, 0x43531b, 0x434c00,
+    0x4344e6, 0x433dcd, 0x4336b4, 0x432f9c, 0x432885, 0x43216f, 0x431a5a, 0x431345,
+    0x430c31, 0x43051e, 0x42fe0b, 0x42f6f9, 0x42efe9, 0x42e8d8, 0x42e1c9, 0x42daba,
+    0x42d3ad, 0x42cca0, 0x42c593, 0x42be88, 0x42b77d, 0x42b073, 0x42a96a, 0x42a261,
+    0x429b59, 0x429452, 0x428d4c, 0x428647, 0x427f42, 0x42783e, 0x42713b, 0x426a39,
+    0x426337, 0x425c36, 0x425536, 0x424e37, 0x424738, 0x42403a, 0x42393d, 0x423241,
+    0x422b45, 0x42244a, 0x421d50, 0x421657, 0x420f5e, 0x420866, 0x42016f, 0x41fa79,
+    0x41f383, 0x41ec8e, 0x41e59a, 0x41dea7, 0x41d7b4, 0x41d0c2, 0x41c9d1, 0x41c2e1,
+    0x41bbf1, 0x41b503, 0x41ae14, 0x41a727, 0x41a03a, 0x41994e, 0x419263, 0x418b79,
+    0x41848f, 0x417da6, 0x4176be, 0x416fd7, 0x4168f0, 0x41620a, 0x415b25, 0x415440,
+    0x414d5c, 0x414679, 0x413f97, 0x4138b6, 0x4131d5, 0x412af5, 0x412415, 0x411d37,
+    0x411659, 0x410f7c, 0x41089f, 0x4101c3, 0x40fae9, 0x40f40e, 0x40ed35, 0x40e65c,
+    0x40df84, 0x40d8ad, 0x40d1d6, 0x40cb00, 0x40c42b, 0x40bd57, 0x40b683, 0x40afb0,
+    0x40a8de, 0x40a20c, 0x409b3b, 0x40946b, 0x408d9c, 0x4086cd, 0x408000, 0x407932,
+    0x407266, 0x406b9a, 0x4064cf, 0x405e05, 0x40573b, 0x405072, 0x4049aa, 0x4042e3,
+    0x403c1c, 0x403556, 0x402e91, 0x4027cc, 0x402109, 0x401a45, 0x401383, 0x400cc1,
+    0x400600, 0x3fff40, 0x3ff880, 0x3ff1c2, 0x3feb03, 0x3fe446, 0x3fdd89, 0x3fd6cd,
+    0x3fd012, 0x3fc957, 0x3fc29d, 0x3fbbe4, 0x3fb52c, 0x3fae74, 0x3fa7bd, 0x3fa107,
+    0x3f9a51, 0x3f939c, 0x3f8ce8, 0x3f8634, 0x3f7f81, 0x3f78cf, 0x3f721e, 0x3f6b6d,
+    0x3f64bd, 0x3f5e0e, 0x3f575f, 0x3f50b1, 0x3f4a04, 0x3f4357, 0x3f3cac, 0x3f3601,
+    0x3f2f56, 0x3f28ac, 0x3f2203, 0x3f1b5b, 0x3f14b3, 0x3f0e0c, 0x3f0766, 0x3f00c1,
+    0x3efa1c, 0x3ef377, 0x3eecd4, 0x3ee631, 0x3edf8f, 0x3ed8ee, 0x3ed24d, 0x3ecbad,
+    0x3ec50e, 0x3ebe6f, 0x3eb7d1, 0x3eb134, 0x3eaa97, 0x3ea3fb, 0x3e9d60, 0x3e96c6,
+    0x3e902c, 0x3e8993, 0x3e82fa, 0x3e7c62, 0x3e75cb, 0x3e6f35, 0x3e689f, 0x3e620a,
+    0x3e5b76, 0x3e54e2, 0x3e4e4f, 0x3e47bd, 0x3e412b, 0x3e3a9a, 0x3e340a, 0x3e2d7a,
+    0x3e26eb, 0x3e205d, 0x3e19cf, 0x3e1342, 0x3e0cb6, 0x3e062b, 0x3dffa0, 0x3df916,
+    0x3df28c, 0x3dec03, 0x3de57b, 0x3ddef4, 0x3dd86d, 0x3dd1e7, 0x3dcb61, 0x3dc4dc,
+    0x3dbe58, 0x3db7d5, 0x3db152, 0x3daad0, 0x3da44f, 0x3d9dce, 0x3d974e, 0x3d90ce,
+    0x3d8a4f, 0x3d83d1, 0x3d7d54, 0x3d76d7, 0x3d705b, 0x3d69e0, 0x3d6365, 0x3d5ceb,
+    0x3d5671, 0x3d4ff9, 0x3d4980, 0x3d4309, 0x3d3c92, 0x3d361c, 0x3d2fa7, 0x3d2932,
+    0x3d22be, 0x3d1c4a, 0x3d15d7, 0x3d0f65, 0x3d08f4, 0x3d0283, 0x3cfc13, 0x3cf5a3,
+    0x3cef34, 0x3ce8c6, 0x3ce259, 0x3cdbec, 0x3cd57f, 0x3ccf14, 0x3cc8a9, 0x3cc23f,
+    0x3cbbd5, 0x3cb56c, 0x3caf04, 0x3ca89c, 0x3ca235, 0x3c9bcf, 0x3c9569, 0x3c8f04,
+    0x3c889f, 0x3c823c, 0x3c7bd8, 0x3c7576, 0x3c6f14, 0x3c68b3, 0x3c6253, 0x3c5bf3,
+    0x3c5593, 0x3c4f35, 0x3c48d7, 0x3c427a, 0x3c3c1d, 0x3c35c1, 0x3c2f66, 0x3c290b,
+    0x3c22b1, 0x3c1c57, 0x3c15ff, 0x3c0fa7, 0x3c094f, 0x3c02f8, 0x3bfca2, 0x3bf64c,
+    0x3beff7, 0x3be9a3, 0x3be34f, 0x3bdcfc, 0x3bd6aa, 0x3bd058, 0x3bca07, 0x3bc3b7,
+    0x3bbd67, 0x3bb718, 0x3bb0c9, 0x3baa7b, 0x3ba42e, 0x3b9de1, 0x3b9795, 0x3b914a,
+    0x3b8aff, 0x3b84b5, 0x3b7e6c, 0x3b7823, 0x3b71db, 0x3b6b93, 0x3b654c, 0x3b5f06,
+    0x3b58c0, 0x3b527b, 0x3b4c36, 0x3b45f3, 0x3b3faf, 0x3b396d, 0x3b332b, 0x3b2cea,
+    0x3b26a9, 0x3b2069, 0x3b1a2a, 0x3b13eb, 0x3b0dad, 0x3b076f, 0x3b0132, 0x3afaf6,
+    0x3af4ba, 0x3aee7f, 0x3ae845, 0x3ae20b, 0x3adbd2, 0x3ad599, 0x3acf61, 0x3ac92a,
+    0x3ac2f3, 0x3abcbd, 0x3ab688, 0x3ab053, 0x3aaa1f, 0x3aa3eb, 0x3a9db8, 0x3a9786,
+    0x3a9154, 0x3a8b23, 0x3a84f2, 0x3a7ec2, 0x3a7893, 0x3a7264, 0x3a6c36, 0x3a6609,
+    0x3a5fdc, 0x3a59b0, 0x3a5384, 0x3a4d59, 0x3a472f, 0x3a4105, 0x3a3adc, 0x3a34b4,
+    0x3a2e8c, 0x3a2864, 0x3a223e, 0x3a1c18, 0x3a15f2, 0x3a0fcd, 0x3a09a9, 0x3a0385,
+    0x39fd62, 0x39f740, 0x39f11e, 0x39eafd, 0x39e4dc, 0x39debc, 0x39d89d, 0x39d27e,
+    0x39cc60, 0x39c642, 0x39c025, 0x39ba09, 0x39b3ed, 0x39add2, 0x39a7b7, 0x39a19d,
+    0x399b84, 0x39956b, 0x398f53, 0x39893b, 0x398324, 0x397d0e, 0x3976f8, 0x3970e3,
+    0x396ace, 0x3964ba, 0x395ea7, 0x395894, 0x395282, 0x394c70, 0x39465f, 0x39404f,
+    0x393a3f, 0x393430, 0x392e21, 0x392813, 0x392206, 0x391bf9, 0x3915ed, 0x390fe1,
+    0x3909d6, 0x3903cb, 0x38fdc1, 0x38f7b8, 0x38f1af, 0x38eba7, 0x38e5a0, 0x38df99,
+    0x38d993, 0x38d38d, 0x38cd88, 0x38c783, 0x38c17f, 0x38bb7c, 0x38b579, 0x38af77,
+    0x38a975, 0x38a374, 0x389d73, 0x389774, 0x389174, 0x388b76, 0x388577, 0x387f7a,
+    0x38797d, 0x387381, 0x386d85, 0x38678a, 0x38618f, 0x385b95, 0x38559b, 0x384fa2,
+    0x3849aa, 0x3843b2, 0x383dbb, 0x3837c5, 0x3831cf, 0x382bd9, 0x3825e4, 0x381ff0,
+    0x3819fd, 0x381409, 0x380e17, 0x380825, 0x380234, 0x37fc43, 0x37f653, 0x37f063,
+    0x37ea74, 0x37e485, 0x37de97, 0x37d8aa, 0x37d2bd, 0x37ccd1, 0x37c6e5, 0x37c0fa,
+    0x37bb10, 0x37b526, 0x37af3d, 0x37a954, 0x37a36c, 0x379d84, 0x37979d, 0x3791b6,
+    0x378bd0, 0x3785eb, 0x378006, 0x377a22, 0x37743e, 0x376e5b, 0x376879, 0x376297,
+    0x375cb5, 0x3756d5, 0x3750f4, 0x374b15, 0x374535, 0x373f57, 0x373979, 0x37339b,
+    0x372dbf, 0x3727e2, 0x372206, 0x371c2b, 0x371651, 0x371077, 0x370a9d, 0x3704c4,
+    0x36feec, 0x36f914, 0x36f33d, 0x36ed66, 0x36e790, 0x36e1ba, 0x36dbe5, 0x36d611,
+    0x36d03d, 0x36ca69, 0x36c497, 0x36bec4, 0x36b8f3, 0x36b321, 0x36ad51, 0x36a781,
+    0x36a1b1, 0x369be2, 0x369614, 0x369046, 0x368a79, 0x3684ac, 0x367ee0, 0x367915,
+    0x36734a, 0x366d7f, 0x3667b5, 0x3661ec, 0x365c23, 0x36565b, 0x365093, 0x364acc,
+    0x364505, 0x363f3f, 0x363979, 0x3633b4, 0x362df0, 0x36282c, 0x362269, 0x361ca6,
+    0x3616e4, 0x361122, 0x360b61, 0x3605a0, 0x35ffe0, 0x35fa20, 0x35f461, 0x35eea3,
+    0x35e8e5, 0x35e328, 0x35dd6b, 0x35d7af, 0x35d1f3, 0x35cc38, 0x35c67d, 0x35c0c3,
+    0x35bb09, 0x35b550, 0x35af98, 0x35a9e0, 0x35a429, 0x359e72, 0x3598bb, 0x359306,
+    0x358d50, 0x35879c, 0x3581e8, 0x357c34, 0x357681, 0x3570ce, 0x356b1c, 0x35656b,
+    0x355fba, 0x355a09, 0x355459, 0x354eaa, 0x3548fb, 0x35434d, 0x353d9f, 0x3537f2,
+    0x353245, 0x352c99, 0x3526ee, 0x352143, 0x351b98, 0x3515ee, 0x351045, 0x350a9c
+};
diff --git a/src/gromacs/math/tests/CMakeLists.txt b/src/gromacs/math/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..867e28e
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+gmx_add_unit_test(MathUnitTests math-test
+                  vectypes.cpp
+                  )
diff --git a/src/gromacs/math/tests/vectypes.cpp b/src/gromacs/math/tests/vectypes.cpp
new file mode 100644 (file)
index 0000000..e1ddb19
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests various corners of gmx::RVec implementation.
+ *
+ * The main point of these tests is to check that all different constructs
+ * using gmx::RVec compile, and that some of the non-trivial conversions
+ * to/from rvec work as intended.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_math
+ */
+#include "gmxpre.h"
+
+#include "gromacs/math/vectypes.h"
+
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/math/vec.h"
+
+namespace
+{
+
+using gmx::RVec;
+
+TEST(RVecTest, CanBeStoredInVector)
+{
+    std::vector<RVec> v;
+    v.push_back(RVec(1, 2, 3));
+    v.resize(2);
+    EXPECT_EQ(1, v[0][XX]);
+    EXPECT_EQ(2, v[0][YY]);
+    EXPECT_EQ(3, v[0][ZZ]);
+}
+
+TEST(RVecTest, ConvertsImplicitlyFrom_rvec)
+{
+    std::vector<RVec> v;
+    rvec              x = { 1, 2, 3 };
+    v.push_back(x);
+    EXPECT_EQ(1, v[0][XX]);
+    EXPECT_EQ(2, v[0][YY]);
+    EXPECT_EQ(3, v[0][ZZ]);
+}
+
+TEST(RVecTest, ConvertsImplicitlyTo_rvec)
+{
+    std::vector<RVec> v;
+    v.push_back(RVec(1, 2, 3));
+    rvec              x;
+    copy_rvec(v[0], x);
+    EXPECT_EQ(1, x[XX]);
+    EXPECT_EQ(2, x[YY]);
+    EXPECT_EQ(3, x[ZZ]);
+}
+
+TEST(RVecTest, WorksAsMutable_rvec)
+{
+    std::vector<RVec> v;
+    v.push_back(RVec(1, 2, 3));
+    rvec              x = {2, 3, 4};
+    copy_rvec(x, v[0]);
+    EXPECT_EQ(2, v[0][XX]);
+    EXPECT_EQ(3, v[0][YY]);
+    EXPECT_EQ(4, v[0][ZZ]);
+}
+
+TEST(RVecTest, WorksAs_rvec_Array)
+{
+    std::vector<RVec> v;
+    v.push_back(RVec(1, 2, 3));
+    v.push_back(RVec(2, 3, 4));
+    const rvec *r = as_rvec_array(&v[0]);
+    EXPECT_EQ(1, r[0][XX]);
+    EXPECT_EQ(2, r[0][YY]);
+    EXPECT_EQ(3, r[0][ZZ]);
+    EXPECT_EQ(2, r[1][XX]);
+    EXPECT_EQ(3, r[1][YY]);
+    EXPECT_EQ(4, r[1][ZZ]);
+}
+
+/*! \brief
+ * Helper function for testing RVec to rvec conversions.
+ */
+const rvec *testFunction(const rvec &x)
+{
+    return &x;
+}
+
+TEST(RVecTest, WorksAs_rvec_Reference)
+{
+    RVec        v(1, 2, 3);
+    const rvec *r = testFunction(v.as_vec());
+    EXPECT_EQ(1, r[0][XX]);
+    EXPECT_EQ(2, r[0][YY]);
+    EXPECT_EQ(3, r[0][ZZ]);
+}
+
+} // namespace
similarity index 94%
rename from src/gromacs/gmxlib/physics.c
rename to src/gromacs/math/units.c
index 529eee86d96248c8dd9a97ef8dfc7673ad909f19..8c631d8b1f4ee46df74f4b286032b69e3a73a484 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-2008, The GROMACS development team.
- * Copyright (c) 2011,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 "units.h"
+
 #include <stdio.h>
+
 #include "gromacs/utility/cstringutil.h"
-#include "physics.h"
 
 double convert2gmx(double x, int unit)
 {
similarity index 98%
rename from src/gromacs/legacyheaders/physics.h
rename to src/gromacs/math/units.h
index 6134f954b5d0faa87c8338356343e59ef7cfe2f5..6afd10f2a9b386781640cd0bf94c0f535e9a825e 100644 (file)
@@ -34,9 +34,8 @@
  * 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 _physics_h
-#define _physics_h
+#ifndef GMX_MATH_UNITS_H
+#define GMX_MATH_UNITS_H
 
 /*
  * Physical constants to be used in Gromacs.
@@ -44,7 +43,7 @@
  * be anywhere else in the code.
  */
 
-#include "../math/utilities.h"
+#include "gromacs/math/utilities.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -156,5 +155,4 @@ extern const char *unit2string(int unit);
 }
 #endif
 
-
-#endif  /* _physics_h */
+#endif
index ca46dbff25003a9ea74b219d5085a6b03dd79042..25f24b5beb913c33f738adad63857cdd8f30ff3b 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.
  */
-#include "gromacs/math/utilities.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "utilities.h"
 
-#include <math.h>
+#include "config.h"
+
+#include <assert.h>
 #include <limits.h>
+#include <math.h>
+
 #ifdef HAVE__FINITE
 #include <float.h>
 #endif
-#include <assert.h>
+#ifndef GMX_NATIVE_WINDOWS
+#include <fenv.h>
+#endif
 
 int gmx_nint(real a)
 {
@@ -60,11 +64,11 @@ real cuberoot(real x)
 {
     if (x < 0)
     {
-        return (-pow(-x, 1.0/DIM));
+        return (-pow(-x, 1.0/3.0));
     }
     else
     {
-        return (pow(x, 1.0/DIM));
+        return (pow(x, 1.0/3.0));
     }
 }
 
@@ -725,9 +729,7 @@ float gmx_erfcf(float x)
 
 gmx_bool gmx_isfinite(real gmx_unused x)
 {
-    gmx_bool returnval = TRUE;
-    /* If no suitable function was found, assume the value is
-     * finite. */
+    gmx_bool returnval;
 
 #ifdef HAVE__FINITE
     returnval = _finite(x);
@@ -735,13 +737,16 @@ gmx_bool gmx_isfinite(real gmx_unused x)
     returnval = isfinite(x);
 #elif defined HAVE__ISFINITE
     returnval = _isfinite(x);
+#else
+    /* If no suitable function was found, assume the value is
+     * finite. */
+    returnval = TRUE;
 #endif
     return returnval;
 }
 
 gmx_bool gmx_isnan(real x)
 {
-    /* cppcheck-suppress duplicateExpression */
     return x != x;
 }
 
@@ -849,3 +854,35 @@ int gmx_greatest_common_divisor(int p, int q)
     }
     return p;
 }
+
+int gmx_feenableexcept()
+{
+#ifdef HAVE_FEENABLEEXCEPT
+    return feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
+#elif (defined(__i386__) || defined(__x86_64__)) && defined(__APPLE__)
+    /* Author:  David N. Williams
+     * License:  Public Domain
+     *
+     * Might also work on non-Apple Unix. But should be tested
+     * before enabling.
+     */
+    unsigned int  excepts = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW;
+    static fenv_t fenv;
+    unsigned int  new_excepts = excepts & FE_ALL_EXCEPT,
+                  old_excepts; // previous masks
+
+    if (fegetenv (&fenv) )
+    {
+        return -1;
+    }
+    old_excepts = fenv.__control & FE_ALL_EXCEPT;
+
+    // unmask
+    fenv.__control &= ~new_excepts;
+    fenv.__mxcsr   &= ~(new_excepts << 7);
+
+    return ( fesetenv (&fenv) ? -1 : old_excepts );
+#else
+    return -1;
+#endif
+}
index c6db48d9a3759fc0926da3b9b443524004bec769..9cc58649d9beffbd7b0d21ce6ff8563ed27905f8 100644 (file)
@@ -40,7 +40,8 @@
 #include <limits.h>
 #include <math.h>
 
-#include "../legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -97,6 +98,14 @@ float   gmx_erfcf(float x);
 #define gmx_erfc(x)  gmx_erfcf(x)
 #endif
 
+#if defined(_MSC_VER) && _MSC_VER < 1800
+#define gmx_expm1(x) (exp(x)-1)
+#define gmx_log1p(x) log(1+x)
+#else
+#define gmx_expm1 expm1
+#define gmx_log1p log1p
+#endif
+
 gmx_bool gmx_isfinite(real x);
 gmx_bool gmx_isnan(real x);
 
@@ -144,9 +153,9 @@ gmx_numzero(double a);
 unsigned int
 gmx_log2i(unsigned int x);
 
-/*! /brief Multiply two large ints
+/*! \brief Multiply two large ints
  *
- *  \return False iff overflow occured
+ * \return False iff overflow occured
  */
 gmx_bool
 check_int_multiply_for_overflow(gmx_int64_t  a,
@@ -160,6 +169,13 @@ check_int_multiply_for_overflow(gmx_int64_t  a,
 int
 gmx_greatest_common_divisor(int p, int q);
 
+
+/*! \brief Enable floating-point exceptions if supported on OS
+ *
+ * Enables division-by-zero, invalid, and overflow.
+ */
+int gmx_feenableexcept();
+
 #ifdef __cplusplus
 }
 #endif
similarity index 91%
rename from src/gromacs/legacyheaders/vec.h
rename to src/gromacs/math/vec.h
index a14dc49dc90f77eb7e1d36c1cbba72adde3f3ea2..d5ee22cbe1b3fead8a6a22449034d044fb1d47eb 100644 (file)
@@ -34,8 +34,8 @@
  * 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 _vec_h
-#define _vec_h
+#ifndef GMX_MATH_VEC_H
+#define GMX_MATH_VEC_H
 
 /*
    collection of in-line ready operations:
    HAVE_*SQRT*. This is no problem with public headers because
    it is OK if user code uses a different rsqrt implementation */
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
-#include "types/simple.h"
-#include "../math/utilities.h"
-#include "typedefs.h"
-#include "sysstuff.h"
-#include "gmx_fatal.h"
 #include <math.h>
-#include "physics.h"
+
+#include "gromacs/math/units.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -137,8 +138,8 @@ extern "C" {
 #define EXP_ADDR(val)   (((val)&EXP_MASK)>>EXP_SHIFT)
 #define FRACT_ADDR(val) (((val)&(FRACT_MASK|EXP_LSB))>>FRACT_SHIFT)
 
-extern const unsigned int *gmx_invsqrt_exptab;
-extern const unsigned int *gmx_invsqrt_fracttab;
+extern const unsigned int gmx_invsqrt_exptab[];
+extern const unsigned int gmx_invsqrt_fracttab[];
 
 typedef union
 {
@@ -329,7 +330,7 @@ static gmx_inline void copy_rvec(const rvec a, rvec b)
     b[ZZ] = a[ZZ];
 }
 
-static gmx_inline void copy_rvecn(rvec *a, rvec *b, int startn, int endn)
+static gmx_inline void copy_rvecn(gmx_cxx_const rvec *a, rvec *b, int startn, int endn)
 {
     int i;
     for (i = startn; i < endn; i++)
@@ -367,7 +368,7 @@ static gmx_inline void ivec_sub(const ivec a, const ivec b, ivec c)
     c[ZZ] = z;
 }
 
-static gmx_inline void copy_mat(matrix a, matrix b)
+static gmx_inline void copy_mat(gmx_cxx_const matrix a, matrix b)
 {
     copy_rvec(a[XX], b[XX]);
     copy_rvec(a[YY], b[YY]);
@@ -617,7 +618,7 @@ gmx_angle(const rvec a, const rvec b)
     return atan2(wlen, s);
 }
 
-static gmx_inline void mmul_ur0(matrix a, matrix b, matrix dest)
+static gmx_inline void mmul_ur0(gmx_cxx_const matrix a, gmx_cxx_const matrix b, matrix dest)
 {
     dest[XX][XX] = a[XX][XX]*b[XX][XX];
     dest[XX][YY] = 0.0;
@@ -630,7 +631,7 @@ static gmx_inline void mmul_ur0(matrix a, matrix b, matrix dest)
     dest[ZZ][ZZ] =                                        a[ZZ][ZZ]*b[ZZ][ZZ];
 }
 
-static gmx_inline void mmul(matrix a, matrix b, matrix dest)
+static gmx_inline void mmul(gmx_cxx_const matrix a, gmx_cxx_const matrix b, matrix dest)
 {
     dest[XX][XX] = a[XX][XX]*b[XX][XX]+a[XX][YY]*b[YY][XX]+a[XX][ZZ]*b[ZZ][XX];
     dest[YY][XX] = a[YY][XX]*b[XX][XX]+a[YY][YY]*b[YY][XX]+a[YY][ZZ]*b[ZZ][XX];
@@ -643,7 +644,7 @@ static gmx_inline void mmul(matrix a, matrix b, matrix dest)
     dest[ZZ][ZZ] = a[ZZ][XX]*b[XX][ZZ]+a[ZZ][YY]*b[YY][ZZ]+a[ZZ][ZZ]*b[ZZ][ZZ];
 }
 
-static gmx_inline void transpose(matrix src, matrix dest)
+static gmx_inline void transpose(gmx_cxx_const matrix src, matrix dest)
 {
     dest[XX][XX] = src[XX][XX];
     dest[YY][XX] = src[XX][YY];
@@ -656,7 +657,7 @@ static gmx_inline void transpose(matrix src, matrix dest)
     dest[ZZ][ZZ] = src[ZZ][ZZ];
 }
 
-static gmx_inline void tmmul(matrix a, matrix b, matrix dest)
+static gmx_inline void tmmul(gmx_cxx_const matrix a, gmx_cxx_const matrix b, matrix dest)
 {
     /* Computes dest=mmul(transpose(a),b,dest) - used in do_pr_pcoupl */
     dest[XX][XX] = a[XX][XX]*b[XX][XX]+a[YY][XX]*b[YY][XX]+a[ZZ][XX]*b[ZZ][XX];
@@ -670,7 +671,7 @@ static gmx_inline void tmmul(matrix a, matrix b, matrix dest)
     dest[ZZ][ZZ] = a[XX][ZZ]*b[XX][ZZ]+a[YY][ZZ]*b[YY][ZZ]+a[ZZ][ZZ]*b[ZZ][ZZ];
 }
 
-static gmx_inline void mtmul(matrix a, matrix b, matrix dest)
+static gmx_inline void mtmul(gmx_cxx_const matrix a, gmx_cxx_const matrix b, matrix dest)
 {
     /* Computes dest=mmul(a,transpose(b),dest) - used in do_pr_pcoupl */
     dest[XX][XX] = a[XX][XX]*b[XX][XX]+a[XX][YY]*b[XX][YY]+a[XX][ZZ]*b[XX][ZZ];
@@ -684,7 +685,7 @@ static gmx_inline void mtmul(matrix a, matrix b, matrix dest)
     dest[ZZ][ZZ] = a[ZZ][XX]*b[ZZ][XX]+a[ZZ][YY]*b[ZZ][YY]+a[ZZ][ZZ]*b[ZZ][ZZ];
 }
 
-static gmx_inline real det(matrix a)
+static gmx_inline real det(gmx_cxx_const matrix a)
 {
     return ( a[XX][XX]*(a[YY][YY]*a[ZZ][ZZ]-a[ZZ][YY]*a[YY][ZZ])
              -a[YY][XX]*(a[XX][YY]*a[ZZ][ZZ]-a[ZZ][YY]*a[XX][ZZ])
@@ -692,7 +693,7 @@ static gmx_inline real det(matrix a)
 }
 
 
-static gmx_inline void m_add(matrix a, matrix b, matrix dest)
+static gmx_inline void m_add(gmx_cxx_const matrix a, gmx_cxx_const matrix b, matrix dest)
 {
     dest[XX][XX] = a[XX][XX]+b[XX][XX];
     dest[XX][YY] = a[XX][YY]+b[XX][YY];
@@ -705,7 +706,7 @@ static gmx_inline void m_add(matrix a, matrix b, matrix dest)
     dest[ZZ][ZZ] = a[ZZ][ZZ]+b[ZZ][ZZ];
 }
 
-static gmx_inline void m_sub(matrix a, matrix b, matrix dest)
+static gmx_inline void m_sub(gmx_cxx_const matrix a, gmx_cxx_const matrix b, matrix dest)
 {
     dest[XX][XX] = a[XX][XX]-b[XX][XX];
     dest[XX][YY] = a[XX][YY]-b[XX][YY];
@@ -718,7 +719,7 @@ static gmx_inline void m_sub(matrix a, matrix b, matrix dest)
     dest[ZZ][ZZ] = a[ZZ][ZZ]-b[ZZ][ZZ];
 }
 
-static gmx_inline void msmul(matrix m1, real r1, matrix dest)
+static gmx_inline void msmul(gmx_cxx_const matrix m1, real r1, matrix dest)
 {
     dest[XX][XX] = r1*m1[XX][XX];
     dest[XX][YY] = r1*m1[XX][YY];
@@ -731,7 +732,7 @@ static gmx_inline void msmul(matrix m1, real r1, matrix dest)
     dest[ZZ][ZZ] = r1*m1[ZZ][ZZ];
 }
 
-static gmx_inline void m_inv_ur0(matrix src, matrix dest)
+static gmx_inline void m_inv_ur0(gmx_cxx_const matrix src, matrix dest)
 {
     double tmp = src[XX][XX]*src[YY][YY]*src[ZZ][ZZ];
     if (fabs(tmp) <= 100*GMX_REAL_MIN)
@@ -751,7 +752,7 @@ static gmx_inline void m_inv_ur0(matrix src, matrix dest)
     dest[YY][ZZ] = 0.0;
 }
 
-static gmx_inline void m_inv(matrix src, matrix dest)
+static gmx_inline void m_inv(gmx_cxx_const matrix src, matrix dest)
 {
     const real smallreal = (real)1.0e-24;
     const real largereal = (real)1.0e24;
@@ -777,7 +778,7 @@ static gmx_inline void m_inv(matrix src, matrix dest)
     dest[ZZ][ZZ] = c*(src[XX][XX]*src[YY][YY]-src[YY][XX]*src[XX][YY]);
 }
 
-static gmx_inline void mvmul(matrix a, const rvec src, rvec dest)
+static gmx_inline void mvmul(gmx_cxx_const matrix a, const rvec src, rvec dest)
 {
     dest[XX] = a[XX][XX]*src[XX]+a[XX][YY]*src[YY]+a[XX][ZZ]*src[ZZ];
     dest[YY] = a[YY][XX]*src[XX]+a[YY][YY]*src[YY]+a[YY][ZZ]*src[ZZ];
@@ -785,14 +786,14 @@ static gmx_inline void mvmul(matrix a, const rvec src, rvec dest)
 }
 
 
-static gmx_inline void mvmul_ur0(matrix a, const rvec src, rvec dest)
+static gmx_inline void mvmul_ur0(gmx_cxx_const matrix a, const rvec src, rvec dest)
 {
     dest[ZZ] = a[ZZ][XX]*src[XX]+a[ZZ][YY]*src[YY]+a[ZZ][ZZ]*src[ZZ];
     dest[YY] = a[YY][XX]*src[XX]+a[YY][YY]*src[YY];
     dest[XX] = a[XX][XX]*src[XX];
 }
 
-static gmx_inline void tmvmul_ur0(matrix a, const rvec src, rvec dest)
+static gmx_inline void tmvmul_ur0(gmx_cxx_const matrix a, const rvec src, rvec dest)
 {
     dest[XX] = a[XX][XX]*src[XX]+a[YY][XX]*src[YY]+a[ZZ][XX]*src[ZZ];
     dest[YY] =                   a[YY][YY]*src[YY]+a[ZZ][YY]*src[ZZ];
@@ -819,14 +820,14 @@ static gmx_inline void unitv_no_table(const rvec src, rvec dest)
     dest[ZZ] = linv*src[ZZ];
 }
 
-static void calc_lll(rvec box, rvec lll)
+static void calc_lll(const rvec box, rvec lll)
 {
     lll[XX] = 2.0*M_PI/box[XX];
     lll[YY] = 2.0*M_PI/box[YY];
     lll[ZZ] = 2.0*M_PI/box[ZZ];
 }
 
-static gmx_inline real trace(matrix m)
+static gmx_inline real trace(gmx_cxx_const matrix m)
 {
     return (m[XX][XX]+m[YY][YY]+m[ZZ][ZZ]);
 }
@@ -850,7 +851,7 @@ static gmx_inline int _mod(int a, int b, char *file, int line)
 }
 
 /* Operations on multidimensional rvecs, used e.g. in edsam.c */
-static gmx_inline void m_rveccopy(int dim, rvec *a, rvec *b)
+static gmx_inline void m_rveccopy(int dim, gmx_cxx_const rvec *a, rvec *b)
 {
     /* b = a */
     int i;
@@ -862,7 +863,7 @@ static gmx_inline void m_rveccopy(int dim, rvec *a, rvec *b)
 }
 
 /*computer matrix vectors from base vectors and angles */
-static gmx_inline void matrix_convert(matrix box, rvec vec, rvec angle)
+static gmx_inline void matrix_convert(matrix box, const rvec vec, rvec angle)
 {
     svmul(DEG2RAD, angle, angle);
     box[XX][XX] = vec[XX];
@@ -880,28 +881,6 @@ static gmx_inline void matrix_convert(matrix box, rvec vec, rvec angle)
 
 #ifdef __cplusplus
 }
-
-static gmx_inline real det(const matrix a)
-{
-    return ( a[XX][XX]*(a[YY][YY]*a[ZZ][ZZ]-a[ZZ][YY]*a[YY][ZZ])
-             -a[YY][XX]*(a[XX][YY]*a[ZZ][ZZ]-a[ZZ][YY]*a[XX][ZZ])
-             +a[ZZ][XX]*(a[XX][YY]*a[YY][ZZ]-a[YY][YY]*a[XX][ZZ]));
-}
-
-static gmx_inline void mvmul(const matrix a, const rvec src, rvec dest)
-{
-    dest[XX] = a[XX][XX]*src[XX]+a[XX][YY]*src[YY]+a[XX][ZZ]*src[ZZ];
-    dest[YY] = a[YY][XX]*src[XX]+a[YY][YY]*src[YY]+a[YY][ZZ]*src[ZZ];
-    dest[ZZ] = a[ZZ][XX]*src[XX]+a[ZZ][YY]*src[YY]+a[ZZ][ZZ]*src[ZZ];
-}
-
-static gmx_inline void tmvmul_ur0(const matrix a, const rvec src, rvec dest)
-{
-    dest[XX] = a[XX][XX]*src[XX]+a[YY][XX]*src[YY]+a[ZZ][XX]*src[ZZ];
-    dest[YY] =                   a[YY][YY]*src[YY]+a[ZZ][YY]*src[ZZ];
-    dest[ZZ] =                                     a[ZZ][ZZ]*src[ZZ];
-}
-
 #endif
 
-#endif  /* _vec_h */
+#endif
diff --git a/src/gromacs/math/vectypes.h b/src/gromacs/math/vectypes.h
new file mode 100644 (file)
index 0000000..91b6d7c
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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_MATH_VECTYPES_H
+#define GMX_MATH_VECTYPES_H
+
+#include "gromacs/utility/real.h"
+
+#define XX      0 /* Defines for indexing in */
+#define YY      1 /* vectors                 */
+#define ZZ      2
+#define DIM     3 /* Dimension of vectors    */
+
+typedef real    rvec[DIM];
+
+typedef double  dvec[DIM];
+
+typedef real    matrix[DIM][DIM];
+
+typedef real    tensor[DIM][DIM];
+
+typedef int     ivec[DIM];
+
+typedef int     imatrix[DIM][DIM];
+
+#ifdef __cplusplus
+
+namespace gmx
+{
+
+/*! \brief
+ * C++ class for 3D vectors.
+ *
+ * \tparam ValueType  Type
+ *
+ * This class provides a C++ version of rvec/dvec/ivec that can be put into STL
+ * containers etc.  It is more or less a drop-in replacement for `rvec` and
+ * friends: it can be used in most contexts that accept the equivalent C type.
+ * However, there are two cases where explicit conversion is necessary:
+ *  - An array of these objects needs to be converted with as_vec_array() (or
+ *    convenience methods like as_rvec_array()).
+ *  - Passing an RVec as a `const rvec &` parameter to a function needs an
+ *    explicit call to as_vec().  The implicit conversion should work for this
+ *    as well, but cppcheck parses the necessary implicit conversion operator
+ *    incorrectly and MSVC fails to compile code that relies on the implicit
+ *    conversion, so the explicit method is necessary.
+ *
+ * For the array conversion to work, the compiler should not add any extra
+ * alignment/padding in the layout of this class;  that this actually works as
+ * intended is tested in the unit tests.
+ *
+ * \inpublicapi
+ */
+template <typename ValueType>
+class BasicVector
+{
+    public:
+        //! Underlying raw C array type (rvec/dvec/ivec).
+        typedef ValueType RawArray[DIM];
+
+        //! Constructs default (uninitialized) vector.
+        BasicVector() {}
+        //! Constructs a vector from given values.
+        BasicVector(ValueType x, ValueType y, ValueType z)
+        {
+            x_[XX] = x;
+            x_[YY] = y;
+            x_[ZZ] = z;
+        }
+        /*! \brief
+         * Constructs a vector from given values.
+         *
+         * This constructor is not explicit to support implicit conversions
+         * that allow, e.g., calling `std::vector<RVec>:``:push_back()` directly
+         * with an `rvec` parameter.
+         */
+        BasicVector(const RawArray x)
+        {
+            x_[XX] = x[XX];
+            x_[YY] = x[YY];
+            x_[ZZ] = x[ZZ];
+        }
+        //! Indexing operator to make the class work as the raw array.
+        ValueType &operator[](int i) { return x_[i]; }
+        //! Indexing operator to make the class work as the raw array.
+        ValueType operator[](int i) const { return x_[i]; }
+        // The conversion functions below could more accurately return
+        // RawArray &, but this fails with cppcheck and does not solve the
+        // issue with MSVC, so as_vec() should be used instead.
+        //! Makes BasicVector usable in contexts where a raw C array is expected.
+        operator ValueType *() { return x_; }
+        //! Makes BasicVector usable in contexts where a raw C array is expected.
+        operator const ValueType *() const { return x_; }
+
+        //! Converts to a raw C array where implicit conversion does not work.
+        RawArray &as_vec() { return x_; }
+        //! Converts to a raw C array where implicit conversion does not work.
+        const RawArray &as_vec() const { return x_; }
+
+    private:
+        RawArray x_;
+};
+
+/*! \brief
+ * Casts a gmx::BasicVector array into an equivalent raw C array.
+ */
+template <typename ValueType> static inline
+typename BasicVector<ValueType>::RawArray *
+as_vec_array(BasicVector<ValueType> *x)
+{
+    return reinterpret_cast<typename BasicVector<ValueType>::RawArray *>(x);
+}
+
+/*! \brief
+ * Casts a gmx::BasicVector array into an equivalent raw C array.
+ */
+template <typename ValueType> static inline
+const typename BasicVector<ValueType>::RawArray *
+as_vec_array(const BasicVector<ValueType> *x)
+{
+    return reinterpret_cast<const typename BasicVector<ValueType>::RawArray *>(x);
+}
+
+//! Shorthand for C++ `rvec`-equivalent type.
+typedef BasicVector<real> RVec;
+//! Casts a gmx::RVec array into an `rvec` array.
+static inline rvec *as_rvec_array(RVec *x)
+{
+    return as_vec_array(x);
+}
+//! Casts a gmx::RVec array into an `rvec` array.
+static inline const rvec *as_rvec_array(const RVec *x)
+{
+    return as_vec_array(x);
+}
+
+} // namespace gmx
+
+#endif
+
+#endif
index 703e8ac32d402fa46d62541724f585bb89ef6bad..d068618f838ff3d0bb3d9f8d0e6e2252acdb1a2c 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # the research papers on the package. Check out http://www.gromacs.org.
 
 file(GLOB MDLIB_SOURCES nbnxn_kernels/simd_4xn/*.c nbnxn_kernels/simd_2xnn/*.c nbnxn_kernels/*.c *.c *.cpp)
-set(MDLIB_SOURCES ${MDLIB_SOURCES} PARENT_SCOPE)
 
 if(GMX_GPU)
     add_subdirectory(nbnxn_cuda)
-    set(GMX_GPU_LIBRARIES ${GMX_GPU_LIBRARIES} nbnxn_cuda PARENT_SCOPE)
+endif()
+
+set(MDLIB_SOURCES ${MDLIB_SOURCES} PARENT_SCOPE)
+if (BUILD_TESTING)
+    add_subdirectory(tests)
 endif()
index d2ac44d54c0c68a89ee35cdb7a2d92850cbfb5e8..9e9db2908984f30cd6a842a4780d2979b194382e 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
+#include "gmxpre.h"
+
 #include "adress.h"
-#include "gromacs/math/utilities.h"
-#include "pbc.h"
-#include "types/simple.h"
-#include "typedefs.h"
-#include "vec.h"
 
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 
 real
 adress_weight(rvec                 x,
index ec8e9fb5f06fd53c46678bae7bcd696d22dc6459..a25514d8b18e6c0b70129568f550e7203fa28a20 100644 (file)
 #ifndef _adress_h_
 #define _adress_h_
 
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+struct t_pbc;
 
 /** \brief calculates the AdResS weight of a particle
  *
@@ -68,7 +75,7 @@ adress_weight(rvec                 x,
               real                 adressr,
               real                 adressw,
               rvec     *           ref,
-              t_pbc     *          pbc,
+              struct t_pbc     *   pbc,
               t_forcerec *         fr);
 
 /** \brief update the weight of all coarse-grained particles in several charge groups for com vsites
@@ -90,7 +97,7 @@ update_adress_weights_com(FILE *               fplog,
                           rvec                 x[],
                           t_forcerec *         fr,
                           t_mdatoms *          mdatoms,
-                          t_pbc *              pbc);
+                          struct t_pbc *       pbc);
 
 /** \brief update the weight of all coarse-grained particles for cog vsites
  *
@@ -107,7 +114,7 @@ update_adress_weights_cog(t_iparams            ip[],
                           rvec                 x[],
                           t_forcerec *         fr,
                           t_mdatoms *          mdatoms,
-                          t_pbc *              pbc);
+                          struct t_pbc *       pbc);
 
 /** \brief update the weight of all coarse-grained particles in several charge groups for atom vsites
  *
@@ -126,7 +133,7 @@ update_adress_weights_atom(int                  cg0,
                            rvec                 x[],
                            t_forcerec *         fr,
                            t_mdatoms *          mdatoms,
-                           t_pbc *              pbc);
+                           struct t_pbc *       pbc);
 
 /** \brief update the weight on per atom basis of all coarse-grained particles in several charge groups for atom vsites
  *
@@ -145,7 +152,7 @@ update_adress_weights_atom_per_atom(int                  cg0,
                                     rvec                 x[],
                                     t_forcerec *         fr,
                                     t_mdatoms *          mdatoms,
-                                    t_pbc *              pbc);
+                                    struct t_pbc *       pbc);
 
 /** \brief add AdResS IC thermodynamic force to f_novirsum
  *
@@ -166,7 +173,7 @@ adress_thermo_force(int                  cg0,
                     rvec                 f[],
                     t_forcerec *         fr,
                     t_mdatoms *          mdatoms,
-                    t_pbc *              pbc);
+                    struct t_pbc *       pbc);
 
 
 /** \brief checks weather a cpu calculates only coarse-grained or explicit interactions
@@ -191,4 +198,9 @@ gmx_bool egp_explicit(t_forcerec *   fr, int egp_nr);
  * \return boolean if coarse-grained or not
  */
 gmx_bool egp_coarsegrained(t_forcerec *   fr, int egp_nr);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
similarity index 97%
rename from src/gromacs/gmxlib/mvdata.c
rename to src/gromacs/mdlib/broadcaststructs.cpp
index b9d3a3a57b0960ddfea63e97334c7e2b3d3ee46d..98b476bc85fd25ce0dc4f7c27efdf4f098a50b9a 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <string.h>
 
-#include "typedefs.h"
-#include "main.h"
-#include "mvdata.h"
-#include "types/commrec.h"
-#include "network.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "symtab.h"
-#include "vec.h"
-#include "tgroup.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
@@ -80,15 +78,13 @@ static void bc_strings(const t_commrec *cr, t_symtab *symtab, int nr, char ****n
 {
     int     i;
     int    *handle;
-    char ***NM;
 
     snew(handle, nr);
     if (MASTER(cr))
     {
-        NM = *nm;
         for (i = 0; (i < nr); i++)
         {
-            handle[i] = lookup_symtab(symtab, NM[i]);
+            handle[i] = lookup_symtab(symtab, (*nm)[i]);
         }
     }
     nblock_bc(cr, nr, handle);
@@ -96,7 +92,6 @@ static void bc_strings(const t_commrec *cr, t_symtab *symtab, int nr, char ****n
     if (!MASTER(cr))
     {
         snew_bc(cr, *nm, nr);
-        NM = *nm;
         for (i = 0; (i < nr); i++)
         {
             (*nm)[i] = get_symtab_handle(symtab, handle[i]);
@@ -188,8 +183,6 @@ static void bc_grps(const t_commrec *cr, t_grps grps[])
 
 static void bc_atoms(const t_commrec *cr, t_symtab *symtab, t_atoms *atoms)
 {
-    int dummy;
-
     block_bc(cr, atoms->nr);
     snew_bc(cr, atoms->atom, atoms->nr);
     nblock_bc(cr, atoms->nr, atoms->atom);
@@ -206,7 +199,6 @@ static void bc_atoms(const t_commrec *cr, t_symtab *symtab, t_atoms *atoms)
 static void bc_groups(const t_commrec *cr, t_symtab *symtab,
                       int natoms, gmx_groups_t *groups)
 {
-    int dummy;
     int g, n;
 
     bc_grps(cr, groups->grps);
@@ -373,7 +365,7 @@ static void bc_ilists(const t_commrec *cr, t_ilist *ilist)
 
 static void bc_cmap(const t_commrec *cr, gmx_cmap_t *cmap_grid)
 {
-    int i, j, nelem, ngrid;
+    int i, nelem, ngrid;
 
     block_bc(cr, cmap_grid->ngrid);
     block_bc(cr, cmap_grid->grid_spacing);
@@ -395,8 +387,6 @@ static void bc_cmap(const t_commrec *cr, gmx_cmap_t *cmap_grid)
 
 static void bc_ffparams(const t_commrec *cr, gmx_ffparams_t *ffp)
 {
-    int i;
-
     block_bc(cr, ffp->ntypes);
     block_bc(cr, ffp->atnr);
     snew_bc(cr, ffp->functype, ffp->ntypes);
@@ -558,8 +548,6 @@ static void bc_adress(const t_commrec *cr, t_adress *adress)
 
 static void bc_imd(const t_commrec *cr, t_IMD *imd)
 {
-    int g;
-
     block_bc(cr, *imd);
     snew_bc(cr, imd->ind, imd->nat);
     nblock_bc(cr, imd->nat, imd->ind);
@@ -567,7 +555,6 @@ static void bc_imd(const t_commrec *cr, t_IMD *imd)
 
 static void bc_fepvals(const t_commrec *cr, t_lambda *fep)
 {
-    gmx_bool bAlloc = TRUE;
     int      i;
 
     block_bc(cr, fep->nstdhdl);
@@ -604,9 +591,6 @@ static void bc_fepvals(const t_commrec *cr, t_lambda *fep)
 
 static void bc_expandedvals(const t_commrec *cr, t_expanded *expand, int n_lambda)
 {
-    gmx_bool bAlloc = TRUE;
-    int      i;
-
     block_bc(cr, expand->nstexpanded);
     block_bc(cr, expand->elamstats);
     block_bc(cr, expand->elmcmove);
@@ -640,9 +624,6 @@ static void bc_expandedvals(const t_commrec *cr, t_expanded *expand, int n_lambd
 
 static void bc_simtempvals(const t_commrec *cr, t_simtemp *simtemp, int n_lambda)
 {
-    gmx_bool bAlloc = TRUE;
-    int      i;
-
     block_bc(cr, simtemp->simtemp_low);
     block_bc(cr, simtemp->simtemp_high);
     block_bc(cr, simtemp->eSimTempScale);
@@ -681,7 +662,6 @@ static void bc_swapions(const t_commrec *cr, t_swapcoords *swap)
 
 static void bc_inputrec(const t_commrec *cr, t_inputrec *inputrec)
 {
-    gmx_bool bAlloc = TRUE;
     int      i;
 
     block_bc(cr, *inputrec);
@@ -756,8 +736,6 @@ static void bc_moltype(const t_commrec *cr, t_symtab *symtab,
 
 static void bc_molblock(const t_commrec *cr, gmx_molblock_t *molb)
 {
-    gmx_bool bAlloc = TRUE;
-
     block_bc(cr, molb->type);
     block_bc(cr, molb->nmol);
     block_bc(cr, molb->natoms_mol);
@@ -800,7 +778,9 @@ static void bc_atomtypes(const t_commrec *cr, t_atomtypes *atomtypes)
     nblock_bc(cr, nr, atomtypes->S_hct);
 }
 
-
+/*! \brief Broadcasts ir and mtop from the master to all nodes in
+ * cr->mpi_comm_mygroup. */
+static
 void bcast_ir_mtop(const t_commrec *cr, t_inputrec *inputrec, gmx_mtop_t *mtop)
 {
     int i;
@@ -847,3 +827,9 @@ void bcast_ir_mtop(const t_commrec *cr, t_inputrec *inputrec, gmx_mtop_t *mtop)
     bc_block(cr, &mtop->mols);
     bc_groups(cr, &mtop->symtab, mtop->natoms, &mtop->groups);
 }
+
+void init_parallel(t_commrec *cr, t_inputrec *inputrec,
+                   gmx_mtop_t *mtop)
+{
+    bcast_ir_mtop(cr, inputrec, mtop);
+}
similarity index 92%
rename from src/gromacs/mdlib/calcmu.c
rename to src/gromacs/mdlib/calcmu.cpp
index 3a2dc0b1a2c688bf85585771b2fc4b2c5dc2dc80..7f2d383ca15b3fd250fd40777e008b5bab9a2ede 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/calcmu.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "typedefs.h"
-#include "network.h"
-#include "vec.h"
-#include "physics.h"
-#include "main.h"
-#include "calcmu.h"
-#include "gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 
 void calc_mu(int start, int homenr, rvec x[], real q[], real qB[],
              int nChargePerturbed,
similarity index 92%
rename from src/gromacs/mdlib/calcvir.c
rename to src/gromacs/mdlib/calcvir.cpp
index 395b9c38f5200c0adcf27ca83f3ec67957802a69..b8b8a71900a4a9166bf20672652f61f46be04dd0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include <algorithm>
+
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 
-#include "sysstuff.h"
-#include "force.h"
-#include "vec.h"
-#include "mshift.h"
-#include "macros.h"
+#define XXXX    0
+#define XXYY    1
+#define XXZZ    2
+#define YYXX    3
+#define YYYY    4
+#define YYZZ    5
+#define ZZXX    6
+#define ZZYY    7
+#define ZZZZ    8
 
 static void upd_vir(rvec vir, real dvx, real dvy, real dvz)
 {
@@ -229,8 +240,8 @@ void f_calc_vir(int i0, int i1, rvec x[], rvec f[], tensor vir,
         /* Calculate virial for bonded forces only when they belong to
          * this node.
          */
-        start = max(i0, g->at_start);
-        end   = min(i1, g->at_end);
+        start = std::max(i0, g->at_start);
+        end   = std::min(i1, g->at_end);
 #ifdef SAFE
         lo_fcv2(start, end, x, f, vir, g->ishift, box, TRICLINIC(box));
 #else
similarity index 96%
rename from src/gromacs/mdlib/clincs.c
rename to src/gromacs/mdlib/clincs.cpp
index 783ad72c8530158783b5eab8f7f3d647489c9f75..480a96596d841b2b1afcb99627f738aa78b843ab 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "main.h"
-#include "constr.h"
-#include "copyrite.h"
-#include "physics.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/utility/smalloc.h"
-#include "mdrun.h"
-#include "nrnb.h"
-#include "domdec.h"
-#include "mtop_util.h"
-#include "gmx_omp_nthreads.h"
+#include <stdlib.h>
 
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/bitmask.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int    b0;         /* first constraint for this thread */
@@ -97,7 +98,7 @@ typedef struct gmx_lincsdata {
     real           *bllen;        /* the reference bond length */
     int             nth;          /* The number of threads doing LINCS */
     lincs_thread_t *th;           /* LINCS thread division */
-    unsigned       *atf;          /* atom flags for thread parallelization */
+    gmx_bitmask_t  *atf;          /* atom flags for thread parallelization */
     int             atf_nalloc;   /* allocation size of atf */
     /* arrays for temporary storage in the LINCS algorithm */
     rvec           *tmpv;
@@ -364,7 +365,7 @@ static void do_lincsp(rvec *x, rvec *f, rvec *fp, t_pbc *pbc,
                       gmx_bool bCalcVir, tensor rmdf)
 {
     int      b0, b1, b, i, j, k, n;
-    real     tmp0, tmp1, tmp2, im1, im2, mvb, rlen, len, wfac, lam;
+    real     tmp0, tmp1, tmp2, mvb;
     rvec     dx;
     int     *bla, *blnr, *blbnb;
     rvec    *r;
@@ -508,7 +509,7 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
                      gmx_bool bCalcVir, tensor vir_r_m_dr)
 {
     int      b0, b1, b, i, j, k, n, iter;
-    real     tmp0, tmp1, tmp2, im1, im2, mvb, rlen, len, len2, dlen2, wfac;
+    real     tmp0, tmp1, tmp2, mvb, rlen, len, len2, dlen2, wfac;
     rvec     dx;
     int     *bla, *blnr, *blbnb;
     rvec    *r;
@@ -651,6 +652,7 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
             dlen2 = 2*len2 - norm2(dx);
             if (dlen2 < wfac*len2 && (nlocat == NULL || nlocat[b]))
             {
+                /* not race free - see detailed comment in caller */
                 *warn = b;
             }
             if (dlen2 > 0)
@@ -802,7 +804,7 @@ void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda)
                             li->triangle[li->ntriangle] = i;
                             li->tri_bits[li->ntriangle] = 0;
                             li->ntriangle++;
-                            if (li->blnr[i+1] - li->blnr[i] > sizeof(li->tri_bits[0])*8 - 1)
+                            if (li->blnr[i+1] - li->blnr[i] > static_cast<int>(sizeof(li->tri_bits[0])*8 - 1))
                             {
                                 gmx_fatal(FARGS, "A constraint is connected to %d constraints, this is more than the %d allowed for constraints participating in triangles",
                                           li->blnr[i+1] - li->blnr[i],
@@ -1034,7 +1036,7 @@ static void lincs_thread_setup(struct gmx_lincsdata *li, int natoms)
 {
     lincs_thread_t *li_m;
     int             th;
-    unsigned       *atf;
+    gmx_bitmask_t  *atf;
     int             a;
 
     if (natoms > li->atf_nalloc)
@@ -1047,7 +1049,12 @@ static void lincs_thread_setup(struct gmx_lincsdata *li, int natoms)
     /* Clear the atom flags */
     for (a = 0; a < natoms; a++)
     {
-        atf[a] = 0;
+        bitmask_clear(&atf[a]);
+    }
+
+    if (li->nth > BITMASK_SIZE)
+    {
+        gmx_fatal(FARGS, "More than %d threads is not supported for LINCS.", BITMASK_SIZE);
     }
 
     for (th = 0; th < li->nth; th++)
@@ -1061,14 +1068,11 @@ static void lincs_thread_setup(struct gmx_lincsdata *li, int natoms)
         li_th->b0 = (li->nc* th   )/li->nth;
         li_th->b1 = (li->nc*(th+1))/li->nth;
 
-        if (th < sizeof(*atf)*8)
+        /* For each atom set a flag for constraints from each */
+        for (b = li_th->b0; b < li_th->b1; b++)
         {
-            /* For each atom set a flag for constraints from each */
-            for (b = li_th->b0; b < li_th->b1; b++)
-            {
-                atf[li->bla[b*2]  ] |= (1U<<th);
-                atf[li->bla[b*2+1]] |= (1U<<th);
-            }
+            bitmask_set_bit(&atf[li->bla[b*2]], th);
+            bitmask_set_bit(&atf[li->bla[b*2+1]], th);
         }
     }
 
@@ -1076,7 +1080,7 @@ static void lincs_thread_setup(struct gmx_lincsdata *li, int natoms)
     for (th = 0; th < li->nth; th++)
     {
         lincs_thread_t *li_th;
-        unsigned        mask;
+        gmx_bitmask_t   mask;
         int             b;
 
         li_th = &li->th[th];
@@ -1088,35 +1092,24 @@ static void lincs_thread_setup(struct gmx_lincsdata *li, int natoms)
             srenew(li_th->ind_r, li_th->ind_nalloc);
         }
 
-        if (th < sizeof(*atf)*8)
-        {
-            mask = (1U<<th) - 1U;
+        bitmask_init_low_bits(&mask, th);
 
-            li_th->nind   = 0;
-            li_th->nind_r = 0;
-            for (b = li_th->b0; b < li_th->b1; b++)
+        li_th->nind   = 0;
+        li_th->nind_r = 0;
+        for (b = li_th->b0; b < li_th->b1; b++)
+        {
+            /* We let the constraint with the lowest thread index
+             * operate on atoms with constraints from multiple threads.
+             */
+            if (bitmask_is_disjoint(atf[li->bla[b*2]], mask) &&
+                bitmask_is_disjoint(atf[li->bla[b*2+1]], mask))
             {
-                /* We let the constraint with the lowest thread index
-                 * operate on atoms with constraints from multiple threads.
-                 */
-                if (((atf[li->bla[b*2]]   & mask) == 0) &&
-                    ((atf[li->bla[b*2+1]] & mask) == 0))
-                {
-                    /* Add the constraint to the local atom update index */
-                    li_th->ind[li_th->nind++] = b;
-                }
-                else
-                {
-                    /* Add the constraint to the rest block */
-                    li_th->ind_r[li_th->nind_r++] = b;
-                }
+                /* Add the constraint to the local atom update index */
+                li_th->ind[li_th->nind++] = b;
             }
-        }
-        else
-        {
-            /* We are out of bits, assign all constraints to rest */
-            for (b = li_th->b0; b < li_th->b1; b++)
+            else
             {
+                /* Add the constraint to the rest block */
                 li_th->ind_r[li_th->nind_r++] = b;
             }
         }
@@ -1171,7 +1164,6 @@ void set_lincs(t_idef *idef, t_mdatoms *md,
     int          i, k, ncc_alloc, ni, con, nconnect, concon;
     int          type, a1, a2;
     real         lenA = 0, lenB;
-    gmx_bool     bLocal;
 
     li->nc  = 0;
     li->ncc = 0;
@@ -1260,7 +1252,6 @@ void set_lincs(t_idef *idef, t_mdatoms *md,
     li->blnr[con] = nconnect;
     for (i = 0; i < ni; i++)
     {
-        bLocal = TRUE;
         type   = iatom[3*i];
         a1     = iatom[3*i+1];
         a2     = iatom[3*i+2];
@@ -1492,7 +1483,7 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
 {
     gmx_bool  bCalcDHDL;
     char      buf[STRLEN], buf2[22], buf3[STRLEN];
-    int       i, warn, p_imax, error;
+    int       i, warn, p_imax;
     real      ncons_loc, p_ssd, p_max = 0;
     rvec      dx;
     gmx_bool  bOK;
@@ -1708,6 +1699,7 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         if (econqCoord)
         {
             /* dhdlambda contains dH/dlambda*dt^2, correct for this */
+            /* TODO This should probably use invdt, so that sd integrator scaling works properly */
             dhdlambda /= ir->delta_t*ir->delta_t;
         }
         *dvdlambda += dhdlambda;
similarity index 91%
rename from src/gromacs/mdlib/constr.c
rename to src/gromacs/mdlib/constr.cpp
index b6878e6bd12107d9bb4faf3e298b2f8c4853a758..ad36ec2a7f985326dde9158ed5bb105e7ace03d6 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/constr.h"
 
 #include <assert.h>
+#include <stdlib.h>
+
+#include <cmath>
+
+#include <algorithm>
 
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/fileio/confio.h"
-#include "types/commrec.h"
-#include "constr.h"
-#include "copyrite.h"
-#include "invblock.h"
-#include "main.h"
-#include "mdrun.h"
-#include "nrnb.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "physics.h"
-#include "names.h"
-#include "txtdump.h"
-#include "domdec.h"
-#include "gromacs/fileio/pdbio.h"
-#include "splitter.h"
-#include "mtop_util.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "macros.h"
-#include "gmx_omp_nthreads.h"
-#include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/splitter.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
-
-#include "gmx_fatal.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/invblock.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct gmx_constr {
     int                ncon_tot;       /* The total number of constraints    */
@@ -79,7 +82,7 @@ typedef struct gmx_constr {
     int                nblocks;        /* The number of SHAKE blocks         */
     int               *sblock;         /* The SHAKE blocks                   */
     int                sblock_nalloc;  /* The allocation size of sblock      */
-    real              *lagr;           /* Lagrange multipliers for SHAKE     */
+    real              *lagr;           /* -2 times the Lagrange multipliers for SHAKE */
     int                lagr_nalloc;    /* The allocation size of lagr        */
     int                maxwarn;        /* The maximum number of warnings     */
     int                warncount_lincs;
@@ -97,67 +100,6 @@ typedef struct {
     atom_id blocknr;
 } t_sortblock;
 
-/* delta_t should be used instead of ir->delta_t, to permit the time
-   step to be scaled by the calling code */
-static void *init_vetavars(t_vetavars *vars,
-                           gmx_bool constr_deriv,
-                           real veta, real vetanew,
-                           t_inputrec *ir, real delta_t,
-                           gmx_ekindata_t *ekind, gmx_bool bPscal)
-{
-    double g;
-    int    i;
-
-    /* first, set the alpha integrator variable */
-    if ((ir->opts.nrdf[0] > 0) && bPscal)
-    {
-        vars->alpha = 1.0 + DIM/((double)ir->opts.nrdf[0]);
-    }
-    else
-    {
-        vars->alpha = 1.0;
-    }
-    g             = 0.5*veta*delta_t;
-    vars->rscale  = exp(g)*series_sinhx(g);
-    g             = -0.25*vars->alpha*veta*delta_t;
-    vars->vscale  = exp(g)*series_sinhx(g);
-    vars->rvscale = vars->vscale*vars->rscale;
-    vars->veta    = vetanew;
-
-    if (constr_deriv)
-    {
-        snew(vars->vscale_nhc, ir->opts.ngtc);
-        if ((ekind == NULL) || (!bPscal))
-        {
-            for (i = 0; i < ir->opts.ngtc; i++)
-            {
-                vars->vscale_nhc[i] = 1;
-            }
-        }
-        else
-        {
-            for (i = 0; i < ir->opts.ngtc; i++)
-            {
-                vars->vscale_nhc[i] = ekind->tcstat[i].vscale_nhc;
-            }
-        }
-    }
-    else
-    {
-        vars->vscale_nhc = NULL;
-    }
-
-    return vars;
-}
-
-static void free_vetavars(t_vetavars *vars)
-{
-    if (vars->vscale_nhc != NULL)
-    {
-        sfree(vars->vscale_nhc);
-    }
-}
-
 static int pcomp(const void *p1, const void *p2)
 {
     int          db;
@@ -172,10 +114,10 @@ static int pcomp(const void *p1, const void *p2)
         return db;
     }
 
-    min1 = min(a1->iatom[1], a1->iatom[2]);
-    max1 = max(a1->iatom[1], a1->iatom[2]);
-    min2 = min(a2->iatom[1], a2->iatom[2]);
-    max2 = max(a2->iatom[1], a2->iatom[2]);
+    min1 = std::min(a1->iatom[1], a1->iatom[2]);
+    max1 = std::max(a1->iatom[1], a1->iatom[2]);
+    min2 = std::min(a2->iatom[1], a2->iatom[2]);
+    max2 = std::max(a2->iatom[1], a2->iatom[2]);
 
     if (min1 == min2)
     {
@@ -217,10 +159,6 @@ static void clear_constraint_quantity_nonlocal(gmx_domdec_t *dd, rvec *q)
 
 void too_many_constraint_warnings(int eConstrAlg, int warncount)
 {
-    const char *abort = "- aborting to avoid logfile runaway.\n"
-        "This normally happens when your system is not sufficiently equilibrated,"
-        "or if you are changing lambda too fast in free energy simulations.\n";
-
     gmx_fatal(FARGS,
               "Too many %s warnings (%d)\n"
               "If you know what you are doing you can %s"
@@ -327,7 +265,7 @@ static void pr_sortblock(FILE *fp, const char *title, int nsb, t_sortblock sb[])
 
 gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                    struct gmx_constr *constr,
-                   t_idef *idef, t_inputrec *ir, gmx_ekindata_t *ekind,
+                   t_idef *idef, t_inputrec *ir,
                    t_commrec *cr,
                    gmx_int64_t step, int delta_step,
                    real step_scaling,
@@ -336,22 +274,19 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                    gmx_bool bMolPBC, matrix box,
                    real lambda, real *dvdlambda,
                    rvec *v, tensor *vir,
-                   t_nrnb *nrnb, int econq, gmx_bool bPscal,
-                   real veta, real vetanew)
+                   t_nrnb *nrnb, int econq)
 {
     gmx_bool    bOK, bDump;
-    int         start, homenr, nrend;
-    int         i, j, d;
-    int         ncons, settle_error;
+    int         start, homenr;
+    int         i, j;
+    int         settle_error;
     tensor      vir_r_m_dr;
-    rvec       *vstor;
     real        scaled_delta_t;
-    real        invdt, vir_fac, t;
+    real        invdt, vir_fac = 0, t;
     t_ilist    *settle;
     int         nsettle;
     t_pbc       pbc, *pbc_null;
     char        buf[22];
-    t_vetavars  vetavar;
     int         nth, th;
 
     if (econq == econqForceDispl && !EI_ENERGY_MINIMIZATION(ir->eI))
@@ -364,14 +299,9 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
 
     start  = 0;
     homenr = md->homenr;
-    nrend  = start+homenr;
 
     scaled_delta_t = step_scaling * ir->delta_t;
 
-    /* set constants for pressure control integration */
-    init_vetavars(&vetavar, econq != econqCoord,
-                  veta, vetanew, ir, scaled_delta_t, ekind, bPscal);
-
     /* Prepare time step for use in constraint implementations, and
        avoid generating inf when ir->delta_t = 0. */
     if (ir->delta_t == 0)
@@ -483,7 +413,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                               idef, ir, x, xprime, nrnb,
                               constr->lagr, lambda, dvdlambda,
                               invdt, v, vir != NULL, vir_r_m_dr,
-                              constr->maxwarn >= 0, econq, &vetavar);
+                              constr->maxwarn >= 0, econq);
                 break;
             case (econqVeloc):
                 bOK = bshakef(fplog, constr->shaked,
@@ -491,7 +421,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                               idef, ir, x, min_proj, nrnb,
                               constr->lagr, lambda, dvdlambda,
                               invdt, NULL, vir != NULL, vir_r_m_dr,
-                              constr->maxwarn >= 0, econq, &vetavar);
+                              constr->maxwarn >= 0, econq);
                 break;
             default:
                 gmx_fatal(FARGS, "Internal error, SHAKE called for constraining something else than coordinates");
@@ -546,8 +476,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                                 x[0], xprime[0],
                                 invdt, v ? v[0] : NULL, calcvir_atom_end,
                                 th == 0 ? vir_r_m_dr : constr->vir_r_m_dr_th[th],
-                                th == 0 ? &settle_error : &constr->settle_error[th],
-                                &vetavar);
+                                th == 0 ? &settle_error : &constr->settle_error[th]);
                     }
                 }
                 inc_nrnb(nrnb, eNR_SETTLE, nsettle);
@@ -585,8 +514,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                                     pbc_null,
                                     x,
                                     xprime, min_proj, calcvir_atom_end,
-                                    th == 0 ? vir_r_m_dr : constr->vir_r_m_dr_th[th],
-                                    &vetavar);
+                                    th == 0 ? vir_r_m_dr : constr->vir_r_m_dr_th[th]);
                     }
                 }
                 /* This is an overestimate */
@@ -605,9 +533,15 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         /* Combine virial and error info of the other threads */
         for (i = 1; i < nth; i++)
         {
-            m_add(vir_r_m_dr, constr->vir_r_m_dr_th[i], vir_r_m_dr);
             settle_error = constr->settle_error[i];
         }
+        if (vir != NULL)
+        {
+            for (i = 1; i < nth; i++)
+            {
+                m_add(vir_r_m_dr, constr->vir_r_m_dr_th[i], vir_r_m_dr);
+            }
+        }
 
         if (econq == econqCoord && settle_error >= 0)
         {
@@ -616,7 +550,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
             {
                 char buf[256];
                 sprintf(buf,
-                        "\nstep " "%"GMX_PRId64 ": Water molecule starting at atom %d can not be "
+                        "\nstep " "%" GMX_PRId64 ": Water molecule starting at atom %d can not be "
                         "settled.\nCheck for bad contacts and/or reduce the timestep if appropriate.\n",
                         step, ddglatnr(cr->dd, settle->iatoms[settle_error*(1+NRAL(F_SETTLE))+1]));
                 if (fplog)
@@ -634,8 +568,6 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         }
     }
 
-    free_vetavars(&vetavar);
-
     if (vir != NULL)
     {
         /* The normal uses of constrain() pass step_scaling = 1.0.
@@ -659,7 +591,6 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                 vir_fac = 0.5;
                 break;
             default:
-                vir_fac = 0;
                 gmx_incons("Unsupported constraint quantity for virial");
         }
 
@@ -830,7 +761,7 @@ static void make_shake_sblock_serial(struct gmx_constr *constr,
                 j, constr->nblocks, ncons);
         for (i = 0; (i < ncons); i++)
         {
-            fprintf(stderr, "i: %5d  sb[i].blocknr: %5u\n", i, sb[i].blocknr);
+            fprintf(stderr, "i: %5d  sb[i].blocknr: %5d\n", i, sb[i].blocknr);
         }
         for (j = 0; (j <= constr->nblocks); j++)
         {
@@ -1193,7 +1124,7 @@ static real constr_r_max_moltype(gmx_moltype_t *molt, t_iparams *iparams,
         if (EI_DYNAMICS(ir->eI))
         {
             lam1 = ir->fepvals->init_lambda + (ir->init_step + ir->nsteps)*ir->fepvals->delta_lambda;
-            rmax = max(rmax, (1 - lam1)*sqrt(r2maxA) + lam1*sqrt(r2maxB));
+            rmax = std::max(rmax, (1 - lam1)*std::sqrt(r2maxA) + lam1*std::sqrt(r2maxB));
         }
     }
 
@@ -1211,9 +1142,9 @@ real constr_r_max(FILE *fplog, gmx_mtop_t *mtop, t_inputrec *ir)
     rmax = 0;
     for (mt = 0; mt < mtop->nmoltype; mt++)
     {
-        rmax = max(rmax,
-                   constr_r_max_moltype(&mtop->moltype[mt],
-                                        mtop->ffparams.iparams, ir));
+        rmax = std::max(rmax,
+                        constr_r_max_moltype(&mtop->moltype[mt],
+                                             mtop->ffparams.iparams, ir));
     }
 
     if (fplog)
@@ -1229,7 +1160,7 @@ gmx_constr_t init_constraints(FILE *fplog,
                               gmx_edsam_t ed, t_state *state,
                               t_commrec *cr)
 {
-    int                  ncon, nset, nmol, settle_type, i, natoms, mt, nflexcon;
+    int                  ncon, nset, nmol, settle_type, i, mt, nflexcon;
     struct gmx_constr   *constr;
     char                *env;
     t_ilist             *ilist;
@@ -1358,12 +1289,17 @@ gmx_constr_t init_constraints(FILE *fplog,
         }
     }
 
+    if ((ncon + nset) > 0 && ir->epc == epcMTTK)
+    {
+        gmx_fatal(FARGS, "Constraints are not implemented with MTTK pressure control.");
+    }
+
     constr->maxwarn = 999;
     env             = getenv("GMX_MAXCONSTRWARN");
     if (env)
     {
         constr->maxwarn = 0;
-        sscanf(env, "%d", &constr->maxwarn);
+        sscanf(env, "%8d", &constr->maxwarn);
         if (fplog)
         {
             fprintf(fplog,
@@ -1414,7 +1350,7 @@ gmx_bool inter_charge_group_constraints(const gmx_mtop_t *mtop)
     const t_block       *cgs;
     const t_ilist       *il;
     int                  mb;
-    int                  nat, *at2cg, cg, a, ftype, i;
+    int                 *at2cg, cg, a, ftype, i;
     gmx_bool             bInterCG;
 
     bInterCG = FALSE;
@@ -1461,7 +1397,7 @@ gmx_bool inter_charge_group_settles(const gmx_mtop_t *mtop)
     const t_block       *cgs;
     const t_ilist       *il;
     int                  mb;
-    int                  nat, *at2cg, cg, a, ftype, i;
+    int                 *at2cg, cg, a, ftype, i;
     gmx_bool             bInterCG;
 
     bInterCG = FALSE;
similarity index 96%
rename from src/gromacs/mdlib/coupling.c
rename to src/gromacs/mdlib/coupling.cpp
index 0898371728aca74a1a835ed6d9f471378154813f..8677c2d97075a7d51dcbaf384ddafcfec454cbb2 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
 #include <assert.h>
 
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "update.h"
-#include "vec.h"
-#include "macros.h"
-#include "physics.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "txtdump.h"
-#include "nrnb.h"
+#include <algorithm>
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
-#include "update.h"
-#include "mdrun.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define NTROTTERPARTS 3
 
@@ -94,7 +94,7 @@ static void NHC_trotter(t_grpopts *opts, int nvar, gmx_ekindata_t *ekind, real d
 {
     /* general routine for both barostat and thermostat nose hoover chains */
 
-    int           i, j, mi, mj, jmax;
+    int           i, j, mi, mj;
     double        Ekin, Efac, reft, kT, nd;
     double        dt;
     t_grp_tcstat *tcstat;
@@ -129,7 +129,7 @@ static void NHC_trotter(t_grpopts *opts, int nvar, gmx_ekindata_t *ekind, real d
         {
             iQinv = &(MassQ->QPinv[i*nh]);
             nd    = 1.0; /* THIS WILL CHANGE IF NOT ISOTROPIC */
-            reft  = max(0.0, opts->ref_t[0]);
+            reft  = std::max<real>(0, opts->ref_t[0]);
             Ekin  = sqr(*veta)/MassQ->Winv;
         }
         else
@@ -137,7 +137,7 @@ static void NHC_trotter(t_grpopts *opts, int nvar, gmx_ekindata_t *ekind, real d
             iQinv  = &(MassQ->Qinv[i*nh]);
             tcstat = &ekind->tcstat[i];
             nd     = opts->nrdf[i];
-            reft   = max(0.0, opts->ref_t[i]);
+            reft   = std::max<real>(0, opts->ref_t[i]);
             if (bEkinAveVel)
             {
                 Ekin = 2*trace(tcstat->ekinf)*tcstat->ekinscalef_nhc;
@@ -229,9 +229,9 @@ static void boxv_trotter(t_inputrec *ir, real *veta, real dt, tensor box,
 
     real   pscal;
     double alpha;
-    int    i, j, d, n, nwall;
-    real   T, GW, vol;
-    tensor Winvm, ekinmod, localpres;
+    int    nwall;
+    real   GW, vol;
+    tensor ekinmod, localpres;
 
     /* The heat bath is coupled to a separate barostat, the last temperature group.  In the
        2006 Tuckerman et al paper., the order is iL_{T_baro} iL {T_part}
@@ -375,8 +375,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 = max(box[XX][XX], box[YY][YY]);
-        maxl = max(maxl, box[ZZ][ZZ]);
+        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++)
@@ -533,7 +533,7 @@ void berendsen_pcoupl(FILE *fplog, gmx_int64_t step,
 {
     int     d, n;
     real    scalar_pressure, xy_pressure, p_corr_z;
-    char   *ptr, buf[STRLEN];
+    char    buf[STRLEN];
 
     /*
      *  Calculate the scaling matrix mu
@@ -706,9 +706,9 @@ void berendsen_tcoupl(t_inputrec *ir, gmx_ekindata_t *ekind, real dt)
 
         if ((opts->tau_t[i] > 0) && (T > 0.0))
         {
-            reft                    = max(0.0, opts->ref_t[i]);
+            reft                    = std::max<real>(0, opts->ref_t[i]);
             lll                     = sqrt(1.0 + (dt/opts->tau_t[i])*(reft/T-1.0));
-            ekind->tcstat[i].lambda = max(min(lll, 1.25), 0.8);
+            ekind->tcstat[i].lambda = std::max<real>(std::min<real>(lll, 1.25), 0.8);
         }
         else
         {
@@ -781,7 +781,7 @@ void nosehoover_tcoupl(t_grpopts *opts, gmx_ekindata_t *ekind, real dt,
 
     for (i = 0; (i < opts->ngtc); i++)
     {
-        reft     = max(0.0, opts->ref_t[i]);
+        reft     = std::max<real>(0, opts->ref_t[i]);
         oldvxi   = vxi[i];
         vxi[i]  += dt*MassQ->Qinv[i]*(ekind->tcstat[i].Th - reft);
         xi[i]   += dt*(oldvxi + vxi[i])*0.5;
@@ -820,16 +820,14 @@ void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind,
                     t_extmass *MassQ, int **trotter_seqlist, int trotter_seqno)
 {
 
-    int             n, i, j, d, ntgrp, ngtc, gc = 0;
+    int             n, i, d, ngtc, gc = 0;
     t_grp_tcstat   *tcstat;
     t_grpopts      *opts;
     gmx_int64_t     step_eff;
-    real            ecorr, pcorr, dvdlcorr;
-    real            bmass, qmass, reft, kT, dt, nd;
-    tensor          dumpres, dumvir;
+    real            dt;
     double         *scalefac, dtc;
     int            *trotter_seq;
-    rvec            sumv = {0, 0, 0}, consk;
+    rvec            sumv = {0, 0, 0};
     gmx_bool        bCouple;
 
     if (trotter_seqno <= ettTSEQ2)
@@ -951,16 +949,12 @@ void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind,
 
 extern void init_npt_masses(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool bInit)
 {
-    int           n, i, j, d, ntgrp, ngtc, nnhpres, nh, gc = 0;
-    t_grp_tcstat *tcstat;
+    int           n, i, j, d, ngtc, nh;
     t_grpopts    *opts;
-    real          ecorr, pcorr, dvdlcorr;
-    real          bmass, qmass, reft, kT, dt, ndj, nd;
-    tensor        dumpres, dumvir;
+    real          reft, kT, ndj, nd;
 
     opts    = &(ir->opts); /* just for ease of referencing */
     ngtc    = ir->opts.ngtc;
-    nnhpres = state->nnhpres;
     nh      = state->nhchainlength;
 
     if (ir->eI == eiMD)
@@ -1021,7 +1015,7 @@ extern void init_npt_masses(t_inputrec *ir, t_state *state, t_extmass *MassQ, gm
         {
             if ((opts->tau_t[i] > 0) && (opts->ref_t[i] > 0))
             {
-                reft = max(0.0, opts->ref_t[i]);
+                reft = std::max<real>(0, opts->ref_t[i]);
                 nd   = opts->nrdf[i];
                 kT   = BOLTZ*reft;
                 for (j = 0; j < nh; j++)
@@ -1039,7 +1033,6 @@ extern void init_npt_masses(t_inputrec *ir, t_state *state, t_extmass *MassQ, gm
             }
             else
             {
-                reft = 0.0;
                 for (j = 0; j < nh; j++)
                 {
                     MassQ->Qinv[i*nh+j] = 0.0;
@@ -1051,16 +1044,12 @@ extern void init_npt_masses(t_inputrec *ir, t_state *state, t_extmass *MassQ, gm
 
 int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool bTrotter)
 {
-    int           n, i, j, d, ntgrp, ngtc, nnhpres, nh, gc = 0;
-    t_grp_tcstat *tcstat;
+    int           i, j, nnhpres, nh;
     t_grpopts    *opts;
-    real          ecorr, pcorr, dvdlcorr;
-    real          bmass, qmass, reft, kT, dt, ndj, nd;
-    tensor        dumpres, dumvir;
+    real          bmass, qmass, reft, kT;
     int         **trotter_seq;
 
     opts    = &(ir->opts); /* just for ease of referencing */
-    ngtc    = state->ngtc;
     nnhpres = state->nnhpres;
     nh      = state->nhchainlength;
 
@@ -1205,7 +1194,7 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
     /* barostat temperature */
     if ((ir->tau_p > 0) && (opts->ref_t[0] > 0))
     {
-        reft = max(0.0, opts->ref_t[0]);
+        reft = std::max<real>(0, opts->ref_t[0]);
         kT   = BOLTZ*reft;
         for (i = 0; i < nnhpres; i++)
         {
@@ -1238,11 +1227,12 @@ int **init_npt_vars(t_inputrec *ir, t_state *state, t_extmass *MassQ, gmx_bool b
 
 real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
 {
-    int     i, j, nd, ndj, bmass, qmass, ngtcall;
-    real    ener_npt, reft, eta, kT, tau;
+    int     i, j;
+    real    nd, ndj;
+    real    ener_npt, reft, kT;
     double *ivxi, *ixi;
     double *iQinv;
-    real    vol, dbaro, W, Q;
+    real    vol;
     int     nh = state->nhchainlength;
 
     ener_npt = 0;
@@ -1290,7 +1280,7 @@ real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
             ivxi  = &state->nhpres_vxi[i*nh];
             ixi   = &state->nhpres_xi[i*nh];
             iQinv = &(MassQ->QPinv[i*nh]);
-            reft  = max(ir->opts.ref_t[0], 0); /* using 'System' temperature */
+            reft  = std::max<real>(ir->opts.ref_t[0], 0.0); /* using 'System' temperature */
             kT    = BOLTZ * reft;
 
             for (j = 0; j < nh; j++)
@@ -1318,10 +1308,10 @@ real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
             iQinv = &(MassQ->Qinv[i*nh]);
 
             nd   = ir->opts.nrdf[i];
-            reft = max(ir->opts.ref_t[i], 0);
+            reft = std::max<real>(ir->opts.ref_t[i], 0);
             kT   = BOLTZ * reft;
 
-            if (nd > 0)
+            if (nd > 0.0)
             {
                 if (IR_NVT_TROTTER(ir))
                 {
@@ -1338,7 +1328,7 @@ real NPT_energy(t_inputrec *ir, t_state *state, t_extmass *MassQ)
                             }
                             else
                             {
-                                ndj = 1;
+                                ndj = 1.0;
                             }
                             ener_npt += ndj*ixi[j]*kT;
                         }
@@ -1635,7 +1625,7 @@ void update_annealing_target_temp(t_grpopts *opts, real t)
             case  eannPERIODIC:
                 /* calculate time modulo the period */
                 pert  = opts->anneal_time[i][npoints-1];
-                n     = t / pert;
+                n     = static_cast<int>(t / pert);
                 thist = t - n*pert; /* modulo time */
                 /* Make sure rounding didn't get us outside the interval */
                 if (fabs(thist-pert) < GMX_REAL_EPS*100)
similarity index 82%
rename from src/gromacs/mdlib/csettle.c
rename to src/gromacs/mdlib/csettle.cpp
index 281f3973c2aa9721df5bf717be24d554b3d9a474..db0590e62cb4258b77f568833bb0797c352c780d 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdio.h>
-#include "vec.h"
-#include "constr.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "pbc.h"
 
 typedef struct
 {
@@ -172,8 +172,7 @@ void settle_proj(gmx_settledata_t settled, int econq,
                  const t_pbc *pbc,
                  rvec x[],
                  rvec *der, rvec *derp,
-                 int calcvir_atom_end, tensor vir_r_m_dder,
-                 t_vetavars *vetavar)
+                 int calcvir_atom_end, tensor vir_r_m_dder)
 {
     /* Settle for projection out constraint components
      * of derivatives of the coordinates.
@@ -184,10 +183,7 @@ void settle_proj(gmx_settledata_t settled, int econq,
     real           imO, imH, dOH, dHH, invdOH, invdHH;
     matrix         invmat;
     int            i, m, m2, ow1, hw2, hw3;
-    rvec           roh2, roh3, rhh, dc, fc, fcv;
-    rvec           derm[3], derpm[3];
-    real           invvscale, vscale_nhc, veta;
-    real           kfacOH, kfacHH;
+    rvec           roh2, roh3, rhh, dc, fc;
 
     calcvir_atom_end *= DIM;
 
@@ -207,9 +203,6 @@ void settle_proj(gmx_settledata_t settled, int econq,
     invdOH = p->invdOH;
     invdHH = p->invdHH;
 
-    veta       = vetavar->veta;
-    vscale_nhc = vetavar->vscale_nhc[0]; /* assume the first temperature control group. */
-
 #ifdef PRAGMAS
 #pragma ivdep
 #endif
@@ -220,19 +213,6 @@ void settle_proj(gmx_settledata_t settled, int econq,
         hw2 = iatoms[i*4+2];
         hw3 = iatoms[i*4+3];
 
-
-        for (m = 0; m < DIM; m++)
-        {
-            /* in the velocity case, these are the velocities, so we
-               need to modify with the pressure control velocities! */
-
-            derm[0][m]  = vscale_nhc*der[ow1][m] + veta*x[ow1][m];
-            derm[1][m]  = vscale_nhc*der[hw2][m] + veta*x[hw2][m];
-            derm[2][m]  = vscale_nhc*der[hw3][m] + veta*x[hw3][m];
-
-        }
-        /* 27 flops */
-
         if (pbc == NULL)
         {
             rvec_sub(x[ow1], x[hw2], roh2);
@@ -250,13 +230,13 @@ void settle_proj(gmx_settledata_t settled, int econq,
         svmul(invdHH, rhh, rhh);
         /* 18 flops */
 
-        /* Determine the projections of der(modified) on the bonds */
+        /* Determine the projections of der on the bonds */
         clear_rvec(dc);
         for (m = 0; m < DIM; m++)
         {
-            dc[0] += (derm[0][m] - derm[1][m])*roh2[m];
-            dc[1] += (derm[0][m] - derm[2][m])*roh3[m];
-            dc[2] += (derm[1][m] - derm[2][m])*rhh [m];
+            dc[0] += (der[ow1][m] - der[hw2][m])*roh2[m];
+            dc[1] += (der[ow1][m] - der[hw3][m])*roh3[m];
+            dc[2] += (der[hw2][m] - der[hw3][m])*rhh [m];
         }
         /* 27 flops */
 
@@ -264,17 +244,12 @@ void settle_proj(gmx_settledata_t settled, int econq,
         mvmul(invmat, dc, fc);
         /* 15 flops */
 
-        /* divide velocity by vscale_nhc for determining constrained velocities, since they
-           have not yet been multiplied */
-        svmul(1.0/vscale_nhc, fc, fcv);
-        /* 7? flops */
-
         /* Subtract the corrections from derp */
         for (m = 0; m < DIM; m++)
         {
-            derp[ow1][m] -= imO*( fcv[0]*roh2[m] + fcv[1]*roh3[m]);
-            derp[hw2][m] -= imH*(-fcv[0]*roh2[m] + fcv[2]*rhh [m]);
-            derp[hw3][m] -= imH*(-fcv[1]*roh3[m] - fcv[2]*rhh [m]);
+            derp[ow1][m] -= imO*( fc[0]*roh2[m] + fc[1]*roh3[m]);
+            derp[hw2][m] -= imH*(-fc[0]*roh2[m] + fc[2]*rhh [m]);
+            derp[hw3][m] -= imH*(-fc[1]*roh3[m] - fc[2]*rhh [m]);
         }
 
         /* 45 flops */
@@ -290,21 +265,13 @@ void settle_proj(gmx_settledata_t settled, int econq,
                 for (m2 = 0; m2 < DIM; m2++)
                 {
                     vir_r_m_dder[m][m2] +=
-                        dOH*roh2[m]*roh2[m2]*fcv[0] +
-                        dOH*roh3[m]*roh3[m2]*fcv[1] +
-                        dHH*rhh [m]*rhh [m2]*fcv[2];
+                        dOH*roh2[m]*roh2[m2]*fc[0] +
+                        dOH*roh3[m]*roh3[m2]*fc[1] +
+                        dHH*rhh [m]*rhh [m2]*fc[2];
                 }
             }
         }
     }
-
-    if (calcvir_atom_end > 0)
-    {
-        /* Correct r_m_dder, which will be used to calcualate the virial;
-         * we need to use the unscaled multipliers in the virial.
-         */
-        msmul(vir_r_m_dder, 1.0/vetavar->vscale, vir_r_m_dder);
-    }
 }
 
 
@@ -314,8 +281,7 @@ void csettle(gmx_settledata_t settled,
              real b4[], real after[],
              real invdt, real *v, int CalcVirAtomEnd,
              tensor vir_r_m_dr,
-             int *error,
-             t_vetavars *vetavar)
+             int *error)
 {
     /* ***************************************************************** */
     /*                                                               ** */
@@ -331,19 +297,19 @@ void csettle(gmx_settledata_t settled,
     /* Initialized data */
     settleparam_t *p;
     real           wh, ra, rb, rc, irc2;
-    real           mOs, mHs, invdts;
+    real           mO, mH;
 
     /* Local variables */
-    real gama, beta, alpa, xcom, ycom, zcom, al2be2, tmp, tmp2;
-    real axlng, aylng, azlng, trns11, trns21, trns31, trns12, trns22,
-         trns32, trns13, trns23, trns33, cosphi, costhe, sinphi, sinthe,
-         cospsi, xaksxd, yaksxd, xakszd, yakszd, zakszd, zaksxd, xaksyd,
-         xb0, yb0, zb0, xc0, yc0, zc0, xa1;
-    real ya1, za1, xb1, yb1;
-    real zb1, xc1, yc1, zc1, yaksyd, zaksyd, sinpsi, xa3, ya3, za3,
-         xb3, yb3, zb3, xc3, yc3, zc3, xb0d, yb0d, xc0d, yc0d,
-         za1d, xb1d, yb1d, zb1d, xc1d, yc1d, zc1d, ya2d, xb2d, yb2d, yc2d,
-         xa3d, ya3d, za3d, xb3d, yb3d, zb3d, xc3d, yc3d, zc3d;
+    real     gama, beta, alpa, xcom, ycom, zcom, al2be2, tmp, tmp2;
+    real     axlng, aylng, azlng, trns11, trns21, trns31, trns12, trns22,
+             trns32, trns13, trns23, trns33, cosphi, costhe, sinphi, sinthe,
+             cospsi, xaksxd, yaksxd, xakszd, yakszd, zakszd, zaksxd, xaksyd,
+             xb0, yb0, zb0, xc0, yc0, zc0, xa1;
+    real     ya1, za1, xb1, yb1;
+    real     zb1, xc1, yc1, zc1, yaksyd, zaksyd, sinpsi, xa3, ya3, za3,
+             xb3, yb3, zb3, xc3, yc3, zc3, xb0d, yb0d, xc0d, yc0d,
+             za1d, xb1d, yb1d, zb1d, xc1d, yc1d, zc1d, ya2d, xb2d, yb2d, yc2d,
+             xa3d, ya3d, za3d, xb3d, yb3d, zb3d, xc3d, yc3d, zc3d;
     real     t1, t2;
     real     dax, day, daz, dbx, dby, dbz, dcx, dcy, dcz;
     real     mdax, mday, mdaz, mdbx, mdby, mdbz, mdcx, mdcy, mdcz;
@@ -360,16 +326,14 @@ void csettle(gmx_settledata_t settled,
 
     CalcVirAtomEnd *= 3;
 
-    p    = &settled->massw;
-    wh   = p->wh;
-    rc   = p->rc;
-    ra   = p->ra;
-    rb   = p->rb;
-    irc2 = p->irc2;
-
-    mOs    = p->mO / vetavar->rvscale;
-    mHs    = p->mH / vetavar->rvscale;
-    invdts = invdt / vetavar->rscale;
+    p     = &settled->massw;
+    wh    = p->wh;
+    rc    = p->rc;
+    ra    = p->ra;
+    rb    = p->rb;
+    irc2  = p->irc2;
+    mO    = p->mO;
+    mH    = p->mH;
 
 #ifdef PRAGMAS
 #pragma ivdep
@@ -595,29 +559,29 @@ void csettle(gmx_settledata_t settled,
 
             if (v != NULL)
             {
-                v[ow1]     += dax*invdts;
-                v[ow1 + 1] += day*invdts;
-                v[ow1 + 2] += daz*invdts;
-                v[hw2]     += dbx*invdts;
-                v[hw2 + 1] += dby*invdts;
-                v[hw2 + 2] += dbz*invdts;
-                v[hw3]     += dcx*invdts;
-                v[hw3 + 1] += dcy*invdts;
-                v[hw3 + 2] += dcz*invdts;
+                v[ow1]     += dax*invdt;
+                v[ow1 + 1] += day*invdt;
+                v[ow1 + 2] += daz*invdt;
+                v[hw2]     += dbx*invdt;
+                v[hw2 + 1] += dby*invdt;
+                v[hw2 + 2] += dbz*invdt;
+                v[hw3]     += dcx*invdt;
+                v[hw3 + 1] += dcy*invdt;
+                v[hw3 + 2] += dcz*invdt;
                 /* 3*6 flops */
             }
 
             if (ow1 < CalcVirAtomEnd)
             {
-                mdax                = mOs*dax;
-                mday                = mOs*day;
-                mdaz                = mOs*daz;
-                mdbx                = mHs*dbx;
-                mdby                = mHs*dby;
-                mdbz                = mHs*dbz;
-                mdcx                = mHs*dcx;
-                mdcy                = mHs*dcy;
-                mdcz                = mHs*dcz;
+                mdax                = mO*dax;
+                mday                = mO*day;
+                mdaz                = mO*daz;
+                mdbx                = mH*dbx;
+                mdby                = mH*dby;
+                mdbz                = mH*dbz;
+                mdcx                = mH*dcx;
+                mdcy                = mH*dcy;
+                mdcz                = mH*dcz;
                 vir_r_m_dr[XX][XX] -= b4[ow1  ]*mdax + (b4[ow1  ]+xb0)*mdbx + (b4[ow1  ]+xc0)*mdcx;
                 vir_r_m_dr[XX][YY] -= b4[ow1  ]*mday + (b4[ow1  ]+xb0)*mdby + (b4[ow1  ]+xc0)*mdcy;
                 vir_r_m_dr[XX][ZZ] -= b4[ow1  ]*mdaz + (b4[ow1  ]+xb0)*mdbz + (b4[ow1  ]+xc0)*mdcz;
diff --git a/src/gromacs/mdlib/domdec_con.c b/src/gromacs/mdlib/domdec_con.c
deleted file mode 100644 (file)
index c9a358f..0000000
+++ /dev/null
@@ -1,1413 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <assert.h>
-
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "constr.h"
-#include "types/commrec.h"
-#include "domdec.h"
-#include "domdec_network.h"
-#include "mtop_util.h"
-#include "gmx_ga2la.h"
-#include "gmx_hash.h"
-#include "gmx_omp_nthreads.h"
-#include "macros.h"
-
-#include "gmx_fatal.h"
-
-typedef struct {
-    int  nsend;
-    int *a;
-    int  a_nalloc;
-    int  nrecv;
-} gmx_specatsend_t;
-
-typedef struct {
-    int *ind;
-    int  nalloc;
-    int  n;
-} ind_req_t;
-
-typedef struct gmx_domdec_specat_comm {
-    /* The number of indices to receive during the setup */
-    int              nreq[DIM][2][2];
-    /* The atoms to send */
-    gmx_specatsend_t spas[DIM][2];
-    gmx_bool        *bSendAtom;
-    int              bSendAtom_nalloc;
-    /* Send buffers */
-    int             *ibuf;
-    int              ibuf_nalloc;
-    rvec            *vbuf;
-    int              vbuf_nalloc;
-    rvec            *vbuf2;
-    int              vbuf2_nalloc;
-    /* The range in the local buffer(s) for received atoms */
-    int              at_start;
-    int              at_end;
-
-    /* The atom indices we need from the surrounding cells.
-     * We can gather the indices over nthread threads.
-     */
-    int        nthread;
-    ind_req_t *ireq;
-} gmx_domdec_specat_comm_t;
-
-typedef struct gmx_domdec_constraints {
-    int       *molb_con_offset;
-    int       *molb_ncon_mol;
-    /* The fully local and connected constraints */
-    int        ncon;
-    /* The global constraint number, only required for clearing gc_req */
-    int       *con_gl;
-    int       *con_nlocat;
-    int        con_nalloc;
-    /* Boolean that tells if a global constraint index has been requested */
-    char      *gc_req;
-    /* Global to local communicated constraint atom only index */
-    gmx_hash_t ga2la;
-
-    /* Multi-threading stuff */
-    int      nthread;
-    t_ilist *ils;
-} gmx_domdec_constraints_t;
-
-
-static void dd_move_f_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
-                             rvec *f, rvec *fshift)
-{
-    gmx_specatsend_t *spas;
-    rvec             *vbuf;
-    int               n, n0, n1, d, dim, dir, i;
-    ivec              vis;
-    int               is;
-    gmx_bool          bPBC, bScrew;
-
-    n = spac->at_end;
-    for (d = dd->ndim-1; d >= 0; d--)
-    {
-        dim = dd->dim[d];
-        if (dd->nc[dim] > 2)
-        {
-            /* Pulse the grid forward and backward */
-            spas = spac->spas[d];
-            n0   = spas[0].nrecv;
-            n1   = spas[1].nrecv;
-            n   -= n1 + n0;
-            vbuf = spac->vbuf;
-            /* Send and receive the coordinates */
-            dd_sendrecv2_rvec(dd, d,
-                              f+n+n1, n0, vbuf, spas[0].nsend,
-                              f+n, n1, vbuf+spas[0].nsend, spas[1].nsend);
-            for (dir = 0; dir < 2; dir++)
-            {
-                bPBC   = ((dir == 0 && dd->ci[dim] == 0) ||
-                          (dir == 1 && dd->ci[dim] == dd->nc[dim]-1));
-                bScrew = (bPBC && dd->bScrewPBC && dim == XX);
-
-                spas = &spac->spas[d][dir];
-                /* Sum the buffer into the required forces */
-                if (!bPBC || (!bScrew && fshift == NULL))
-                {
-                    for (i = 0; i < spas->nsend; i++)
-                    {
-                        rvec_inc(f[spas->a[i]], *vbuf);
-                        vbuf++;
-                    }
-                }
-                else
-                {
-                    clear_ivec(vis);
-                    vis[dim] = (dir == 0 ? 1 : -1);
-                    is       = IVEC2IS(vis);
-                    if (!bScrew)
-                    {
-                        /* Sum and add to shift forces */
-                        for (i = 0; i < spas->nsend; i++)
-                        {
-                            rvec_inc(f[spas->a[i]], *vbuf);
-                            rvec_inc(fshift[is], *vbuf);
-                            vbuf++;
-                        }
-                    }
-                    else
-                    {
-                        /* Rotate the forces */
-                        for (i = 0; i < spas->nsend; i++)
-                        {
-                            f[spas->a[i]][XX] += (*vbuf)[XX];
-                            f[spas->a[i]][YY] -= (*vbuf)[YY];
-                            f[spas->a[i]][ZZ] -= (*vbuf)[ZZ];
-                            if (fshift)
-                            {
-                                rvec_inc(fshift[is], *vbuf);
-                            }
-                            vbuf++;
-                        }
-                    }
-                }
-            }
-        }
-        else
-        {
-            /* Two cells, so we only need to communicate one way */
-            spas = &spac->spas[d][0];
-            n   -= spas->nrecv;
-            /* Send and receive the coordinates */
-            dd_sendrecv_rvec(dd, d, dddirForward,
-                             f+n, spas->nrecv, spac->vbuf, spas->nsend);
-            /* Sum the buffer into the required forces */
-            if (dd->bScrewPBC && dim == XX &&
-                (dd->ci[dim] == 0 ||
-                 dd->ci[dim] == dd->nc[dim]-1))
-            {
-                for (i = 0; i < spas->nsend; i++)
-                {
-                    /* Rotate the force */
-                    f[spas->a[i]][XX] += spac->vbuf[i][XX];
-                    f[spas->a[i]][YY] -= spac->vbuf[i][YY];
-                    f[spas->a[i]][ZZ] -= spac->vbuf[i][ZZ];
-                }
-            }
-            else
-            {
-                for (i = 0; i < spas->nsend; i++)
-                {
-                    rvec_inc(f[spas->a[i]], spac->vbuf[i]);
-                }
-            }
-        }
-    }
-}
-
-void dd_move_f_vsites(gmx_domdec_t *dd, rvec *f, rvec *fshift)
-{
-    if (dd->vsite_comm)
-    {
-        dd_move_f_specat(dd, dd->vsite_comm, f, fshift);
-    }
-}
-
-void dd_clear_f_vsites(gmx_domdec_t *dd, rvec *f)
-{
-    int i;
-
-    if (dd->vsite_comm)
-    {
-        for (i = dd->vsite_comm->at_start; i < dd->vsite_comm->at_end; i++)
-        {
-            clear_rvec(f[i]);
-        }
-    }
-}
-
-static void dd_move_x_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
-                             matrix box,
-                             rvec *x0,
-                             rvec *x1, gmx_bool bX1IsCoord)
-{
-    gmx_specatsend_t *spas;
-    rvec             *x, *vbuf, *rbuf;
-    int               nvec, v, n, nn, ns0, ns1, nr0, nr1, nr, d, dim, dir, i;
-    gmx_bool          bPBC, bScrew = FALSE;
-    rvec              shift = {0, 0, 0};
-
-    nvec = 1;
-    if (x1 != NULL)
-    {
-        nvec++;
-    }
-
-    n = spac->at_start;
-    for (d = 0; d < dd->ndim; d++)
-    {
-        dim = dd->dim[d];
-        if (dd->nc[dim] > 2)
-        {
-            /* Pulse the grid forward and backward */
-            vbuf = spac->vbuf;
-            for (dir = 0; dir < 2; dir++)
-            {
-                if (dir == 0 && dd->ci[dim] == 0)
-                {
-                    bPBC   = TRUE;
-                    bScrew = (dd->bScrewPBC && dim == XX);
-                    copy_rvec(box[dim], shift);
-                }
-                else if (dir == 1 && dd->ci[dim] == dd->nc[dim]-1)
-                {
-                    bPBC   = TRUE;
-                    bScrew = (dd->bScrewPBC && dim == XX);
-                    for (i = 0; i < DIM; i++)
-                    {
-                        shift[i] = -box[dim][i];
-                    }
-                }
-                else
-                {
-                    bPBC   = FALSE;
-                    bScrew = FALSE;
-                }
-                spas = &spac->spas[d][dir];
-                for (v = 0; v < nvec; v++)
-                {
-                    x = (v == 0 ? x0 : x1);
-                    /* Copy the required coordinates to the send buffer */
-                    if (!bPBC || (v == 1 && !bX1IsCoord))
-                    {
-                        /* Only copy */
-                        for (i = 0; i < spas->nsend; i++)
-                        {
-                            copy_rvec(x[spas->a[i]], *vbuf);
-                            vbuf++;
-                        }
-                    }
-                    else if (!bScrew)
-                    {
-                        /* Shift coordinates */
-                        for (i = 0; i < spas->nsend; i++)
-                        {
-                            rvec_add(x[spas->a[i]], shift, *vbuf);
-                            vbuf++;
-                        }
-                    }
-                    else
-                    {
-                        /* Shift and rotate coordinates */
-                        for (i = 0; i < spas->nsend; i++)
-                        {
-                            (*vbuf)[XX] =               x[spas->a[i]][XX] + shift[XX];
-                            (*vbuf)[YY] = box[YY][YY] - x[spas->a[i]][YY] + shift[YY];
-                            (*vbuf)[ZZ] = box[ZZ][ZZ] - x[spas->a[i]][ZZ] + shift[ZZ];
-                            vbuf++;
-                        }
-                    }
-                }
-            }
-            /* Send and receive the coordinates */
-            spas = spac->spas[d];
-            ns0  = spas[0].nsend;
-            nr0  = spas[0].nrecv;
-            ns1  = spas[1].nsend;
-            nr1  = spas[1].nrecv;
-            if (nvec == 1)
-            {
-                dd_sendrecv2_rvec(dd, d,
-                                  spac->vbuf+ns0, ns1, x0+n, nr1,
-                                  spac->vbuf, ns0, x0+n+nr1, nr0);
-            }
-            else
-            {
-                /* Communicate both vectors in one buffer */
-                rbuf = spac->vbuf2;
-                dd_sendrecv2_rvec(dd, d,
-                                  spac->vbuf+2*ns0, 2*ns1, rbuf, 2*nr1,
-                                  spac->vbuf, 2*ns0, rbuf+2*nr1, 2*nr0);
-                /* Split the buffer into the two vectors */
-                nn = n;
-                for (dir = 1; dir >= 0; dir--)
-                {
-                    nr = spas[dir].nrecv;
-                    for (v = 0; v < 2; v++)
-                    {
-                        x = (v == 0 ? x0 : x1);
-                        for (i = 0; i < nr; i++)
-                        {
-                            copy_rvec(*rbuf, x[nn+i]);
-                            rbuf++;
-                        }
-                    }
-                    nn += nr;
-                }
-            }
-            n += nr0 + nr1;
-        }
-        else
-        {
-            spas = &spac->spas[d][0];
-            /* Copy the required coordinates to the send buffer */
-            vbuf = spac->vbuf;
-            for (v = 0; v < nvec; v++)
-            {
-                x = (v == 0 ? x0 : x1);
-                if (dd->bScrewPBC && dim == XX &&
-                    (dd->ci[XX] == 0 || dd->ci[XX] == dd->nc[XX]-1))
-                {
-                    /* Here we only perform the rotation, the rest of the pbc
-                     * is handled in the constraint or viste routines.
-                     */
-                    for (i = 0; i < spas->nsend; i++)
-                    {
-                        (*vbuf)[XX] =               x[spas->a[i]][XX];
-                        (*vbuf)[YY] = box[YY][YY] - x[spas->a[i]][YY];
-                        (*vbuf)[ZZ] = box[ZZ][ZZ] - x[spas->a[i]][ZZ];
-                        vbuf++;
-                    }
-                }
-                else
-                {
-                    for (i = 0; i < spas->nsend; i++)
-                    {
-                        copy_rvec(x[spas->a[i]], *vbuf);
-                        vbuf++;
-                    }
-                }
-            }
-            /* Send and receive the coordinates */
-            if (nvec == 1)
-            {
-                dd_sendrecv_rvec(dd, d, dddirBackward,
-                                 spac->vbuf, spas->nsend, x0+n, spas->nrecv);
-            }
-            else
-            {
-                /* Communicate both vectors in one buffer */
-                rbuf = spac->vbuf2;
-                dd_sendrecv_rvec(dd, d, dddirBackward,
-                                 spac->vbuf, 2*spas->nsend, rbuf, 2*spas->nrecv);
-                /* Split the buffer into the two vectors */
-                nr = spas[0].nrecv;
-                for (v = 0; v < 2; v++)
-                {
-                    x = (v == 0 ? x0 : x1);
-                    for (i = 0; i < nr; i++)
-                    {
-                        copy_rvec(*rbuf, x[n+i]);
-                        rbuf++;
-                    }
-                }
-            }
-            n += spas->nrecv;
-        }
-    }
-}
-
-void dd_move_x_constraints(gmx_domdec_t *dd, matrix box,
-                           rvec *x0, rvec *x1, gmx_bool bX1IsCoord)
-{
-    if (dd->constraint_comm)
-    {
-        dd_move_x_specat(dd, dd->constraint_comm, box, x0, x1, bX1IsCoord);
-    }
-}
-
-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);
-    }
-}
-
-int *dd_constraints_nlocalatoms(gmx_domdec_t *dd)
-{
-    if (dd->constraints)
-    {
-        return dd->constraints->con_nlocat;
-    }
-    else
-    {
-        return NULL;
-    }
-}
-
-void dd_clear_local_constraint_indices(gmx_domdec_t *dd)
-{
-    gmx_domdec_constraints_t *dc;
-    int i;
-
-    dc = dd->constraints;
-
-    for (i = 0; i < dc->ncon; i++)
-    {
-        dc->gc_req[dc->con_gl[i]] = 0;
-    }
-
-    if (dd->constraint_comm)
-    {
-        gmx_hash_clear_and_optimize(dc->ga2la);
-    }
-}
-
-void dd_clear_local_vsite_indices(gmx_domdec_t *dd)
-{
-    int i;
-
-    if (dd->vsite_comm)
-    {
-        gmx_hash_clear_and_optimize(dd->ga2la_vsite);
-    }
-}
-
-static int setup_specat_communication(gmx_domdec_t             *dd,
-                                      ind_req_t                *ireq,
-                                      gmx_domdec_specat_comm_t *spac,
-                                      gmx_hash_t                ga2la_specat,
-                                      int                       at_start,
-                                      int                       vbuf_fac,
-                                      const char               *specat_type,
-                                      const char               *add_err)
-{
-    int               nsend[2], nlast, nsend_zero[2] = {0, 0}, *nsend_ptr;
-    int               d, dim, ndir, dir, nr, ns, i, nrecv_local, n0, start, indr, ind, buf[2];
-    int               nat_tot_specat, nat_tot_prev, nalloc_old;
-    gmx_bool          bPBC, bFirst;
-    gmx_specatsend_t *spas;
-
-    if (debug)
-    {
-        fprintf(debug, "Begin setup_specat_communication for %s\n", specat_type);
-    }
-
-    /* nsend[0]: the number of atoms requested by this node only,
-     *           we communicate this for more efficients checks
-     * nsend[1]: the total number of requested atoms
-     */
-    nsend[0] = ireq->n;
-    nsend[1] = nsend[0];
-    nlast    = nsend[1];
-    for (d = dd->ndim-1; d >= 0; d--)
-    {
-        /* Pulse the grid forward and backward */
-        dim  = dd->dim[d];
-        bPBC = (dim < dd->npbcdim);
-        if (dd->nc[dim] == 2)
-        {
-            /* Only 2 cells, so we only need to communicate once */
-            ndir = 1;
-        }
-        else
-        {
-            ndir = 2;
-        }
-        for (dir = 0; dir < ndir; dir++)
-        {
-            if (!bPBC &&
-                dd->nc[dim] > 2 &&
-                ((dir == 0 && dd->ci[dim] == dd->nc[dim] - 1) ||
-                 (dir == 1 && dd->ci[dim] == 0)))
-            {
-                /* No pbc: the fist/last cell should not request atoms */
-                nsend_ptr = nsend_zero;
-            }
-            else
-            {
-                nsend_ptr = nsend;
-            }
-            /* Communicate the number of indices */
-            dd_sendrecv_int(dd, d, dir == 0 ? dddirForward : dddirBackward,
-                            nsend_ptr, 2, spac->nreq[d][dir], 2);
-            nr = spac->nreq[d][dir][1];
-            if (nlast+nr > ireq->nalloc)
-            {
-                ireq->nalloc = over_alloc_dd(nlast+nr);
-                srenew(ireq->ind, ireq->nalloc);
-            }
-            /* Communicate the indices */
-            dd_sendrecv_int(dd, d, dir == 0 ? dddirForward : dddirBackward,
-                            ireq->ind, nsend_ptr[1], ireq->ind+nlast, nr);
-            nlast += nr;
-        }
-        nsend[1] = nlast;
-    }
-    if (debug)
-    {
-        fprintf(debug, "Communicated the counts\n");
-    }
-
-    /* Search for the requested atoms and communicate the indices we have */
-    nat_tot_specat = at_start;
-    nrecv_local    = 0;
-    for (d = 0; d < dd->ndim; d++)
-    {
-        bFirst = (d == 0);
-        /* Pulse the grid forward and backward */
-        if (dd->dim[d] >= dd->npbcdim || dd->nc[dd->dim[d]] > 2)
-        {
-            ndir = 2;
-        }
-        else
-        {
-            ndir = 1;
-        }
-        nat_tot_prev = nat_tot_specat;
-        for (dir = ndir-1; dir >= 0; dir--)
-        {
-            if (nat_tot_specat > spac->bSendAtom_nalloc)
-            {
-                nalloc_old             = spac->bSendAtom_nalloc;
-                spac->bSendAtom_nalloc = over_alloc_dd(nat_tot_specat);
-                srenew(spac->bSendAtom, spac->bSendAtom_nalloc);
-                for (i = nalloc_old; i < spac->bSendAtom_nalloc; i++)
-                {
-                    spac->bSendAtom[i] = FALSE;
-                }
-            }
-            spas = &spac->spas[d][dir];
-            n0   = spac->nreq[d][dir][0];
-            nr   = spac->nreq[d][dir][1];
-            if (debug)
-            {
-                fprintf(debug, "dim=%d, dir=%d, searching for %d atoms\n",
-                        d, dir, nr);
-            }
-            start       = nlast - nr;
-            spas->nsend = 0;
-            nsend[0]    = 0;
-            for (i = 0; i < nr; i++)
-            {
-                indr = ireq->ind[start+i];
-                ind  = -1;
-                /* Check if this is a home atom and if so ind will be set */
-                if (!ga2la_get_home(dd->ga2la, indr, &ind))
-                {
-                    /* Search in the communicated atoms */
-                    ind = gmx_hash_get_minone(ga2la_specat, indr);
-                }
-                if (ind >= 0)
-                {
-                    if (i < n0 || !spac->bSendAtom[ind])
-                    {
-                        if (spas->nsend+1 > spas->a_nalloc)
-                        {
-                            spas->a_nalloc = over_alloc_large(spas->nsend+1);
-                            srenew(spas->a, spas->a_nalloc);
-                        }
-                        /* Store the local index so we know which coordinates
-                         * to send out later.
-                         */
-                        spas->a[spas->nsend] = ind;
-                        spac->bSendAtom[ind] = TRUE;
-                        if (spas->nsend+1 > spac->ibuf_nalloc)
-                        {
-                            spac->ibuf_nalloc = over_alloc_large(spas->nsend+1);
-                            srenew(spac->ibuf, spac->ibuf_nalloc);
-                        }
-                        /* Store the global index so we can send it now */
-                        spac->ibuf[spas->nsend] = indr;
-                        if (i < n0)
-                        {
-                            nsend[0]++;
-                        }
-                        spas->nsend++;
-                    }
-                }
-            }
-            nlast = start;
-            /* Clear the local flags */
-            for (i = 0; i < spas->nsend; i++)
-            {
-                spac->bSendAtom[spas->a[i]] = FALSE;
-            }
-            /* Send and receive the number of indices to communicate */
-            nsend[1] = spas->nsend;
-            dd_sendrecv_int(dd, d, dir == 0 ? dddirBackward : dddirForward,
-                            nsend, 2, buf, 2);
-            if (debug)
-            {
-                fprintf(debug, "Send to rank %d, %d (%d) indices, "
-                        "receive from rank %d, %d (%d) indices\n",
-                        dd->neighbor[d][1-dir], nsend[1], nsend[0],
-                        dd->neighbor[d][dir], buf[1], buf[0]);
-                if (gmx_debug_at)
-                {
-                    for (i = 0; i < spas->nsend; i++)
-                    {
-                        fprintf(debug, " %d", spac->ibuf[i]+1);
-                    }
-                    fprintf(debug, "\n");
-                }
-            }
-            nrecv_local += buf[0];
-            spas->nrecv  = buf[1];
-            if (nat_tot_specat + spas->nrecv > dd->gatindex_nalloc)
-            {
-                dd->gatindex_nalloc =
-                    over_alloc_dd(nat_tot_specat + spas->nrecv);
-                srenew(dd->gatindex, dd->gatindex_nalloc);
-            }
-            /* Send and receive the indices */
-            dd_sendrecv_int(dd, d, dir == 0 ? dddirBackward : dddirForward,
-                            spac->ibuf, spas->nsend,
-                            dd->gatindex+nat_tot_specat, spas->nrecv);
-            nat_tot_specat += spas->nrecv;
-        }
-
-        /* Allocate the x/f communication buffers */
-        ns = spac->spas[d][0].nsend;
-        nr = spac->spas[d][0].nrecv;
-        if (ndir == 2)
-        {
-            ns += spac->spas[d][1].nsend;
-            nr += spac->spas[d][1].nrecv;
-        }
-        if (vbuf_fac*ns > spac->vbuf_nalloc)
-        {
-            spac->vbuf_nalloc = over_alloc_dd(vbuf_fac*ns);
-            srenew(spac->vbuf, spac->vbuf_nalloc);
-        }
-        if (vbuf_fac == 2 && vbuf_fac*nr > spac->vbuf2_nalloc)
-        {
-            spac->vbuf2_nalloc = over_alloc_dd(vbuf_fac*nr);
-            srenew(spac->vbuf2, spac->vbuf2_nalloc);
-        }
-
-        /* Make a global to local index for the communication atoms */
-        for (i = nat_tot_prev; i < nat_tot_specat; i++)
-        {
-            gmx_hash_change_or_set(ga2la_specat, dd->gatindex[i], i);
-        }
-    }
-
-    /* Check that in the end we got the number of atoms we asked for */
-    if (nrecv_local != ireq->n)
-    {
-        if (debug)
-        {
-            fprintf(debug, "Requested %d, received %d (tot recv %d)\n",
-                    ireq->n, nrecv_local, nat_tot_specat-at_start);
-            if (gmx_debug_at)
-            {
-                for (i = 0; i < ireq->n; i++)
-                {
-                    ind = gmx_hash_get_minone(ga2la_specat, ireq->ind[i]);
-                    fprintf(debug, " %s%d",
-                            (ind >= 0) ? "" : "!",
-                            ireq->ind[i]+1);
-                }
-                fprintf(debug, "\n");
-            }
-        }
-        fprintf(stderr, "\nDD cell %d %d %d: Neighboring cells do not have atoms:",
-                dd->ci[XX], dd->ci[YY], dd->ci[ZZ]);
-        for (i = 0; i < ireq->n; i++)
-        {
-            if (gmx_hash_get_minone(ga2la_specat, ireq->ind[i]) < 0)
-            {
-                fprintf(stderr, " %d", ireq->ind[i]+1);
-            }
-        }
-        fprintf(stderr, "\n");
-        gmx_fatal(FARGS, "DD cell %d %d %d could only obtain %d of the %d atoms that are connected via %ss from the neighboring cells. This probably means your %s lengths are too long compared to the domain decomposition cell size. Decrease the number of domain decomposition grid cells%s%s.",
-                  dd->ci[XX], dd->ci[YY], dd->ci[ZZ],
-                  nrecv_local, ireq->n, specat_type,
-                  specat_type, add_err,
-                  dd->bGridJump ? " or use the -rcon option of mdrun" : "");
-    }
-
-    spac->at_start = at_start;
-    spac->at_end   = nat_tot_specat;
-
-    if (debug)
-    {
-        fprintf(debug, "Done setup_specat_communication\n");
-    }
-
-    return nat_tot_specat;
-}
-
-static void walk_out(int con, int con_offset, int a, int offset, int nrec,
-                     int ncon1, const t_iatom *ia1, const t_iatom *ia2,
-                     const t_blocka *at2con,
-                     const gmx_ga2la_t ga2la, gmx_bool bHomeConnect,
-                     gmx_domdec_constraints_t *dc,
-                     gmx_domdec_specat_comm_t *dcc,
-                     t_ilist *il_local,
-                     ind_req_t *ireq)
-{
-    int            a1_gl, a2_gl, a_loc, i, coni, b;
-    const t_iatom *iap;
-
-    if (dc->gc_req[con_offset+con] == 0)
-    {
-        /* Add this non-home constraint to the list */
-        if (dc->ncon+1 > dc->con_nalloc)
-        {
-            dc->con_nalloc = over_alloc_large(dc->ncon+1);
-            srenew(dc->con_gl, dc->con_nalloc);
-            srenew(dc->con_nlocat, dc->con_nalloc);
-        }
-        dc->con_gl[dc->ncon]       = con_offset + con;
-        dc->con_nlocat[dc->ncon]   = (bHomeConnect ? 1 : 0);
-        dc->gc_req[con_offset+con] = 1;
-        if (il_local->nr + 3 > il_local->nalloc)
-        {
-            il_local->nalloc = over_alloc_dd(il_local->nr+3);
-            srenew(il_local->iatoms, il_local->nalloc);
-        }
-        iap = constr_iatomptr(ncon1, ia1, ia2, con);
-        il_local->iatoms[il_local->nr++] = iap[0];
-        a1_gl = offset + iap[1];
-        a2_gl = offset + iap[2];
-        /* The following indexing code can probably be optizimed */
-        if (ga2la_get_home(ga2la, a1_gl, &a_loc))
-        {
-            il_local->iatoms[il_local->nr++] = a_loc;
-        }
-        else
-        {
-            /* We set this index later */
-            il_local->iatoms[il_local->nr++] = -a1_gl - 1;
-        }
-        if (ga2la_get_home(ga2la, a2_gl, &a_loc))
-        {
-            il_local->iatoms[il_local->nr++] = a_loc;
-        }
-        else
-        {
-            /* We set this index later */
-            il_local->iatoms[il_local->nr++] = -a2_gl - 1;
-        }
-        dc->ncon++;
-    }
-    /* Check to not ask for the same atom more than once */
-    if (gmx_hash_get_minone(dc->ga2la, offset+a) == -1)
-    {
-        assert(dcc);
-        /* Add this non-home atom to the list */
-        if (ireq->n+1 > ireq->nalloc)
-        {
-            ireq->nalloc = over_alloc_large(ireq->n+1);
-            srenew(ireq->ind, ireq->nalloc);
-        }
-        ireq->ind[ireq->n++] = offset + a;
-        /* Temporarily mark with -2, we get the index later */
-        gmx_hash_set(dc->ga2la, offset+a, -2);
-    }
-
-    if (nrec > 0)
-    {
-        for (i = at2con->index[a]; i < at2con->index[a+1]; i++)
-        {
-            coni = at2con->a[i];
-            if (coni != con)
-            {
-                /* Walk further */
-                iap = constr_iatomptr(ncon1, ia1, ia2, coni);
-                if (a == iap[1])
-                {
-                    b = iap[2];
-                }
-                else
-                {
-                    b = iap[1];
-                }
-                if (!ga2la_get_home(ga2la, offset+b, &a_loc))
-                {
-                    walk_out(coni, con_offset, b, offset, nrec-1,
-                             ncon1, ia1, ia2, at2con,
-                             ga2la, FALSE, dc, dcc, il_local, ireq);
-                }
-            }
-        }
-    }
-}
-
-static void atoms_to_settles(gmx_domdec_t *dd,
-                             const gmx_mtop_t *mtop,
-                             const int *cginfo,
-                             const int **at2settle_mt,
-                             int cg_start, int cg_end,
-                             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);
-
-    nral = NRAL(F_SETTLE);
-
-    for (cg = cg_start; cg < cg_end; cg++)
-    {
-        if (GET_CGINFO_SETTLE(cginfo[cg]))
-        {
-            for (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];
-
-                settle = at2settle_mt[molb->type][a_mol];
-
-                if (settle >= 0)
-                {
-                    offset = a_gl - a_mol;
-
-                    ia1 = mtop->moltype[molb->type].ilist[F_SETTLE].iatoms;
-
-                    bAssign = FALSE;
-                    nlocal  = 0;
-                    for (sa = 0; sa < nral; sa++)
-                    {
-                        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 (nlocal == 0 && a_gl == a_glsa)
-                            {
-                                bAssign = TRUE;
-                            }
-                            nlocal++;
-                        }
-                    }
-
-                    if (bAssign)
-                    {
-                        if (ils_local->nr+1+nral > ils_local->nalloc)
-                        {
-                            ils_local->nalloc = over_alloc_dd(ils_local->nr+1+nral);
-                            srenew(ils_local->iatoms, ils_local->nalloc);
-                        }
-
-                        ils_local->iatoms[ils_local->nr++] = ia1[settle*4];
-
-                        for (sa = 0; sa < nral; sa++)
-                        {
-                            if (ga2la_get_home(ga2la, a_gls[sa], &a_locs[sa]))
-                            {
-                                ils_local->iatoms[ils_local->nr++] = a_locs[sa];
-                            }
-                            else
-                            {
-                                ils_local->iatoms[ils_local->nr++] = -a_gls[sa] - 1;
-                                /* Add this non-home atom to the list */
-                                if (ireq->n+1 > ireq->nalloc)
-                                {
-                                    ireq->nalloc = over_alloc_large(ireq->n+1);
-                                    srenew(ireq->ind, ireq->nalloc);
-                                }
-                                ireq->ind[ireq->n++] = a_gls[sa];
-                                /* A check on double atom requests is
-                                 * not required for settle.
-                                 */
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    gmx_mtop_atomlookup_destroy(alook);
-}
-
-static void atoms_to_constraints(gmx_domdec_t *dd,
-                                 const gmx_mtop_t *mtop,
-                                 const int *cginfo,
-                                 const t_blocka *at2con_mt, int nrec,
-                                 t_ilist *ilc_local,
-                                 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;
-
-    dc  = dd->constraints;
-    dcc = dd->constraint_comm;
-
-    ga2la  = dd->ga2la;
-
-    alook = gmx_mtop_atomlookup_init(mtop);
-
-    nhome = 0;
-    for (cg = 0; cg < dd->ncg_home; cg++)
-    {
-        if (GET_CGINFO_CONSTR(cginfo[cg]))
-        {
-            for (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];
-
-                ncon1 = mtop->moltype[molb->type].ilist[F_CONSTR].nr/NRAL(F_SETTLE);
-
-                ia1 = mtop->moltype[molb->type].ilist[F_CONSTR].iatoms;
-                ia2 = mtop->moltype[molb->type].ilist[F_CONSTRNC].iatoms;
-
-                /* Calculate the global constraint number offset for the molecule.
-                 * This is only required for the global index to make sure
-                 * that we use each constraint only once.
-                 */
-                con_offset =
-                    dc->molb_con_offset[mb] + molnr*dc->molb_ncon_mol[mb];
-
-                /* The global atom number offset for this molecule */
-                offset = a_gl - a_mol;
-                at2con = &at2con_mt[molb->type];
-                for (i = at2con->index[a_mol]; i < at2con->index[a_mol+1]; i++)
-                {
-                    con = at2con->a[i];
-                    iap = constr_iatomptr(ncon1, ia1, ia2, con);
-                    if (a_mol == iap[1])
-                    {
-                        b_mol = iap[2];
-                    }
-                    else
-                    {
-                        b_mol = iap[1];
-                    }
-                    if (ga2la_get_home(ga2la, offset+b_mol, &a_loc))
-                    {
-                        /* Add this fully home constraint at the first atom */
-                        if (a_mol < b_mol)
-                        {
-                            if (dc->ncon+1 > dc->con_nalloc)
-                            {
-                                dc->con_nalloc = over_alloc_large(dc->ncon+1);
-                                srenew(dc->con_gl, dc->con_nalloc);
-                                srenew(dc->con_nlocat, dc->con_nalloc);
-                            }
-                            dc->con_gl[dc->ncon]     = con_offset + con;
-                            dc->con_nlocat[dc->ncon] = 2;
-                            if (ilc_local->nr + 3 > ilc_local->nalloc)
-                            {
-                                ilc_local->nalloc = over_alloc_dd(ilc_local->nr + 3);
-                                srenew(ilc_local->iatoms, ilc_local->nalloc);
-                            }
-                            b_lo = a_loc;
-                            ilc_local->iatoms[ilc_local->nr++] = iap[0];
-                            ilc_local->iatoms[ilc_local->nr++] = (a_gl == iap[1] ? a    : b_lo);
-                            ilc_local->iatoms[ilc_local->nr++] = (a_gl == iap[1] ? b_lo : a   );
-                            dc->ncon++;
-                            nhome++;
-                        }
-                    }
-                    else
-                    {
-                        /* We need the nrec constraints coupled to this constraint,
-                         * so we need to walk out of the home cell by nrec+1 atoms,
-                         * since already atom bg is not locally present.
-                         * Therefore we call walk_out with nrec recursions to go
-                         * after this first call.
-                         */
-                        walk_out(con, con_offset, b_mol, offset, nrec,
-                                 ncon1, ia1, ia2, at2con,
-                                 dd->ga2la, TRUE, dc, dcc, ilc_local, ireq);
-                    }
-                }
-            }
-        }
-    }
-
-    gmx_mtop_atomlookup_destroy(alook);
-
-    if (debug)
-    {
-        fprintf(debug,
-                "Constraints: home %3d border %3d atoms: %3d\n",
-                nhome, dc->ncon-nhome,
-                dd->constraint_comm ? ireq->n : 0);
-    }
-}
-
-int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
-                              const gmx_mtop_t *mtop,
-                              const int *cginfo,
-                              gmx_constr_t constr, int nrec,
-                              t_ilist *il_local)
-{
-    gmx_domdec_constraints_t *dc;
-    t_ilist                  *ilc_local, *ils_local;
-    ind_req_t                *ireq;
-    const t_blocka           *at2con_mt;
-    const int               **at2settle_mt;
-    gmx_hash_t                ga2la_specat;
-    int at_end, i, j;
-    t_iatom                  *iap;
-
-    dc = dd->constraints;
-
-    ilc_local = &il_local[F_CONSTR];
-    ils_local = &il_local[F_SETTLE];
-
-    dc->ncon      = 0;
-    ilc_local->nr = 0;
-    if (dd->constraint_comm)
-    {
-        at2con_mt = atom2constraints_moltype(constr);
-        ireq      = &dd->constraint_comm->ireq[0];
-        ireq->n   = 0;
-    }
-    else
-    {
-        at2con_mt = NULL;
-        ireq      = NULL;
-    }
-
-    if (dd->bInterCGsettles)
-    {
-        at2settle_mt  = atom2settle_moltype(constr);
-        ils_local->nr = 0;
-    }
-    else
-    {
-        /* Settle works inside charge groups, we assigned them already */
-        at2settle_mt = NULL;
-    }
-
-    if (at2settle_mt == NULL)
-    {
-        atoms_to_constraints(dd, mtop, cginfo, at2con_mt, nrec,
-                             ilc_local, ireq);
-    }
-    else
-    {
-        int t0_set;
-        int thread;
-
-        /* 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);
-
-#pragma omp parallel for num_threads(dc->nthread) schedule(static)
-        for (thread = 0; thread < dc->nthread; thread++)
-        {
-            if (at2con_mt && thread == 0)
-            {
-                atoms_to_constraints(dd, mtop, cginfo, at2con_mt, nrec,
-                                     ilc_local, ireq);
-            }
-
-            if (thread >= t0_set)
-            {
-                int        cg0, cg1;
-                t_ilist   *ilst;
-                ind_req_t *ireqt;
-
-                /* Distribute the settle check+assignments over
-                 * dc->nthread or dc->nthread-1 threads.
-                 */
-                cg0 = (dd->ncg_home*(thread-t0_set  ))/(dc->nthread-t0_set);
-                cg1 = (dd->ncg_home*(thread-t0_set+1))/(dc->nthread-t0_set);
-
-                if (thread == t0_set)
-                {
-                    ilst = ils_local;
-                }
-                else
-                {
-                    ilst = &dc->ils[thread];
-                }
-                ilst->nr = 0;
-
-                ireqt = &dd->constraint_comm->ireq[thread];
-                if (thread > 0)
-                {
-                    ireqt->n = 0;
-                }
-
-                atoms_to_settles(dd, mtop, cginfo, at2settle_mt,
-                                 cg0, cg1,
-                                 ilst, ireqt);
-            }
-        }
-
-        /* Combine the generate settles and requested indices */
-        for (thread = 1; thread < dc->nthread; thread++)
-        {
-            t_ilist   *ilst;
-            ind_req_t *ireqt;
-            int        ia;
-
-            if (thread > t0_set)
-            {
-                ilst = &dc->ils[thread];
-                if (ils_local->nr + ilst->nr > ils_local->nalloc)
-                {
-                    ils_local->nalloc = over_alloc_large(ils_local->nr + ilst->nr);
-                    srenew(ils_local->iatoms, ils_local->nalloc);
-                }
-                for (ia = 0; ia < ilst->nr; ia++)
-                {
-                    ils_local->iatoms[ils_local->nr+ia] = ilst->iatoms[ia];
-                }
-                ils_local->nr += ilst->nr;
-            }
-
-            ireqt = &dd->constraint_comm->ireq[thread];
-            if (ireq->n+ireqt->n > ireq->nalloc)
-            {
-                ireq->nalloc = over_alloc_large(ireq->n+ireqt->n);
-                srenew(ireq->ind, ireq->nalloc);
-            }
-            for (ia = 0; ia < ireqt->n; ia++)
-            {
-                ireq->ind[ireq->n+ia] = ireqt->ind[ia];
-            }
-            ireq->n += ireqt->n;
-        }
-
-        if (debug)
-        {
-            fprintf(debug, "Settles: total %3d\n", ils_local->nr/4);
-        }
-    }
-
-    if (dd->constraint_comm)
-    {
-        int nral1;
-
-        at_end =
-            setup_specat_communication(dd, ireq, dd->constraint_comm,
-                                       dd->constraints->ga2la,
-                                       at_start, 2,
-                                       "constraint", " or lincs-order");
-
-        /* Fill in the missing indices */
-        ga2la_specat = dd->constraints->ga2la;
-
-        nral1 = 1 + NRAL(F_CONSTR);
-        for (i = 0; i < ilc_local->nr; i += nral1)
-        {
-            iap = ilc_local->iatoms + i;
-            for (j = 1; j < nral1; j++)
-            {
-                if (iap[j] < 0)
-                {
-                    iap[j] = gmx_hash_get_minone(ga2la_specat, -iap[j]-1);
-                }
-            }
-        }
-
-        nral1 = 1 + NRAL(F_SETTLE);
-        for (i = 0; i < ils_local->nr; i += nral1)
-        {
-            iap = ils_local->iatoms + i;
-            for (j = 1; j < nral1; j++)
-            {
-                if (iap[j] < 0)
-                {
-                    iap[j] = gmx_hash_get_minone(ga2la_specat, -iap[j]-1);
-                }
-            }
-        }
-    }
-    else
-    {
-        at_end = at_start;
-    }
-
-    return at_end;
-}
-
-int dd_make_local_vsites(gmx_domdec_t *dd, int at_start, t_ilist *lil)
-{
-    gmx_domdec_specat_comm_t *spac;
-    ind_req_t                *ireq;
-    gmx_hash_t                ga2la_specat;
-    int  ftype, nral, i, j, gat, a;
-    t_ilist                  *lilf;
-    t_iatom                  *iatoms;
-    int  at_end;
-
-    spac         = dd->vsite_comm;
-    ireq         = &spac->ireq[0];
-    ga2la_specat = dd->ga2la_vsite;
-
-    ireq->n = 0;
-    /* Loop over all the home vsites */
-    for (ftype = 0; ftype < F_NRE; ftype++)
-    {
-        if (interaction_function[ftype].flags & IF_VSITE)
-        {
-            nral = NRAL(ftype);
-            lilf = &lil[ftype];
-            for (i = 0; i < lilf->nr; i += 1+nral)
-            {
-                iatoms = lilf->iatoms + i;
-                /* Check if we have the other atoms */
-                for (j = 1; j < 1+nral; j++)
-                {
-                    if (iatoms[j] < 0)
-                    {
-                        /* This is not a home atom,
-                         * we need to ask our neighbors.
-                         */
-                        a = -iatoms[j] - 1;
-                        /* Check to not ask for the same atom more than once */
-                        if (gmx_hash_get_minone(dd->ga2la_vsite, a) == -1)
-                        {
-                            /* Add this non-home atom to the list */
-                            if (ireq->n+1 > ireq->nalloc)
-                            {
-                                ireq->nalloc = over_alloc_large(ireq->n+1);
-                                srenew(ireq->ind, ireq->nalloc);
-                            }
-                            ireq->ind[ireq->n++] = a;
-                            /* Temporarily mark with -2,
-                             * we get the index later.
-                             */
-                            gmx_hash_set(ga2la_specat, a, -2);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    at_end = setup_specat_communication(dd, ireq, dd->vsite_comm, ga2la_specat,
-                                        at_start, 1, "vsite", "");
-
-    /* Fill in the missing indices */
-    for (ftype = 0; ftype < F_NRE; ftype++)
-    {
-        if (interaction_function[ftype].flags & IF_VSITE)
-        {
-            nral = NRAL(ftype);
-            lilf = &lil[ftype];
-            for (i = 0; i < lilf->nr; i += 1+nral)
-            {
-                iatoms = lilf->iatoms + i;
-                for (j = 1; j < 1+nral; j++)
-                {
-                    if (iatoms[j] < 0)
-                    {
-                        iatoms[j] = gmx_hash_get_minone(ga2la_specat, -iatoms[j]-1);
-                    }
-                }
-            }
-        }
-    }
-
-    return at_end;
-}
-
-static gmx_domdec_specat_comm_t *specat_comm_init(int nthread)
-{
-    gmx_domdec_specat_comm_t *spac;
-
-    snew(spac, 1);
-    spac->nthread = nthread;
-    snew(spac->ireq, spac->nthread);
-
-    return spac;
-}
-
-void init_domdec_constraints(gmx_domdec_t *dd,
-                             gmx_mtop_t   *mtop)
-{
-    gmx_domdec_constraints_t *dc;
-    gmx_molblock_t           *molb;
-    int mb, ncon, c, a;
-
-    if (debug)
-    {
-        fprintf(debug, "Begin init_domdec_constraints\n");
-    }
-
-    snew(dd->constraints, 1);
-    dc = dd->constraints;
-
-    snew(dc->molb_con_offset, mtop->nmolblock);
-    snew(dc->molb_ncon_mol, mtop->nmolblock);
-
-    ncon = 0;
-    for (mb = 0; mb < mtop->nmolblock; mb++)
-    {
-        molb                    = &mtop->molblock[mb];
-        dc->molb_con_offset[mb] = ncon;
-        dc->molb_ncon_mol[mb]   =
-            mtop->moltype[molb->type].ilist[F_CONSTR].nr/3 +
-            mtop->moltype[molb->type].ilist[F_CONSTRNC].nr/3;
-        ncon += molb->nmol*dc->molb_ncon_mol[mb];
-    }
-
-    if (ncon > 0)
-    {
-        snew(dc->gc_req, ncon);
-        for (c = 0; c < ncon; c++)
-        {
-            dc->gc_req[c] = 0;
-        }
-    }
-
-    /* Use a hash table for the global to local index.
-     * The number of keys is a rough estimate, it will be optimized later.
-     */
-    dc->ga2la = gmx_hash_init(min(mtop->natoms/20,
-                                  mtop->natoms/(2*dd->nnodes)));
-
-    dc->nthread = gmx_omp_nthreads_get(emntDomdec);
-    snew(dc->ils, dc->nthread);
-
-    dd->constraint_comm = specat_comm_init(dc->nthread);
-}
-
-void init_domdec_vsites(gmx_domdec_t *dd, int n_intercg_vsite)
-{
-    int i;
-    gmx_domdec_constraints_t *dc;
-
-    if (debug)
-    {
-        fprintf(debug, "Begin init_domdec_vsites\n");
-    }
-
-    /* Use a hash table for the global to local index.
-     * The number of keys is a rough estimate, it will be optimized later.
-     */
-    dd->ga2la_vsite = gmx_hash_init(min(n_intercg_vsite/20,
-                                        n_intercg_vsite/(2*dd->nnodes)));
-
-    dd->vsite_comm = specat_comm_init(1);
-}
index 4760fcf32e1ea8d2397a16551d0b29c3200d42b9..8056f1f9bf252e0cec24df9997742506017fc105 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/ebin.h"
 
 #include <math.h>
 #include <string.h>
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "ebin.h"
-#include "main.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "vec.h"
-#include "physics.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 t_ebin *mk_ebin(void)
 {
@@ -79,10 +77,10 @@ int get_ebin_space(t_ebin *eb, int nener, const char *enm[], const char *unit)
         eb->e_sim[i].e    = 0;
         eb->e_sim[i].eav  = 0;
         eb->e_sim[i].esum = 0;
-        eb->enm[i].name   = strdup(enm[i-index]);
+        eb->enm[i].name   = gmx_strdup(enm[i-index]);
         if (unit != NULL)
         {
-            eb->enm[i].unit = strdup(unit);
+            eb->enm[i].unit = gmx_strdup(unit);
         }
         else
         {
@@ -109,7 +107,7 @@ int get_ebin_space(t_ebin *eb, int nener, const char *enm[], const char *unit)
                     }
                 }
             }
-            eb->enm[i].unit = strdup(u);
+            eb->enm[i].unit = gmx_strdup(u);
         }
     }
 
@@ -278,7 +276,7 @@ int main(int argc, char *argv[])
     {
         e[i] = i;
         sprintf(buf, "e%d", i);
-        ce[i] = strdup(buf);
+        ce[i] = gmx_strdup(buf);
     }
     ie = get_ebin_space(eb, NE, ce);
     add_ebin(eb, ie, NE, e, 0);
@@ -286,7 +284,7 @@ int main(int argc, char *argv[])
     {
         s[i] = i;
         sprintf(buf, "s%d", i);
-        cs[i] = strdup(buf);
+        cs[i] = gmx_strdup(buf);
     }
     is = get_ebin_space(eb, NS, cs);
     add_ebin(eb, is, NS, s, 0);
@@ -294,7 +292,7 @@ int main(int argc, char *argv[])
     {
         t[i] = i;
         sprintf(buf, "t%d", i);
-        ct[i] = strdup(buf);
+        ct[i] = gmx_strdup(buf);
     }
     it = get_ebin_space(eb, NT, ct);
     add_ebin(eb, it, NT, t, 0);
index 14d0e7ea3d3a23ef7227d323928affa55e8e17e5..f1a1bce5e8f7ddb1938771ae27f55a58514473ed 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <stdio.h>
 #include <math.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "names.h"
-#include "gromacs/fileio/confio.h"
-#include "txtdump.h"
-#include "pbc.h"
-#include "chargegroup.h"
-#include "vec.h"
-#include "nrnb.h"
-#include "mshift.h"
-#include "mdrun.h"
-#include "update.h"
-#include "physics.h"
-#include "main.h"
-#include "mdatoms.h"
-#include "force.h"
-#include "bondf.h"
-#include "pme.h"
-#include "disre.h"
-#include "orires.h"
-#include "network.h"
-#include "calcmu.h"
-#include "constr.h"
-#include "xvgr.h"
-#include "gromacs/random/random.h"
-#include "domdec.h"
-#include "macros.h"
+#include <stdio.h>
 
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/xtcio.h"
+#include "gromacs/legacyheaders/calcmu.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/random/random.h"
 #include "gromacs/timing/wallcycle.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
 
 static void init_df_history_weights(df_history_t *dfhist, t_expanded *expand, int nlim)
 {
similarity index 86%
rename from src/gromacs/mdlib/force.c
rename to src/gromacs/mdlib/force.cpp
index 5230983cbe17802a374739a500948b343d4af8ba..e9e80dd12aada29d9089b40ef7b8b0bb70138b5e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/force.h"
+
+#include "config.h"
 
+#include <assert.h>
 #include <math.h>
 #include <string.h>
-#include <assert.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "physics.h"
-#include "force.h"
-#include "nonbonded.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "bondf.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "coulomb.h"
-#include "pme.h"
-#include "mdrun.h"
-#include "domdec.h"
-#include "qmmm.h"
-#include "gmx_omp_nthreads.h"
 
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/ewald/ewald.h"
+#include "gromacs/ewald/long-range-correction.h"
+#include "gromacs/ewald/pme.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/listed-forces/listed-forces.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/forcerec-threading.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 void ns(FILE              *fp,
         t_forcerec        *fr,
@@ -78,7 +81,6 @@ void ns(FILE              *fp,
         gmx_bool           bFillGrid,
         gmx_bool           bDoLongRangeNS)
 {
-    char   *ptr;
     int     nsearch;
 
 
@@ -119,8 +121,9 @@ static void reduce_thread_forces(int n, rvec *f,
     int t, i;
     int nthreads_loop gmx_unused;
 
-    /* This reduction can run over any number of threads */
+    // cppcheck-suppress unreadVariable
     nthreads_loop = gmx_omp_nthreads_get(emntBonded);
+    /* This reduction can run over any number of threads */
 #pragma omp parallel for num_threads(nthreads_loop) private(t) schedule(static)
     for (i = 0; i < n; i++)
     {
@@ -140,13 +143,7 @@ static void reduce_thread_forces(int n, rvec *f,
     }
 }
 
-void gmx_print_sepdvdl(FILE *fplog, const char *s, real v, real dvdlambda)
-{
-    fprintf(fplog, "  %-30s V %12.5e  dVdl %12.5e\n", s, v, dvdlambda);
-}
-
-void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
-                       t_forcerec *fr,      t_inputrec *ir,
+void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                        t_idef     *idef,    t_commrec  *cr,
                        t_nrnb     *nrnb,    gmx_wallcycle_t wcycle,
                        t_mdatoms  *md,
@@ -157,7 +154,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
                        t_fcdata   *fcd,
                        gmx_localtop_t *top,
                        gmx_genborn_t *born,
-                       t_atomtypes *atype,
                        gmx_bool       bBornRadii,
                        matrix     box,
                        t_lambda   *fepvals,
@@ -170,22 +166,17 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
 {
     int         i, j;
     int         donb_flags;
-    gmx_bool    bDoEpot, bSepDVDL, bSB;
+    gmx_bool    bSB;
     int         pme_flags;
     matrix      boxs;
     rvec        box_size;
     t_pbc       pbc;
-    char        buf[22];
-    double      clam_i, vlam_i;
-    real        dvdl_dum[efptNR], dvdl_nb[efptNR], lam_i[efptNR];
-    real        dvdl_q, dvdl_lj;
+    real        dvdl_dum[efptNR], dvdl_nb[efptNR];
 
 #ifdef GMX_MPI
     double  t0 = 0.0, t1, t2, t3; /* time measurement for coarse load balancing */
 #endif
 
-#define PRINT_SEPDVDL(s, v, dvdlambda) if (bSepDVDL) { gmx_print_sepdvdl(fplog, s, v, dvdlambda); }
-
     set_pbc(&pbc, fr->ePBC, box);
 
     /* reset free energy components */
@@ -201,7 +192,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         box_size[i] = box[i][i];
     }
 
-    bSepDVDL = (fr->bSepDVDL && do_per_step(step, ir->nstlog));
     debug_gmx();
 
     /* do QMMM first if requested */
@@ -210,12 +200,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         enerd->term[F_EQM] = calculate_QMMM(cr, x, f, fr);
     }
 
-    if (bSepDVDL)
-    {
-        fprintf(fplog, "Step %s: non-bonded V and dVdl for rank %d:\n",
-                gmx_step_str(step, buf), cr->nodeid);
-    }
-
     /* Call the short range functions all in one go. */
 
 #ifdef GMX_MPI
@@ -233,7 +217,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         /* foreign lambda component for walls */
         real dvdl_walls = do_walls(ir, fr, box, md, x, f, lambda[efptVDW],
                                    enerd->grpp.ener[egLJSR], nrnb);
-        PRINT_SEPDVDL("Walls", 0.0, dvdl_walls);
         enerd->dvdl_lin[efptVDW] += dvdl_walls;
     }
 
@@ -294,6 +277,8 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         {
             for (i = 0; i < enerd->n_lambda; i++)
             {
+                real lam_i[efptNR];
+
                 for (j = 0; j < efptNR; j++)
                 {
                     lam_i[j] = (i == 0 ? lambda[j] : fepvals->all_lambda[j][i-1]);
@@ -316,10 +301,10 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
     /* MRS: Eventually, many need to include free energy contribution here! */
     if (ir->implicit_solvent)
     {
-        wallcycle_sub_start(wcycle, ewcsBONDED);
+        wallcycle_sub_start(wcycle, ewcsLISTED);
         calc_gb_forces(cr, md, born, top, x, f, fr, idef,
                        ir->gb_algorithm, ir->sa_algorithm, nrnb, &pbc, graph, enerd);
-        wallcycle_sub_stop(wcycle, ewcsBONDED);
+        wallcycle_sub_stop(wcycle, ewcsLISTED);
     }
 
 #ifdef GMX_MPI
@@ -351,24 +336,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         enerd->dvdl_lin[efptCOUL] += dvdl_nb[efptCOUL];
     }
 
-    if (bSepDVDL)
-    {
-        real V_short_range    = 0;
-        real dvdl_short_range = 0;
-
-        for (i = 0; i < enerd->grpp.nener; i++)
-        {
-            V_short_range +=
-                (fr->bBHAM ?
-                 enerd->grpp.ener[egBHAMSR][i] :
-                 enerd->grpp.ener[egLJSR][i])
-                + enerd->grpp.ener[egCOULSR][i] + enerd->grpp.ener[egGB][i];
-        }
-        dvdl_short_range = dvdl_nb[efptVDW] + dvdl_nb[efptCOUL];
-        PRINT_SEPDVDL("VdW and Coulomb SR particle-p.",
-                      V_short_range,
-                      dvdl_short_range);
-    }
     debug_gmx();
 
 
@@ -377,9 +344,9 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         pr_rvecs(debug, 0, "fshift after SR", fr->fshift, SHIFTS);
     }
 
-    /* Shift the coordinates. Must be done before bonded forces and PPPM,
+    /* Shift the coordinates. Must be done before listed forces and PPPM,
      * but is also necessary for SHAKE and update, therefore it can NOT
-     * go when no bonded forces have to be evaluated.
+     * go when no listed forces have to be evaluated.
      */
 
     /* Here sometimes we would not need to shift with NBFonly,
@@ -397,9 +364,9 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
             inc_nrnb(nrnb, eNR_SHIFTX, graph->nnodes);
         }
     }
-    /* Check whether we need to do bondeds or correct for exclusions */
+    /* Check whether we need to do listed interactions or correct for exclusions */
     if (fr->bMolPBC &&
-        ((flags & GMX_FORCE_BONDED)
+        ((flags & GMX_FORCE_LISTED)
          || EEL_RF(fr->eeltype) || EEL_FULL(fr->eeltype) || EVDW_PME(fr->vdwtype)))
     {
         /* Since all atoms are in the rectangular or triclinic unit-cell,
@@ -409,51 +376,26 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
     }
     debug_gmx();
 
-    if (flags & GMX_FORCE_BONDED)
-    {
-        wallcycle_sub_start(wcycle, ewcsBONDED);
-        calc_bonds(fplog, cr->ms,
-                   idef, x, hist, f, fr, &pbc, graph, enerd, nrnb, lambda, md, fcd,
-                   DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL, atype, born,
-                   flags,
-                   fr->bSepDVDL && do_per_step(step, ir->nstlog), step);
-
-        /* Check if we have to determine energy differences
-         * at foreign lambda's.
-         */
-        if (fepvals->n_lambda > 0 && (flags & GMX_FORCE_DHDL) &&
-            idef->ilsort != ilsortNO_FE)
-        {
-            if (idef->ilsort != ilsortFE_SORTED)
-            {
-                gmx_incons("The bonded interactions are not sorted for free energy");
-            }
-            for (i = 0; i < enerd->n_lambda; i++)
-            {
-                reset_foreign_enerdata(enerd);
-                for (j = 0; j < efptNR; j++)
-                {
-                    lam_i[j] = (i == 0 ? lambda[j] : fepvals->all_lambda[j][i-1]);
-                }
-                calc_bonds_lambda(fplog, idef, x, fr, &pbc, graph, &(enerd->foreign_grpp), enerd->foreign_term, nrnb, lam_i, md,
-                                  fcd, DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
-                sum_epot(&(enerd->foreign_grpp), enerd->foreign_term);
-                enerd->enerpart_lambda[i] += enerd->foreign_term[F_EPOT];
-            }
-        }
-        debug_gmx();
-
-        wallcycle_sub_stop(wcycle, ewcsBONDED);
-    }
+    do_force_listed(wcycle, box, ir->fepvals, cr->ms,
+                    idef, (const rvec *) x, hist, f, fr,
+                    &pbc, graph, enerd, nrnb, lambda, md, fcd,
+                    DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL,
+                    flags);
 
     where();
 
     *cycles_pme = 0;
+    clear_mat(fr->vir_el_recip);
+    clear_mat(fr->vir_lj_recip);
+
+    /* Do long-range electrostatics and/or LJ-PME, including related short-range
+     * corrections.
+     */
     if (EEL_FULL(fr->eeltype) || EVDW_PME(fr->vdwtype))
     {
-        real Vlr             = 0, Vcorr = 0;
-        real dvdl_long_range = 0;
-        int  status          = 0;
+        int  status            = 0;
+        real Vlr_q             = 0, Vlr_lj = 0, Vcorr_q = 0, Vcorr_lj = 0;
+        real dvdl_long_range_q = 0, dvdl_long_range_lj = 0;
 
         bSB = (ir->nwall == 2);
         if (bSB)
@@ -462,20 +404,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
             svmul(ir->wall_ewald_zfac, boxs[ZZ], boxs[ZZ]);
             box_size[ZZ] *= ir->wall_ewald_zfac;
         }
-    }
-
-    /* Do long-range electrostatics and/or LJ-PME, including related short-range
-     * corrections.
-     */
-
-    clear_mat(fr->vir_el_recip);
-    clear_mat(fr->vir_lj_recip);
-
-    if (EEL_FULL(fr->eeltype) || EVDW_PME(fr->vdwtype))
-    {
-        real Vlr_q             = 0, Vlr_lj = 0, Vcorr_q = 0, Vcorr_lj = 0;
-        real dvdl_long_range_q = 0, dvdl_long_range_lj = 0;
-        int  status            = 0;
 
         if (EEL_PME_EWALD(fr->eeltype) || EVDW_PME(fr->vdwtype))
         {
@@ -506,7 +434,7 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
 #pragma omp parallel for num_threads(nthreads) schedule(static)
                 for (t = 0; t < nthreads; t++)
                 {
-                    int     s, e, i;
+                    int     i;
                     rvec   *fnv;
                     tensor *vir_q, *vir_lj;
                     real   *Vcorrt_q, *Vcorrt_lj, *dvdlt_q, *dvdlt_lj;
@@ -574,15 +502,10 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
                                                    fr->vir_el_recip);
             }
 
-            PRINT_SEPDVDL("Ewald excl./charge/dip. corr.", Vcorr_q, dvdl_long_range_correction_q);
-            PRINT_SEPDVDL("Ewald excl. corr. LJ", Vcorr_lj, dvdl_long_range_correction_lj);
             enerd->dvdl_lin[efptCOUL] += dvdl_long_range_correction_q;
             enerd->dvdl_lin[efptVDW]  += dvdl_long_range_correction_lj;
-        }
 
-        if ((EEL_PME(fr->eeltype) || EVDW_PME(fr->vdwtype)))
-        {
-            if (cr->duty & DUTY_PME)
+            if ((EEL_PME(fr->eeltype) || EVDW_PME(fr->vdwtype)) && (cr->duty & DUTY_PME))
             {
                 /* Do reciprocal PME for Coulomb and/or LJ. */
                 assert(fr->n_tpi >= 0);
@@ -654,7 +577,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
                                         md->chargeA + md->homenr - fr->n_tpi,
                                         &Vlr_q);
                 }
-                PRINT_SEPDVDL("PME mesh", Vlr_q + Vlr_lj, dvdl_long_range_q+dvdl_long_range_lj);
             }
         }
 
@@ -665,7 +587,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
                              box_size, cr, md->homenr,
                              fr->vir_el_recip, fr->ewaldcoeff_q,
                              lambda[efptCOUL], &dvdl_long_range_q, fr->ewald_table);
-            PRINT_SEPDVDL("Ewald long-range", Vlr_q, dvdl_long_range_q);
         }
 
         /* Note that with separate PME nodes we get the real energies later */
@@ -700,8 +621,6 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
                                        fr->fshift, &pbc, lambda[efptCOUL], &dvdl_rf_excl);
 
                 enerd->dvdl_lin[efptCOUL] += dvdl_rf_excl;
-                PRINT_SEPDVDL("RF exclusion correction",
-                              enerd->term[F_RF_EXCL], dvdl_rf_excl);
             }
         }
     }
@@ -723,6 +642,7 @@ void do_force_lowlevel(FILE       *fplog,   gmx_int64_t step,
         fr->t_wait += t3-t2;
         if (fr->timesteps == 11)
         {
+            char buf[22];
             fprintf(stderr, "* PP load balancing info: rank %d, step %s, rel wait time=%3.0f%% , load string value: %7.2f\n",
                     cr->nodeid, gmx_step_str(fr->timesteps, buf),
                     100*fr->t_wait/(fr->t_wait+fr->t_fnbf),
similarity index 75%
rename from src/gromacs/legacyheaders/mvdata.h
rename to src/gromacs/mdlib/forcerec-threading.h
index 083e4fc6bcec05dd5c1f6c4bebe3214583c58f18..b40a18ba32ff37607fd32f8fd21b1363286337cf 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) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _mvdata_h
-#define _mvdata_h
+#ifndef GMX_MDLIB_FORCEREC_THREADING_H
+#define GMX_MDLIB_FORCEREC_THREADING_H
 
-#include "typedefs.h"
+#include "gromacs/utility/bitmask.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void bcast_ir_mtop(const t_commrec *cr,
-                   t_inputrec *inputrec, gmx_mtop_t *mtop);
-/* Broadcasts ir and mtop from the master to all nodes 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.
- */
+struct f_thread_t {
+    rvec             *f;
+    int               f_nalloc;
+    gmx_bitmask_t     red_mask; /* Mask for marking which parts of f are filled */
+    rvec             *fshift;
+    real              ener[F_NRE];
+    gmx_grppairener_t grpp;
+    real              Vcorr_q;
+    real              Vcorr_lj;
+    real              dvdl[efptNR];
+    tensor            vir_q;
+    tensor            vir_lj;
+};
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif  /* _mvdata_h */
+#endif
similarity index 95%
rename from src/gromacs/mdlib/forcerec.c
rename to src/gromacs/mdlib/forcerec.cpp
index 1ec1c2b171b3a282638d0cccbe1d59ec97834ab9..3f6b1874a7ba4aa1d3cacf039344e28e52517220 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
+#include <assert.h>
 #include <math.h>
 #include <string.h>
-#include <assert.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "vec.h"
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/ewald/ewald.h"
+#include "gromacs/gmxlib/cuda_tools/pmalloc_cuda.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_detect_hardware.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/inputrec.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/md_support.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/tables.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/math/calculate-ewald-splitting-coefficient.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "physics.h"
-#include "force.h"
-#include "tables.h"
-#include "nonbonded.h"
-#include "invblock.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "coulomb.h"
-#include "md_support.h"
-#include "md_logging.h"
-#include "domdec.h"
-#include "qmmm.h"
-#include "copyrite.h"
-#include "mtop_util.h"
-#include "nbnxn_simd.h"
-#include "nbnxn_search.h"
-#include "nbnxn_atomdata.h"
-#include "nbnxn_consts.h"
-#include "gmx_omp_nthreads.h"
-#include "gmx_detect_hardware.h"
-#include "inputrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/forcerec-threading.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_atomdata.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/mdlib/nbnxn_simd.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/simd/simd.h"
-
-#include "types/nbnxn_cuda_types_ext.h"
-#include "gpu_utils.h"
-#include "nbnxn_cuda_data_mgmt.h"
-#include "pmalloc_cuda.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 t_forcerec *mk_forcerec(void)
 {
@@ -155,9 +155,10 @@ static real *mk_nbfp(const gmx_ffparams_t *idef, gmx_bool bBHAM)
 
 static real *make_ljpme_c6grid(const gmx_ffparams_t *idef, t_forcerec *fr)
 {
-    int   i, j, k, atnr;
-    real  c6, c6i, c6j, c12i, c12j, epsi, epsj, sigmai, sigmaj;
-    real *grid;
+    int        i, j, k, atnr;
+    real       c6, c6i, c6j, c12i, c12j, epsi, epsj, sigmai, sigmaj;
+    real      *grid;
+    const real oneOverSix = 1.0 / 6.0;
 
     /* For LJ-PME simulations, we correct the energies with the reciprocal space
      * inside of the cut-off. To do this the non-bonded kernels needs to have
@@ -178,8 +179,8 @@ static real *make_ljpme_c6grid(const gmx_ffparams_t *idef, t_forcerec *fr)
             if (fr->ljpme_combination_rule == eljpmeLB
                 && !gmx_numzero(c6) && !gmx_numzero(c12i) && !gmx_numzero(c12j))
             {
-                sigmai = pow(c12i / c6i, 1.0/6.0);
-                sigmaj = pow(c12j / c6j, 1.0/6.0);
+                sigmai = pow(c12i / c6i, oneOverSix);
+                sigmaj = pow(c12j / c6j, oneOverSix);
                 epsi   = c6i * c6i / c12i;
                 epsj   = c6j * c6j / c12j;
                 c6     = sqrt(epsi * epsj) * pow(0.5*(sigmai+sigmaj), 6);
@@ -195,10 +196,11 @@ static real *make_ljpme_c6grid(const gmx_ffparams_t *idef, t_forcerec *fr)
 
 static real *mk_nbfp_combination_rule(const gmx_ffparams_t *idef, int comb_rule)
 {
-    real *nbfp;
-    int   i, j, k, atnr;
-    real  c6i, c6j, c12i, c12j, epsi, epsj, sigmai, sigmaj;
-    real  c6, c12;
+    real      *nbfp;
+    int        i, j, atnr;
+    real       c6i, c6j, c12i, c12j, epsi, epsj, sigmai, sigmaj;
+    real       c6, c12;
+    const real oneOverSix = 1.0 / 6.0;
 
     atnr = idef->atnr;
     snew(nbfp, 2*atnr*atnr);
@@ -215,8 +217,8 @@ static real *mk_nbfp_combination_rule(const gmx_ffparams_t *idef, int comb_rule)
             if (comb_rule == eCOMB_ARITHMETIC
                 && !gmx_numzero(c6) && !gmx_numzero(c12))
             {
-                sigmai = pow(c12i / c6i, 1.0/6.0);
-                sigmaj = pow(c12j / c6j, 1.0/6.0);
+                sigmai = pow(c12i / c6i, oneOverSix);
+                sigmaj = pow(c12j / c6j, oneOverSix);
                 epsi   = c6i * c6i / c12i;
                 epsj   = c6j * c6j / c12j;
                 c6     = sqrt(epsi * epsj) * pow(0.5*(sigmai+sigmaj), 6);
@@ -264,7 +266,6 @@ check_solvent_cg(const gmx_moltype_t    *molt,
                  int                     cginfo,
                  int                    *cg_sp)
 {
-    const t_blocka       *excl;
     t_atom               *atom;
     int                   j, k;
     int                   j0, j1, nj;
@@ -509,9 +510,8 @@ check_solvent(FILE  *                fp,
               cginfo_mb_t           *cginfo_mb)
 {
     const t_block     *   cgs;
-    const t_block     *   mols;
     const gmx_moltype_t  *molt;
-    int                   mb, mol, cg_mol, at_offset, cg_offset, am, cgm, i, nmol_ch, nmol;
+    int                   mb, mol, cg_mol, at_offset, am, cgm, i, nmol_ch, nmol;
     int                   n_solvent_parameters;
     solvent_parameters_t *solvent_parameters;
     int                 **cg_sp;
@@ -522,14 +522,11 @@ check_solvent(FILE  *                fp,
         fprintf(debug, "Going to determine what solvent types we have.\n");
     }
 
-    mols = &mtop->mols;
-
     n_solvent_parameters = 0;
     solvent_parameters   = NULL;
     /* Allocate temporary array for solvent type */
     snew(cg_sp, mtop->nmolblock);
 
-    cg_offset = 0;
     at_offset = 0;
     for (mb = 0; mb < mtop->nmolblock; mb++)
     {
@@ -557,7 +554,6 @@ check_solvent(FILE  *                fp,
                                  &cg_sp[mb][cgm+cg_mol]);
             }
         }
-        cg_offset += cgs->nr;
         at_offset += cgs->index[cgs->nr];
     }
 
@@ -585,10 +581,6 @@ check_solvent(FILE  *                fp,
         bestsol = esolNO;
     }
 
-#ifdef DISABLE_WATER_NLIST
-    bestsol = esolNO;
-#endif
-
     fr->nWatMol = 0;
     for (mb = 0; mb < mtop->nmolblock; mb++)
     {
@@ -637,14 +629,13 @@ static cginfo_mb_t *init_cginfo_mb(FILE *fplog, const gmx_mtop_t *mtop,
     cginfo_mb_t          *cginfo_mb;
     gmx_bool             *type_VDW;
     int                  *cginfo;
-    int                   cg_offset, a_offset, cgm, am;
-    int                   mb, m, ncg_tot, cg, a0, a1, gid, ai, j, aj, excl_nalloc;
+    int                   cg_offset, a_offset;
+    int                   mb, m, cg, a0, a1, gid, ai, j, aj, excl_nalloc;
     int                  *a_con;
     int                   ftype;
     int                   ia;
     gmx_bool              bId, *bExcl, bExclIntraAll, bExclInter, bHaveVDW, bHaveQ, bHavePerturbedAtoms;
 
-    ncg_tot = ncg_mtop(mtop);
     snew(cginfo_mb, mtop->nmolblock);
 
     snew(type_VDW, fr->ntype);
@@ -679,10 +670,9 @@ static cginfo_mb_t *init_cginfo_mb(FILE *fplog, const gmx_mtop_t *mtop,
          * Otherwise we make an array of #mol times #cgs per molecule.
          */
         bId = TRUE;
-        am  = 0;
         for (m = 0; m < molb->nmol; m++)
         {
-            am = m*cgs->index[cgs->nr];
+            int am = m*cgs->index[cgs->nr];
             for (cg = 0; cg < cgs->nr; cg++)
             {
                 a0 = cgs->index[cg];
@@ -736,8 +726,8 @@ static cginfo_mb_t *init_cginfo_mb(FILE *fplog, const gmx_mtop_t *mtop,
 
         for (m = 0; m < (bId ? 1 : molb->nmol); m++)
         {
-            cgm = m*cgs->nr;
-            am  = m*cgs->index[cgs->nr];
+            int cgm = m*cgs->nr;
+            int am  = m*cgs->index[cgs->nr];
             for (cg = 0; cg < cgs->nr; cg++)
             {
                 a0 = cgs->index[cg];
@@ -991,7 +981,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, const gmx_mtop_t *mtop)
 {
     const t_atoms  *atoms, *atoms_tpi;
     const t_blocka *excl;
-    int             mb, nmol, nmolc, i, j, tpi, tpj, j1, j2, k, n, nexcl, q;
+    int             mb, nmol, nmolc, i, j, tpi, tpj, j1, j2, k, nexcl, q;
     gmx_int64_t     npair, npair_ij, tmpi, tmpj;
     double          csix, ctwelve;
     int             ntp, *typecount;
@@ -1788,7 +1778,8 @@ static void pick_nbnxn_kernel(FILE                *fp,
     }
 }
 
-static void pick_nbnxn_resources(const t_commrec     *cr,
+static void pick_nbnxn_resources(FILE                *fp,
+                                 const t_commrec     *cr,
                                  const gmx_hw_info_t *hwinfo,
                                  gmx_bool             bDoNonbonded,
                                  gmx_bool            *bUseGPU,
@@ -1823,7 +1814,7 @@ static void pick_nbnxn_resources(const t_commrec     *cr,
     {
         /* Each PP node will use the intra-node id-th device from the
          * list of detected/selected GPUs. */
-        if (!init_gpu(cr->rank_pp_intranode, gpu_err_str,
+        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
@@ -1919,8 +1910,6 @@ void init_interaction_const_tables(FILE                *fp,
                                    gmx_bool             bUsesSimpleTables,
                                    real                 rtab)
 {
-    real spacing;
-
     if (ic->eeltype == eelEWALD || EEL_PME(ic->eeltype) || EVDW_PME(ic->vdwtype))
     {
         init_ewald_f_table(ic, bUsesSimpleTables, rtab);
@@ -1982,6 +1971,8 @@ init_interaction_const(FILE                       *fp,
 {
     interaction_const_t *ic;
     gmx_bool             bUsesSimpleTables = TRUE;
+    const real           minusSix          = -6.0;
+    const real           minusTwelve       = -12.0;
 
     snew(ic, 1);
 
@@ -2008,14 +1999,14 @@ init_interaction_const(FILE                       *fp,
     {
         case eintmodPOTSHIFT:
             /* Only shift the potential, don't touch the force */
-            ic->dispersion_shift.cpot = -pow(ic->rvdw, -6.0);
-            ic->repulsion_shift.cpot  = -pow(ic->rvdw, -12.0);
+            ic->dispersion_shift.cpot = -pow(ic->rvdw, minusSix);
+            ic->repulsion_shift.cpot  = -pow(ic->rvdw, minusTwelve);
             if (EVDW_PME(ic->vdwtype))
             {
                 real crc2;
 
                 crc2            = sqr(ic->ewaldcoeff_lj*ic->rvdw);
-                ic->sh_lj_ewald = (exp(-crc2)*(1 + crc2 + 0.5*crc2*crc2) - 1)*pow(ic->rvdw, -6.0);
+                ic->sh_lj_ewald = (exp(-crc2)*(1 + crc2 + 0.5*crc2*crc2) - 1)*pow(ic->rvdw, minusSix);
             }
             break;
         case eintmodFORCESWITCH:
@@ -2150,7 +2141,7 @@ static void init_nb_verlet(FILE                *fp,
 
     snew(nbv, 1);
 
-    pick_nbnxn_resources(cr, fr->hwinfo,
+    pick_nbnxn_resources(fp, cr, fr->hwinfo,
                          fr->bNonbonded,
                          &nbv->bUseGPU,
                          &bEmulateGPU,
@@ -2311,6 +2302,11 @@ static void init_nb_verlet(FILE                *fp,
     }
 }
 
+gmx_bool usingGpu(nonbonded_verlet_t *nbv)
+{
+    return nbv != NULL && nbv->bUseGPU;
+}
+
 void init_forcerec(FILE              *fp,
                    const output_env_t oenv,
                    t_forcerec        *fr,
@@ -2327,7 +2323,7 @@ void init_forcerec(FILE              *fp,
                    gmx_bool           bNoSolvOpt,
                    real               print_force)
 {
-    int            i, j, m, natoms, ngrp, negp_pp, negptable, egi, egj;
+    int            i, m, negp_pp, negptable, egi, egj;
     real           rtab;
     char          *env;
     double         dbl;
@@ -2335,7 +2331,6 @@ void init_forcerec(FILE              *fp,
     gmx_bool       bGenericKernelOnly;
     gmx_bool       bMakeTables, bMakeSeparate14Table, bSomeNormalNbListsAreInUse;
     gmx_bool       bFEP_NonBonded;
-    t_nblists     *nbl;
     int           *nm_ind, egp_flags;
 
     if (fr->hwinfo == NULL)
@@ -2352,8 +2347,6 @@ void init_forcerec(FILE              *fp,
 
     fr->bDomDec = DOMAINDECOMP(cr);
 
-    natoms = mtop->natoms;
-
     if (check_box(ir->ePBC, box))
     {
         gmx_fatal(FARGS, check_box(ir->ePBC, box));
@@ -2445,7 +2438,7 @@ void init_forcerec(FILE              *fp,
     if (env != NULL)
     {
         dbl = 0;
-        sscanf(env, "%lf", &dbl);
+        sscanf(env, "%20lf", &dbl);
         fr->sc_sigma6_min = pow(dbl, 6);
         if (fp)
         {
@@ -3093,7 +3086,6 @@ void init_forcerec(FILE              *fp,
                     egp_flags = ir->opts.egp_flags[GID(egi, egj, ir->opts.ngener)];
                     if ((egp_flags & EGP_TABLE) && !(egp_flags & EGP_EXCL))
                     {
-                        nbl = &(fr->nblists[m]);
                         if (fr->nnblists > 1)
                         {
                             fr->gid2nblists[GID(egi, egj, ir->opts.ngener)] = m;
@@ -3324,3 +3316,46 @@ void forcerec_set_excl_load(t_forcerec           *fr,
         fr->excl_load[t] = i;
     }
 }
+
+/* Frees GPU memory and destroys the CUDA context.
+ *
+ * Note that this function needs to be called even if GPUs are not used
+ * 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)
+{
+    gmx_bool bIsPPrankUsingGPU;
+    char     gpu_err_str[STRLEN];
+
+    bIsPPrankUsingGPU = (cr->duty & DUTY_PP) && fr && fr->nbv && fr->nbv->bUseGPU;
+
+    if (bIsPPrankUsingGPU)
+    {
+        /* free nbnxn data in GPU memory */
+        nbnxn_cuda_free(fr->nbv->cu_nbv);
+
+        /* With tMPI we need to wait for all ranks to finish deallocation before
+         * destroying the context in free_gpu() as some ranks may be sharing
+         * GPU and context.
+         * Note: as only PP ranks need to free GPU resources, so it is safe to
+         * not call the barrier on PME ranks.
+         */
+#ifdef GMX_THREAD_MPI
+        if (PAR(cr))
+        {
+            gmx_barrier(cr);
+        }
+#endif  /* GMX_THREAD_MPI */
+
+        /* uninitialize GPU (by destroying the context) */
+        if (!free_gpu(cr->rank_pp_intranode, gpu_err_str, gpu_info, gpu_opt))
+        {
+            gmx_warning("On rank %d failed to free GPU #%d: %s",
+                        cr->nodeid, get_current_gpu_device_id(), gpu_err_str);
+        }
+    }
+}
index 6c20080c5f8a5ee44823975b91a53f776c416eb8..a4f34b8ad597615babffb9cc025b5d36dd3ed812 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/genborn.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "genborn.h"
-#include "vec.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/pdbio.h"
-#include "names.h"
-#include "physics.h"
-#include "domdec.h"
-#include "network.h"
-#include "gmx_fatal.h"
-#include "mtop_util.h"
-#include "pbc.h"
-#include "nrnb.h"
-#include "bondf.h"
-
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
 
 #ifdef GMX_SIMD_X86_SSE2_OR_HIGHER
 #  ifdef GMX_DOUBLE
-#    include "genborn_sse2_double.h"
-#    include "genborn_allvsall_sse2_double.h"
+#    include "gromacs/mdlib/genborn_allvsall_sse2_double.h"
+#    include "gromacs/mdlib/genborn_sse2_double.h"
 #  else
-#    include "genborn_sse2_single.h"
-#    include "genborn_allvsall_sse2_single.h"
+#    include "gromacs/mdlib/genborn_allvsall_sse2_single.h"
+#    include "gromacs/mdlib/genborn_sse2_single.h"
 #  endif /* GMX_DOUBLE */
 #endif   /* SSE or AVX present */
 
-#include "genborn_allvsall.h"
+#include "gromacs/mdlib/genborn_allvsall.h"
 
 /*#define DISABLE_SSE*/
 
@@ -87,7 +86,7 @@ typedef struct gbtmpnbls {
     int         list_nalloc;
 } t_gbtmpnbls;
 
-/* This function is exactly the same as the one in bondfree.c. The reason
+/* This function is exactly the same as the one in listed-forces/bonded.cpp. The reason
  * it is copied here is that the bonded gb-interactions are evaluated
  * not in calc_bonds, but rather in calc_gb_forces
  */
index 766341efad9b0621674a83d2bb1903ad6f3ce8c5..a18f2e1ac5cbc267a47a4ec97a3bd0b1f1ff1a11 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "genborn_allvsall.h"
 
 #include <math.h>
-#include "types/simple.h"
 
-#include "vec.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "network.h"
-#include "physics.h"
-#include "genborn.h"
-#include "genborn_allvsall.h"
-
 
 typedef struct
 {
index 10ab33930c7c34ae63629e78c94718e3adbbe671..83492bdef1e65dad07c950d0fd27d9d93a8f3729 100644 (file)
 #ifndef _GENBORN_ALLVSALL_H
 #define _GENBORN_ALLVSALL_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 int
 genborn_allvsall_calc_still_radii(t_forcerec *           fr,
index ff2c3aefd44dfae96f25155b54b0d9d7ea1dabe0..58475254654e5e667a84df8a6caaa915f8221d9b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "types/simple.h"
 
-#include "vec.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/genborn_allvsall.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "network.h"
-#include "physics.h"
-#include "genborn.h"
-#include "genborn_allvsall.h"
-
 
 #if 0 && defined (GMX_SIMD_X86_SSE2_OR_HIGHER)
 
index 778a4df3d840fc1cf18ff51403800105902fc348..3629475dc342ce68754bc04950e7fe593a088bf2 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _GENBORN_ALLVSALL_SSE2_DOUBLE_H
 #define _GENBORN_ALLVSALL_SSE2_DOUBLE_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 int
 genborn_allvsall_calc_still_radii_sse2_double(t_forcerec *           fr,
index 1f17f499aa55341f0c0341282f6f30034a4a3517..8c3ce47c99fbb18cf09bbc58678599efa3c1b575 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "types/simple.h"
 
-#include "vec.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/genborn_allvsall.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "network.h"
-#include "physics.h"
-#include "genborn.h"
-#include "genborn_allvsall.h"
-
 #if 0 && defined (GMX_SIMD_X86_SSE2_OR_HIGHER)
 
 #include <gmx_sse2_single.h>
index 2c56207b76fe03c01a8fb5b63c444195d1de3792..d1e908a985c73e2f6614fc9e3520502498fb3625 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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _GENBORN_ALLVSALL_SSE2_SINGLE_H
 #define _GENBORN_ALLVSALL_SSE2_SINGLE_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "types/simple.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 int
 genborn_allvsall_calc_still_radii_sse2_single(t_forcerec *           fr,
index 7e71bf8ba437977065a6fd0ada88a1917f1c0bec..62cab4b2f34f5e01b9537e99dbb6f4986964a98b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "genborn.h"
-#include "vec.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/pdbio.h"
-#include "names.h"
-#include "physics.h"
-#include "domdec.h"
-#include "network.h"
-#include "gmx_fatal.h"
-#include "mtop_util.h"
-#include "genborn.h"
-
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
 
 /* Only compile this file if SSE2 intrinsics are available */
 #if 0 && defined (GMX_SIMD_X86_SSE2_OR_HIGHER)
-#include <gmx_sse2_double.h>
-#include <emmintrin.h>
-
 #include "genborn_sse2_double.h"
 
+#include <emmintrin.h>
+#include <gmx_sse2_double.h>
+
 int
 calc_gb_rad_still_sse2_double(t_commrec *cr, t_forcerec *fr,
                               int natoms, gmx_localtop_t *top,
index d4b5271454251a071faeef306a62b51e5b65b153..0bf4ea9d6946ac565442f67e81510ab86c353c8e 100644 (file)
 #ifndef _genborn_sse2_double_h
 #define _genborn_sse2_double_h
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 int
 calc_gb_rad_still_sse2_double(t_commrec *cr, t_forcerec *fr, int natoms, gmx_localtop_t *top,
index 95fa0cdc40a9fe2927aa548b790fa60ab3669f08..accbb6ef40221e2c37a17877a3b4b8c406dbcb9c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "genborn.h"
-#include "vec.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/pdbio.h"
-#include "names.h"
-#include "physics.h"
-#include "domdec.h"
-#include "network.h"
-#include "gmx_fatal.h"
-#include "mtop_util.h"
-#include "genborn.h"
-
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* Only compile this file if SSE intrinsics are available */
 #if 0 && defined (GMX_SIMD_X86_SSE2_OR_HIGHER)
 
-#include <gmx_sse2_single.h>
-#include <emmintrin.h>
-
 #include "genborn_sse2_single.h"
 
+#include <emmintrin.h>
+#include <gmx_sse2_single.h>
+
 
 int
 calc_gb_rad_still_sse2_single(t_commrec *cr, t_forcerec *fr,
index 95b4ce63f68d827991a5cf6ae53a71a352801c67..6753e0e17f8068226d74d8cb77857220a9d9f267 100644 (file)
 #ifndef _genborn_sse_h
 #define _genborn_sse_h
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 float
 calc_gb_chainrule_sse2_single(int natoms, t_nblist *nl, float *dadx, float *dvda,
similarity index 98%
rename from src/gromacs/mdlib/groupcoord.c
rename to src/gromacs/mdlib/groupcoord.cpp
index dae82018af8c037e07534b8e8a2fbd14593ee52a..b02f852374416c8ab629f037aa3e2734c49cca8c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
+#include "gmxpre.h"
 
 #include "groupcoord.h"
-#include "network.h"
-#include "pbc.h"
-#include "vec.h"
+
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_ga2la.h"
 
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
 
index a664e343208793810299882c119c793aacee9bf9..686ce17517e2a1cc82c89801570fcd4383fc1158 100644 (file)
  * \inlibraryapi
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <stdio.h>
-#include "typedefs.h"
-#include "types/commrec.h"
 
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*! \brief Select local atoms of a group.
  *
@@ -74,6 +74,7 @@
  *                            (collective) array such that it can be gmx_summed
  *                            in the communicate_group_positions routine.
  */
+
 extern void dd_make_local_group_indices(gmx_ga2la_t ga2la,
                                         const int nr, int anrs[], int *nr_loc,
                                         int *anrs_loc[], int *nalloc_loc,
@@ -204,3 +205,7 @@ extern void translate_x(rvec x[], const int nr, const rvec transvec);
  *
  */
 extern void rotate_x(rvec x[], const int nr, matrix rmat);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/gromacs/mdlib/init.c b/src/gromacs/mdlib/init.c
deleted file mode 100644 (file)
index 9551634..0000000
+++ /dev/null
@@ -1,167 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include "typedefs.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
-#include "main.h"
-#include "mvdata.h"
-#include "gmx_fatal.h"
-#include "symtab.h"
-#include "txtdump.h"
-#include "mdatoms.h"
-#include "mdrun.h"
-#include "names.h"
-#include "calcgrid.h"
-#include "update.h"
-#include "mdebin.h"
-
-#define BUFSIZE 256
-
-#define NOT_FINISHED(l1, l2) \
-    printf("not finished yet: lines %d .. %d in %s\n", l1, l2, __FILE__)
-
-void set_state_entries(t_state *state, const t_inputrec *ir)
-{
-    int nnhpres;
-
-    /* The entries in the state in the tpx file might not correspond
-     * with what is needed, so we correct this here.
-     */
-    state->flags = 0;
-    if (ir->efep != efepNO || ir->bExpanded)
-    {
-        state->flags |= (1<<estLAMBDA);
-        state->flags |= (1<<estFEPSTATE);
-    }
-    state->flags |= (1<<estX);
-    if (state->lambda == NULL)
-    {
-        snew(state->lambda, efptNR);
-    }
-    if (state->x == NULL)
-    {
-        snew(state->x, state->nalloc);
-    }
-    if (EI_DYNAMICS(ir->eI))
-    {
-        state->flags |= (1<<estV);
-        if (state->v == NULL)
-        {
-            snew(state->v, state->nalloc);
-        }
-    }
-    if (ir->eI == eiSD2)
-    {
-        state->flags |= (1<<estSDX);
-        if (state->sd_X == NULL)
-        {
-            /* sd_X is not stored in the tpx file, so we need to allocate it */
-            snew(state->sd_X, state->nalloc);
-        }
-    }
-    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);
-        }
-    }
-
-    state->nnhpres = 0;
-    if (ir->ePBC != epbcNONE)
-    {
-        state->flags |= (1<<estBOX);
-        if (PRESERVE_SHAPE(*ir))
-        {
-            state->flags |= (1<<estBOX_REL);
-        }
-        if ((ir->epc == epcPARRINELLORAHMAN) || (ir->epc == epcMTTK))
-        {
-            state->flags |= (1<<estBOXV);
-        }
-        if (ir->epc != epcNO)
-        {
-            if (IR_NPT_TROTTER(ir) || (IR_NPH_TROTTER(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);
-            }
-        }
-    }
-
-    if (ir->etc == etcNOSEHOOVER)
-    {
-        state->flags |= (1<<estNH_XI);
-        state->flags |= (1<<estNH_VXI);
-    }
-
-    if (ir->etc == etcVRESCALE)
-    {
-        state->flags |= (1<<estTC_INT);
-    }
-
-    init_gtc_state(state, state->ngtc, state->nnhpres, ir->opts.nhchainlength); /* allocate the space for nose-hoover chains */
-    init_ekinstate(&state->ekinstate, ir);
-
-    init_energyhistory(&state->enerhist);
-    init_df_history(&state->dfhist, ir->fepvals->n_lambda);
-    state->swapstate.eSwapCoords = ir->eSwapCoords;
-}
-
-
-void init_parallel(t_commrec *cr, t_inputrec *inputrec,
-                   gmx_mtop_t *mtop)
-{
-    bcast_ir_mtop(cr, inputrec, mtop);
-}
diff --git a/src/gromacs/mdlib/iteratedconstraints.c b/src/gromacs/mdlib/iteratedconstraints.c
deleted file mode 100644 (file)
index 5c3529f..0000000
+++ /dev/null
@@ -1,236 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "mdrun.h"
-#include "md_support.h"
-#include "md_logging.h"
-#include "types/iteratedconstraints.h"
-
-#ifdef GMX_DOUBLE
-#define CONVERGEITER  0.000000001
-#define CLOSE_ENOUGH  0.000001000
-#else
-#define CONVERGEITER  0.0001
-#define CLOSE_ENOUGH  0.0050
-#endif
-
-/* we want to keep track of the close calls.  If there are too many, there might be some other issues.
-   so we make sure that it's either less than some predetermined number, or if more than that number,
-   only some small fraction of the total. */
-#define MAX_NUMBER_CLOSE        50
-#define FRACTION_CLOSE       0.001
-
-/* maximum length of cyclic traps to check, emerging from limited numerical precision  */
-#define CYCLEMAX            20
-
-void gmx_iterate_init(gmx_iterate_t *iterate, gmx_bool bSetIterationActive)
-{
-    int i;
-
-    iterate->iter_i           = 0;
-    iterate->bIterationActive = bSetIterationActive;
-    iterate->num_close        = 0;
-    for (i = 0; i < MAXITERCONST+2; i++)
-    {
-        iterate->allrelerr[i] = 0;
-    }
-}
-
-gmx_bool done_iterating(const t_commrec *cr, FILE *fplog, int nsteps, gmx_iterate_t *iterate, gmx_bool bFirstIterate, real fom, real *newf)
-{
-    /* monitor convergence, and use a secant search to propose new
-       values.
-                                                                  x_{i} - x_{i-1}
-       The secant method computes x_{i+1} = x_{i} - f(x_{i}) * ---------------------
-                                                                f(x_{i}) - f(x_{i-1})
-
-       The function we are trying to zero is fom-x, where fom is the
-       "figure of merit" which is the pressure (or the veta value) we
-       would get by putting in an old value of the pressure or veta into
-       the incrementor function for the step or half step.  I have
-       verified that this gives the same answer as self consistent
-       iteration, usually in many fewer steps, especially for small tau_p.
-
-       We could possibly eliminate an iteration with proper use
-       of the value from the previous step, but that would take a bit
-       more bookkeeping, especially for veta, since tests indicate the
-       function of veta on the last step is not sufficiently close to
-       guarantee convergence this step. This is
-       good enough for now.  On my tests, I could use tau_p down to
-       0.02, which is smaller that would ever be necessary in
-       practice. Generally, 3-5 iterations will be sufficient */
-
-    real     relerr, err, xmin;
-    int      i;
-    gmx_bool incycle;
-
-    if (bFirstIterate)
-    {
-        iterate->x     = fom;
-        iterate->f     = fom-iterate->x;
-        iterate->xprev = 0;
-        iterate->fprev = 0;
-        *newf          = fom;
-    }
-    else
-    {
-        iterate->f = fom-iterate->x; /* we want to zero this difference */
-        if ((iterate->iter_i > 1) && (iterate->iter_i < MAXITERCONST))
-        {
-            if (iterate->f == iterate->fprev)
-            {
-                *newf = iterate->f;
-            }
-            else
-            {
-                *newf = iterate->x - (iterate->x-iterate->xprev)*(iterate->f)/(iterate->f-iterate->fprev);
-            }
-        }
-        else
-        {
-            /* just use self-consistent iteration the first step to initialize, or
-               if it's not converging (which happens occasionally -- need to investigate why) */
-            *newf = fom;
-        }
-    }
-    /* Consider a slight shortcut allowing us to exit one sooner -- we check the
-       difference between the closest of x and xprev to the new
-       value. To be 100% certain, we should check the difference between
-       the last result, and the previous result, or
-
-       relerr = (fabs((x-xprev)/fom));
-
-       but this is pretty much never necessary under typical conditions.
-       Checking numerically, it seems to lead to almost exactly the same
-       trajectories, but there are small differences out a few decimal
-       places in the pressure, and eventually in the v_eta, but it could
-       save an interation.
-
-       if (fabs(*newf-x) < fabs(*newf - xprev)) { xmin = x;} else { xmin = xprev;}
-       relerr = (fabs((*newf-xmin) / *newf));
-     */
-
-    err    = fabs((iterate->f-iterate->fprev));
-    relerr = fabs(err/fom);
-
-    iterate->allrelerr[iterate->iter_i] = relerr;
-
-    if (iterate->iter_i > 0)
-    {
-        if (debug)
-        {
-            fprintf(debug, "Iterating NPT constraints: %6i %20.12f%14.6g%20.12f\n",
-                    iterate->iter_i, fom, relerr, *newf);
-        }
-
-        if ((relerr < CONVERGEITER) || (err < CONVERGEITER) || (fom == 0) || ((iterate->x == iterate->xprev) && iterate->iter_i > 1))
-        {
-            iterate->bIterationActive = FALSE;
-            if (debug)
-            {
-                fprintf(debug, "Iterating NPT constraints: CONVERGED\n");
-            }
-            return TRUE;
-        }
-        if (iterate->iter_i > MAXITERCONST)
-        {
-            if (relerr < CLOSE_ENOUGH)
-            {
-                incycle = FALSE;
-                for (i = 1; i < CYCLEMAX; i++)
-                {
-                    if ((iterate->allrelerr[iterate->iter_i-(1+i)] == iterate->allrelerr[iterate->iter_i-1]) &&
-                        (iterate->allrelerr[iterate->iter_i-(1+i)] == iterate->allrelerr[iterate->iter_i-(1+2*i)]))
-                    {
-                        incycle = TRUE;
-                        if (debug)
-                        {
-                            fprintf(debug, "Exiting from an NPT iterating cycle of length %d\n", i);
-                        }
-                        break;
-                    }
-                }
-
-                if (incycle)
-                {
-                    /* step 1: trapped in a numerical attractor */
-                    /* we are trapped in a numerical attractor, and can't converge any more, and are close to the final result.
-                       Better to give up convergence here than have the simulation die.
-                     */
-                    iterate->num_close++;
-                    iterate->bIterationActive = FALSE;
-                    return TRUE;
-                }
-                else
-                {
-                    /* Step #2: test if we are reasonably close for other reasons, then monitor the number.  If not, die */
-
-                    /* how many close calls have we had?  If less than a few, we're OK */
-                    if (iterate->num_close < MAX_NUMBER_CLOSE)
-                    {
-                        md_print_warn(cr, fplog, "Slight numerical convergence deviation with NPT at step %d, relative error only %10.5g, likely not a problem, continuing\n", nsteps, relerr);
-                        iterate->num_close++;
-                        iterate->bIterationActive = FALSE;
-                        return TRUE;
-                        /* if more than a few, check the total fraction.  If too high, die. */
-                    }
-                    else if (iterate->num_close/(double)nsteps > FRACTION_CLOSE)
-                    {
-                        gmx_fatal(FARGS, "Could not converge NPT constraints, too many exceptions (%d%%\n", iterate->num_close/(double)nsteps);
-                    }
-                }
-            }
-            else
-            {
-                gmx_fatal(FARGS, "Could not converge NPT constraints\n");
-            }
-        }
-    }
-
-    iterate->xprev = iterate->x;
-    iterate->x     = *newf;
-    iterate->fprev = iterate->f;
-    iterate->iter_i++;
-
-    return FALSE;
-}
similarity index 85%
rename from src/gromacs/mdlib/md_support.c
rename to src/gromacs/mdlib/md_support.cpp
index 748768687bb94b1a5bb9cd5c3ced4ddf6cd88e45..00bce0b9b330c9565a84c9cd5ee688dd2758e8dc 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
 
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "mdrun.h"
-#include "domdec.h"
-#include "mtop_util.h"
-#include "vcm.h"
-#include "nrnb.h"
-#include "macros.h"
-#include "md_logging.h"
-#include "md_support.h"
-#include "names.h"
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/md_support.h"
+
+#include <algorithm>
 
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vcm.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 /* Is the signal in one simulation independent of other simulations? */
-gmx_bool gs_simlocal[eglsNR] = { TRUE, FALSE, FALSE, TRUE };
+gmx_bool gs_simlocal[eglsNR] = { FALSE, FALSE, TRUE };
 
 /* check which of the multisim simulations has the shortest number of
    steps and return that number of nsteps */
@@ -88,7 +92,7 @@ gmx_int64_t get_multisim_nsteps(const t_commrec *cr,
         if (steps_out >= 0 && steps_out < nsteps)
         {
             char strbuf[255];
-            snprintf(strbuf, 255, "Will stop simulation %%d after %s steps (another simulation will end then).\n", "%"GMX_PRId64);
+            snprintf(strbuf, 255, "Will stop simulation %%d after %s steps (another simulation will end then).\n", "%" GMX_PRId64);
             fprintf(stderr, strbuf, cr->ms->sim, steps_out);
         }
     }
@@ -117,7 +121,7 @@ int multisim_min(const gmx_multisim_t *ms, int nmin, int n)
     {
         if (bEqual)
         {
-            nmin = min(nmin, buf[0]);
+            nmin = std::min(nmin, buf[0]);
         }
         else
         {
@@ -292,24 +296,20 @@ void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inpu
     int      i, gsi;
     real     gs_buf[eglsNR];
     tensor   corr_vir, corr_pres;
-    gmx_bool bEner, bPres, bTemp, bVV;
-    gmx_bool bRerunMD, bStopCM, bGStat, bIterate,
-             bFirstIterate, bReadEkin, bEkinAveVel, bScaleEkin, bConstrain;
-    real     ekin, temp, prescorr, enercorr, dvdlcorr, dvdl_ekin;
+    gmx_bool bEner, bPres, bTemp;
+    gmx_bool bStopCM, bGStat,
+             bReadEkin, bEkinAveVel, bScaleEkin, bConstrain;
+    real     prescorr, enercorr, dvdlcorr, dvdl_ekin;
 
     /* translate CGLO flags to gmx_booleans */
-    bRerunMD = flags & CGLO_RERUNMD;
-    bStopCM  = flags & CGLO_STOPCM;
-    bGStat   = flags & CGLO_GSTAT;
-
+    bStopCM       = flags & CGLO_STOPCM;
+    bGStat        = flags & CGLO_GSTAT;
     bReadEkin     = (flags & CGLO_READEKIN);
     bScaleEkin    = (flags & CGLO_SCALEEKIN);
     bEner         = flags & CGLO_ENERGY;
     bTemp         = flags & CGLO_TEMPERATURE;
     bPres         = (flags & CGLO_PRESSURE);
     bConstrain    = (flags & CGLO_CONSTRAINT);
-    bIterate      = (flags & CGLO_ITERATE);
-    bFirstIterate = (flags & CGLO_FIRSTITERATE);
 
     /* we calculate a full state kinetic energy either with full-step velocity verlet
        or half step where we need the pressure */
@@ -338,8 +338,7 @@ void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inpu
         }
         else
         {
-
-            calc_ke_part(state, &(ir->opts), mdatoms, ekind, nrnb, bEkinAveVel, bIterate);
+            calc_ke_part(state, &(ir->opts), mdatoms, ekind, nrnb, bEkinAveVel);
         }
 
         debug_gmx();
@@ -447,8 +446,6 @@ void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inpu
            Leap with AveVel is not supported; it's not clear that it will actually work.
            bEkinAveVel: If TRUE, we simply multiply ekin by ekinscale to get a full step kinetic energy.
            If FALSE, we average ekinh_old and ekinh*ekinscale_nhc to get an averaged half step kinetic energy.
-           bSaveEkinOld: If TRUE (in the case of iteration = bIterate is TRUE), we don't reset the ekinscale_nhc.
-           If FALSE, we go ahead and erase over it.
          */
         enerd->term[F_TEMP] = sum_ekin(&(ir->opts), ekind, &dvdl_ekin,
                                        bEkinAveVel, bScaleEkin);
@@ -461,11 +458,11 @@ void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inpu
 
     if (bEner || bPres || bConstrain)
     {
-        calc_dispcorr(fplog, ir, fr, 0, top_global->natoms, box, state->lambda[efptVDW],
+        calc_dispcorr(ir, fr, top_global->natoms, box, state->lambda[efptVDW],
                       corr_pres, corr_vir, &prescorr, &enercorr, &dvdlcorr);
     }
 
-    if (bEner && bFirstIterate)
+    if (bEner)
     {
         enerd->term[F_DISPCORR]  = enercorr;
         enerd->term[F_EPOT]     += enercorr;
@@ -535,7 +532,7 @@ void set_current_lambdas(gmx_int64_t step, t_lambda *fepvals, gmx_bool bRerunMD,
             {
                 /* find out between which two value of lambda we should be */
                 frac      = (step*fepvals->delta_lambda);
-                fep_state = floor(frac*fepvals->n_lambda);
+                fep_state = static_cast<int>(floor(frac*fepvals->n_lambda));
                 /* interpolate between this state and the next */
                 /* this assumes that the initial lambda corresponds to lambda==0, which is verified in grompp */
                 frac = (frac*fepvals->n_lambda)-fep_state;
@@ -563,7 +560,7 @@ void set_current_lambdas(gmx_int64_t step, t_lambda *fepvals, gmx_bool bRerunMD,
             frac = (step*fepvals->delta_lambda);
             if (fepvals->n_lambda > 0)
             {
-                fep_state = floor(frac*fepvals->n_lambda);
+                fep_state = static_cast<int>(floor(frac*fepvals->n_lambda));
                 /* interpolate between this state and the next */
                 /* this assumes that the initial lambda corresponds to lambda==0, which is verified in grompp */
                 frac = (frac*fepvals->n_lambda)-fep_state;
@@ -751,11 +748,8 @@ void check_ir_old_tpx_versions(t_commrec *cr, FILE *fplog,
 void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
                          gmx_bool *bNotLastFrame)
 {
-    gmx_bool bAlloc;
     rvec    *xp, *vp;
 
-    bAlloc = (fr->natoms == 0);
-
     if (MASTER(cr) && !*bNotLastFrame)
     {
         fr->natoms = -1;
@@ -769,3 +763,100 @@ void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
     *bNotLastFrame = (fr->natoms >= 0);
 
 }
+
+void set_state_entries(t_state *state, const t_inputrec *ir)
+{
+    /* The entries in the state in the tpx file might not correspond
+     * with what is needed, so we correct this here.
+     */
+    state->flags = 0;
+    if (ir->efep != efepNO || ir->bExpanded)
+    {
+        state->flags |= (1<<estLAMBDA);
+        state->flags |= (1<<estFEPSTATE);
+    }
+    state->flags |= (1<<estX);
+    if (state->lambda == NULL)
+    {
+        snew(state->lambda, efptNR);
+    }
+    if (state->x == NULL)
+    {
+        snew(state->x, state->nalloc);
+    }
+    if (EI_DYNAMICS(ir->eI))
+    {
+        state->flags |= (1<<estV);
+        if (state->v == NULL)
+        {
+            snew(state->v, state->nalloc);
+        }
+    }
+    if (ir->eI == eiSD2)
+    {
+        state->flags |= (1<<estSDX);
+        if (state->sd_X == NULL)
+        {
+            /* sd_X is not stored in the tpx file, so we need to allocate it */
+            snew(state->sd_X, state->nalloc);
+        }
+    }
+    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);
+        }
+    }
+
+    state->nnhpres = 0;
+    if (ir->ePBC != epbcNONE)
+    {
+        state->flags |= (1<<estBOX);
+        if (PRESERVE_SHAPE(*ir))
+        {
+            state->flags |= (1<<estBOX_REL);
+        }
+        if ((ir->epc == epcPARRINELLORAHMAN) || (ir->epc == epcMTTK))
+        {
+            state->flags |= (1<<estBOXV);
+        }
+        if (ir->epc != epcNO)
+        {
+            if (IR_NPT_TROTTER(ir) || (IR_NPH_TROTTER(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);
+            }
+        }
+    }
+
+    if (ir->etc == etcNOSEHOOVER)
+    {
+        state->flags |= (1<<estNH_XI);
+        state->flags |= (1<<estNH_VXI);
+    }
+
+    if (ir->etc == etcVRESCALE)
+    {
+        state->flags |= (1<<estTC_INT);
+    }
+
+    init_gtc_state(state, state->ngtc, state->nnhpres, ir->opts.nhchainlength); /* allocate the space for nose-hoover chains */
+    init_ekinstate(&state->ekinstate, ir);
+
+    init_energyhistory(&state->enerhist);
+    init_df_history(&state->dfhist, ir->fepvals->n_lambda);
+    state->swapstate.eSwapCoords = ir->eSwapCoords;
+}
similarity index 96%
rename from src/gromacs/mdlib/mdatom.c
rename to src/gromacs/mdlib/mdatom.cpp
index e4b698a018a9f5a000109c8b7fd25eddc816af4e..3d1c2e2a96cb99bc419e9e40fda3fad3599c7b35 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 
-#include "typedefs.h"
-#include "mdatoms.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/smalloc.h"
-#include "main.h"
-#include "qmmm.h"
-#include "mtop_util.h"
-#include "gmx_omp_nthreads.h"
 
 #define ALMOST_ZERO 1e-30
 
 t_mdatoms *init_mdatoms(FILE *fp, gmx_mtop_t *mtop, gmx_bool bFreeEnergy)
 {
-    int                     mb, a, g, nmol;
+    int                     a;
     double                  tmA, tmB;
     t_atom                 *atom;
     t_mdatoms              *md;
     gmx_mtop_atomloop_all_t aloop;
-    t_ilist                *ilist;
 
     snew(md, 1);
 
@@ -120,8 +116,8 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
     int                   i;
     t_grpopts            *opts;
     gmx_groups_t         *groups;
-    gmx_molblock_t       *molblock;
     int                   nthreads gmx_unused;
+    const real            oneOverSix = 1.0 / 6.0;
 
     bLJPME = EVDW_PME(ir->vdwtype);
 
@@ -129,8 +125,6 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
 
     groups = &mtop->groups;
 
-    molblock = mtop->molblock;
-
     /* 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.
@@ -231,11 +225,12 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
 
     alook = gmx_mtop_atomlookup_init(mtop);
 
+    // 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++)
     {
-        int      g, ag, molb;
+        int      g, ag;
         real     mA, mB, fac;
         real     c6, c12;
         t_atom  *atom;
@@ -333,7 +328,7 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
             }
             else
             {
-                md->sigmaA[i] = pow(c12/c6, 1.0/6.0);
+                md->sigmaA[i] = pow(c12/c6, oneOverSix);
             }
             md->sigma3A[i]    = 1/(md->sigmaA[i]*md->sigmaA[i]*md->sigmaA[i]);
         }
@@ -353,7 +348,7 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
                 }
                 else
                 {
-                    md->sigmaB[i] = pow(c12/c6, 1.0/6.0);
+                    md->sigmaB[i] = pow(c12/c6, oneOverSix);
                 }
                 md->sigma3B[i]    = 1/(md->sigmaB[i]*md->sigmaB[i]*md->sigmaB[i]);
             }
index bb4809174c0fde7a3e5b9128a2b3467d865b02c6..84b1db0f3d12f3329f77a1eadbdab3da1d902420 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/mdebin.h"
 
-#include <string.h>
 #include <float.h>
-#include "typedefs.h"
-#include "mdebin.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
+#include <stdlib.h>
+#include <string.h>
+
 #include "gromacs/fileio/enxio.h"
-#include "vec.h"
-#include "disre.h"
-#include "main.h"
-#include "network.h"
-#include "names.h"
-#include "orires.h"
-#include "constr.h"
-#include "mtop_util.h"
-#include "xvgr.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "macros.h"
-#include "mdrun.h"
-#include "mdebin_bar.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/mdebin_bar.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/smalloc.h"
 
 static const char *conrmsd_nm[] = { "Constr. rmsd", "Constr.2 rmsd" };
 
@@ -547,7 +547,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
     {
         ni = groups->grps[egcTC].nm_ind[i];
         sprintf(buf, "T-%s", *(groups->grpname[ni]));
-        grpnms[i] = strdup(buf);
+        grpnms[i] = gmx_strdup(buf);
     }
     md->itemp = get_ebin_space(md->ebin, md->nTC, (const char **)grpnms,
                                unit_temp_K);
@@ -565,9 +565,9 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
                     for (j = 0; (j < md->nNHC); j++)
                     {
                         sprintf(buf, "Xi-%d-%s", j, bufi);
-                        grpnms[2*(i*md->nNHC+j)] = strdup(buf);
+                        grpnms[2*(i*md->nNHC+j)] = gmx_strdup(buf);
                         sprintf(buf, "vXi-%d-%s", j, bufi);
-                        grpnms[2*(i*md->nNHC+j)+1] = strdup(buf);
+                        grpnms[2*(i*md->nNHC+j)+1] = gmx_strdup(buf);
                     }
                 }
                 md->itc = get_ebin_space(md->ebin, md->mde_n,
@@ -580,9 +580,9 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
                         for (j = 0; (j < md->nNHC); j++)
                         {
                             sprintf(buf, "Xi-%d-%s", j, bufi);
-                            grpnms[2*(i*md->nNHC+j)] = strdup(buf);
+                            grpnms[2*(i*md->nNHC+j)] = gmx_strdup(buf);
                             sprintf(buf, "vXi-%d-%s", j, bufi);
-                            grpnms[2*(i*md->nNHC+j)+1] = strdup(buf);
+                            grpnms[2*(i*md->nNHC+j)+1] = gmx_strdup(buf);
                         }
                     }
                     md->itcb = get_ebin_space(md->ebin, md->mdeb_n,
@@ -596,9 +596,9 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
                     ni   = groups->grps[egcTC].nm_ind[i];
                     bufi = *(groups->grpname[ni]);
                     sprintf(buf, "Xi-%s", bufi);
-                    grpnms[2*i] = strdup(buf);
+                    grpnms[2*i] = gmx_strdup(buf);
                     sprintf(buf, "vXi-%s", bufi);
-                    grpnms[2*i+1] = strdup(buf);
+                    grpnms[2*i+1] = gmx_strdup(buf);
                 }
                 md->itc = get_ebin_space(md->ebin, md->mde_n,
                                          (const char **)grpnms, unit_invtime);
@@ -612,7 +612,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         {
             ni = groups->grps[egcTC].nm_ind[i];
             sprintf(buf, "Lamb-%s", *(groups->grpname[ni]));
-            grpnms[i] = strdup(buf);
+            grpnms[i] = gmx_strdup(buf);
         }
         md->itc = get_ebin_space(md->ebin, md->mde_n, (const char **)grpnms, "");
     }
@@ -628,11 +628,11 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         {
             ni = groups->grps[egcACC].nm_ind[i];
             sprintf(buf, "Ux-%s", *(groups->grpname[ni]));
-            grpnms[3*i+XX] = strdup(buf);
+            grpnms[3*i+XX] = gmx_strdup(buf);
             sprintf(buf, "Uy-%s", *(groups->grpname[ni]));
-            grpnms[3*i+YY] = strdup(buf);
+            grpnms[3*i+YY] = gmx_strdup(buf);
             sprintf(buf, "Uz-%s", *(groups->grpname[ni]));
-            grpnms[3*i+ZZ] = strdup(buf);
+            grpnms[3*i+ZZ] = gmx_strdup(buf);
         }
         md->iu = get_ebin_space(md->ebin, 3*md->nU, (const char **)grpnms, unit_vel);
         sfree(grpnms);
@@ -733,7 +733,7 @@ static void print_lambda_vector(t_lambda *fep, int i,
     if (Nsep > 1)
     {
         /* and add the closing parenthesis */
-        str += sprintf(str, ")");
+        sprintf(str, ")");
     }
 }
 
@@ -846,7 +846,7 @@ extern FILE *open_dhdl(const char *filename, const t_inputrec *ir,
     {
         /* state for the fep_vals, if we have alchemical sampling */
         sprintf(buf, "%s", "Thermodynamic state");
-        setname[s] = strdup(buf);
+        setname[s] = gmx_strdup(buf);
         s         += 1;
     }
 
@@ -862,7 +862,7 @@ extern FILE *open_dhdl(const char *filename, const t_inputrec *ir,
             default:
                 sprintf(buf, "%s (%s)", "Total Energy", unit_energy);
         }
-        setname[s] = strdup(buf);
+        setname[s] = gmx_strdup(buf);
         s         += 1;
     }
 
@@ -888,7 +888,7 @@ extern FILE *open_dhdl(const char *filename, const t_inputrec *ir,
                     sprintf(buf, "%s %s = %.4f", dhdl, efpt_singular_names[i],
                             lam);
                 }
-                setname[s] = strdup(buf);
+                setname[s] = gmx_strdup(buf);
                 s         += 1;
             }
         }
@@ -935,14 +935,14 @@ extern FILE *open_dhdl(const char *filename, const t_inputrec *ir,
                         ir->simtempvals->temperatures[s-(nsetsbegin)],
                         unit_temp_K);
             }
-            setname[s] = strdup(buf);
+            setname[s] = gmx_strdup(buf);
             s++;
         }
         if (write_pV)
         {
             np                     = sprintf(buf, "pV (%s)", unit_energy);
-            setname[nsetsextend-1] = strdup(buf);  /* the first entry after
-                                                      nsets */
+            setname[nsetsextend-1] = gmx_strdup(buf);  /* the first entry after
+                                                          nsets */
         }
 
         xvgr_legend(fp, nsetsextend, (const char **)setname, oenv);
@@ -1547,7 +1547,7 @@ void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
                             nj = groups->grps[egcENER].nm_ind[j];
                             sprintf(buf, "%s-%s", *(groups->grpname[ni]),
                                     *(groups->grpname[nj]));
-                            md->print_grpnms[n++] = strdup(buf);
+                            md->print_grpnms[n++] = gmx_strdup(buf);
                         }
                     }
                 }
index b855e33a9d6b9f791c9c7a8a69de841911b5adfc..e351275864fe06b0e57b0059d7084235b07b6086 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "mdebin_bar.h"
 
-#include <string.h>
 #include <float.h>
 #include <math.h>
-#include "typedefs.h"
-#include "gmx_fatal.h"
-#include "mdebin.h"
-#include "gromacs/utility/smalloc.h"
+#include <string.h>
+
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "mdebin_bar.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* reset the delta_h list to prepare it for new values */
 static void mde_delta_h_reset(t_mde_delta_h *dh)
index 8da7c38fef6cb2257519459af3b7cf8cbbe7dcc3..c31a068edf96544f35a31252af2e9219ee7bc881 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,6 +38,8 @@
 #ifndef _mdebin_bar_h
 #define _mdebin_bar_h
 
+#include "gromacs/legacyheaders/mdebin.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
similarity index 90%
rename from src/gromacs/mdlib/minimize.c
rename to src/gromacs/mdlib/minimize.cpp
index 69008f53fabcb3388951c01d7554d479c67ccdca..c4bd5c77ba0d1fbb62afc3ff7737f86250de42de 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
+#include <math.h>
 #include <string.h>
 #include <time.h>
-#include <math.h>
-#include "sysstuff.h"
-#include "gromacs/utility/cstringutil.h"
-#include "network.h"
-#include "gromacs/utility/smalloc.h"
-#include "nrnb.h"
-#include "main.h"
-#include "force.h"
-#include "macros.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "update.h"
-#include "constr.h"
-#include "vec.h"
-#include "tgroup.h"
-#include "mdebin.h"
-#include "vsite.h"
-#include "force.h"
-#include "mdrun.h"
-#include "md_support.h"
-#include "sim_util.h"
-#include "domdec.h"
-#include "mdatoms.h"
-#include "ns.h"
-#include "mtop_util.h"
-#include "pme.h"
-#include "bondf.h"
-#include "gmx_omp_nthreads.h"
-#include "md_logging.h"
 
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/mtxio.h"
 #include "gromacs/fileio/trajectory_writing.h"
-#include "gromacs/linearalgebra/mtxio.h"
+#include "gromacs/imd/imd.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/md_support.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
+#include "gromacs/listed-forces/manage-threading.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
-#include "gromacs/imd/imd.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     t_state  s;
@@ -203,7 +205,7 @@ static void get_f_norm_max(t_commrec *cr,
                            real *fnorm, real *fmax, int *a_fmax)
 {
     double fnorm2, *sum;
-    real   fmax2, fmax2_0, fam;
+    real   fmax2, fam;
     int    la_max, a_max, start, end, i, m, gf;
 
     /* This routine finds the largest force and returns it.
@@ -212,7 +214,6 @@ static void get_f_norm_max(t_commrec *cr,
     fnorm2 = 0;
     fmax2  = 0;
     la_max = -1;
-    gf     = 0;
     start  = 0;
     end    = mdatoms->homenr;
     if (mdatoms->cFREEZE)
@@ -416,10 +417,10 @@ 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,
-                      ir, NULL, cr, -1, 0, 1.0, mdatoms,
+                      ir, cr, -1, 0, 1.0, mdatoms,
                       ems->s.x, ems->s.x, NULL, fr->bMolPBC, ems->s.box,
                       ems->s.lambda[efptFEP], &dvdl_constr,
-                      NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
+                      NULL, NULL, nrnb, econqCoord);
         }
     }
 
@@ -427,6 +428,10 @@ void init_em(FILE *fplog, const char *title,
     {
         *gstat = global_stat_init(ir);
     }
+    else
+    {
+        *gstat = NULL;
+    }
 
     *outf = init_mdoutf(fplog, nfile, fnm, 0, cr, ir, top_global, NULL, wcycle);
 
@@ -588,6 +593,7 @@ static void do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
     x1 = s1->x;
     x2 = s2->x;
 
+    // cppcheck-suppress unreadVariable
     nthreads = gmx_omp_nthreads_get(emntUpdate);
 #pragma omp parallel num_threads(nthreads)
     {
@@ -651,10 +657,10 @@ static void do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
         wallcycle_start(wcycle, ewcCONSTR);
         dvdl_constr = 0;
         constrain(NULL, TRUE, TRUE, constr, &top->idef,
-                  ir, NULL, cr, count, 0, 1.0, md,
+                  ir, cr, count, 0, 1.0, md,
                   s1->x, s2->x, NULL, bMolPBC, s2->box,
                   s2->lambda[efptBONDED], &dvdl_constr,
-                  NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
+                  NULL, NULL, nrnb, econqCoord);
         wallcycle_stop(wcycle, ewcCONSTR);
     }
 }
@@ -692,7 +698,6 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
 {
     real     t;
     gmx_bool bNS;
-    int      nabnsb;
     tensor   force_vir, shake_vir, ekin;
     real     dvdl_constr, prescorr, enercorr, dvdlcorr;
     real     terminate = 0;
@@ -713,15 +718,6 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         {
             bNS = TRUE;
         }
-        else if (inputrec->nstlist == -1)
-        {
-            nabnsb = natoms_beyond_ns_buffer(inputrec, fr, &top->cgs, NULL, ems->s.x);
-            if (PAR(cr))
-            {
-                gmx_sumi(1, &nabnsb, cr);
-            }
-            bNS = (nabnsb > 0);
-        }
     }
 
     if (vsite)
@@ -766,14 +762,13 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
                     top_global, &ems->s, FALSE,
                     CGLO_ENERGY |
                     CGLO_PRESSURE |
-                    CGLO_CONSTRAINT |
-                    CGLO_FIRSTITERATE);
+                    CGLO_CONSTRAINT);
 
         wallcycle_stop(wcycle, ewcMoveE);
     }
 
     /* Calculate long range corrections to pressure and energy */
-    calc_dispcorr(fplog, inputrec, fr, count, top_global->natoms, ems->s.box, ems->s.lambda[efptVDW],
+    calc_dispcorr(inputrec, fr, top_global->natoms, ems->s.box, ems->s.lambda[efptVDW],
                   pres, force_vir, &prescorr, &enercorr, &dvdlcorr);
     enerd->term[F_DISPCORR] = enercorr;
     enerd->term[F_EPOT]    += enercorr;
@@ -788,14 +783,10 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         wallcycle_start(wcycle, ewcCONSTR);
         dvdl_constr = 0;
         constrain(NULL, FALSE, FALSE, constr, &top->idef,
-                  inputrec, NULL, cr, count, 0, 1.0, mdatoms,
+                  inputrec, cr, count, 0, 1.0, mdatoms,
                   ems->s.x, ems->f, ems->f, fr->bMolPBC, ems->s.box,
                   ems->s.lambda[efptBONDED], &dvdl_constr,
-                  NULL, &shake_vir, nrnb, econqForceDispl, FALSE, 0, 0);
-        if (fr->bSepDVDL && fplog)
-        {
-            gmx_print_sepdvdl(fplog, "Constraints", t, dvdl_constr);
-        }
+                  NULL, &shake_vir, nrnb, econqForceDispl);
         enerd->term[F_DVDL_CONSTR] += dvdl_constr;
         m_add(force_vir, shake_vir, vir);
         wallcycle_stop(wcycle, ewcCONSTR);
@@ -975,8 +966,8 @@ double do_cg(FILE *fplog, t_commrec *cr,
     rvec             *f;
     gmx_global_stat_t gstat;
     t_graph          *graph;
-    rvec             *f_global, *p, *sf, *sfm;
-    double            gpa, gpb, gpc, tmp, sum[2], minstep;
+    rvec             *f_global, *p, *sf;
+    double            gpa, gpb, gpc, tmp, minstep;
     real              fnormn;
     real              stepsize;
     real              a, b, c, beta = 0.0;
@@ -990,7 +981,6 @@ double do_cg(FILE *fplog, t_commrec *cr,
     int               number_steps, neval = 0, nstcg = inputrec->nstcgsteep;
     gmx_mdoutf_t      outf;
     int               i, m, gf, step, nminstep;
-    real              terminate = 0;
 
     step = 0;
 
@@ -1049,16 +1039,17 @@ double do_cg(FILE *fplog, t_commrec *cr,
 
     if (MASTER(cr))
     {
+        double sqrtNumAtoms = sqrt(static_cast<double>(state_global->natoms));
         fprintf(stderr, "   F-max             = %12.5e on atom %d\n",
                 s_min->fmax, s_min->a_fmax+1);
         fprintf(stderr, "   F-Norm            = %12.5e\n",
-                s_min->fnorm/sqrt(state_global->natoms));
+                s_min->fnorm/sqrtNumAtoms);
         fprintf(stderr, "\n");
         /* and copy to the log file too... */
         fprintf(fplog, "   F-max             = %12.5e on atom %d\n",
                 s_min->fmax, s_min->a_fmax+1);
         fprintf(fplog, "   F-Norm            = %12.5e\n",
-                s_min->fnorm/sqrt(state_global->natoms));
+                s_min->fnorm/sqrtNumAtoms);
         fprintf(fplog, "\n");
     }
     /* Start the loop over CG steps.
@@ -1263,7 +1254,7 @@ double do_cg(FILE *fplog, t_commrec *cr,
          * the line minimum. We try to interpolate based on the derivative at the endpoints,
          * and only continue until we find a lower value. In most cases this means 1-2 iterations.
          *
-         * I also have a safeguard for potentially really patological functions so we never
+         * 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.
@@ -1399,7 +1390,6 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 }
                 swap_em_state(s_b, s_c);
                 gpb = gpc;
-                b   = c;
             }
             else
             {
@@ -1410,7 +1400,6 @@ double do_cg(FILE *fplog, t_commrec *cr,
                 }
                 swap_em_state(s_b, s_a);
                 gpb = gpa;
-                b   = a;
             }
 
         }
@@ -1423,7 +1412,6 @@ double do_cg(FILE *fplog, t_commrec *cr,
             }
             swap_em_state(s_b, s_c);
             gpb = gpc;
-            b   = c;
         }
 
         /* new search direction */
@@ -1459,8 +1447,9 @@ double do_cg(FILE *fplog, t_commrec *cr,
         {
             if (bVerbose)
             {
+                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, s_min->epot, s_min->fnorm/sqrt(state_global->natoms),
+                        step, s_min->epot, s_min->fnorm/sqrtNumAtoms,
                         s_min->fmax, s_min->a_fmax+1);
             }
             /* Store the new (lower) energies */
@@ -1553,10 +1542,11 @@ double do_cg(FILE *fplog, t_commrec *cr,
                   top_global, inputrec, step,
                   s_min, state_global, f_global);
 
-    fnormn = s_min->fnorm/sqrt(state_global->natoms);
 
     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);
         print_converged(fplog, CG, inputrec->em_tol, step, converged, number_steps,
@@ -1604,14 +1594,14 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     t_graph           *graph;
     rvec              *f_global;
     int                ncorr, nmaxcorr, point, cp, neval, nminstep;
-    double             stepsize, gpa, gpb, gpc, tmp, minstep;
+    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               a, b, c, maxdelta, delta;
     real               diag, Epot0, Epot, EpotA, EpotB, EpotC;
     real               dgdx, dgdg, sq, yr, beta;
     t_mdebin          *mdebin;
-    gmx_bool           converged, first;
+    gmx_bool           converged;
     rvec               mu_tot;
     real               fnorm, fmax;
     gmx_bool           do_log, do_ene, do_x, do_f, foundlower, *frozen;
@@ -1620,8 +1610,6 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
     gmx_mdoutf_t       outf;
     int                i, k, m, n, nfmax, gf, step;
     int                mdof_flags;
-    /* not used */
-    real               terminate;
 
     if (PAR(cr))
     {
@@ -1767,18 +1755,22 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
     if (MASTER(cr))
     {
+        double sqrtNumAtoms = sqrt(static_cast<double>(state->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/sqrt(state->natoms));
+        fprintf(stderr, "   F-Norm            = %12.5e\n", 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/sqrt(state->natoms));
+        fprintf(fplog, "   F-Norm            = %12.5e\n", fnorm/sqrtNumAtoms);
         fprintf(fplog, "\n");
     }
 
+    // Point is an index to the memory of search directions, where 0 is the first one.
     point = 0;
+
+    // Set initial search direction to the force (-gradient), or 0 for frozen particles.
     for (i = 0; i < n; i++)
     {
         if (!frozen[i])
@@ -1791,8 +1783,11 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         }
     }
 
+    // Stepsize will be modified during the search, and actually it is not critical
+    // (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;
-    converged = FALSE;
 
     /* Start the loop over BFGS steps.
      * Each successful step is counted, and we continue until
@@ -1831,16 +1826,16 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
         /* Do the linesearching in the direction dx[point][0..(n-1)] */
 
-        /* pointer to current direction - point=0 first time here */
+        /* make s a pointer to current search direction - point=0 first time we get here */
         s = dx[point];
 
-        /* calculate line gradient */
+        // calculate line gradient in position A
         for (gpa = 0, i = 0; i < n; i++)
         {
             gpa -= s[i]*ff[i];
         }
 
-        /* Calculate minimum allowed stepsize, before the average (norm)
+        /* Calculate minimum allowed stepsize along the line, before the average (norm)
          * relative change in coordinate is smaller than precision
          */
         for (minstep = 0, i = 0; i < n; i++)
@@ -1861,7 +1856,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             break;
         }
 
-        /* Store old forces and coordinates */
+        // Before taking any steps along the line, store the old position
         for (i = 0; i < n; i++)
         {
             lastx[i] = xx[i];
@@ -1869,15 +1864,14 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         }
         Epot0 = Epot;
 
-        first = TRUE;
-
         for (i = 0; i < n; i++)
         {
             xa[i] = xx[i];
         }
 
         /* Take a step downhill.
-         * In theory, we should minimize the function along this direction.
+         * In theory, we should find the actual minimum of the function in this
+         * direction, somewhere along the line.
          * That is quite possible, but it turns out to take 5-10 function evaluations
          * for each line. However, we dont really need to find the exact minimum -
          * it is much better to start a new BFGS step in a modified direction as soon
@@ -1885,25 +1879,36 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
          *
          * In practice, we just try to take a single step.
          * If it worked (i.e. lowered the energy), we increase the stepsize but
-         * the continue straight to the next BFGS step without trying to find any minimum.
+         * continue straight to the next BFGS step without trying to find any minimum,
+         * i.e. we change the search direction too. If the line was smooth, it is
+         * likely we are in a smooth region, and then it makes sense to take longer
+         * steps in the modified search direction too.
+         *
          * If it didn't work (higher energy), there must be a minimum somewhere between
-         * the old position and the new one.
+         * the old position and the new one. Then we need to start by finding a lower
+         * value before we change search direction. Since the energy was apparently
+         * quite rough, we need to decrease the step size.
          *
          * Due to the finite numerical accuracy, it turns out that it is a good idea
-         * to even accept a SMALL increase in energy, if the derivative is still downhill.
+         * to accept a SMALL increase in energy, if the derivative is still downhill.
          * This leads to lower final energies in the tests I've done. / Erik
          */
-        foundlower = FALSE;
+
+        // State "A" is the first position along the line.
+        // reference position along line is initially zero
         EpotA      = Epot0;
         a          = 0.0;
-        c          = a + stepsize; /* reference position along line is zero */
 
-        /* Check stepsize first. We do not allow displacements
-         * larger than emstep.
-         */
+        // Check stepsize first. We do not allow displacements
+        // larger than emstep.
+        //
         do
         {
+            // Pick a new position C by adding stepsize to A.
             c        = a + stepsize;
+
+            // Calculate what the largest change in any individual coordinate
+            // would be (translation along line * gradient along line)
             maxdelta = 0;
             for (i = 0; i < n; i++)
             {
@@ -1913,6 +1918,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                     maxdelta = delta;
                 }
             }
+            // If any displacement is larger than the stepsize limit, reduce the step
             if (maxdelta > inputrec->em_stepsize)
             {
                 stepsize *= 0.1;
@@ -1920,14 +1926,14 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         }
         while (maxdelta > inputrec->em_stepsize);
 
-        /* Take a trial step */
+        // Take a trial step and move the coordinate array xc[] to position C
         for (i = 0; i < n; i++)
         {
             xc[i] = lastx[i] + c*s[i];
         }
 
         neval++;
-        /* Calculate energy for the trial step */
+        // Calculate energy for the trial step in position C
         ems.s.x = (rvec *)xc;
         ems.f   = (rvec *)fc;
         evaluate_energy(fplog, cr,
@@ -1937,7 +1943,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                         mu_tot, enerd, vir, pres, step, FALSE);
         EpotC = ems.epot;
 
-        /* Calc derivative along line */
+        // Calc line gradient in position C
         for (gpc = 0, i = 0; i < n; i++)
         {
             gpc -= s[i]*fc[i]; /* f is negative gradient, thus the sign */
@@ -1948,59 +1954,53 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             gmx_sumd(1, &gpc, cr);
         }
 
-        /* This is the max amount of increase in energy we tolerate */
+        // 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);
 
-        /* Accept the step if the energy is lower, or if it is not significantly higher
-         * and the line derivative is still negative.
-         */
+        // 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)))
         {
+            // 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
+            // search direction instead, which will be much more efficient than continuing
+            // 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;
-            /* Great, we found a better energy. Increase step for next iteration
-             * if we are still going down, decrease it otherwise
-             */
-            if (gpc < 0)
-            {
-                stepsize *= 1.618034; /* The golden section */
-            }
-            else
-            {
-                stepsize *= 0.618034; /* 1/golden section */
-            }
+            fnorm      = ems.fnorm;
         }
         else
         {
-            /* New energy is the same or higher. We will have to do some work
-             * to find a smaller value in the interval. Take smaller step next time!
-             */
+            // If we got here, the energy is NOT lower in point C, i.e. it will be the same
+            // or higher than in point A. In this case it is pointless to move to point C,
+            // so we will have to do more iterations along the same line to find a smaller
+            // value in the interval [A=0.0,C].
+            // Here, A is still 0.0, but that will change when we do a search in the interval
+            // [0.0,C] below. That search we will do by interpolation or bisection rather
+            // than with the stepsize, so no need to modify it. For the next search direction
+            // it will be reset to 1/fnorm anyway.
             foundlower = FALSE;
-            stepsize  *= 0.618034;
         }
 
-        /* OK, if we didn't find a lower value we will have to locate one now - there must
-         * be one in the interval [a=0,c].
-         * The same thing is valid here, though: Don't spend dozens of iterations to find
-         * the line minimum. We try to interpolate based on the derivative at the endpoints,
-         * and only continue until we find a lower value. In most cases this means 1-2 iterations.
-         *
-         * I also have a safeguard for potentially really patological 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.
-         */
-
         if (!foundlower)
         {
-
+            // OK, if we didn't find a lower value we will have to locate one now - there must
+            // be one in the interval [a,c].
+            // The same thing is valid here, though: Don't spend dozens of iterations to find
+            // the line minimum. We try to interpolate based on the derivative at the endpoints,
+            // and only continue until we find a lower value. In most cases this means 1-2 iterations.
+            // 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;
             do
             {
-                /* Select a new trial point.
-                 * If the derivatives at points a & c have different sign we interpolate to zero,
-                 * otherwise just do a bisection.
-                 */
-
+                // Select a new trial point B in the interval [A,C].
+                // If the derivatives at points a & c have different sign we interpolate to zero,
+                // otherwise just do a bisection since there might be multiple minima/maxima
+                // inside the interval.
                 if (gpa < 0 && gpc > 0)
                 {
                     b = a + gpa*(a-c)/(gpc-gpa);
@@ -2018,14 +2018,14 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                     b = 0.5*(a+c);
                 }
 
-                /* Take a trial step */
+                // Take a trial step to point B
                 for (i = 0; i < n; i++)
                 {
                     xb[i] = lastx[i] + b*s[i];
                 }
 
                 neval++;
-                /* Calculate energy for the trial step */
+                // Calculate energy for the trial step in point B
                 ems.s.x = (rvec *)xb;
                 ems.f   = (rvec *)fb;
                 evaluate_energy(fplog, cr,
@@ -2034,9 +2034,9 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                                 vsite, constr, fcd, graph, mdatoms, fr,
                                 mu_tot, enerd, vir, pres, step, FALSE);
                 EpotB = ems.epot;
-
                 fnorm = ems.fnorm;
 
+                // Calculate gradient in point B
                 for (gpb = 0, i = 0; i < n; i++)
                 {
                     gpb -= s[i]*fb[i]; /* f is negative gradient, thus the sign */
@@ -2048,7 +2048,8 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                     gmx_sumd(1, &gpb, cr);
                 }
 
-                /* Keep one of the intervals based on the value of the derivative at the new point */
+                // Keep one of the intervals [A,B] or [B,C] based on the value of the derivative
+                // at the new point B, and rename the endpoints of this new interval A and C.
                 if (gpb > 0)
                 {
                     /* Replace c endpoint with b */
@@ -2125,7 +2126,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                     xx[i] = xc[i];
                     ff[i] = fc[i];
                 }
-                stepsize = c;
+                step_taken = c;
             }
             else
             {
@@ -2136,7 +2137,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                     xx[i] = xa[i];
                     ff[i] = fa[i];
                 }
-                stepsize = a;
+                step_taken = a;
             }
 
         }
@@ -2150,7 +2151,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
                 xx[i] = xc[i];
                 ff[i] = fc[i];
             }
-            stepsize = c;
+            step_taken = c;
         }
 
         /* Update the memory information, and calculate a new
@@ -2166,7 +2167,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         for (i = 0; i < n; i++)
         {
             dg[point][i]  = lastf[i]-ff[i];
-            dx[point][i] *= stepsize;
+            dx[point][i] *= step_taken;
         }
 
         dgdg = 0;
@@ -2259,8 +2260,6 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             }
         }
 
-        stepsize = 1.0;
-
         /* Test whether the convergence criterion is met */
         get_f_norm_max(cr, &(inputrec->opts), mdatoms, f, &fnorm, &fmax, &nfmax);
 
@@ -2269,8 +2268,9 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
         {
             if (bVerbose)
             {
+                double sqrtNumAtoms = sqrt(static_cast<double>(state->natoms));
                 fprintf(stderr, "\rStep %d, Epot=%12.6e, Fnorm=%9.3e, Fmax=%9.3e (atom %d)\n",
-                        step, Epot, fnorm/sqrt(state->natoms), fmax, nfmax+1);
+                        step, Epot, fnorm/sqrtNumAtoms, fmax, nfmax+1);
             }
             /* Store the new (lower) energies */
             upd_mdebin(mdebin, FALSE, FALSE, (double)step,
@@ -2293,10 +2293,12 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
             IMD_send_positions(inputrec->imd);
         }
 
+        // Reset stepsize in we are doing more iterations
+        stepsize = 1.0/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);
 
     } /* End of the loop */
@@ -2354,10 +2356,11 @@ double do_lbfgs(FILE *fplog, t_commrec *cr,
 
     if (MASTER(cr))
     {
+        double sqrtNumAtoms = sqrt(static_cast<double>(state->natoms));
         print_converged(stderr, LBFGS, inputrec->em_tol, step, converged,
-                        number_steps, Epot, fmax, nfmax, fnorm/sqrt(state->natoms));
+                        number_steps, Epot, fmax, nfmax, fnorm/sqrtNumAtoms);
         print_converged(fplog, LBFGS, inputrec->em_tol, step, converged,
-                        number_steps, Epot, fmax, nfmax, fnorm/sqrt(state->natoms));
+                        number_steps, Epot, fmax, nfmax, fnorm/sqrtNumAtoms);
 
         fprintf(fplog, "\nPerformed %d energy evaluations in total.\n", neval);
     }
@@ -2400,7 +2403,7 @@ double do_steep(FILE *fplog, t_commrec *cr,
     rvec             *f;
     gmx_global_stat_t gstat;
     t_graph          *graph;
-    real              stepsize, constepsize;
+    real              stepsize;
     real              ustep, fnormn;
     gmx_mdoutf_t      outf;
     t_mdebin         *mdebin;
@@ -2410,8 +2413,6 @@ double do_steep(FILE *fplog, t_commrec *cr,
     int               nsteps;
     int               count          = 0;
     int               steps_accepted = 0;
-    /* not used */
-    real              terminate = 0;
 
     s_min = init_em_state();
     s_try = init_em_state();
@@ -2478,7 +2479,7 @@ double do_steep(FILE *fplog, t_commrec *cr,
 
         if (count == 0)
         {
-            s_min->epot = s_try->epot + 1;
+            s_min->epot = s_try->epot;
         }
 
         /* Print it if necessary  */
@@ -2488,10 +2489,10 @@ double do_steep(FILE *fplog, t_commrec *cr,
             {
                 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,
-                        (s_try->epot < s_min->epot) ? '\n' : '\r');
+                        ( (count == 0) || (s_try->epot < s_min->epot) ) ? '\n' : '\r');
             }
 
-            if (s_try->epot < s_min->epot)
+            if ( (count == 0) || (s_try->epot < s_min->epot) )
             {
                 /* Store the new (lower) energies  */
                 upd_mdebin(mdebin, FALSE, FALSE, (double)count,
@@ -2591,10 +2592,11 @@ double do_steep(FILE *fplog, t_commrec *cr,
                   top_global, inputrec, count,
                   s_min, state_global, f_global);
 
-    fnormn = s_min->fnorm/sqrt(state_global->natoms);
-
     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);
         print_converged(fplog, SD, inputrec->em_tol, count, bDone, nsteps,
@@ -2643,8 +2645,6 @@ double do_nm(FILE *fplog, t_commrec *cr,
     rvec                *f;
     gmx_global_stat_t    gstat;
     t_graph             *graph;
-    real                 t, t0, lambda, lam0;
-    gmx_bool             bNS;
     tensor               vir, pres;
     rvec                 mu_tot;
     rvec                *fneg, *dfdx;
@@ -2658,7 +2658,7 @@ double do_nm(FILE *fplog, t_commrec *cr,
     int        i, j, k, row, col;
     real       der_range = 10.0*sqrt(GMX_REAL_EPS);
     real       x_min;
-    real       fnorm, fmax;
+    bool       bIsMaster = MASTER(cr);
 
     if (constr != NULL)
     {
@@ -2679,7 +2679,7 @@ double do_nm(FILE *fplog, t_commrec *cr,
     snew(dfdx, natoms);
 
 #ifndef GMX_DOUBLE
-    if (MASTER(cr))
+    if (bIsMaster)
     {
         fprintf(stderr,
                 "NOTE: This version of Gromacs has been compiled in single precision,\n"
@@ -2711,7 +2711,7 @@ double do_nm(FILE *fplog, t_commrec *cr,
         bSparse = TRUE;
     }
 
-    if (MASTER(cr))
+    if (bIsMaster)
     {
         sz = DIM*top_global->natoms;
 
@@ -2728,12 +2728,6 @@ double do_nm(FILE *fplog, t_commrec *cr,
         }
     }
 
-    /* Initial values */
-    t0           = inputrec->init_t;
-    lam0         = inputrec->fepvals->init_lambda;
-    t            = t0;
-    lambda       = lam0;
-
     init_nrnb(nrnb);
 
     where();
@@ -2744,7 +2738,7 @@ double do_nm(FILE *fplog, t_commrec *cr,
     /* fudge nr of steps to nr of atoms */
     inputrec->nsteps = natoms*2;
 
-    if (MASTER(cr))
+    if (bIsMaster)
     {
         fprintf(stderr, "starting normal mode calculation '%s'\n%d steps.\n\n",
                 *(top_global->name), (int)inputrec->nsteps);
@@ -2827,7 +2821,7 @@ double do_nm(FILE *fplog, t_commrec *cr,
                 }
             }
 
-            if (!MASTER(cr))
+            if (!bIsMaster)
             {
 #ifdef GMX_MPI
 #ifdef GMX_DOUBLE
@@ -2884,15 +2878,15 @@ double do_nm(FILE *fplog, t_commrec *cr,
             }
         }
         /* write progress */
-        if (MASTER(cr) && bVerbose)
+        if (bIsMaster && bVerbose)
         {
             fprintf(stderr, "\rFinished step %d out of %d",
-                    min(atom+nnodes, natoms), natoms);
+                    std::min(atom+nnodes, natoms), natoms);
             fflush(stderr);
         }
     }
 
-    if (MASTER(cr))
+    if (bIsMaster)
     {
         fprintf(stderr, "\n\nWriting Hessian...\n");
         gmx_mtxio_write(ftp2fn(efMTX, nfile, fnm), sz, sz, full_matrix, sparse_matrix);
similarity index 89%
rename from src/gromacs/legacyheaders/types/nb_verlet.h
rename to src/gromacs/mdlib/nb_verlet.h
index aaeeaa8b3616d2603c4e84dd64d90cdc96e5632a..c435262ce7697a80ee36cd4cc699e40fa1e5d48e 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,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.
 #ifndef NB_VERLET_H
 #define NB_VERLET_H
 
-#include "nbnxn_pairlist.h"
-#include "nbnxn_cuda_types_ext.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
-/*! Nonbonded NxN kernel types: plain C, CPU SIMD, GPU CUDA, GPU emulation */
+/** Nonbonded NxN kernel types: plain C, CPU SIMD, GPU CUDA, GPU emulation */
 typedef enum
 {
     nbnxnkNotSet = 0,
@@ -56,7 +56,7 @@ typedef enum
     nbnxnkNR
 } nbnxn_kernel_type;
 
-/*! Return a string indentifying the kernel type */
+/** Return a string indentifying the kernel type */
 const char *lookup_nbnxn_kernel_name(int kernel_type);
 
 enum {
@@ -88,7 +88,7 @@ enum {
     enbvClearFNo, enbvClearFYes
 };
 
-typedef struct {
+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 */
@@ -96,7 +96,7 @@ typedef struct {
 } nonbonded_verlet_group_t;
 
 /* non-bonded data structure with Verlet-type cut-off */
-typedef struct {
+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 */
@@ -107,6 +107,10 @@ typedef struct {
                                                  used for the 8x8x8 CUDA kernels    */
 } nonbonded_verlet_t;
 
+/*! \brief Getter for bUseGPU */
+gmx_bool
+usingGpu(nonbonded_verlet_t *nbv);
+
 #ifdef __cplusplus
 }
 #endif
index d271a8ce7a165392094f12f730b97ce1d9b661e1..c20dfb2e54bc18f313c3f002d2600154f25b472e 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_atomdata.h"
+
+#include "config.h"
 
+#include <assert.h>
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
-#include <assert.h>
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "nbnxn_consts.h"
-#include "nbnxn_internal.h"
-#include "nbnxn_atomdata.h"
-#include "nbnxn_search.h"
-#include "gromacs/utility/gmxomp.h"
-#include "gmx_omp_nthreads.h"
+
 #include "thread_mpi/atomic.h"
 
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_internal.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
+
 /* Default nbnxn allocation routine, allocates NBNXN_MEM_ALIGN byte aligned */
 void nbnxn_alloc_aligned(void **ptr, size_t nbytes)
 {
@@ -1518,7 +1524,7 @@ static void nbnxn_atomdata_add_nbat_f_to_f_treereduce(const nbnxn_atomdata_t *nb
                     i0 =  b   *NBNXN_BUFFERFLAG_SIZE*nbat->fstride;
                     i1 = (b+1)*NBNXN_BUFFERFLAG_SIZE*nbat->fstride;
 
-                    if ((flags->flag[b] & (1ULL<<index[1])) || group_size > 2)
+                    if (bitmask_is_set(flags->flag[b], index[1]) || group_size > 2)
                     {
 #ifdef GMX_NBNXN_SIMD
                         nbnxn_atomdata_reduce_reals_simd
@@ -1526,11 +1532,11 @@ static void nbnxn_atomdata_add_nbat_f_to_f_treereduce(const nbnxn_atomdata_t *nb
                         nbnxn_atomdata_reduce_reals
 #endif
                             (nbat->out[index[0]].f,
-                            (flags->flag[b] & (1ULL<<index[0])) || group_size > 2,
+                            bitmask_is_set(flags->flag[b], index[0]) || group_size > 2,
                             &(nbat->out[index[1]].f), 1, i0, i1);
 
                     }
-                    else if (!(flags->flag[b] & (1ULL<<index[0])))
+                    else if (!bitmask_is_set(flags->flag[b], index[0]))
                     {
                         nbnxn_atomdata_clear_reals(nbat->out[index[0]].f,
                                                    i0, i1);
@@ -1570,7 +1576,7 @@ static void nbnxn_atomdata_add_nbat_f_to_f_stdreduce(const nbnxn_atomdata_t *nba
             nfptr = 0;
             for (out = 1; out < nbat->nout; out++)
             {
-                if (flags->flag[b] & (1U<<out))
+                if (bitmask_is_set(flags->flag[b], out))
                 {
                     fptr[nfptr++] = nbat->out[out].f;
                 }
@@ -1583,11 +1589,11 @@ static void nbnxn_atomdata_add_nbat_f_to_f_stdreduce(const nbnxn_atomdata_t *nba
                 nbnxn_atomdata_reduce_reals
 #endif
                     (nbat->out[0].f,
-                    flags->flag[b] & (1U<<0),
+                    bitmask_is_set(flags->flag[b], 0),
                     fptr, nfptr,
                     i0, i1);
             }
-            else if (!(flags->flag[b] & (1U<<0)))
+            else if (!bitmask_is_set(flags->flag[b], 0))
             {
                 nbnxn_atomdata_clear_reals(nbat->out[0].f,
                                            i0, i1);
index 5855e5b50d1e5845a514553b85ffb0866da850d3..f3f50c66343b021dd6c2ddd70c19194226004767 100644 (file)
@@ -36,7 +36,8 @@
 #ifndef _nbnxn_atomdata_h
 #define _nbnxn_atomdata_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 #ifdef __cplusplus
 extern "C" {
index f5bd3d01ab096ef770fb074dcf9e6af423111ac9..719e47b8f4f6c99d94b70fc2f74cbe96d9e57466 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, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and 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 @@ extern "C" {
 #define NBNXN_GPU_CLUSTER_SIZE         8
 
 /* With GPU kernels we group cluster pairs in 4 to optimize memory usage.
- * To change this, also change nbnxn_cj4_t in include/types/nbnxn_pairlist.h.
+ * To change this, also change nbnxn_cj4_t in gromacs/mdlib/nbnxn_pairlist.h.
  */
 #define NBNXN_GPU_JGROUP_SIZE       4
 #define NBNXN_GPU_JGROUP_SIZE_2LOG  2
index 48a0712afa63f2563243dfed0dc680281bcc4d8e..2d5636b865129adf4301a6de1f7044f1ed15cc98 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 
 if(GMX_GPU)
     file(GLOB CUDA_NB_SOURCES *.cu)
-    CUDA_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-    CUDA_ADD_LIBRARY(nbnxn_cuda STATIC ${CUDA_NB_SOURCES}
-            OPTIONS
-            RELWITHDEBINFO -g
-            DEBUG -g -D_DEBUG_=1)
-    target_link_libraries(nbnxn_cuda cuda_tools)
+    set(MDLIB_SOURCES ${MDLIB_SOURCES} ${CUDA_NB_SOURCES} PARENT_SCOPE)
 endif()
index 29af9eb52f937c73df36f5b037f7bee99a8cab72..9ee57c656da43a53753988d19d5df8a34fab331a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_cuda.h"
+
+#include "config.h"
 
-#include <stdlib.h>
 #include <assert.h>
+#include <stdlib.h>
 
 #if defined(_MSVC)
 #include <limits>
 
 #include <cuda.h>
 
-#include "types/simple.h"
-#include "types/nbnxn_pairlist.h"
-#include "types/nb_verlet.h"
-#include "types/ishift.h"
-#include "types/force_flags.h"
-#include "../nbnxn_consts.h"
-
 #ifdef TMPI_ATOMICS
 #include "thread_mpi/atomic.h"
 #endif
 
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/cstringutil.h"
+
 #include "nbnxn_cuda_types.h"
-#include "../../gmxlib/cuda_tools/cudautils.cuh"
-#include "nbnxn_cuda.h"
-#include "nbnxn_cuda_data_mgmt.h"
 
 #if defined TEXOBJ_SUPPORTED && __CUDA_ARCH__ >= 300
 #define USE_TEXOBJ
@@ -78,8 +80,38 @@ texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
 #define NCL_PER_SUPERCL         (NBNXN_GPU_NCLUSTER_PER_SUPERCLUSTER)
 #define CL_SIZE                 (NBNXN_GPU_CLUSTER_SIZE)
 
+/* NTHREAD_Z controls the number of j-clusters processed concurrently on NTHREAD_Z
+ * warp-pairs per block.
+ *
+ * - On CC 2.0-3.5, 5.0, and 5.2, NTHREAD_Z == 1, translating to 64 th/block with 16
+ * blocks/multiproc, is the fastest even though this setup gives low occupancy.
+ * NTHREAD_Z > 1 results in excessive register spilling unless the minimum blocks
+ * per multiprocessor is reduced proportionally to get the original number of max
+ * threads in flight (and slightly lower performance).
+ * - On CC 3.7 there are enough registers to double the number of threads; using
+ * NTHREADS_Z == 2 is fastest with 16 blocks (TODO: test with RF and other kernels
+ * with low-register use).
+ *
+ * Note that the current kernel implementation only supports NTHREAD_Z > 1 with
+ * shuffle-based reduction, hence CC >= 3.0.
+ */
+
+/* Kernel launch bounds as function of NTHREAD_Z.
+ * - CC 3.5/5.2: NTHREAD_Z=1, (64, 16) bounds
+ * - CC 3.7:     NTHREAD_Z=2, (128, 16) bounds
+ */
+#if __CUDA_ARCH__ == 370
+#define NTHREAD_Z           (2)
+#define MIN_BLOCKS_PER_MP   (16)
+#else
+#define NTHREAD_Z           (1)
+#define MIN_BLOCKS_PER_MP   (16)
+#endif
+#define THREADS_PER_BLOCK   (CL_SIZE*CL_SIZE*NTHREAD_Z)
+
+
 /***** The kernels come here *****/
-#include "nbnxn_cuda_kernel_utils.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh"
 
 /* Top-level kernel generation: will generate through multiple inclusion the
  * following flavors for all kernels:
@@ -89,19 +121,19 @@ texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
  * - force and energy output with pair list pruning.
  */
 /** Force only **/
-#include "nbnxn_cuda_kernels.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh"
 /** Force & energy **/
 #define CALC_ENERGIES
-#include "nbnxn_cuda_kernels.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh"
 #undef CALC_ENERGIES
 
 /*** Pair-list pruning kernels ***/
 /** Force only **/
 #define PRUNE_NBL
-#include "nbnxn_cuda_kernels.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh"
 /** Force & energy **/
 #define CALC_ENERGIES
-#include "nbnxn_cuda_kernels.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh"
 #undef CALC_ENERGIES
 #undef PRUNE_NBL
 
@@ -239,7 +271,7 @@ static inline nbnxn_cu_kfunc_ptr_t select_nbnxn_kernel(int  eeltype,
 }
 
 /*! Calculates the amount of shared memory required by the CUDA kernel in use. */
-static inline int calc_shmem_required()
+static inline int calc_shmem_required(const int num_threads_z)
 {
     int shmem;
 
@@ -247,8 +279,8 @@ static inline int calc_shmem_required()
     /* NOTE: with the default kernel on sm3.0 we need shmem only for pre-loading */
     /* i-atom x+q in shared memory */
     shmem  = NCL_PER_SUPERCL * CL_SIZE * sizeof(float4);
-    /* cj in shared memory, for both warps separately */
-    shmem += 2 * NBNXN_GPU_JGROUP_SIZE * sizeof(int);
+    /* cj in shared memory, for each warp separately */
+    shmem += num_threads_z * 2 * NBNXN_GPU_JGROUP_SIZE * sizeof(int);
 #ifdef IATYPE_SHMEM
     /* i-atom types in shared memory */
     shmem += NCL_PER_SUPERCL * CL_SIZE * sizeof(int);
@@ -366,19 +398,30 @@ void nbnxn_cuda_launch_kernel(nbnxn_cuda_ptr_t        cu_nb,
                                     bCalcEner,
                                     plist->bDoPrune || always_prune);
 
-    /* kernel launch config */
+    /* 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 = 1;
+    if (cu_nb->dev_info->prop.major == 3 && cu_nb->dev_info->prop.minor == 7)
+    {
+        num_threads_z = 2;
+    }
     nblock    = calc_nb_kernel_nblock(plist->nsci, cu_nb->dev_info);
-    dim_block = dim3(CL_SIZE, CL_SIZE, 1);
+    dim_block = dim3(CL_SIZE, CL_SIZE, num_threads_z);
     dim_grid  = dim3(nblock, 1, 1);
-    shmem     = calc_shmem_required();
+    shmem     = calc_shmem_required(num_threads_z);
 
     if (debug)
     {
         fprintf(debug, "GPU launch configuration:\n\tThread block: %dx%dx%d\n\t"
-                "Grid: %dx%d\n\t#Super-clusters/clusters: %d/%d (%d)\n",
+                "\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, plist->nsci*NCL_PER_SUPERCL,
-                NCL_PER_SUPERCL, plist->na_c);
+                NCL_PER_SUPERCL, plist->na_c,
+                shmem);
     }
 
     nb_kernel<<< dim_grid, dim_block, shmem, stream>>> (*adat, *nbp, *plist, bCalcFshift);
@@ -714,18 +757,18 @@ void nbnxn_cuda_set_cacheconfig(cuda_dev_info_t *devinfo)
             if (devinfo->prop.major >= 3)
             {
                 /* Default kernel on sm 3.x 48/16 kB Shared/L1 */
-                stat = cudaFuncSetCacheConfig(nb_kfunc_ener_prune_ptr[i][j], cudaFuncCachePreferShared);
-                stat = cudaFuncSetCacheConfig(nb_kfunc_ener_noprune_ptr[i][j], cudaFuncCachePreferShared);
-                stat = cudaFuncSetCacheConfig(nb_kfunc_noener_prune_ptr[i][j], cudaFuncCachePreferShared);
+                cudaFuncSetCacheConfig(nb_kfunc_ener_prune_ptr[i][j], cudaFuncCachePreferShared);
+                cudaFuncSetCacheConfig(nb_kfunc_ener_noprune_ptr[i][j], cudaFuncCachePreferShared);
+                cudaFuncSetCacheConfig(nb_kfunc_noener_prune_ptr[i][j], cudaFuncCachePreferShared);
                 stat = cudaFuncSetCacheConfig(nb_kfunc_noener_noprune_ptr[i][j], cudaFuncCachePreferShared);
             }
             else
             {
                 /* On Fermi prefer L1 gives 2% higher performance */
                 /* Default kernel on sm_2.x 16/48 kB Shared/L1 */
-                stat = cudaFuncSetCacheConfig(nb_kfunc_ener_prune_ptr[i][j], cudaFuncCachePreferL1);
-                stat = cudaFuncSetCacheConfig(nb_kfunc_ener_noprune_ptr[i][j], cudaFuncCachePreferL1);
-                stat = cudaFuncSetCacheConfig(nb_kfunc_noener_prune_ptr[i][j], cudaFuncCachePreferL1);
+                cudaFuncSetCacheConfig(nb_kfunc_ener_prune_ptr[i][j], cudaFuncCachePreferL1);
+                cudaFuncSetCacheConfig(nb_kfunc_ener_noprune_ptr[i][j], cudaFuncCachePreferL1);
+                cudaFuncSetCacheConfig(nb_kfunc_noener_prune_ptr[i][j], cudaFuncCachePreferL1);
                 stat = cudaFuncSetCacheConfig(nb_kfunc_noener_noprune_ptr[i][j], cudaFuncCachePreferL1);
             }
             CU_RET_ERR(stat, "cudaFuncSetCacheConfig failed");
index 994738f627a94ba99c359e15041b37d702fdfb89..174a9054af9f902254ba00f56653e72f0cda62ad 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 NBNXN_CUDA_H
 #define NBNXN_CUDA_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
-#include "types/nbnxn_cuda_types_ext.h"
-#include "types/simple.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef GMX_GPU
 #define FUNC_TERM ;
 extern "C" {
 #endif
 
-/*! Launch asynchronously the nonbonded force calculations.
+struct nbnxn_atomdata_t;
+
+/*! \brief
+ * Launch asynchronously the nonbonded force calculations.
+ *
  *  This consists of the following (async) steps launched:
  *  - upload x and q;
  *  - upload shift vector;
@@ -61,29 +62,31 @@ extern "C" {
  *  The local and non-local interaction calculations are launched in two
  *  separate streams.
  */
-void nbnxn_cuda_launch_kernel(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
-                              const nbnxn_atomdata_t gmx_unused *nbdata,
-                              int                    gmx_unused  flags,
-                              int                    gmx_unused  iloc) FUNC_TERM
+void nbnxn_cuda_launch_kernel(nbnxn_cuda_ptr_t              gmx_unused  cu_nb,
+                              const struct nbnxn_atomdata_t gmx_unused *nbdata,
+                              int                           gmx_unused  flags,
+                              int                           gmx_unused  iloc) FUNC_TERM
 
-/*! Launch asynchronously the download of nonbonded forces from the GPU
- *  (and energies/shift forces if required).
+/*! \brief
+ * Launch asynchronously the download of nonbonded forces from the GPU
+ * (and energies/shift forces if required).
  */
-void nbnxn_cuda_launch_cpyback(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
-                               const nbnxn_atomdata_t gmx_unused *nbatom,
-                               int                    gmx_unused  flags,
-                               int                    gmx_unused  aloc) FUNC_TERM
+void nbnxn_cuda_launch_cpyback(nbnxn_cuda_ptr_t              gmx_unused  cu_nb,
+                               const struct nbnxn_atomdata_t gmx_unused *nbatom,
+                               int                           gmx_unused  flags,
+                               int                           gmx_unused  aloc) FUNC_TERM
 
-/*! Wait for the asynchronously launched nonbonded calculations and data
- *  transfers to finish.
+/*! \brief
+ * Wait for the asynchronously launched nonbonded calculations and data
+ * transfers to finish.
  */
-void nbnxn_cuda_wait_gpu(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
-                         const nbnxn_atomdata_t gmx_unused *nbatom,
-                         int                    gmx_unused  flags,
-                         int                    gmx_unused  aloc,
-                         real                   gmx_unused *e_lj,
-                         real                   gmx_unused *e_el,
-                         rvec                   gmx_unused *fshift) FUNC_TERM
+void nbnxn_cuda_wait_gpu(nbnxn_cuda_ptr_t              gmx_unused  cu_nb,
+                         const struct nbnxn_atomdata_t gmx_unused *nbatom,
+                         int                           gmx_unused  flags,
+                         int                           gmx_unused  aloc,
+                         real                          gmx_unused *e_lj,
+                         real                          gmx_unused *e_el,
+                         rvec                          gmx_unused *fshift) FUNC_TERM
 
 #ifdef __cplusplus
 }
index 23ccf848a295c9ab877c1a54f321c4128203575d..f1027b0344a164aded49e76cbba1edb5aa516907 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_cuda_data_mgmt.h"
+
+#include "config.h"
 
 #include <assert.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <cuda.h>
-
-#include "gmx_fatal.h"
+#include <cuda_profiler_api.h>
+
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/gmxlib/cuda_tools/pmalloc_cuda.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
+#include "gromacs/legacyheaders/gmx_detect_hardware.h"
+#include "gromacs/legacyheaders/tables.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "tables.h"
-#include "typedefs.h"
-#include "types/enums.h"
-#include "types/nb_verlet.h"
-#include "types/interaction_const.h"
-#include "types/force_flags.h"
-#include "../nbnxn_consts.h"
-#include "gmx_detect_hardware.h"
 
 #include "nbnxn_cuda_types.h"
-#include "../../gmxlib/cuda_tools/cudautils.cuh"
-#include "nbnxn_cuda_data_mgmt.h"
-#include "pmalloc_cuda.h"
-#include "gpu_utils.h"
-
-// Hack for release-5-0 only to avoid a common.h dependency in CUDA code,
-// which causes issues with some nvcc/boost combinations.
-// Solved with a larger-scale header refactoring in master.
-#ifndef GMX_UNUSED_VALUE
-#define GMX_UNUSED_VALUE(value) (void)value
-#endif
 
 static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */
 
@@ -431,10 +429,15 @@ 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_cuda_pme_loadbal_update_param(nbnxn_cuda_ptr_t           cu_nb,
-                                         const interaction_const_t *ic)
+void nbnxn_cuda_pme_loadbal_update_param(const nonbonded_verlet_t    *nbv,
+                                         const interaction_const_t   *ic)
 {
-    cu_nbparam_t *nbp = cu_nb->nbparam;
+    if (!nbv || nbv->grp[0].kernel_type != nbnxnk8x8x8_CUDA)
+    {
+        return;
+    }
+    nbnxn_cuda_ptr_t cu_nb = nbv->cu_nbv;
+    cu_nbparam_t    *nbp   = cu_nb->nbparam;
 
     set_cutoff_parameters(nbp, ic);
 
@@ -924,6 +927,14 @@ void nbnxn_cuda_free(nbnxn_cuda_ptr_t cu_nb)
     cu_plist_t      *plist, *plist_nl;
     cu_timers_t     *timers;
 
+    /* Stopping the nvidia profiler here allows us to eliminate the subsequent
+       uninitialization API calls from the trace. */
+    if (getenv("NVPROF_ID") != NULL)
+    {
+        stat = cudaProfilerStop();
+        CU_RET_ERR(stat, "cudaProfilerStop failed");
+    }
+
     if (cu_nb == NULL)
     {
         return;
@@ -1082,11 +1093,24 @@ wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t cu_nb)
     return (cu_nb != NULL && cu_nb->bDoTime) ? cu_nb->timings : NULL;
 }
 
-void nbnxn_cuda_reset_timings(nbnxn_cuda_ptr_t cu_nb)
+void nbnxn_cuda_reset_timings(nonbonded_verlet_t* nbv)
 {
-    if (cu_nb->bDoTime)
+    /* The NVPROF_ID environment variable is set by nvprof and indicates that
+       mdrun is executed in the CUDA profiler.
+       If nvprof was run is with "--profile-from-start off", the profiler will
+       be started here. This way we can avoid tracing the CUDA events from the
+       first part of the run. Starting the profiler again does nothing.
+     */
+    if (getenv("NVPROF_ID") != NULL)
+    {
+        cudaError_t stat;
+        stat = cudaProfilerStart();
+        CU_RET_ERR(stat, "cudaProfilerStart failed");
+    }
+
+    if (nbv->cu_nbv && nbv->cu_nbv->bDoTime)
     {
-        init_timings(cu_nb->timings);
+        init_timings(nbv->cu_nbv->timings);
     }
 }
 
similarity index 68%
rename from src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h
rename to src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h
index 62cdfe6ceab333a31b9d2aed1c067c769b5adb99..00cac2ee453c23bddb0e46452aa338140e608b2b 100644 (file)
 #ifndef NBNXN_CUDA_DATA_MGMT_H
 #define NBNXN_CUDA_DATA_MGMT_H
 
-#include "types/simple.h"
-#include "types/interaction_const.h"
-#include "types/nbnxn_cuda_types_ext.h"
-#include "types/hw_info.h"
-#include "types/nb_verlet.h"
+#include "config.h"
+
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef GMX_GPU
 #define FUNC_TERM ;
 extern "C" {
 #endif
 
-/*! Initializes the data structures related to CUDA nonbonded calculations. */
+struct nonbonded_verlet_group_t;
+struct nbnxn_pairlist_t;
+struct nbnxn_atomdata_t;
+
+/** Initializes the data structures related to CUDA nonbonded calculations. */
 FUNC_QUALIFIER
 void nbnxn_cuda_init(FILE gmx_unused                 *fplog,
                      nbnxn_cuda_ptr_t gmx_unused     *p_cu_nb,
@@ -64,43 +69,43 @@ void nbnxn_cuda_init(FILE gmx_unused                 *fplog,
                      /* true of both local and non-local are don on GPU */
                      gmx_bool gmx_unused              bLocalAndNonlocal) FUNC_TERM
 
-/*! Initializes simulation constant data. */
+/** Initializes simulation constant data. */
 FUNC_QUALIFIER
-void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t               gmx_unused  cu_nb,
-                           const interaction_const_t      gmx_unused *ic,
-                           const nonbonded_verlet_group_t gmx_unused *nbv_group) FUNC_TERM
+void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t               gmx_unused         cu_nb,
+                           const interaction_const_t      gmx_unused        *ic,
+                           const struct nonbonded_verlet_group_t gmx_unused *nbv_group) FUNC_TERM
 
-/*! Initializes pair-list data for GPU, called at every pair search step. */
+/** Initializes pair-list data for GPU, called at every pair search step. */
 FUNC_QUALIFIER
-void nbnxn_cuda_init_pairlist(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
-                              const nbnxn_pairlist_t gmx_unused *h_nblist,
-                              int                    gmx_unused  iloc) FUNC_TERM
+void nbnxn_cuda_init_pairlist(nbnxn_cuda_ptr_t       gmx_unused         cu_nb,
+                              const struct nbnxn_pairlist_t gmx_unused *h_nblist,
+                              int                    gmx_unused         iloc) FUNC_TERM
 
-/*! Initializes atom-data on the GPU, called at every pair search step. */
+/** Initializes atom-data on the GPU, called at every pair search step. */
 FUNC_QUALIFIER
-void nbnxn_cuda_init_atomdata(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
-                              const nbnxn_atomdata_t gmx_unused *atomdata) FUNC_TERM
+void nbnxn_cuda_init_atomdata(const nbnxn_cuda_ptr_t       gmx_unused   cu_nb,
+                              const struct nbnxn_atomdata_t gmx_unused *atomdata) FUNC_TERM
 
 /*! \brief Update parameters during PP-PME load balancing. */
 FUNC_QUALIFIER
-void nbnxn_cuda_pme_loadbal_update_param(nbnxn_cuda_ptr_t          gmx_unused  cu_nb,
-                                         const interaction_const_t gmx_unused *ic) FUNC_TERM
+void nbnxn_cuda_pme_loadbal_update_param(const struct nonbonded_verlet_t gmx_unused *nbv,
+                                         const interaction_const_t gmx_unused       *ic) FUNC_TERM
 
-/*! Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
+/** Uploads shift vector to the GPU if the box is dynamic (otherwise just returns). */
 FUNC_QUALIFIER
-void nbnxn_cuda_upload_shiftvec(nbnxn_cuda_ptr_t       gmx_unused  cu_nb,
-                                const nbnxn_atomdata_t gmx_unused *nbatom) FUNC_TERM
+void nbnxn_cuda_upload_shiftvec(nbnxn_cuda_ptr_t       gmx_unused         cu_nb,
+                                const struct nbnxn_atomdata_t gmx_unused *nbatom) FUNC_TERM
 
-/*! Clears GPU outputs: nonbonded force, shift force and energy. */
+/** Clears GPU outputs: nonbonded force, shift force and energy. */
 FUNC_QUALIFIER
 void nbnxn_cuda_clear_outputs(nbnxn_cuda_ptr_t gmx_unused cu_nb,
                               int              gmx_unused flags) FUNC_TERM
 
-/*! Frees all GPU resources used for the nonbonded calculations. */
+/** Frees all GPU resources used for the nonbonded calculations. */
 FUNC_QUALIFIER
 void nbnxn_cuda_free(nbnxn_cuda_ptr_t gmx_unused  cu_nb) FUNC_TERM
 
-/*! Returns the GPU timings structure or NULL if GPU is not used or timing is off. */
+/** Returns the GPU timings structure or NULL if GPU is not used or timing is off. */
 FUNC_QUALIFIER
 wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 #ifdef GMX_GPU
@@ -111,12 +116,12 @@ wallclock_gpu_t * nbnxn_cuda_get_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 }
 #endif
 
-/*! Resets nonbonded GPU timings. */
+/** Resets nonbonded GPU timings. */
 FUNC_QUALIFIER
-void nbnxn_cuda_reset_timings(nbnxn_cuda_ptr_t gmx_unused cu_nb) FUNC_TERM
+void nbnxn_cuda_reset_timings(struct nonbonded_verlet_t gmx_unused *nbv) FUNC_TERM
 
-/*! Calculates the minimum size of proximity lists to improve SM load balance
   with CUDA non-bonded kernels. */
+/** Calculates the minimum size of proximity lists to improve SM load balance
*  with CUDA non-bonded kernels. */
 FUNC_QUALIFIER
 int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 #ifdef GMX_GPU
@@ -127,7 +132,7 @@ int nbnxn_cuda_min_ci_balanced(nbnxn_cuda_ptr_t gmx_unused cu_nb)
 }
 #endif
 
-/*! Returns if analytical Ewald CUDA kernels are used. */
+/** Returns if analytical Ewald CUDA kernels are used. */
 FUNC_QUALIFIER
 gmx_bool nbnxn_cuda_is_kernel_ewald_analytical(const nbnxn_cuda_ptr_t gmx_unused cu_nb)
 #ifdef GMX_GPU
index 84634d5e7e4b0ad033452c0e8a4263830fc8a000..924cc2a357e898fbee12babfd95f32877579f92f 100644 (file)
@@ -34,6 +34,7 @@
  */
 
 #include "gromacs/math/utilities.h"
+#include "gromacs/pbcutil/ishift.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.
 /*
    Kernel launch parameters:
     - #blocks   = #pair lists, blockId = pair list Id
-    - #threads  = CL_SIZE^2
-    - shmem     = CL_SIZE^2 * sizeof(float)
+    - #threads  = NTHREAD_Z * CL_SIZE^2
+    - shmem     = see nbnxn_cuda.cu:calc_shmem_required()
 
     Each thread calculates an i force-component taking one pair of i-j atoms.
  */
+
 #if __CUDA_ARCH__ >= 350
-__launch_bounds__(64, 16)
+__launch_bounds__(THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP)
+#else
+__launch_bounds__(THREADS_PER_BLOCK)
 #endif
 #ifdef PRUNE_NBL
 #ifdef CALC_ENERGIES
@@ -144,6 +148,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
     unsigned int tidxi  = threadIdx.x;
     unsigned int tidxj  = threadIdx.y;
     unsigned int tidx   = threadIdx.y * blockDim.x + threadIdx.x;
+    unsigned int tidxz  = threadIdx.z;
     unsigned int bidx   = blockIdx.x;
     unsigned int widx   = tidx / WARP_SIZE; /* warp index */
 
@@ -171,11 +176,11 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
     /* shmem buffer for i x+q pre-loading */
     extern __shared__  float4 xqib[];
-    /* shmem buffer for cj, for both warps separately */
-    int *cjs     = (int *)(xqib + NCL_PER_SUPERCL * CL_SIZE);
+    /* shmem buffer for cj, for each warp separately */
+    int *cjs     = ((int *)(xqib + NCL_PER_SUPERCL * CL_SIZE)) + tidxz * 2 * NBNXN_GPU_JGROUP_SIZE;
 #ifdef IATYPE_SHMEM
     /* shmem buffer for i atom-type pre-loading */
-    int *atib = (int *)(cjs + 2 * NBNXN_GPU_JGROUP_SIZE);
+    int *atib    = ((int *)(xqib + NCL_PER_SUPERCL * CL_SIZE)) + NTHREAD_Z * 2 * NBNXN_GPU_JGROUP_SIZE;
 #endif
 
 #ifndef REDUCE_SHUFFLE
@@ -183,7 +188,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #ifdef IATYPE_SHMEM
     float *f_buf = (float *)(atib + NCL_PER_SUPERCL * CL_SIZE);
 #else
-    float *f_buf = (float *)(cjs + 2 * NBNXN_GPU_JGROUP_SIZE);
+    float *f_buf = (float *)(cjs + NTHREAD_Z * 2 * NBNXN_GPU_JGROUP_SIZE);
 #endif
 #endif
 
@@ -192,14 +197,17 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
     cij4_start  = nb_sci.cj4_ind_start; /* first ...*/
     cij4_end    = nb_sci.cj4_ind_end;   /* and last index of j clusters */
 
-    /* Pre-load i-atom x and q into shared memory */
-    ci = sci * NCL_PER_SUPERCL + tidxj;
-    ai = ci * CL_SIZE + tidxi;
-    xqib[tidxj * CL_SIZE + tidxi] = xq[ai] + shift_vec[nb_sci.shift];
+    if (tidxz == 0)
+    {
+        /* Pre-load i-atom x and q into shared memory */
+        ci = sci * NCL_PER_SUPERCL + tidxj;
+        ai = ci * CL_SIZE + tidxi;
+        xqib[tidxj * CL_SIZE + tidxi] = xq[ai] + shift_vec[nb_sci.shift];
 #ifdef IATYPE_SHMEM
-    /* Pre-load the i-atom types into shared memory */
-    atib[tidxj * CL_SIZE + tidxi] = atom_types[ai];
+        /* Pre-load the i-atom types into shared memory */
+        atib[tidxj * CL_SIZE + tidxi] = atom_types[ai];
 #endif
+    }
     __syncthreads();
 
     for (ci_offset = 0; ci_offset < NCL_PER_SUPERCL; ci_offset++)
@@ -241,12 +249,12 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 
         /* divide the self term(s) equally over the j-threads, then multiply with the coefficients. */
 #ifdef LJ_EWALD
-        E_lj /= CL_SIZE;
+        E_lj /= CL_SIZE*NTHREAD_Z;
         E_lj *= 0.5f*ONE_SIXTH_F*lje_coeff6_6;
 #endif  /* LJ_EWALD */
 
 #if defined EL_EWALD_ANY || defined EL_RF || defined EL_CUTOFF
-        E_el /= CL_SIZE;
+        E_el /= CL_SIZE*NTHREAD_Z;
 #if defined EL_RF || defined EL_CUTOFF
         E_el *= -nbparam.epsfac*0.5f*c_rf;
 #else
@@ -267,7 +275,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
     fshift_buf = make_float3(0.0f);
 
     /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
-    for (j4 = cij4_start; j4 < cij4_end; j4++)
+    for (j4 = cij4_start + tidxz; j4 < cij4_end; j4 += NTHREAD_Z)
     {
         wexcl_idx   = pl_cj4[j4].imei[widx].excl_ind;
         imask       = pl_cj4[j4].imei[widx].imask;
index 7ea591db30fe37f39cd39005c258b793e3f4ae53..ac8a530f2c795d19674f0ef44e95a8fd47209a19 100644 (file)
@@ -38,7 +38,7 @@
  * code that is in double precision.
  */
 
-#include "../../gmxlib/cuda_tools/vectype_ops.cuh"
+#include "gromacs/gmxlib/cuda_tools/vectype_ops.cuh"
 
 #ifndef NBNXN_CUDA_KERNEL_UTILS_CUH
 #define NBNXN_CUDA_KERNEL_UTILS_CUH
index 3bdb17f8feaf51b33c790c09f252a5243a8d0578..3b37869e6dda00b17ae3f2fa4bced6347a271587 100644 (file)
 
 /* cut-off + V shift LJ */
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJ ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w geometric combination rules */
 #define LJ_EWALD_COMB_GEOM
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJEwCombGeom ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_GEOM
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w LB combination rules */
 #define LJ_EWALD_COMB_LB
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJEwCombLB ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_LB
 #undef NB_KERNEL_FUNC_NAME
 /* F switch LJ */
 #define LJ_FORCE_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJFsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_FORCE_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 /* V switch LJ */
 #define LJ_POT_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecCut_VdwLJPsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_POT_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 
 
 /* cut-off + V shift LJ */
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJ ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w geometric combination rules */
 #define LJ_EWALD_COMB_GEOM
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJEwCombGeom ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_GEOM
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w LB combination rules */
 #define LJ_EWALD_COMB_LB
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJEwCombLB ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_LB
 #undef NB_KERNEL_FUNC_NAME
 /* F switch LJ */
 #define LJ_FORCE_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJFsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_FORCE_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 /* V switch LJ */
 #define LJ_POT_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecRF_VdwLJPsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_POT_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 
 
 /* cut-off + V shift LJ */
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJ ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w geometric combination rules */
 #define LJ_EWALD_COMB_GEOM
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJEwCombGeom ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_GEOM
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w LB combination rules */
 #define LJ_EWALD_COMB_LB
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJEwCombLB ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_LB
 #undef NB_KERNEL_FUNC_NAME
 /* F switch LJ */
 #define LJ_FORCE_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJFsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_FORCE_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 /* V switch LJ */
 #define LJ_POT_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJPsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_POT_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 
 
 /* cut-off + V shift LJ */
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJ ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w geometric combination rules */
 #define LJ_EWALD_COMB_GEOM
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJEwCombGeom ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_GEOM
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w LB combination rules */
 #define LJ_EWALD_COMB_LB
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJEwCombLB ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_LB
 #undef NB_KERNEL_FUNC_NAME
 /* F switch LJ */
 #define LJ_FORCE_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJFsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_FORCE_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 /* V switch LJ */
 #define LJ_POT_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwTwinCut_VdwLJPsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_POT_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 
 
 /* cut-off + V shift LJ */
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJ ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w geometric combination rules */
 #define LJ_EWALD_COMB_GEOM
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJEwCombGeom ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_GEOM
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w LB combination rules */
 #define LJ_EWALD_COMB_LB
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJEwCombLB ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_LB
 #undef NB_KERNEL_FUNC_NAME
 /* F switch LJ */
 #define LJ_FORCE_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJFsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_FORCE_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 /* V switch LJ */
 #define LJ_POT_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTab_VdwLJPsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_POT_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 
 
 /* cut-off + V shift LJ */
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJ ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w geometric combination rules */
 #define LJ_EWALD_COMB_GEOM
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJEwCombGeom ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_GEOM
 #undef NB_KERNEL_FUNC_NAME
 /* LJ-Ewald w LB combination rules */
 #define LJ_EWALD_COMB_LB
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJEwCombLB ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_EWALD_COMB_LB
 #undef NB_KERNEL_FUNC_NAME
 /* F switch LJ */
 #define LJ_FORCE_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJFsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_FORCE_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 /* V switch LJ */
 #define LJ_POT_SWITCH
 #define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEwQSTabTwinCut_VdwLJPsw ## __VA_ARGS__
-#include "nbnxn_cuda_kernel.cuh"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #undef LJ_POT_SWITCH
 #undef NB_KERNEL_FUNC_NAME
 
index 0fa40d2466800d9fc85f4185c0a920e4e6d02a0b..fe186eda89183700e31279017dc61636c1ce662a 100644 (file)
 #ifndef NBNXN_CUDA_TYPES_H
 #define NBNXN_CUDA_TYPES_H
 
-#include "types/interaction_const.h"
-#include "types/nbnxn_pairlist.h"
-#include "types/nbnxn_cuda_types_ext.h"
-#include "../../gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 /* CUDA versions from 5.0 above support texture objects. */
 #if CUDA_VERSION >= 5000
index e8e94fdfdedde8797668401b9a68b3062d17063f..db548c115fe8ae54790f07832793f8a5ca7f62a0 100644 (file)
 #ifndef _nbnxn_internal_h
 #define _nbnxn_internal_h
 
-#include "typedefs.h"
-#include "nbnxn_simd.h"
-#include "domdec.h"
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/mdlib/nbnxn_simd.h"
 #include "gromacs/timing/cyclecounter.h"
 
 
index 7ce061ff2140722826220812b50b1ebaa9e42e6c..9663861948f3f4fb1829fe884f338d6c8ab8f69a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "nbnxn_kernel_common.h"
 
+#include "gromacs/pbcutil/ishift.h"
+
 static void
 clear_f_all(const nbnxn_atomdata_t *nbat, real *f)
 {
@@ -53,16 +53,16 @@ static void
 clear_f_flagged(const nbnxn_atomdata_t *nbat, int output_index, real *f)
 {
     const nbnxn_buffer_flags_t *flags;
-    unsigned                    our_flag;
+    gmx_bitmask_t               our_flag;
     int g, b, a0, a1, i;
 
     flags = &nbat->buffer_flags;
 
-    our_flag = (1U << output_index);
+    bitmask_init_bit(&our_flag, output_index);
 
     for (b = 0; b < flags->nflag; b++)
     {
-        if (flags->flag[b] & our_flag)
+        if (!bitmask_is_disjoint(flags->flag[b], our_flag))
         {
             a0 = b*NBNXN_BUFFERFLAG_SIZE;
             a1 = a0 + NBNXN_BUFFERFLAG_SIZE;
index 7855b310fe10fb3f50cd51f4a9831f8362862dc4..69d2423780341568217e4383456f6d0609a15e8d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,7 +36,8 @@
 #ifndef _nbnxn_kernel_common_h
 #define _nbnxn_kernel_common_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 #ifdef __cplusplus
 extern "C" {
index b3fdecc0147a1ba909073f892ff9850ef8a48e5f..b7740bfcaf0bfdb19cbdef72a32a2c7053e54310 100755 (executable)
@@ -75,6 +75,7 @@
 import re
 import sys
 import os
+os.chdir(os.path.dirname(os.path.abspath(__file__)))
 import collections # Requires Python 2.7
 sys.path.append('../../../../../admin')
 from copyright import create_copyright_header
@@ -163,6 +164,7 @@ for type in VerletKernelTypeDict:
     KernelNamePrefix = 'nbnxn_kernel'
     KernelsName = "{0}_simd_{1}".format(KernelNamePrefix,type)
     KernelsHeaderFileName = "{0}.h".format(KernelsName,type)
+    KernelsHeaderPathName = "gromacs/mdlib/nbnxn_kernels/simd_{0}/{1}".format(type,KernelsHeaderFileName)
     KernelFunctionLookupTable = {}
     KernelDeclarations = ''
     KernelTemplate = read_kernel_template("{0}_kernel.c.pre".format(KernelsName))
@@ -189,7 +191,7 @@ for type in VerletKernelTypeDict:
                                            ElectrostaticsDict[elec]['define'],
                                            VdwTreatmentDict[ljtreat]['define'],
                                            EnergiesComputationDict[ener]['define'],
-                                           KernelsHeaderFileName,
+                                           KernelsHeaderPathName,
                                            KernelName,
                                            " " * (len(KernelName) + 1),
                                            VerletKernelTypeDict[type]['UnrollSize'],
index 3aa7ae025e7087f1c7adb81857cff8939b0970a6..2dbae1b8513305ad0786c17686cbd2cd75c9925e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,6 +38,8 @@
  * {0}, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE {7}
 #include "{4}"
 
@@ -46,7 +48,7 @@
 {3}
 
 #ifdef {0}
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* {0} */
 
 #ifdef CALC_ENERGIES
@@ -69,7 +71,7 @@ void
 {6}real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef {0}
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* {0} */
 {{
 /* No need to call gmx_incons() here, because the only function
index 622f011f53194fa3ba59c567a3c6fcaefccf526e..69872b938c20a1c7a492ba4a3a1dcb5dd54c9c8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,6 +38,8 @@
  * {0}, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE {7}
 #include "{4}"
 
@@ -46,7 +48,7 @@
 {3}
 
 #ifdef {0}
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* {0} */
 
 #ifdef CALC_ENERGIES
@@ -69,7 +71,7 @@ void
 {6}real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef {0}
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* {0} */
 {{
 /* No need to call gmx_incons() here, because the only function
index 2aa4fa9fb59bf5db2dab19d027552d4707556867..5e410cdecc4525f96fa7ab74c4a50c848b203861 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
+#include "config.h"
 
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
 
 #ifdef {0}
 {2}
 #define GMX_SIMD_J_UNROLL_SIZE {3}
 #include "{4}"
-#include "../nbnxn_kernel_common.h"
-#include "gmx_omp_nthreads.h"
-#include "types/force_flags.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
  */
@@ -117,7 +118,7 @@ reduce_group_energies(int ng, int ng_2log,
 
 #else /* {0} */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #endif /* {0} */
 
index e3fa05fb8f5b57a7f2eca53bceea931212fa0323..22ada3b193bd4770efa13ada39efbffa3742c36e 100644 (file)
@@ -32,8 +32,8 @@
  * 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 "typedefs.h"
-
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
 
 #ifdef __cplusplus
index 24ef4a96b016e923610a73d4d36b7336dc466f2e..5e8ac7ca2abd538f80614883b54427f65d2c016d 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_kernel_gpu_ref.h"
+
+#include "config.h"
 
 #include <math.h>
 
-#include "types/simple.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 #include "gromacs/math/utilities.h"
-#include "vec.h"
-#include "typedefs.h"
-#include "force.h"
-#include "nbnxn_kernel_gpu_ref.h"
-#include "../nbnxn_consts.h"
-#include "nbnxn_kernel_common.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
+#include "gromacs/pbcutil/ishift.h"
 
 #define NCL_PER_SUPERCL         (NBNXN_GPU_NCLUSTER_PER_SUPERCLUSTER)
 #define CL_SIZE                 (NBNXN_GPU_CLUSTER_SIZE)
index 18f4e9d01f3693f07bb17b62a33bcf38d4aeccbd..3084a57210bdbcfa4e253738779b1b7f48d1c029 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,7 +36,8 @@
 #ifndef _nbnxn_kernel_gpu_ref_h
 #define _nbnxn_kernel_gpu_ref_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 #ifdef __cplusplus
 extern "C" {
index a10465296569d932b4b90a2b34ca131d98c2fe58..4cad2a2f5637ba5b410af8db8ca1225cc441d1a6 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_kernel_ref.h"
+
+#include "config.h"
 
-#include <math.h>
 #include <assert.h>
+#include <math.h>
 
-#include "typedefs.h"
-#include "vec.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
+#include "gromacs/pbcutil/ishift.h"
 #include "gromacs/utility/smalloc.h"
-#include "force.h"
-#include "gmx_omp_nthreads.h"
-#include "nbnxn_kernel_ref.h"
-#include "../nbnxn_consts.h"
-#include "nbnxn_kernel_common.h"
 
 /*! \brief Typedefs for declaring lookup tables of kernel functions.
  */
@@ -70,21 +73,21 @@ typedef void (*p_nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
 /* Analytical reaction-field kernels */
 #define CALC_COUL_RF
 #define LJ_CUT
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_CUT
 #define LJ_FORCE_SWITCH
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_FORCE_SWITCH
 #define LJ_POT_SWITCH
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_POT_SWITCH
 #define LJ_EWALD
 #define LJ_CUT
 #define LJ_EWALD_COMB_GEOM
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_EWALD_COMB_GEOM
 #define LJ_EWALD_COMB_LB
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_EWALD_COMB_LB
 #undef LJ_CUT
 #undef LJ_EWALD
@@ -94,42 +97,42 @@ typedef void (*p_nbk_func_ener)(const nbnxn_pairlist_t     *nbl,
 /* Tabulated exclusion interaction electrostatics kernels */
 #define CALC_COUL_TAB
 #define LJ_CUT
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_CUT
 #define LJ_FORCE_SWITCH
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_FORCE_SWITCH
 #define LJ_POT_SWITCH
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_POT_SWITCH
 #define LJ_EWALD
 #define LJ_CUT
 #define LJ_EWALD_COMB_GEOM
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_EWALD_COMB_GEOM
 #define LJ_EWALD_COMB_LB
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_EWALD_COMB_LB
 #undef LJ_CUT
 #undef LJ_EWALD
 /* Twin-range cut-off kernels */
 #define VDW_CUTOFF_CHECK
 #define LJ_CUT
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_CUT
 #define LJ_FORCE_SWITCH
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_FORCE_SWITCH
 #define LJ_POT_SWITCH
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_POT_SWITCH
 #define LJ_EWALD
 #define LJ_CUT
 #define LJ_EWALD_COMB_GEOM
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_EWALD_COMB_GEOM
 #define LJ_EWALD_COMB_LB
-#include "nbnxn_kernel_ref_includes.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_includes.h"
 #undef LJ_EWALD_COMB_LB
 #undef LJ_CUT
 #undef LJ_EWALD
index bfcfee5b77419f694331b8815f0af526484be897..d8d4df1eed82a0240ac82fb783ed78c5865ea6d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,7 +36,8 @@
 #ifndef _nbnxn_kernel_ref_h
 #define _nbnxn_kernel_ref_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 #ifdef __cplusplus
 extern "C" {
index 91447143a8a48c7645c339a9cfa2157c2f55614b..099a9079a41eaaa22b6a9bb37019aac074534ac5 100644 (file)
  */
 
 /* Include the force only kernels */
-#include "nbnxn_kernel_ref_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_outer.h"
 
 /* Include the force+energy kernels */
 #define CALC_ENERGIES
-#include "nbnxn_kernel_ref_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_outer.h"
 #undef CALC_ENERGIES
 
 /* Include the force+energygroups kernels */
 #define CALC_ENERGIES
 #define ENERGY_GROUPS
-#include "nbnxn_kernel_ref_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_outer.h"
 #undef ENERGY_GROUPS
 #undef CALC_ENERGIES
index 955e708fae8994866423b554059a97d028f615d9..e0cfcef8bd01be56ef8ab4a4f7278497c26f21bf 100644 (file)
@@ -332,20 +332,19 @@ NBK_FUNC_NAME(_VgrpF)
             {
 #define CALC_COULOMB
 #define HALF_LJ
-#include "nbnxn_kernel_ref_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h"
 #undef HALF_LJ
 #undef CALC_COULOMB
             }
-            /* cppcheck-suppress duplicateBranch */
             else if (do_coul)
             {
 #define CALC_COULOMB
-#include "nbnxn_kernel_ref_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h"
 #undef CALC_COULOMB
             }
             else
             {
-#include "nbnxn_kernel_ref_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h"
             }
 #undef CHECK_EXCLS
             cjind++;
@@ -357,20 +356,19 @@ NBK_FUNC_NAME(_VgrpF)
             {
 #define CALC_COULOMB
 #define HALF_LJ
-#include "nbnxn_kernel_ref_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h"
 #undef HALF_LJ
 #undef CALC_COULOMB
             }
-            /* cppcheck-suppress duplicateBranch */
             else if (do_coul)
             {
 #define CALC_COULOMB
-#include "nbnxn_kernel_ref_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h"
 #undef CALC_COULOMB
             }
             else
             {
-#include "nbnxn_kernel_ref_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_inner.h"
             }
         }
         ninner += cjind1 - cjind0;
index 6eb97445b02e3fb40632135e91b18c0de54b7181..5e1e01114160693eef9e1cdc5af59730a1fc6178 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _nbnxn_kernel_simd_utils_h_
 #define _nbnxn_kernel_simd_utils_h_
 
+#include "config.h"
+
 #include "gromacs/legacyheaders/types/simple.h"
 
 /*! \brief Provides hardware-specific utility routines for the SIMD kernels.
@@ -63,11 +65,11 @@ prepare_table_load_buffer(const int gmx_unused *array)
     return NULL;
 }
 
-#include "nbnxn_kernel_simd_utils_ref.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_ref.h"
 
 #else /* GMX_SIMD_REFERENCE */
 
-#if defined  GMX_TARGET_X86 && !defined __MIC__
+#if defined  GMX_TARGET_X86 && !defined GMX_SIMD_X86_MIC
 /* Include x86 SSE2 compatible SIMD functions */
 
 /* Set the stride for the lookup of the two LJ parameters from their
@@ -94,21 +96,21 @@ prepare_table_load_buffer(int gmx_unused *array)
 
 #ifdef GMX_DOUBLE
 #if GMX_SIMD_REAL_WIDTH == 2
-#include "nbnxn_kernel_simd_utils_x86_128d.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128d.h"
 #else
-#include "nbnxn_kernel_simd_utils_x86_256d.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_256d.h"
 #endif
 #else /* GMX_DOUBLE */
 /* In single precision aligned FDV0 table loads are optimal */
 #define TAB_FDV0
 #if GMX_SIMD_REAL_WIDTH == 4
-#include "nbnxn_kernel_simd_utils_x86_128s.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128s.h"
 #else
-#include "nbnxn_kernel_simd_utils_x86_256s.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_256s.h"
 #endif
 #endif /* GMX_DOUBLE */
 
-#else  /* GMX_TARGET_X86 && !__MIC__ */
+#else  /* GMX_TARGET_X86 && !GMX_SIMD_X86_MIC */
 
 #if GMX_SIMD_REAL_WIDTH > 4
 /* For width>4 we use unaligned loads. And thus we can use the minimal stride */
@@ -123,14 +125,14 @@ static const int nbfp_stride = GMX_SIMD_REAL_WIDTH;
 #endif
 
 #ifdef GMX_SIMD_IBM_QPX
-#include "nbnxn_kernel_simd_utils_ibm_qpx.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_ibm_qpx.h"
 #endif /* GMX_SIMD_IBM_QPX */
 
-#ifdef __MIC__
-#include "nbnxn_kernel_simd_utils_x86_mic.h"
+#ifdef GMX_SIMD_X86_MIC
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_mic.h"
 #endif
 
-#endif /* GMX_TARGET_X86 && !__MIC__ */
+#endif /* GMX_TARGET_X86 && !GMX_SIMD_X86_MIC */
 
 #endif /* GMX_SIMD_REFERENCE */
 
index c90e4bb8030211fbdc8ca45a4cd15787029c0158..589dafa32036cb80d9aeccc4125d396eec54e356 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _nbnxn_kernel_simd_utils_x86_128s_h_
 #define _nbnxn_kernel_simd_utils_x86_128s_h_
 
+#include "config.h"
+
 #include "gromacs/legacyheaders/types/simple.h"
 
 /* This files contains all functions/macros for the SIMD kernels
index 51dd883ed2c10a46fb5f7dce8c5c9d91060959fb..52a081ae9bae6bb1199ba4246f9d36a08bdd8997 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _nbnxn_kernel_simd_utils_x86_256s_h_
 #define _nbnxn_kernel_simd_utils_x86_256s_h_
 
+#include "config.h"
+
 /* This files contains all functions/macros for the SIMD kernels
  * which have explicit dependencies on the j-cluster size and/or SIMD-width.
  * The functionality which depends on the j-cluster size is:
@@ -310,6 +312,7 @@ gmx_load1_exclfilter(int e)
 static gmx_inline gmx_exclfilter gmx_simdcall
 gmx_load_exclusion_filter(const unsigned *i)
 {
+    /* cppcheck-suppress invalidPointerCast */
     return gmx_simd_load_r((real *) (i));
 }
 
index f22dbdb368173dd7cee986ef8713888c5a0af61c..980f4dfb16b51e9b923329d54cb33cfffd1d53eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef _nbnxn_kernel_x86_simd128_h
 #define _nbnxn_kernel_x86_simd128_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 36d921b127b0f50eb7d9ed4dfa438ba7909039cb..75ef5d204bb29973f07672d7126506cc6ac7500f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -35,7 +35,7 @@
 #ifndef _nbnxn_kernel_x86_simd256_h
 #define _nbnxn_kernel_x86_simd256_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
index 76b056ec75b53ff468020f59ca175407cc869932..af3cddcabac24977af13fca636cc4138f254ee5a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_un
                                                 real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 44671ee1adaff0cd4b3dfde54816156dd4b92a55..cab3a81e6cc188671ea2d31f3d409ee12fd0652a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7f1513fab6f55faa908cb7e238084bc69ac41fc1..3ea52e5713eacb19f6b149753747a577c7ff8a0b 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gm
                                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 369bfbfe28c61f1aeec5e777691c6a5a48d20e72..ba6c3484e0bbd0c6edeec4f3235da42c8f6b7c7a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_2xnn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 61d29bba951da9b974382dc6b5842b0af8771a28..8c1f1bf319f2d8936c871b9d108af3b131064455 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 769037be60aae735f354f8a69b05cabed05177ff..bb98a336b97722bfa2ce59c2dd9e1d220338c350 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index bb32524cb156eeff91a17044fac36aeb7cc0b77c..39e8aab2fc170d7072ad69527147c3810eed6d23 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 5c53c287bbc680c70fa6d5d72a0db1e4c4fd76ca..349b54084e141bd496a8f4208ccc4429684189e8 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx
                                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index df6ca901bb6e2b04a455741bd90e78ee70875a5f..6be1d1e476c7ff6ac62ba47ea9354e49ac81fc73 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -55,7 +57,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -78,7 +80,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t
                                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index dc919db9e1f9a0298fb7a6fa816d031cd8564268..f078e47607c96d43fcc16e07fceb959dee7572c1 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 42650bcfc85361ef8e4f99ff8ff6421c87bf0761..d2bf9323645de4a2876aceaffb0edcc3246f88dd 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 3ba6f9595935c9892b7180939d70ab21ba64c7ed..1e2ba356418023b96a329a7554f838251aad88a1 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c1f0727b925971d9b3aa96dd35bdd4e7933b4248..18247249a3127c338c4a36e30b3e9ff208404147 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c627bacf2c1ac0de814458bd6a0b2eb079cd9f46..93bd804307b8f3a241cec3c8e3183d2fbd41df94 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c83c7a6549af857970ddff13eaf664732131f6a3..cceaf2eb5da4ac85a1a602cf08c8ef4b16cf42c4 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index fe72d654c00eeaad3a8eeb9d40b1ba4e437be7cb..36c340a8f9505c71fdcde292e120e4f3056347eb 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index d60902913c9be7dc1ce66fd023ebea086be7ef85..87450fcf62a378881d3bcff1faf8cd0a4736aca0 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *n
                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 4d4db8b38297f09a949e2aa6c110c3df57d939d9..7c2637c26a55254f59bd779ff23ee1a267abc024 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9a35731fc16527a85e99995d80814c55ece81f54..f5fe39ca114ebe90b10256451766e244f4edf9ff 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_unused *n
                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 92b0afbd10cbb424bc0be3d2e857ffc6cad70a5d..2b32f242e73b6d9befb5639ecd3c00a74566f3af 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 26c75477df4e0b270c05e9b4bf242aa63d8d2992..e79107a0c9e52f519090027b6025e24d069e7b46 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ea8cf655db2f95e36b8b68a3b571fbc3715b8751..c838ad21818b6f235697da9b92fdc7f830c0f6ba 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombLB_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ad64932b61b442330b3c46385b77b813cfc0bc9f..f5eaa4faaa808a4eac44b7edfbfbc5d53e060d41 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombLB_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ba3512160c56df8fccb7c0b09856071073f04cc0..ecae99f539ec1b403f0ee9977f328ed5d230cf7e 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index cb67816b7efc190a36e209ee54041743fd5620e0..69f5ef4d74c1296f283d9f4710e023c2fb334882 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index f71bb45808fb74d38fe516729d95a00ab5cad9e5..75c875e283832d670b8ff3b8dc5e6196a94a22f0 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index a57df6e663be437de56bc59ec81e7b18cac8f132..b08bcd4e001186239188c1a07e5fc231f5c76a5e 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 59f709a399b64c06cf8056fbbbc91e893f0a3100..bd57798ddd03fbf412886d90f9236f9f6a829f51 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJFSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c5c4c14ef6e806a9ec79718d013967bd450357b7..37e37755522be900966bf65d06e378b594028970 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJFSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 885f4f4f282a9b04e6954c21ccef593d26696d39..0038130fddf4a44a547b59d435c4b0fe9f11b626 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_FORCE_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 4ff834e209134e0ccae72f587bc1222b6acd99b9..b279d7ccb15713138e91dd9a0aac04bc87223cd2 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJPSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 926a8b6bbb67b82cd9b45a90ce749a7c71743e86..6e28781ed5ed7bcf0ca43e9b207229d56ffd44c1 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJPSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0997b57c5b85eadfb44282e5db7d21b5c29dab16..b804656537e2f95db8fceede21aa30b5943340cf 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_POT_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 68aa2b3963efbc73aa2e62e6bae58ea96971cf7c..03fb7b24bbab0d0e6acb8868451b5e0b99df2917 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJ_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 71d77c125538dc82a4135522444b5c0686df62ec..a61e355b2fb8fc16a4e2c9e004303819b55efe7b 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJ_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index a2e613257a5e0df7b011b01adacef1f8d971e821..a1793eb96d1979fac34bdb265f951019f0e638e6 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJ_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 16448b72ba29c612f899b0fbaab367fb0854ff77..05118e2c62e4e2be9cc12210e248810a26c925b1 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx
                                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 22315ee3338035171c29bba6b4a2fb2bbcfa4ea8..b05cbdc30ac27570f715f2275dfd32432cf339ff 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_2xnn(const nbnxn_pairlist_t    gm
                                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 64ce413cc9e47fcdb23c824641cd72e2fceb3c8a..626f0145b89f40d10af9698176934ef8108420f7 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t
                                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 5c89c4fb3bb8909eab4f12c8986157680e768b17..7cdb2eaad9947fb1a6b6d537ac3741a63a0779c0 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_2xnn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index d4e17ecfdd2c8c1059518e4f11b2dd14e17074ad..cf6d3cd48cd41eac7d908627ab90d7c75953a41a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_2xnn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 3c75e0801b4bc75503bd3aa488e690aefbb0ea82..718601a87ee554ef808a10ab3e484f3af6984bca 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_2xnn(const nbnxn_pairlist_t    g
                                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ae5d693ffc0841cbfb4b8b859e4208c546877118..e661ec3b3d85a36ef70202d4f8b301f00ea1ca1a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_2xnn(const nbnxn_pairlist_t    g
                                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 5d991b37e60734b2dc2e6ee6cf870096da105726..f231bafded3992e8d10abcd31f842b0327e5957c 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_2xnn(const nbnxn_pairlist_t
                                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index bc09bbddab342b1fef772c12783179c6222f390f..7a57912fbb57b9935fa97ee928a1c0cfe25ccf87 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -55,7 +57,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -78,7 +80,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t
                                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index bd8436c676804bf5ffecef328b6ab8b762bde753..29d3554d0b4620ad8d18362f2ec56a02d30aa8df 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_2xnn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 28b27d3a8a20c7a5938c3b1c7aa9437becc91036..e19ba53e1dc810a817bd4eeaef7b8d8c055a6285 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2077c6dd0562802fec8e2205cfb378aecef09bb8..0098e4149149b57cf9e08ddb8dc98e07ae581480 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index a6e4f45b44b401b099a86f717b210e3bd1afc770..8d25dfeb6a40fbf06d9d39c6ad7faf00fdd46652 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_2xnn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2972fcfe355552153468d0088d8bb29f7e8ef531..145d00dea4747c69640a35cce9d45a0f91f1869e 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index d267d8e678ec299c3493bb521d10c831490379e0..4f6103b846294efe5aa8b6171053cb96309c95ef 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 118dc553fb628bcc0688d3faf7e0735ac8f02770..3f12026d7486d8d2f161e2f108e286a7cd7d7e0b 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index e04c3d911e3ba7fac52c362e73eb8069adaece28..36efbb2bcef2146c4ef35e6a07b113a0dbdb8baa 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index e0af6c8177e3f8100eb0d9b11f6d4bb5ffd9038d..4d04f3e872becc1ec1a141eb62cc2378f444d65e 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 78ecf6966cf8e6a24961491676b2a6b5820e651c..56eaa69c99bc7c0f2cd3a14579758ddfb56e6e5d 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index f2136020bdc5a15283b1c20537c8f8fef519e6b1..3d7fbb36db737a6dbcaad392a04e54e331d7a762 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2ddcb859b5f448cdcd29890b00a7ee524abb0ea4..575058440d5913d1e32d26ebdcb005bc5a2d466e 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_un
                                                 real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0182f56c9531602dba7d78390076866aba0391fe..b4a0a96dd68aed553fba1eab3bbb6fd27d4b35bb 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_2xnn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 23ed646115046953e0a6cd17621ac9f566e39598..0f06e7e15237f3fb6222caf8cca29c59470067de 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 54c5d56a289dc865f8b04b31af16a1b4bc041df6..3fb2510be264e9831a72e507d0c2c1e9dcf257ef 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2fa3ed90af6a3008edf0e792842073c16b76a4e3..7b0768c943473b003a4c54b5e396718654efccf9 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ba086c8a92c61efd954a4645f3aedcad05f2f5d6..b32a7d11e29107055abcfc135594c2e21438ab05 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7906b80fe1d4893e14806d39e3ac68a7e30d117d..004a236bfb4c699981dafddee5d32bc389da0f18 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 18f5ab376c7c0550795b28db92ad46d3a23b81fd..40e218ad71ebd6d60e0f1ee5dfd557560123fc23 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJFSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index e61100d1023be8f43b99ce546e02e8fcad84f149..11e1d686f49d1060148ac4f7c29a341a5482d710 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2276f91a5ce39c6937274a35fd80de3fd679b571..c4a8f35fabc5a893a367a323a29460c4e2df4db7 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_FORCE_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ef13e59a2ebd312b0ca9d5de34d3cf1908a84258..f24498ee3d9f0fe6f1a4d124d27b24f1b895df71 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJPSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c7f15d611cd33d2546c1d1756d97a3b7b54ee92f..737daff0ff2e803db158a86f1670cd062a544343 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c10f52cad3c71a720ee9065ce273822e68c06b97..a18b5ccf61437135ae7d8b35187ab1741d3993ec 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_POT_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index def30cfc19b0c37529e7b38385a1978141462488..11ff86c8d8abdae9105ac407a11f4995324a87dd 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJ_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index a996b1a88595328199f21a56a48af87f96e39d8d..d268f0120762dc5de9575dc0ceb1118b8e507d2c 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJ_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 459729abbd64632e87f3e016e2e0caf4f3671635..44b98c55f55383344f6b0011b4392286cf466ffe 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 42222b7bb77dae7644832fc648a807324ae1c596..ceb0bde4f5d61f11581d5ccef87bb1c97d5f9290 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_unused *n
                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index f6e9e6fffcc522409e1000b744024883efb3a7c2..d3ad5b91a85bf62fbf3dac199e607c278c386f51 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0d03367d1431b9aff94adc62111f931988a16cc6..0044b4250d64764acc88dfcc379db68bb1314011 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7bd991cf80eca405b553a04850a91783f77087c2..41374a7f00b161fecbdb2af3bb921e41456a15c3 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombLB_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 8b7415b0e55c79beabe95ede74ff8f5713148d59..b60766f94ebe980ea3906527bcf157a2c852794a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombLB_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 44cc1e9a15f4d5ff388c4fc71714875bf24e6371..aa1444145eb2bc3c2084eeecacd62b1f731dde62 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index e220d69377c48fd92451f4b7d8633925062ef64a..13441f0e399d654d3c9c16e5f7bd35b6dded8c20 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_2xnn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 630ec030dddce26da47eb077d1d0aa42bc5f99c6..df538906e02d8a3280a9e7481a78af7eff0dac69 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_2xnn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index c18876d6146b4d517cda7d5ad15ff2df29b8daa7..a1a7c412bdc2affc33cd74b8500c4f03a9b28328 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index d6600ae047df4794267b3f5e2204da8b2f7d157c..a25c2bb9a93fcb72a4b12afc07deee98fa75f6ab 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJFSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index edf6fddfc0a334d7e0ddc1753ed59001a8a8f101..43ddf01acb67bd971fe734df1cbc5105247cd85f 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJFSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index e43052880dc8b01c394275aa00499f81ddeb7361..2a56307b2f007645bb500336d351154b66c02589 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_FORCE_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 198955942f4a72cd0b367390883bea5b550be11a..6e58109513927334e9703e2d259deff30eeedffe 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJPSw_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index ccb52a8b1f4e891efb0d97cd337a4a672e52d116..a29ad7969ee2129de78472b9646f544fd3ea2ead 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJPSw_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index bec4d4c39a762cc8bdd21708dc3b857787726364..f5d7c317b5708428bf539eee46be2d90d440b8b2 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_POT_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9eec2b30325c836140bb60cffdfe1db11b5ac6a3..18ccd0fca693a41cefd62ddf76169b9825ea17e1 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJ_F_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 46a2417fd392e07d5c1fc19709398fe06f8068df..1f8fb7dc78c81f385e593e393f2b52f0bcb2e08a 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJ_VF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 90b38d626398e97205cefc2c8ac52b4d6129a4cc..b6d89da0c7bb6e6fdb1b411cf514036017af2697 100644 (file)
  * GMX_NBNXN_SIMD_2XNN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 2
-#include "nbnxn_kernel_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h"
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJ_VgrpF_2xnn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_kernel_simd_2xnn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h"
 #else /* GMX_NBNXN_SIMD_2XNN */
 {
 /* No need to call gmx_incons() here, because the only function
index 35181d43eb17c584fa2af44b62f20aef15443875..1d8567b206d4619eab232683f732d56f20b71010 100644 (file)
  * kernel type 2xnn.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
+#include "config.h"
 
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
 
 #ifdef GMX_NBNXN_SIMD_2XNN
 
 #define GMX_SIMD_J_UNROLL_SIZE 2
 #include "nbnxn_kernel_simd_2xnn.h"
-#include "../nbnxn_kernel_common.h"
-#include "gmx_omp_nthreads.h"
-#include "types/force_flags.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
  */
@@ -252,7 +253,7 @@ reduce_group_energies(int ng, int ng_2log,
 
 #else /* GMX_NBNXN_SIMD_2XNN */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #endif /* GMX_NBNXN_SIMD_2XNN */
 
index c7ec9bcbd7db63438412c1d7a5581ef39c34fe63..f554134cbe35aba9f63b26ac86c66ec8d0f49ea2 100644 (file)
@@ -37,8 +37,8 @@
  * kernel type 2xnn.
  */
 
-#include "typedefs.h"
-
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
 
 #ifdef __cplusplus
index 698c5d389c6827a21184395ba5e1cd3fcd86a92d..3f3abe8308823e358e44e24d2f246bcefd93e7a9 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.
  */
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/pbcutil/ishift.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/simd_math.h"
 #include "gromacs/simd/vector_operations.h"
-#include "../../nbnxn_consts.h"
 #ifdef CALC_COUL_EWALD
 #include "gromacs/math/utilities.h"
 #endif
@@ -48,9 +49,9 @@
 #define UNROLLJ    (GMX_SIMD_REAL_WIDTH/GMX_SIMD_J_UNROLL_SIZE)
 
 /* The stride of all the atom data arrays is equal to half the SIMD width */
-#define STRIDE     (GMX_SIMD_REAL_WIDTH/GMX_SIMD_J_UNROLL_SIZE)
+#define STRIDE     UNROLLJ
 
-#include "../nbnxn_kernel_simd_utils.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h"
 
 static gmx_inline void gmx_simdcall
 gmx_load_simd_2xnn_interactions(int                  excl,
index c051d7e763696668fbdea0f26f390ae12752875e..2f45b53bafe0acd349b949ad2bf60e603a0e1220 100644 (file)
     /* Atom indices (of the first atom in the cluster) */
     aj            = cj*UNROLLJ;
 #if defined CALC_LJ && (defined LJ_COMB_GEOM || defined LJ_COMB_LB || defined LJ_EWALD_GEOM)
-#if UNROLLJ == STRIDE
     aj2           = aj*2;
-#else
-    aj2           = (cj>>1)*2*STRIDE + (cj & 1)*UNROLLJ;
-#endif
 #endif
-#if UNROLLJ == STRIDE
     ajx           = aj*DIM;
-#else
-    ajx           = (cj>>1)*DIM*STRIDE + (cj & 1)*UNROLLJ;
-#endif
     ajy           = ajx + STRIDE;
     ajz           = ajy + STRIDE;
 
index 590c09547df299ca20279ee02be9f82a5f4863a5..21a63ab4aa7b6fcdd899101711d8c75690025dd6 100644 (file)
 #define CHECK_EXCLS
             while (cjind < cjind1 && nbl->cj[cjind].excl != NBNXN_INTERACTION_MASK_ALL)
             {
-#include "nbnxn_kernel_simd_2xnn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h"
                 cjind++;
             }
 #undef CHECK_EXCLS
             for (; (cjind < cjind1); cjind++)
             {
-#include "nbnxn_kernel_simd_2xnn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h"
             }
 #undef HALF_LJ
 #undef CALC_COULOMB
 #define CHECK_EXCLS
             while (cjind < cjind1 && nbl->cj[cjind].excl != NBNXN_INTERACTION_MASK_ALL)
             {
-#include "nbnxn_kernel_simd_2xnn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h"
                 cjind++;
             }
 #undef CHECK_EXCLS
             for (; (cjind < cjind1); cjind++)
             {
-#include "nbnxn_kernel_simd_2xnn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h"
             }
 #undef CALC_COULOMB
         }
 #define CHECK_EXCLS
             while (cjind < cjind1 && nbl->cj[cjind].excl != NBNXN_INTERACTION_MASK_ALL)
             {
-#include "nbnxn_kernel_simd_2xnn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h"
                 cjind++;
             }
 #undef CHECK_EXCLS
             for (; (cjind < cjind1); cjind++)
             {
-#include "nbnxn_kernel_simd_2xnn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h"
             }
         }
 #undef CALC_LJ
index 8e0ce5738527e173ab02ca8d76e608e8c2ae89db..c25e20657bbac134df58357a5fb66b9000b1cbed 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index e877eea0396841dbbf1db275a004d85b9ada4aa6..3d656ca5782071a4757d5d2e62bdf9fa50354515 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_un
                                                 real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 079eba6952e8b413fa01bdbba8b451714e0e015d..a33780c1f8e002948cab97312cdc310c7a2dd83d 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx
                                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 6da840273a958250d095b61c50a8cbeee7cff411..992b1d928e25dbe8567aea2992156a79cc4d9836 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_F_4xn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index db2d2ebef95d2f74099a501cfce5a4c6217ba9f3..51864b3777aa2b5e8482cd23789f6d1a17f554ae 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 6ea91013e8595b9313728467a6a43ff5a26765d6..35a0c184616664c9eba3a5ab23aefbdab3a40593 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJCombLB_VgrpF_4xn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 85d4cb96890b7ccdf43e5c976e380ba76196b1ff..5976fd8fbf30c1b634e8e00feb2eff1cd22a08ab 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 55fd27a07af387c65105d3764558e246ee39a7ee..1bebf3b7a8c4f6e54390a7d39d41dcde33ed709c 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index fe173b32a0e7d4abd2147b550b6205730e8c745c..8d27735f0d75b6ae9ff020e4844f5cc0c51595bb 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -55,7 +57,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -78,7 +80,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJEwCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    g
                                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 199fb5c6239ebfd260cd39d6d8abb3d5220eae38..af75543a08761071e3ded4726fd54c0419f72c49 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index aefb1ae61a69dd4cd3e315e96d944069b60947e3..493b5522d5c396544d2f469f6814676e2f52e9c8 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 1f21e2613a409da9a1d9f507a83e123da9c3860b..fb0f0ba423d9fbcd4119ba0f86f23222ae5d365c 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJFSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 8f95cb7e1a352e3429af8f04ccffc6a7c826652e..5a7f31fe6d50cb6fe2bc3ce34f697b59ec50c0cd 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index f7fb96448e04f92dfc1662ace0a6e77f11dbb504..17d45a63ea63b32317d557ee3aeb98636f5f0b6e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index bb9c907dd0d9bd113b2f16d23d2d265c7c70ce7e..c64ef620b8902f7fb9923987f5e03f2c22d73b23 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJPSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 20ab0c5e14b6805f57e32659cd9dd673c289203a..e16b3874546df416c3885c32a3e2b436dcfbe9d4 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJ_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 5e982d5eb3726c577bc6494bda476ee53d24fdb9..0ea8f4edafb4f1cdd233007accc49a338ab42631 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJ_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index b68109cde37905a8570e171927cfe1df496c2618..defafbd6997a93c52e622ad79d33d40648a0744d 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEwTwinCut_VdwLJ_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 8c59343b3e174fa18e9f8c54c864572786a21b8d..3ca1f1aeebdd7248a362e3f770b8c35a321ff6f6 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 014a837702083320230ea214ff53f244ac0d1f45..6f4d2ad3a06f819992115de2e4e5d6d54c759457 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_unused *n
                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ae3950f048b6ae2c93462ac41a34ddb11628af96..ca22c74c835d05b1c276b0a8daeae07ec1dd0c49 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9045ae46c9767e684ae4b41fbd9d76e0c758abdf..c94fb2e3cc66ca3bfc02447d8ae9f91c5dc673a9 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombLB_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9020fd4d0b5491272d01cb082a9409d74570d647..ca440173af146078d7f4232ea57638a261f97a66 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJCombLB_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 806e2592232370716b361790ef61a7362967e365..69bad94b772c70257592cb6a441fe093507d80c0 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJCombLB_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index eb6df025658e72bd3cdbc630acfb0ce3c85c78e2..f90727ca2468d198fcacaa8da8060cb89008fbb4 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJEwCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index db3f1cd84b7e7031bdbcb7556778a94da7b7df59..23b5a598cabe76a005bc9349a94e76daf103063b 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 487d76842ea713335febc60b2bab91216954b257..8d30e9bebe7f1ff85d09519be00d9891f3ed5d54 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecEw_VdwLJEwCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ea145640cc13478393086325c6c1c4a337b5c814..1da4a2bf55295650b2f89da044fc2a1c8742e5d1 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJFSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 16ed3130c324a9700024985bef70cf686a238022..9fa9e4606c2a1b226949227955bc1b375c7412a4 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJFSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index e440224f0f79811402d9691430cd390fef1ff20d..ac11905c7c06c8e3b7f6ca1f8b1539a515704c0f 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_FORCE_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJFSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ba18cfb1bed2a3d041dd784bf589cb42f860d194..38365e1f334133db1f9ba96f50b0c1e0e224b3ff 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJPSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 452bf4b9d0b60ecbfb8abc3257543601c1d7e8c7..31da77cf375397844c475b18746a6de1ee4f6486 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJPSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2a754765e08e10642c10cbc00db2ca39eb2ebbcc..052f30b4e689ac31b417ffde86f9534d082bfa22 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_POT_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJPSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7f9dd0af81cfaa9b4ed6985ea66b2b11ff265c27..67c2ec7afc0319b48a2da47c81602873c90034cb 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJ_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                 real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 504e91db22067266f9b2cd5bcb1a77fabf26a3ad..c6a3b33d86989b48697c757266399ab73cb1a31e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecEw_VdwLJ_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 71c5db2ba53934e6d1fb5bc8a4c9405ee1c1e7d9..909c01a95d907ce2de644120cf363560e5b9bf1a 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_EWALD
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecEw_VdwLJ_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index fb90fe04061ae0e99f8045243de4b601f6636890..2c31aec0dca397963353b4532ff7ed37427b6575 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_
                                                   real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0b18b0b573a7b437c90b446a494f5eb68220501b..c38a39bc1f4a0b6771da50f3d24ca65cb053c68f 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx
                                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 56b173331dd97ba557ad73e9cd180d03fa017089..dd97997fd56a5f23a35d1e115c03cdfe21177da6 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombGeom_VgrpF_4xn(const nbnxn_pairlist_t
                                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 94ca416349554bdc8e3a1577252315647ff23a13..7bb9dfbbd77234e0b7f6dc3fb4591b3b87502895 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_F_4xn(const nbnxn_pairlist_t    gmx_un
                                                 real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7eded238af6d2370e4dbf0c60301dcf618a34cde..c8cff5cb9133637c9d593cfa2987abf03e20244e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VF_4xn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0657e0e4bf3360ced345283d558a8e26215dca20..87df91626b5f705038eca9b70dee80568d631c79 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJCombLB_VgrpF_4xn(const nbnxn_pairlist_t    gm
                                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 58cebd8fed93dca0e22d7da6c980d37938ab8e5c..af8977de09f885d84d2a86f9dbbb8a82a45fb421 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_F_4xn(const nbnxn_pairlist_t    gm
                                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 1ff9cddc5b449e600ad42b85f021dfd453a76035..b1e8334e6ef2986f5702d85541f34a343630d5dc 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VF_4xn(const nbnxn_pairlist_t    g
                                                      real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9c211d4950aac641513eb25edccc90b7255e6cb2..e87d41b46078114a99a4b668de917d951923bf41 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -55,7 +57,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -78,7 +80,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJEwCombGeom_VgrpF_4xn(const nbnxn_pairlist_t
                                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index f37b271857c46f974948b7657e08d5957c2a1af2..a53704cc0c6ba907bb003fb414a5b26dff88c185 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_F_4xn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 22b395bfe73219060ccedcd8ca93d724519b21a4..8f140303026dee741a35d4041e490056d9a3b174 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index faef66891c095369a52f806a767b321d61df2bf8..b5de54ffd0f5eda89943f1cc6b24292f6e3b120e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJFSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index bd495ebcb8ecf9083777471116fdc0306d945882..39f91daf41472d83f4114d639e925d7f5e4ea1ec 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_F_4xn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ee2e69b9e74e6652e2b7a85da223220db7e54307..8d2a2a5ca82dfeac9f0a1af8f36e3550ca9f52e6 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 8ce952c1cfa54df1d9fe0d30783528eb93991351..2363c56399be191c9b35544bc77fee41a43b9d47 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJPSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index eea95fb0bddd4da3bf4d123bf64961c64f25fd0d..c27fbc791902955c2a137d1d398f4f14e5ea9272 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_F_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 3c78488ab426aafc7bc2804c3fb9c627510af948..597ccebd97827cb37ba7ac5661422fcb1420112e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VF_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index f347e81186bad820f96e9bd244d28600a16fd9db..8cf34c0e9266e809722a26117a1d1283f440ac67 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define VDW_CUTOFF_CHECK /* Use twin-range cut-off */
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTabTwinCut_VdwLJ_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0830a5d3d4bafb5e562008d5b5749cf1ec7d8cd0..f1b46725108ea55f7b6e4864a3a478e970e067ca 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 45a166051282b6152b6e2af9942c1eb3a5575715..9a0e265fc2680952cb2d705a165e40a8a3a21fc9 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 803070fca86bc03b45ee7fc5b0704ec35dbbd3c8..d52387b1479abd9f446621ae2304ede0aecbd0a4 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unu
                                                real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ed0d1b4cc0c3b7695473ed879bc2f9530c06e778..28d13ebcb7eb4d0ad03eb1fa4c7c2b3030a52ba9 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombLB_F_4xn(const nbnxn_pairlist_t    gmx_unused *n
                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 3936c1e233a5f2c449af9ccec299f2ebc1edc2ab..063b7dbead2bab686ffde79da0b68f9ba5953209 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombLB_VF_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index defe4535caa45f9cfa05994093f49ed1e22d778f..841d3183dbe76cb5ef56cc0aedef782c6beffbff 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJCombLB_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ce52c0e291e968265a822172358bb04dd91d974f..749bfac6b6bad0d1133e35051f14bdcc186fa067 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unuse
                                              real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index ab580a8b5129a64b8e0e6e78d6b78ca7397860fe..b85597c7b4ba634b289ff9d9912fa984c9ae248e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index d23c22e43aa16361c76e84126540560b8cd9724d..3fcc0df958852665cf6f5054be41799cd51fc191 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecQSTab_VdwLJEwCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx_u
                                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2667a84575bec8652d0013d256804f36b6741898..4c949841e5cfdef32ade11ad1c3e8c77ade4ab34 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJFSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9bb1c64890dc5cba262fafd5a3ef0294535c6489..b7924a089a44e55478cf88c41128536b59ee90d1 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJFSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 1568dd540d683e5f70ac9594ad2064b03ca9a218..1faa919b93a3d4360fd73edd2fc5d893a7a6c925 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_FORCE_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJFSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 8f1ce9210f6573532627a53e8cf279f0a0659520..854601cd924e9f1f475de4c6502355f01a47d7c4 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJPSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index d1c7ea46976c4c9fee8f4fc70c692d6ed7b5d541..c70d75dfebb5b0382b39140554bc2a3e91a81966 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJPSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 472c06690f140c693cdeec9b02deb0e3498fb091..7fafdc148b4597fa5822568ff899097c66f56e25 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_POT_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJPSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2b604bb7fcdb3f64e29e8c7bf69f399faab3c7e4..50244f263badb8c305dc26c93c39bad3ce16b510 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJ_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 33e92d77a3ddd69cb6db93e3f67b48eee83c173d..d72013f90b507efa45906edb2a63a331849ef97e 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecQSTab_VdwLJ_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index eafdb1615a0a7804835f164992866422db675929..eb661637f70af7d6633492648ed910e44d956095 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_TAB
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecQSTab_VdwLJ_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index a77ee987a3fa2c6d25c34854ed6799507d7b2742..5a0a775bef493a502d4df1838d11e2418fe3d197 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unused *nb
                                         real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 8b7c2e3396464b5bbcf96d2d8e8d22e0fbdf684f..7e81a25cabf7845b5b4d548c2d7fdf345346909f 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_unused *n
                                          real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 57e35f799705a2f24b30baef1bc699d9fbcf5b9b..507a41f0edc2085a59281766e29c66206303c568 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused
                                             real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 6b47f07dca9118f778c99fb4b566b16154b9b08c..5c2498e1a84c00dac9e49a2692e51349e2da714b 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombLB_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                       real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 41a404314c6b4400df75be90e29d6d66aa841d80..04078b18e90085265f78d9575ece11dccd16a957 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJCombLB_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9ccd2b7a53b2393774ab1fc0a2a7048592f43509..2043603110dd7d6ac265bce8062f705eb0a05b94 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJCombLB_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0f3ac29b4a47cd9907dec32322ffcd70fce1b044..53e9a056d9af2e8bd59f5dcfd9fdbebdabf645d6 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJEwCombGeom_F_4xn(const nbnxn_pairlist_t    gmx_unused *
                                           real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index c1403ce23cb13c6b493ff35f588a05970ecc73ec..7739c596694fb5afd42a3fac5061b9da1b6600db 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VF_4xn(const nbnxn_pairlist_t    gmx_unused
                                            real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7d6e2fc64d93bc80d3caa97cf47bec2811ad4c0f..2a2852a1701cefe63b06779609f67a3658346cff 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -54,7 +56,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -77,7 +79,7 @@ nbnxn_kernel_ElecRF_VdwLJEwCombGeom_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unus
                                               real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index bc1873f650279595ec331f629db7138c5a719acc..878a77c1d7e04969be8363791519afc00103423c 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJFSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 16f30946087d54bee157b01b45e97bddd379d8d3..333b58c65f6d67b5d097a59841806c481b2437e0 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_FORCE_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJFSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 7ee74d34ab79c3c1e01e59ff5319204df4cded60..58f35877ddf6fb7665af1c0bf39a449437f81a80 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_FORCE_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJFSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 19213cc2f8baa4b646205fa3b347092223c6847e..6a3cdf502fbb7300a6d2a407960fce5762f68c60 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJPSw_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                    real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 2a11985b2f539fc10124e07bc22a4edc5a56e3d4..efa5e54da930bea66e53b6b57dc7b4b75fb351d3 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_POT_SWITCH
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJPSw_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 9e0233f8417e02b6d28570d7017e915e6a341c25..7c960842a345909f59397c5b79336500d2623b68 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_POT_SWITCH
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJPSw_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl
                                        real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index cdb8bbfd4b2d5d571880906f67923b6722870f8a..8515978f714bec14ba0206f69e049c8cf4a2e136 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 /* Will not calculate energies */
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJ_F_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                 real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 0ea279ab33e592f0dc4d91eb657e766271388ef9..a6bb59bb1acd9c18c1c6c2fd6cd1014acab1d208 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -52,7 +54,7 @@
 #define CALC_ENERGIES
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -75,7 +77,7 @@ nbnxn_kernel_ElecRF_VdwLJ_VF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                  real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 21b243907e0c43ad45e11375978b31fbfe0ff475..fb9c5d3693746814bb618a75b4b6f73ec78d9383 100644 (file)
  * GMX_NBNXN_SIMD_4XN, so that this file reduces to a stub
  * function definition when the kernel will never be called.
  */
+#include "gmxpre.h"
+
 #define GMX_SIMD_J_UNROLL_SIZE 1
-#include "nbnxn_kernel_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
 
 #define CALC_COUL_RF
 #define LJ_CUT
@@ -53,7 +55,7 @@
 #define ENERGY_GROUPS
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_common.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h"
 #endif /* GMX_NBNXN_SIMD_4XN */
 
 #ifdef CALC_ENERGIES
@@ -76,7 +78,7 @@ nbnxn_kernel_ElecRF_VdwLJ_VgrpF_4xn(const nbnxn_pairlist_t    gmx_unused *nbl,
                                     real                      gmx_unused *fshift)
 #endif /* CALC_ENERGIES */
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_kernel_simd_4xn_outer.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h"
 #else /* GMX_NBNXN_SIMD_4XN */
 {
 /* No need to call gmx_incons() here, because the only function
index 5974873a070147da2fd1723c8909d00449eb3dfe..3531299efd5feeda4bf72de911292bee47805745 100644 (file)
  * kernel type 4xn.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
+#include "config.h"
 
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
 
 #ifdef GMX_NBNXN_SIMD_4XN
 
 #define GMX_SIMD_J_UNROLL_SIZE 1
 #include "nbnxn_kernel_simd_4xn.h"
-#include "../nbnxn_kernel_common.h"
-#include "gmx_omp_nthreads.h"
-#include "types/force_flags.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_common.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \brief Kinds of electrostatic treatments in SIMD Verlet kernels
  */
@@ -251,7 +252,7 @@ reduce_group_energies(int ng, int ng_2log,
 
 #else /* GMX_NBNXN_SIMD_4XN */
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 #endif /* GMX_NBNXN_SIMD_4XN */
 
index e6e475765a84e69ec2279edf674ac31d59f64281..87c96994e808b529009e8d069dac905313313950 100644 (file)
@@ -37,8 +37,8 @@
  * kernel type 4xn.
  */
 
-#include "typedefs.h"
-
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 #include "gromacs/mdlib/nbnxn_simd.h"
 
 #ifdef __cplusplus
index 7b4bc4f524eac0e8bfa8e03b1b35208291004842..70d6edff67ce522c8c678f1f7a8cab28bd5163e7 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.
  */
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/pbcutil/ishift.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/simd_math.h"
 #include "gromacs/simd/vector_operations.h"
-#include "../../nbnxn_consts.h"
 #ifdef CALC_COUL_EWALD
 #include "gromacs/math/utilities.h"
 #endif
 
+#include "config.h"
+
 #ifndef GMX_SIMD_J_UNROLL_SIZE
 #error "Need to define GMX_SIMD_J_UNROLL_SIZE before including the 4xn kernel common header file"
 #endif
@@ -54,7 +57,7 @@
 #define STRIDE     (UNROLLI)
 #endif
 
-#include "../nbnxn_kernel_simd_utils.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h"
 
 static gmx_inline void gmx_simdcall
 gmx_load_simd_4xn_interactions(int                        excl,
index ffe53d5cd709cc26c50e69c3528a025feccae313..15bdf6ca91455228ba6318e24498597c516e4565 100644 (file)
 #define CHECK_EXCLS
             while (cjind < cjind1 && nbl->cj[cjind].excl != NBNXN_INTERACTION_MASK_ALL)
             {
-#include "nbnxn_kernel_simd_4xn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h"
                 cjind++;
             }
 #undef CHECK_EXCLS
             for (; (cjind < cjind1); cjind++)
             {
-#include "nbnxn_kernel_simd_4xn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h"
             }
 #undef HALF_LJ
 #undef CALC_COULOMB
 #define CHECK_EXCLS
             while (cjind < cjind1 && nbl->cj[cjind].excl != NBNXN_INTERACTION_MASK_ALL)
             {
-#include "nbnxn_kernel_simd_4xn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h"
                 cjind++;
             }
 #undef CHECK_EXCLS
             for (; (cjind < cjind1); cjind++)
             {
-#include "nbnxn_kernel_simd_4xn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h"
             }
 #undef CALC_COULOMB
         }
 #define CHECK_EXCLS
             while (cjind < cjind1 && nbl->cj[cjind].excl != NBNXN_INTERACTION_MASK_ALL)
             {
-#include "nbnxn_kernel_simd_4xn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h"
                 cjind++;
             }
 #undef CHECK_EXCLS
             for (; (cjind < cjind1); cjind++)
             {
-#include "nbnxn_kernel_simd_4xn_inner.h"
+#include "gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h"
             }
         }
 #undef CALC_LJ
similarity index 93%
rename from src/gromacs/legacyheaders/types/nbnxn_pairlist.h
rename to src/gromacs/mdlib/nbnxn_pairlist.h
index f89a418ce38db08c05f548d3337aca3b3bf6f052..09163178a358aa1f5e7bc2cab50cf0763c35069b 100644 (file)
 #ifndef _nbnxn_pairlist_h
 #define _nbnxn_pairlist_h
 
-#include "nblist.h"
+#include <stddef.h>
+
+#include "thread_mpi/atomic.h"
+
+#include "gromacs/legacyheaders/types/nblist.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/bitmask.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -122,7 +130,7 @@ typedef struct {
                             */
 } nbnxn_excl_t;
 
-typedef struct {
+typedef struct nbnxn_pairlist_t {
     gmx_cache_protect_t cp0;
 
     nbnxn_alloc_t      *alloc;
@@ -198,21 +206,16 @@ typedef struct {
 #define NBNXN_BUFFERFLAG_SIZE  16
 #endif
 
-/* We currently store the reduction flags as bits in an unsigned int.
- * In most cases this limits the number of flags to 32.
- * The reduction will automatically disable the flagging and do a full
- * reduction when the flags won't fit, but this will lead to very slow
- * reduction. As we anyhow don't expect reasonable performance with
- * more than 32 threads, we put in this hard limit.
- * You can increase this number, but the reduction will be very slow.
+/* We store the reduction flags as gmx_bitmask_t.
+ * This limits the number of flags to BITMASK_SIZE.
  */
-#define NBNXN_BUFFERFLAG_MAX_THREADS  32
+#define NBNXN_BUFFERFLAG_MAX_THREADS  (BITMASK_SIZE)
 
 /* Flags for telling if threads write to force output buffers */
 typedef struct {
-    int           nflag;       /* The number of flag blocks                         */
-    unsigned int *flag;        /* Bit i is set when thread i writes to a cell-block */
-    int           flag_nalloc; /* Allocation size of cxy_flag                       */
+    int               nflag;       /* The number of flag blocks                         */
+    gmx_bitmask_t    *flag;        /* Bit i is set when thread i writes to a cell-block */
+    int               flag_nalloc; /* Allocation size of cxy_flag                       */
 } nbnxn_buffer_flags_t;
 
 /* LJ combination rules: geometric, Lorentz-Berthelot, none */
@@ -220,10 +223,7 @@ enum {
     ljcrGEOM, ljcrLB, ljcrNONE, ljcrNR
 };
 
-/* TODO: Remove need for forward declare */
-struct tMPI_Atomic;
-
-typedef struct {
+typedef struct nbnxn_atomdata_t {
     nbnxn_alloc_t           *alloc;
     nbnxn_free_t            *free;
     int                      ntype;           /* The number of different atom types                 */
@@ -267,7 +267,7 @@ typedef struct {
     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 */
-    struct tMPI_Atomic      *syncStep;               /* Synchronization step for tree reduce */
+    tMPI_Atomic_t           *syncStep;               /* Synchronization step for tree reduce */
 } nbnxn_atomdata_t;
 
 #ifdef __cplusplus
index 63a2cc49c355c532726bf5e3ab7514d16faa25f5..14573e913c8ebceca426491cdbaee3b12e1cda5a 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,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nbnxn_search.h"
 
+#include <assert.h>
 #include <math.h>
 #include <string.h>
-#include <assert.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "macros.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/math/utilities.h"
-#include "vec.h"
-#include "pbc.h"
-#include "nbnxn_consts.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_atomdata.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/smalloc.h"
+
 /* nbnxn_internal.h included gromacs/simd/macros.h */
-#include "nbnxn_internal.h"
-#ifdef GMX_NBNXN_SIMD
+#include "gromacs/mdlib/nbnxn_internal.h"
+#ifdef GMX_SIMD
 #include "gromacs/simd/vector_operations.h"
 #endif
-#include "nbnxn_atomdata.h"
-#include "nbnxn_search.h"
-#include "gmx_omp_nthreads.h"
-#include "nrnb.h"
-#include "ns.h"
-
-#include "gromacs/fileio/gmxfio.h"
 
 #ifdef NBNXN_SEARCH_BB_SIMD4
 /* Always use 4-wide SIMD for bounding box calculations */
@@ -1381,14 +1380,13 @@ static void sort_columns_supersub(const nbnxn_search_t nbs,
                                   int cxy_start, int cxy_end,
                                   int *sort_work)
 {
-    int  cxy;
-    int  cx, cy, cz = -1, c = -1, ncz;
-    int  na, ash, na_c, ind, a;
-    int  subdiv_z, sub_z, na_z, ash_z;
-    int  subdiv_y, sub_y, na_y, ash_y;
-    int  subdiv_x, sub_x, na_x, ash_x;
+    int        cxy;
+    int        cx, cy, cz = -1, c = -1, ncz;
+    int        na, ash, na_c, ind, a;
+    int        subdiv_z, sub_z, na_z, ash_z;
+    int        subdiv_y, sub_y, na_y, ash_y;
+    int        subdiv_x, sub_x, na_x, ash_x;
 
-    /* cppcheck-suppress unassignedVariable */
     nbnxn_bb_t bb_work_array[2], *bb_work_aligned;
 
     bb_work_aligned = (nbnxn_bb_t *)(((size_t)(bb_work_array+1)) & (~((size_t)15)));
@@ -1766,7 +1764,7 @@ static void init_buffer_flags(nbnxn_buffer_flags_t *flags,
     }
     for (b = 0; b < flags->nflag; b++)
     {
-        flags->flag[b] = 0;
+        bitmask_clear(&(flags->flag[b]));
     }
 }
 
@@ -2943,10 +2941,10 @@ static void make_cluster_list_simple(const nbnxn_grid_t *gridj,
 }
 
 #ifdef GMX_NBNXN_SIMD_4XN
-#include "nbnxn_search_simd_4xn.h"
+#include "gromacs/mdlib/nbnxn_search_simd_4xn.h"
 #endif
 #ifdef GMX_NBNXN_SIMD_2XNN
-#include "nbnxn_search_simd_2xnn.h"
+#include "gromacs/mdlib/nbnxn_search_simd_2xnn.h"
 #endif
 
 /* Plain C or SIMD4 code for making a pair list of super-cell sci vs scj.
@@ -4333,6 +4331,12 @@ static int get_nsubpair_max(const nbnxn_search_t nbs,
 
     grid = &nbs->grid[0];
 
+    if (min_ci_balanced <= 0 || grid->nc >= min_ci_balanced || grid->nc == 0)
+    {
+        /* We don't need to worry */
+        return -1;
+    }
+
     ls[XX] = (grid->c1[XX] - grid->c0[XX])/(grid->ncx*GPU_NSUBCELL_X);
     ls[YY] = (grid->c1[YY] - grid->c0[YY])/(grid->ncy*GPU_NSUBCELL_Y);
     ls[ZZ] = (grid->c1[ZZ] - grid->c0[ZZ])*grid->ncx*grid->ncy/(grid->nc*GPU_NSUBCELL_Z);
@@ -4381,22 +4385,14 @@ static int get_nsubpair_max(const nbnxn_search_t nbs,
         nsp_est = nsp_est_nl;
     }
 
-    if (min_ci_balanced <= 0 || grid->nc >= min_ci_balanced || grid->nc == 0)
-    {
-        /* We don't need to worry */
-        nsubpair_max = -1;
-    }
-    else
-    {
-        /* Thus the (average) maximum j-list size should be as follows */
-        nsubpair_max = max(1, (int)(nsp_est/min_ci_balanced+0.5));
+    /* Thus the (average) maximum j-list size should be as follows */
+    nsubpair_max = max(1, (int)(nsp_est/min_ci_balanced+0.5));
 
-        /* Since the target value is a maximum (this avoids high outliers,
-         * which lead to load imbalance), not average, we add half the
-         * number of pairs in a cj4 block to get the average about right.
-         */
-        nsubpair_max += GPU_NSUBCELL*NBNXN_GPU_JGROUP_SIZE/2;
-    }
+    /* Since the target value is a maximum (this avoids high outliers,
+     * which lead to load imbalance), not average, we add half the
+     * number of pairs in a cj4 block to get the average about right.
+     */
+    nsubpair_max += GPU_NSUBCELL*NBNXN_GPU_JGROUP_SIZE/2;
 
     if (debug)
     {
@@ -4839,7 +4835,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
     int               ndistc;
     int               ncpcheck;
     int               gridi_flag_shift = 0, gridj_flag_shift = 0;
-    unsigned int     *gridj_flag       = NULL;
+    gmx_bitmask_t    *gridj_flag       = NULL;
     int               ncj_old_i, ncj_old_j;
 
     nbs_cycle_start(&work->cc[enbsCCsearch]);
@@ -5345,7 +5341,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
                                         cbl = nbl->cj[nbl->ncj-1].cj >> gridj_flag_shift;
                                         for (cb = cbf; cb <= cbl; cb++)
                                         {
-                                            gridj_flag[cb] = 1U<<th;
+                                            bitmask_init_bit(&gridj_flag[cb], th);
                                         }
                                     }
                                 }
@@ -5410,7 +5406,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
 
         if (bFBufferFlag && nbl->ncj > ncj_old_i)
         {
-            work->buffer_flags.flag[(gridi->cell0+ci)>>gridi_flag_shift] = 1U<<th;
+            bitmask_init_bit(&(work->buffer_flags.flag[(gridi->cell0+ci)>>gridi_flag_shift]), th);
         }
     }
 
@@ -5444,8 +5440,8 @@ static void reduce_buffer_flags(const nbnxn_search_t        nbs,
                                 int                         nsrc,
                                 const nbnxn_buffer_flags_t *dest)
 {
-    int                 s, b;
-    const unsigned int *flag;
+    int            s, b;
+    gmx_bitmask_t *flag;
 
     for (s = 0; s < nsrc; s++)
     {
@@ -5453,33 +5449,35 @@ static void reduce_buffer_flags(const nbnxn_search_t        nbs,
 
         for (b = 0; b < dest->nflag; b++)
         {
-            dest->flag[b] |= flag[b];
+            bitmask_union(&(dest->flag[b]), flag[b]);
         }
     }
 }
 
 static void print_reduction_cost(const nbnxn_buffer_flags_t *flags, int nout)
 {
-    int nelem, nkeep, ncopy, nred, b, c, out;
+    int           nelem, nkeep, ncopy, nred, b, c, out;
+    gmx_bitmask_t mask_0;
 
     nelem = 0;
     nkeep = 0;
     ncopy = 0;
     nred  = 0;
+    bitmask_init_bit(&mask_0, 0);
     for (b = 0; b < flags->nflag; b++)
     {
-        if (flags->flag[b] == 1)
+        if (bitmask_is_equal(flags->flag[b], mask_0))
         {
             /* Only flag 0 is set, no copy of reduction required */
             nelem++;
             nkeep++;
         }
-        else if (flags->flag[b] > 0)
+        else if (!bitmask_is_zero(flags->flag[b]))
         {
             c = 0;
             for (out = 0; out < nout; out++)
             {
-                if (flags->flag[b] & (1U<<out))
+                if (bitmask_is_set(flags->flag[b], out))
                 {
                     c++;
                 }
index 6b3ab7c8d2c8744dad189d8c331cfbc02b14c79a..8e644bf21a7f95b1547f773f18646709211766a4 100644 (file)
@@ -36,7 +36,8 @@
 #ifndef _nbnxn_search_h
 #define _nbnxn_search_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
 
 #ifdef __cplusplus
 extern "C" {
index 59760f4b94fd18072ab50e6e15c045a19e306666..2ff7bc991e32ad57953e57a7c25d98d9c5ebc0e4 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 /* Get the half-width SIMD stuff from the kernel utils files */
-#include "nbnxn_kernels/nbnxn_kernel_simd_utils.h"
+#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h"
 
 
 #if GMX_SIMD_REAL_WIDTH >= 2*NBNXN_CPU_CLUSTER_I_SIZE
index 8a328404badb64065b5791bef66e029bb0de6868..4e1c15a0ee65c8b19e4bc59d12345db7971d06f4 100644 (file)
@@ -33,7 +33,6 @@
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-
 #if GMX_SIMD_REAL_WIDTH >= NBNXN_CPU_CLUSTER_I_SIZE
 #define STRIDE_S  (GMX_SIMD_REAL_WIDTH)
 #else
@@ -110,6 +109,7 @@ make_cluster_list_simd_4xn(const nbnxn_grid_t *gridj,
     float                              d2;
     int                                xind_f, xind_l, cj;
 
+    /* cppcheck-suppress selfAssignment . selfAssignment for width 4.*/
     cjf = CI_TO_CJ_SIMD_4XN(cjf);
     cjl = CI_TO_CJ_SIMD_4XN(cjl+1) - 1;
 
index d3a04e026288058787c1875fcffedad3434edd5b..eae76faa151b221efdb4c8bbd70fb6670c1d997f 100644 (file)
 #ifndef _nbnxn_simd_h
 #define _nbnxn_simd_h
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 /* Include SIMD, below we select kernels based on the SIMD width */
 #include "gromacs/simd/simd.h"
@@ -63,7 +61,7 @@
 
 /* MIC for double is implemented in the SIMD module but so far missing in
    mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_mic.h */
-#if defined __MIC__ && !defined GMX_DOUBLE
+#if defined GMX_SIMD_X86_MIC && !defined GMX_DOUBLE
 #define GMX_NBNXN_SIMD
 #endif
 
diff --git a/src/gromacs/mdlib/nlistheuristics.c b/src/gromacs/mdlib/nlistheuristics.c
deleted file mode 100644 (file)
index d2f7401..0000000
+++ /dev/null
@@ -1,136 +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) 2012,2013, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
-#include "types/nlistheuristics.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-
-void reset_nlistheuristics(gmx_nlheur_t *nlh, gmx_int64_t step)
-{
-    nlh->lt_runav     = 0;
-    nlh->lt_runav2    = 0;
-    nlh->step_nscheck = step;
-}
-
-void init_nlistheuristics(gmx_nlheur_t *nlh,
-                          gmx_bool bGStatEveryStep, gmx_int64_t step)
-{
-    nlh->bGStatEveryStep = bGStatEveryStep;
-    nlh->nns             = 0;
-    nlh->nabnsb          = 0;
-    nlh->s1              = 0;
-    nlh->s2              = 0;
-    nlh->ab              = 0;
-
-    reset_nlistheuristics(nlh, step);
-}
-
-void update_nliststatistics(gmx_nlheur_t *nlh, gmx_int64_t step)
-{
-    gmx_int64_t     nl_lt;
-    char            sbuf[STEPSTRSIZE], sbuf2[STEPSTRSIZE];
-
-    /* Determine the neighbor list life time */
-    nl_lt = step - nlh->step_ns;
-    if (debug)
-    {
-        fprintf(debug, "%d atoms beyond ns buffer, updating neighbor list after %s steps\n", nlh->nabnsb, gmx_step_str(nl_lt, sbuf));
-    }
-    nlh->nns++;
-    nlh->s1 += nl_lt;
-    nlh->s2 += nl_lt*nl_lt;
-    nlh->ab += nlh->nabnsb;
-    if (nlh->lt_runav == 0)
-    {
-        nlh->lt_runav  = nl_lt;
-        /* Initialize the fluctuation average
-         * such that at startup we check after 0 steps.
-         */
-        nlh->lt_runav2 = sqr(nl_lt/2.0);
-    }
-    /* Running average with 0.9 gives an exp. history of 9.5 */
-    nlh->lt_runav2 = 0.9*nlh->lt_runav2 + 0.1*sqr(nlh->lt_runav - nl_lt);
-    nlh->lt_runav  = 0.9*nlh->lt_runav  + 0.1*nl_lt;
-    if (nlh->bGStatEveryStep)
-    {
-        /* Always check the nlist validity */
-        nlh->step_nscheck = step;
-    }
-    else
-    {
-        /* We check after:  <life time> - 2*sigma
-         * The factor 2 is quite conservative,
-         * but we assume that with nstlist=-1 the user
-         * prefers exact integration over performance.
-         */
-        nlh->step_nscheck = step
-            + (int)(nlh->lt_runav - 2.0*sqrt(nlh->lt_runav2)) - 1;
-    }
-    if (debug)
-    {
-        fprintf(debug, "nlist life time %s run av. %4.1f sig %3.1f check %s check with -gcom %d\n",
-                gmx_step_str(nl_lt, sbuf), nlh->lt_runav, sqrt(nlh->lt_runav2),
-                gmx_step_str(nlh->step_nscheck-step+1, sbuf2),
-                (int)(nlh->lt_runav - 2.0*sqrt(nlh->lt_runav2)));
-    }
-}
-
-void set_nlistheuristics(gmx_nlheur_t *nlh, gmx_bool bReset, gmx_int64_t step)
-{
-    int d;
-
-    if (bReset)
-    {
-        reset_nlistheuristics(nlh, step);
-    }
-    else
-    {
-        update_nliststatistics(nlh, step);
-    }
-
-    nlh->step_ns = step;
-    /* Initialize the cumulative coordinate scaling matrix */
-    clear_mat(nlh->scale_tot);
-    for (d = 0; d < DIM; d++)
-    {
-        nlh->scale_tot[d][d] = 1.0;
-    }
-}
index 430e26d304780b5b3f828efdad076163127cff1d..b78b3c2b915ae5c581d88d20496607df73d83b72 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/ns.h"
 
 #include <math.h>
+#include <stdlib.h>
 #include <string.h>
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/nsgrid.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/math/utilities.h"
-#include "vec.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "nsgrid.h"
-#include "force.h"
-#include "nonbonded.h"
-#include "ns.h"
-#include "pbc.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "nrnb.h"
-#include "txtdump.h"
-#include "mtop_util.h"
-
-#include "domdec.h"
-#include "adress.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
+#include "adress.h"
 
 /*
  *    E X C L U S I O N   H A N D L I N G
@@ -287,11 +287,8 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
         /* 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
-#ifndef DISABLE_WATERWATER_NLIST
             || nbl->nlist_sr[eNL_VDWQQ_WATERWATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_QQ_WATERWATER].kernelptr_vf == NULL
-#endif
-            )
+            || nbl->nlist_sr[eNL_QQ_WATERWATER].kernelptr_vf == NULL)
         {
             fr->solvent_opt = esolNO;
             if (log != NULL)
@@ -672,13 +669,11 @@ put_in_list_at(gmx_bool              bHaveVdW[],
 
     if (iwater != esolNO)
     {
-        vdwc = &nlist[eNL_VDWQQ_WATER];
-        vdw  = &nlist[eNL_VDW];
-        coul = &nlist[eNL_QQ_WATER];
-#ifndef DISABLE_WATERWATER_NLIST
+        vdwc    = &nlist[eNL_VDWQQ_WATER];
+        vdw     = &nlist[eNL_VDW];
+        coul    = &nlist[eNL_QQ_WATER];
         vdwc_ww = &nlist[eNL_VDWQQ_WATERWATER];
         coul_ww = &nlist[eNL_QQ_WATERWATER];
-#endif
     }
     else
     {
@@ -698,9 +693,7 @@ put_in_list_at(gmx_bool              bHaveVdW[],
             if (bDoCoul && bDoVdW)
             {
                 new_i_nblist(vdwc, i_atom, shift, gid);
-#ifndef DISABLE_WATERWATER_NLIST
                 new_i_nblist(vdwc_ww, i_atom, shift, gid);
-#endif
             }
             if (bDoVdW)
             {
@@ -709,9 +702,7 @@ put_in_list_at(gmx_bool              bHaveVdW[],
             if (bDoCoul)
             {
                 new_i_nblist(coul, i_atom, shift, gid);
-#ifndef DISABLE_WATERWATER_NLIST
                 new_i_nblist(coul_ww, i_atom, shift, gid);
-#endif
             }
             /* Loop over the j charge groups */
             for (j = 0; (j < nj); j++)
@@ -736,19 +727,6 @@ put_in_list_at(gmx_bool              bHaveVdW[],
                     }
                     else
                     {
-#ifdef DISABLE_WATERWATER_NLIST
-                        /* Add entries for the three atoms - only do VdW if we need to */
-                        if (!bDoVdW)
-                        {
-                            add_j_to_nblist(coul, jj0, bLR);
-                        }
-                        else
-                        {
-                            add_j_to_nblist(vdwc, jj0, bLR);
-                        }
-                        add_j_to_nblist(coul, jj0+1, bLR);
-                        add_j_to_nblist(coul, jj0+2, bLR);
-#else
                         /* One entry for the entire water-water interaction */
                         if (!bDoVdW)
                         {
@@ -758,7 +736,6 @@ put_in_list_at(gmx_bool              bHaveVdW[],
                         {
                             add_j_to_nblist(vdwc_ww, jj0, bLR);
                         }
-#endif
                     }
                 }
                 else if (iwater == esolTIP4P && jwater == esolTIP4P)
@@ -771,16 +748,6 @@ put_in_list_at(gmx_bool              bHaveVdW[],
                     }
                     else
                     {
-#ifdef DISABLE_WATERWATER_NLIST
-                        /* Add entries for the four atoms - only do VdW if we need to */
-                        if (bDoVdW)
-                        {
-                            add_j_to_nblist(vdw, jj0, bLR);
-                        }
-                        add_j_to_nblist(coul, jj0+1, bLR);
-                        add_j_to_nblist(coul, jj0+2, bLR);
-                        add_j_to_nblist(coul, jj0+3, bLR);
-#else
                         /* One entry for the entire water-water interaction */
                         if (!bDoVdW)
                         {
@@ -790,7 +757,6 @@ put_in_list_at(gmx_bool              bHaveVdW[],
                         {
                             add_j_to_nblist(vdwc_ww, jj0, bLR);
                         }
-#endif
                     }
                 }
                 else
@@ -851,10 +817,8 @@ put_in_list_at(gmx_bool              bHaveVdW[],
             close_i_nblist(vdw);
             close_i_nblist(coul);
             close_i_nblist(vdwc);
-#ifndef DISABLE_WATERWATER_NLIST
             close_i_nblist(coul_ww);
             close_i_nblist(vdwc_ww);
-#endif
         }
         else
         {
@@ -2131,7 +2095,7 @@ static int nsgrid_core(t_commrec *cr, t_forcerec *fr,
     gmx_ns_t     *ns;
     atom_id     **nl_lr_ljc, **nl_lr_one, **nl_sr;
     int          *nlr_ljc, *nlr_one, *nsr;
-    gmx_domdec_t *dd     = NULL;
+    gmx_domdec_t *dd;
     t_block      *cgs    = &(top->cgs);
     int          *cginfo = fr->cginfo;
     /* atom_id *i_atoms,*cgsindex=cgs->index; */
@@ -2159,10 +2123,7 @@ static int nsgrid_core(t_commrec *cr, t_forcerec *fr,
     ns = &fr->ns;
 
     bDomDec = DOMAINDECOMP(cr);
-    if (bDomDec)
-    {
-        dd = cr->dd;
-    }
+    dd      = cr->dd;
 
     bTriclinicX = ((YY < grid->npbcdim &&
                     (!bDomDec || dd->nc[YY] == 1) && box[YY][XX] != 0) ||
@@ -2872,107 +2833,3 @@ int search_neighbours(FILE *log, t_forcerec *fr,
 
     return nsearch;
 }
-
-int natoms_beyond_ns_buffer(t_inputrec *ir, t_forcerec *fr, t_block *cgs,
-                            matrix scale_tot, rvec *x)
-{
-    int  cg0, cg1, cg, a0, a1, a, i, j;
-    real rint, hbuf2, scale;
-    rvec *cg_cm, cgsc;
-    gmx_bool bIsotropic;
-    int  nBeyond;
-
-    nBeyond = 0;
-
-    rint = max(ir->rcoulomb, ir->rvdw);
-    if (ir->rlist < rint)
-    {
-        gmx_fatal(FARGS, "The neighbor search buffer has negative size: %f nm",
-                  ir->rlist - rint);
-    }
-    cg_cm = fr->cg_cm;
-
-    cg0 = fr->cg0;
-    cg1 = fr->hcg;
-
-    if (!EI_DYNAMICS(ir->eI) || !DYNAMIC_BOX(*ir))
-    {
-        hbuf2 = sqr(0.5*(ir->rlist - rint));
-        for (cg = cg0; cg < cg1; cg++)
-        {
-            a0 = cgs->index[cg];
-            a1 = cgs->index[cg+1];
-            for (a = a0; a < a1; a++)
-            {
-                if (distance2(cg_cm[cg], x[a]) > hbuf2)
-                {
-                    nBeyond++;
-                }
-            }
-        }
-    }
-    else
-    {
-        bIsotropic = TRUE;
-        scale      = scale_tot[0][0];
-        for (i = 1; i < DIM; i++)
-        {
-            /* With anisotropic scaling, the original spherical ns volumes become
-             * ellipsoids. To avoid costly transformations we use the minimum
-             * eigenvalue of the scaling matrix for determining the buffer size.
-             * Since the lower half is 0, the eigenvalues are the diagonal elements.
-             */
-            scale = min(scale, scale_tot[i][i]);
-            if (scale_tot[i][i] != scale_tot[i-1][i-1])
-            {
-                bIsotropic = FALSE;
-            }
-            for (j = 0; j < i; j++)
-            {
-                if (scale_tot[i][j] != 0)
-                {
-                    bIsotropic = FALSE;
-                }
-            }
-        }
-        hbuf2 = sqr(0.5*(scale*ir->rlist - rint));
-        if (bIsotropic)
-        {
-            for (cg = cg0; cg < cg1; cg++)
-            {
-                svmul(scale, cg_cm[cg], cgsc);
-                a0 = cgs->index[cg];
-                a1 = cgs->index[cg+1];
-                for (a = a0; a < a1; a++)
-                {
-                    if (distance2(cgsc, x[a]) > hbuf2)
-                    {
-                        nBeyond++;
-                    }
-                }
-            }
-        }
-        else
-        {
-            /* Anistropic scaling */
-            for (cg = cg0; cg < cg1; cg++)
-            {
-                /* Since scale_tot contains the transpose of the scaling matrix,
-                 * we need to multiply with the transpose.
-                 */
-                tmvmul_ur0(scale_tot, cg_cm[cg], cgsc);
-                a0 = cgs->index[cg];
-                a1 = cgs->index[cg+1];
-                for (a = a0; a < a1; a++)
-                {
-                    if (distance2(cgsc, x[a]) > hbuf2)
-                    {
-                        nBeyond++;
-                    }
-                }
-            }
-        }
-    }
-
-    return nBeyond;
-}
index 137b06f25559d6ef13d92f79586b1e2e76dc9a69..75e689e8f4112e029502bd3310de05d301667817 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <stdlib.h>
+#include "gromacs/legacyheaders/nsgrid.h"
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "nsgrid.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "network.h"
-#include "domdec.h"
-#include "pbc.h"
 #include <stdio.h>
-#include "gromacs/fileio/futil.h"
+#include <stdlib.h>
+
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/pdbio.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /***********************************
  *         Grid Routines
@@ -291,7 +289,7 @@ static void set_grid_sizes(matrix box, rvec izones_x0, rvec izones_x1, real rlis
                      */
                     /* Determine the shift for the corners of the triclinic box */
                     add_tric = izones_size[j]*box[j][i]/box[j][j];
-                    if (dd && dd->ndim == 1 && j == ZZ)
+                    if (dd->ndim == 1 && j == ZZ)
                     {
                         /* With 1D domain decomposition the cg's are not in
                          * the triclinic box, but trilinic x-y and rectangular y-z.
index c7382ab1ed14b969f5991a956eb87c51bfdc32ec..837113f2aec7e4791b259112854434e2c054ca28 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
+#include "gromacs/legacyheaders/perf_est.h"
 
-#include "perf_est.h"
-#include "physics.h"
-#include "vec.h"
-#include "mtop_util.h"
-#include "types/commrec.h"
-#include "nbnxn_search.h"
-#include "nbnxn_consts.h"
+#include <math.h>
 
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
 
 /* Computational cost of bonded, non-bonded and PME calculations.
  * This will be machine dependent.
index d3ba4ac4ab0a17e6b6f851d9f22f35cdfcd21cd9..d913f7f48925abd33818aa8e90317dac5d590b2a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #ifdef GMX_QMMM_GAMESS
 
 #include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "force.h"
-#include "invblock.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "bondf.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "qmmm.h"
 #include <stdio.h>
-#include <string.h>
-#include "gmx_fatal.h"
-#include "typedefs.h"
 #include <stdlib.h>
+#include <string.h>
+
+#include "gromacs/fileio/confio.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* QMMM sub routines */
index e7422941aed503572f6d2900777cb609aeaf63a3..d90232c7e86a55fae13a1b0ca5d9a31f4c1fb51f 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #ifdef GMX_QMMM_GAUSSIAN
 
 #include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "force.h"
-#include "invblock.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "bondf.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "qmmm.h"
 #include <stdio.h>
-#include <string.h>
-#include "gmx_fatal.h"
-#include "typedefs.h"
 #include <stdlib.h>
+#include <string.h>
+
+#include "gromacs/fileio/confio.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* TODO: this should be made thread-safe */
@@ -207,7 +201,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
 
         if (buf)
         {
-            qm->gauss_dir = strdup(buf);
+            qm->gauss_dir = gmx_strdup(buf);
         }
         else
         {
@@ -217,7 +211,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
         buf = getenv("GMX_QM_GAUSS_EXE");
         if (buf)
         {
-            qm->gauss_exe = strdup(buf);
+            qm->gauss_exe = gmx_strdup(buf);
         }
         else
         {
@@ -226,7 +220,7 @@ void init_gaussian(t_commrec *cr, t_QMrec *qm, t_MMrec *mm)
         buf = getenv("GMX_QM_MODIFIED_LINKS_DIR");
         if (buf)
         {
-            qm->devel_dir = strdup (buf);
+            qm->devel_dir = gmx_strdup (buf);
         }
         else
         {
@@ -1023,15 +1017,10 @@ void do_gaussian(int step, char *exe)
                 "input.log");
     }
     fprintf(stderr, "Calling '%s'\n", buf);
-#ifdef GMX_NO_SYSTEM
-    printf("Warning-- No calls to system(3) supported on this platform.");
-    gmx_fatal(FARGS, "Call to '%s' failed\n", buf);
-#else
     if (system(buf) != 0)
     {
         gmx_fatal(FARGS, "Call to '%s' failed\n", buf);
     }
-#endif
 }
 
 real call_gaussian(t_commrec *cr,  t_forcerec *fr,
index 760e4e00589779fbf2ca03dca0be1ae3e384b7bf..6eb689cd3ea5d5f4002da26408af314e9154625c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #ifdef GMX_QMMM_MOPAC
 
 #include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "force.h"
-#include "invblock.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "bondf.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "qmmm.h"
 #include <stdio.h>
-#include <string.h>
-#include "gmx_fatal.h"
-#include "typedefs.h"
 #include <stdlib.h>
+#include <string.h>
+
+#include "gromacs/fileio/confio.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 
 /* mopac interface routines */
index 7dbee944afdbf4dc7ee22bf097f5bb460a42f581..11ddfd325b901c82b2b25aa211aa228f59c9546b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "force.h"
-#include "invblock.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "bondf.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "qmmm.h"
 #include <stdio.h>
-#include <string.h>
-#include "gmx_fatal.h"
-#include "typedefs.h"
 #include <stdlib.h>
+#include <string.h>
+
+#include "gromacs/fileio/confio.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* ORCA interface routines */
 
index 91a8a2c98a6938e91394707f97e5b62bb5092c6e..bb83405a5548e083d481bcf88616aed3c422a2b5 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/qmmm.h"
+
+#include "config.h"
 
 #include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "force.h"
-#include "invblock.h"
-#include "gromacs/fileio/confio.h"
-#include "names.h"
-#include "network.h"
-#include "pbc.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "bondf.h"
-#include "mshift.h"
-#include "txtdump.h"
-#include "qmmm.h"
 #include <stdio.h>
-#include <string.h>
-#include "gmx_fatal.h"
-#include "typedefs.h"
 #include <stdlib.h>
-#include "mtop_util.h"
+#include <string.h>
 
+#include "gromacs/fileio/confio.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 /* declarations of the interfaces to the QM packages. The _SH indicate
  * the QM interfaces can be used for Surface Hopping simulations
index ede7ace0bae5731feb3a596b6d0ecaffda9f78ea..a4703cca24ebd8af1d5be38ae523119e038dd3f0 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "force.h"
-#include "names.h"
-#include "vec.h"
-#include "physics.h"
-#include "copyrite.h"
-#include "pbc.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 
 real RF_excl_correction(const t_forcerec *fr, t_graph *g,
                         const t_mdatoms *mdatoms, const t_blocka *excl,
diff --git a/src/gromacs/mdlib/shakef.c b/src/gromacs/mdlib/shakef.c
deleted file mode 100644 (file)
index ab09ea4..0000000
+++ /dev/null
@@ -1,577 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "pbc.h"
-#include "txtdump.h"
-#include "vec.h"
-#include "nrnb.h"
-#include "constr.h"
-
-typedef struct gmx_shakedata
-{
-    rvec *rij;
-    real *M2;
-    real *tt;
-    real *dist2;
-    int   nalloc;
-    /* SOR stuff */
-    real  delta;
-    real  omega;
-    real  gamma;
-} t_gmx_shakedata;
-
-gmx_shakedata_t shake_init()
-{
-    gmx_shakedata_t d;
-
-    snew(d, 1);
-
-    d->nalloc = 0;
-    d->rij    = NULL;
-    d->M2     = NULL;
-    d->tt     = NULL;
-    d->dist2  = NULL;
-
-    /* SOR initialization */
-    d->delta = 0.1;
-    d->omega = 1.0;
-    d->gamma = 1000000;
-
-    return d;
-}
-
-static void pv(FILE *log, char *s, rvec x)
-{
-    int m;
-
-    fprintf(log, "%5s:", s);
-    for (m = 0; (m < DIM); m++)
-    {
-        fprintf(log, "  %10.3f", x[m]);
-    }
-    fprintf(log, "\n");
-    fflush(log);
-}
-
-void cshake(atom_id iatom[], int ncon, int *nnit, int maxnit,
-            real dist2[], real xp[], real rij[], real m2[], real omega,
-            real invmass[], real tt[], real lagr[], int *nerror)
-{
-    /*
-     *     r.c. van schaik and w.f. van gunsteren
-     *     eth zuerich
-     *     june 1992
-     *     Adapted for use with Gromacs by David van der Spoel november 92 and later.
-     */
-    /* default should be increased! MRS 8/4/2009 */
-    const   real mytol = 1e-10;
-
-    int          ll, i, j, i3, j3, l3;
-    int          ix, iy, iz, jx, jy, jz;
-    real         toler, rpij2, rrpr, tx, ty, tz, diff, acor, im, jm;
-    real         xh, yh, zh, rijx, rijy, rijz;
-    real         tix, tiy, tiz;
-    real         tjx, tjy, tjz;
-    int          nit, error, nconv;
-    real         iconvf;
-
-    error = 0;
-    nconv = 1;
-    for (nit = 0; (nit < maxnit) && (nconv != 0) && (error == 0); nit++)
-    {
-        nconv = 0;
-        for (ll = 0; (ll < ncon) && (error == 0); ll++)
-        {
-            l3    = 3*ll;
-            rijx  = rij[l3+XX];
-            rijy  = rij[l3+YY];
-            rijz  = rij[l3+ZZ];
-            i     = iatom[l3+1];
-            j     = iatom[l3+2];
-            i3    = 3*i;
-            j3    = 3*j;
-            ix    = i3+XX;
-            iy    = i3+YY;
-            iz    = i3+ZZ;
-            jx    = j3+XX;
-            jy    = j3+YY;
-            jz    = j3+ZZ;
-
-            tx      = xp[ix]-xp[jx];
-            ty      = xp[iy]-xp[jy];
-            tz      = xp[iz]-xp[jz];
-            rpij2   = tx*tx+ty*ty+tz*tz;
-            toler   = dist2[ll];
-            diff    = toler-rpij2;
-
-            /* iconvf is less than 1 when the error is smaller than a bound */
-            /* But if tt is too big, then it will result in looping in iconv */
-
-            iconvf = fabs(diff)*tt[ll];
-
-            if (iconvf > 1)
-            {
-                nconv   = iconvf;
-                rrpr    = rijx*tx+rijy*ty+rijz*tz;
-
-                if (rrpr < toler*mytol)
-                {
-                    error = ll+1;
-                }
-                else
-                {
-                    acor      = omega*diff*m2[ll]/rrpr;
-                    lagr[ll] += acor;
-                    xh        = rijx*acor;
-                    yh        = rijy*acor;
-                    zh        = rijz*acor;
-                    im        = invmass[i];
-                    jm        = invmass[j];
-                    xp[ix]   += xh*im;
-                    xp[iy]   += yh*im;
-                    xp[iz]   += zh*im;
-                    xp[jx]   -= xh*jm;
-                    xp[jy]   -= yh*jm;
-                    xp[jz]   -= zh*jm;
-                }
-            }
-        }
-    }
-    *nnit   = nit;
-    *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 lagr[],
-               real invdt, rvec *v,
-               gmx_bool bCalcVir, tensor vir_r_m_dr, int econq,
-               t_vetavars *vetavar)
-{
-    rvec    *rij;
-    real    *M2, *tt, *dist2;
-    int      maxnit = 1000;
-    int      nit    = 0, ll, i, j, type;
-    t_iatom *ia;
-    real     L1, tol2, toler;
-    real     mm    = 0., tmp;
-    int      error = 0;
-    real     g, vscale, rscale, rvscale;
-
-    if (ncon > shaked->nalloc)
-    {
-        shaked->nalloc = over_alloc_dd(ncon);
-        srenew(shaked->rij, shaked->nalloc);
-        srenew(shaked->M2, shaked->nalloc);
-        srenew(shaked->tt, shaked->nalloc);
-        srenew(shaked->dist2, shaked->nalloc);
-    }
-    rij   = shaked->rij;
-    M2    = shaked->M2;
-    tt    = shaked->tt;
-    dist2 = shaked->dist2;
-
-    L1   = 1.0-lambda;
-    tol2 = 2.0*tol;
-    ia   = iatom;
-    for (ll = 0; (ll < ncon); ll++, ia += 3)
-    {
-        type  = ia[0];
-        i     = ia[1];
-        j     = ia[2];
-
-        mm          = 2*(invmass[i]+invmass[j]);
-        rij[ll][XX] = x[i][XX]-x[j][XX];
-        rij[ll][YY] = x[i][YY]-x[j][YY];
-        rij[ll][ZZ] = x[i][ZZ]-x[j][ZZ];
-        M2[ll]      = 1.0/mm;
-        if (bFEP)
-        {
-            toler = sqr(L1*ip[type].constr.dA + lambda*ip[type].constr.dB);
-        }
-        else
-        {
-            toler = sqr(ip[type].constr.dA);
-        }
-        dist2[ll] = toler;
-        tt[ll]    = 1.0/(toler*tol2);
-    }
-
-    switch (econq)
-    {
-        case econqCoord:
-            cshake(iatom, ncon, &nit, maxnit, dist2, prime[0], rij[0], M2, omega, invmass, tt, lagr, &error);
-            break;
-        case econqVeloc:
-            crattle(iatom, ncon, &nit, maxnit, dist2, prime[0], rij[0], M2, omega, invmass, tt, lagr, &error, invdt, vetavar);
-            break;
-    }
-
-    if (nit >= maxnit)
-    {
-        if (fplog)
-        {
-            fprintf(fplog, "Shake did not converge in %d steps\n", maxnit);
-        }
-        fprintf(stderr, "Shake did not converge in %d steps\n", maxnit);
-        nit = 0;
-    }
-    else if (error != 0)
-    {
-        if (fplog)
-        {
-            fprintf(fplog, "Inner product between old and new vector <= 0.0!\n"
-                    "constraint #%d atoms %u and %u\n",
-                    error-1, iatom[3*(error-1)+1]+1, iatom[3*(error-1)+2]+1);
-        }
-        fprintf(stderr, "Inner product between old and new vector <= 0.0!\n"
-                "constraint #%d atoms %u and %u\n",
-                error-1, iatom[3*(error-1)+1]+1, iatom[3*(error-1)+2]+1);
-        nit = 0;
-    }
-
-    /* Constraint virial and correct the lagrange multipliers for the length */
-
-    ia = iatom;
-
-    for (ll = 0; (ll < ncon); ll++, ia += 3)
-    {
-
-        if ((econq == econqCoord) && v != NULL)
-        {
-            /* Correct the velocities */
-            mm = lagr[ll]*invmass[ia[1]]*invdt/vetavar->rscale;
-            for (i = 0; i < DIM; i++)
-            {
-                v[ia[1]][i] += mm*rij[ll][i];
-            }
-            mm = lagr[ll]*invmass[ia[2]]*invdt/vetavar->rscale;
-            for (i = 0; i < DIM; i++)
-            {
-                v[ia[2]][i] -= mm*rij[ll][i];
-            }
-            /* 16 flops */
-        }
-
-        /* constraint virial */
-        if (bCalcVir)
-        {
-            if (econq == econqCoord)
-            {
-                mm = lagr[ll]/vetavar->rvscale;
-            }
-            if (econq == econqVeloc)
-            {
-                mm = lagr[ll]/(vetavar->vscale*vetavar->vscale_nhc[0]);
-            }
-            for (i = 0; i < DIM; i++)
-            {
-                tmp = mm*rij[ll][i];
-                for (j = 0; j < DIM; j++)
-                {
-                    vir_r_m_dr[i][j] -= tmp*rij[ll][j];
-                }
-            }
-            /* 21 flops */
-        }
-
-        /* Correct the lagrange multipliers for the length  */
-        /* (more details would be useful here . . . )*/
-
-        type  = ia[0];
-        if (bFEP)
-        {
-            toler = L1*ip[type].constr.dA + lambda*ip[type].constr.dB;
-        }
-        else
-        {
-            toler     = ip[type].constr.dA;
-            lagr[ll] *= toler;
-        }
-    }
-
-    return nit;
-}
-
-static void check_cons(FILE *log, int nc, rvec x[], rvec prime[], rvec v[],
-                       t_iparams ip[], t_iatom *iatom,
-                       real invmass[], int econq)
-{
-    t_iatom *ia;
-    int      ai, aj;
-    int      i;
-    real     d, dp;
-    rvec     dx, dv;
-
-    fprintf(log,
-            "    i     mi      j     mj      before       after   should be\n");
-    ia = iatom;
-    for (i = 0; (i < nc); i++, ia += 3)
-    {
-        ai = ia[1];
-        aj = ia[2];
-        rvec_sub(x[ai], x[aj], dx);
-        d = norm(dx);
-
-        switch (econq)
-        {
-            case econqCoord:
-                rvec_sub(prime[ai], prime[aj], dx);
-                dp = norm(dx);
-                fprintf(log, "%5d  %5.2f  %5d  %5.2f  %10.5f  %10.5f  %10.5f\n",
-                        ai+1, 1.0/invmass[ai],
-                        aj+1, 1.0/invmass[aj], d, dp, ip[ia[0]].constr.dA);
-                break;
-            case econqVeloc:
-                rvec_sub(v[ai], v[aj], dv);
-                d = iprod(dx, dv);
-                rvec_sub(prime[ai], prime[aj], dv);
-                dp = iprod(dx, dv);
-                fprintf(log, "%5d  %5.2f  %5d  %5.2f  %10.5f  %10.5f  %10.5f\n",
-                        ai+1, 1.0/invmass[ai],
-                        aj+1, 1.0/invmass[aj], d, dp, 0.);
-                break;
-        }
-    }
-}
-
-gmx_bool bshakef(FILE *log, gmx_shakedata_t shaked,
-                 real invmass[], int nblocks, int sblock[],
-                 t_idef *idef, t_inputrec *ir, rvec x_s[], rvec prime[],
-                 t_nrnb *nrnb, real *lagr, real lambda, real *dvdlambda,
-                 real invdt, rvec *v, gmx_bool bCalcVir, tensor vir_r_m_dr,
-                 gmx_bool bDumpOnError, int econq, t_vetavars *vetavar)
-{
-    t_iatom *iatoms;
-    real    *lam, dt_2, dvdl;
-    int      i, n0, ncons, blen, type;
-    int      tnit = 0, trij = 0;
-
-#ifdef DEBUG
-    fprintf(log, "nblocks=%d, sblock[0]=%d\n", nblocks, sblock[0]);
-#endif
-
-    ncons = idef->il[F_CONSTR].nr/3;
-
-    for (i = 0; i < ncons; i++)
-    {
-        lagr[i] = 0;
-    }
-
-    iatoms = &(idef->il[F_CONSTR].iatoms[sblock[0]]);
-    lam    = lagr;
-    for (i = 0; (i < nblocks); )
-    {
-        blen  = (sblock[i+1]-sblock[i]);
-        blen /= 3;
-        n0    = vec_shakef(log, shaked, invmass, blen, idef->iparams,
-                           iatoms, ir->shake_tol, x_s, prime, shaked->omega,
-                           ir->efep != efepNO, lambda, lam, invdt, v, bCalcVir, vir_r_m_dr,
-                           econq, vetavar);
-
-#ifdef DEBUGSHAKE
-        check_cons(log, blen, x_s, prime, v, idef->iparams, iatoms, invmass, econq);
-#endif
-
-        if (n0 == 0)
-        {
-            if (bDumpOnError && log)
-            {
-                {
-                    check_cons(log, blen, x_s, prime, v, idef->iparams, iatoms, invmass, econq);
-                }
-            }
-            return FALSE;
-        }
-        tnit   += n0*blen;
-        trij   += blen;
-        iatoms += 3*blen; /* Increment pointer! */
-        lam    += blen;
-        i++;
-    }
-    /* only for position part? */
-    if (econq == econqCoord)
-    {
-        if (ir->efep != efepNO)
-        {
-            real bondA, bondB;
-            dt_2 = 1/sqr(ir->delta_t);
-            dvdl = 0;
-            for (i = 0; i < ncons; i++)
-            {
-                type  = idef->il[F_CONSTR].iatoms[3*i];
-
-                /* dh/dl contribution from constraint force is  dh/dr (constraint force) dot dr/dl */
-                /* constraint force is -\sum_i lagr_i* d(constraint)/dr, with constrant = r^2-d^2  */
-                /* constraint force is -\sum_i lagr_i* 2 r  */
-                /* so dh/dl = -\sum_i lagr_i* 2 r * dr/dl */
-                /* However, by comparison with lincs and with
-                   comparison with a full thermodynamics cycle (see
-                   redmine issue #1255), this is off by a factor of
-                   two -- the 2r should apparently just be r.  Further
-                   investigation should be done at some point to
-                   understand why and see if there is something deeper
-                   we are missing */
-
-                bondA = idef->iparams[type].constr.dA;
-                bondB = idef->iparams[type].constr.dB;
-                dvdl += lagr[i] * dt_2 * ((1.0-lambda)*bondA + lambda*bondB) * (bondB-bondA);
-            }
-            *dvdlambda += dvdl;
-        }
-    }
-#ifdef DEBUG
-    fprintf(log, "tnit: %5d  omega: %10.5f\n", tnit, omega);
-#endif
-    if (ir->bShakeSOR)
-    {
-        if (tnit > shaked->gamma)
-        {
-            shaked->delta *= -0.5;
-        }
-        shaked->omega += shaked->delta;
-        shaked->gamma  = tnit;
-    }
-    inc_nrnb(nrnb, eNR_SHAKE, tnit);
-    inc_nrnb(nrnb, eNR_SHAKE_RIJ, trij);
-    if (v)
-    {
-        inc_nrnb(nrnb, eNR_CONSTR_V, trij*2);
-    }
-    if (bCalcVir)
-    {
-        inc_nrnb(nrnb, eNR_CONSTR_VIR, trij);
-    }
-
-    return TRUE;
-}
-
-void crattle(atom_id iatom[], int ncon, int *nnit, int maxnit,
-             real dist2[], real vp[], real rij[], real m2[], real omega,
-             real invmass[], real tt[], real lagr[], int *nerror, real invdt, t_vetavars *vetavar)
-{
-    /*
-     *     r.c. van schaik and w.f. van gunsteren
-     *     eth zuerich
-     *     june 1992
-     *     Adapted for use with Gromacs by David van der Spoel november 92 and later.
-     *     rattle added by M.R. Shirts, April 2004, from code written by Jay Ponder in TINKER
-     *     second part of rattle algorithm
-     */
-
-    const   real mytol = 1e-10;
-
-    int          ll, i, j, i3, j3, l3, ii;
-    int          ix, iy, iz, jx, jy, jz;
-    real         toler, rijd, vpijd, vx, vy, vz, diff, acor, xdotd, fac, im, jm, imdt, jmdt;
-    real         xh, yh, zh, rijx, rijy, rijz;
-    real         tix, tiy, tiz;
-    real         tjx, tjy, tjz;
-    int          nit, error, nconv;
-    real         veta, vscale_nhc, iconvf;
-
-    veta       = vetavar->veta;
-    vscale_nhc = vetavar->vscale_nhc[0];  /* for now, just use the first state */
-
-    error = 0;
-    nconv = 1;
-    for (nit = 0; (nit < maxnit) && (nconv != 0) && (error == 0); nit++)
-    {
-        nconv = 0;
-        for (ll = 0; (ll < ncon) && (error == 0); ll++)
-        {
-            l3      = 3*ll;
-            rijx    = rij[l3+XX];
-            rijy    = rij[l3+YY];
-            rijz    = rij[l3+ZZ];
-            i       = iatom[l3+1];
-            j       = iatom[l3+2];
-            i3      = 3*i;
-            j3      = 3*j;
-            ix      = i3+XX;
-            iy      = i3+YY;
-            iz      = i3+ZZ;
-            jx      = j3+XX;
-            jy      = j3+YY;
-            jz      = j3+ZZ;
-            vx      = vp[ix]-vp[jx];
-            vy      = vp[iy]-vp[jy];
-            vz      = vp[iz]-vp[jz];
-
-            vpijd   = vx*rijx+vy*rijy+vz*rijz;
-            toler   = dist2[ll];
-            /* this is r(t+dt) \dotproduct \dot{r}(t+dt) */
-            xdotd   = vpijd*vscale_nhc + veta*toler;
-
-            /* iconv is zero when the error is smaller than a bound */
-            iconvf   = fabs(xdotd)*(tt[ll]/invdt);
-
-            if (iconvf > 1)
-            {
-                nconv     = iconvf;
-                fac       = omega*2.0*m2[ll]/toler;
-                acor      = -fac*xdotd;
-                lagr[ll] += acor;
-
-                xh        = rijx*acor;
-                yh        = rijy*acor;
-                zh        = rijz*acor;
-
-                im        = invmass[i]/vscale_nhc;
-                jm        = invmass[j]/vscale_nhc;
-
-                vp[ix] += xh*im;
-                vp[iy] += yh*im;
-                vp[iz] += zh*im;
-                vp[jx] -= xh*jm;
-                vp[jy] -= yh*jm;
-                vp[jz] -= zh*jm;
-            }
-        }
-    }
-    *nnit   = nit;
-    *nerror = error;
-}
diff --git a/src/gromacs/mdlib/shakef.cpp b/src/gromacs/mdlib/shakef.cpp
new file mode 100644 (file)
index 0000000..20d620b
--- /dev/null
@@ -0,0 +1,587 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 <math.h>
+
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/smalloc.h"
+
+typedef struct gmx_shakedata
+{
+    rvec *rij;
+    real *half_of_reduced_mass;
+    real *distance_squared_tolerance;
+    real *constraint_distance_squared;
+    int   nalloc;
+    /* SOR stuff */
+    real  delta;
+    real  omega;
+    real  gamma;
+} t_gmx_shakedata;
+
+gmx_shakedata_t shake_init()
+{
+    gmx_shakedata_t d;
+
+    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;
+
+    /* SOR initialization */
+    d->delta = 0.1;
+    d->omega = 1.0;
+    d->gamma = 1000000;
+
+    return d;
+}
+
+static void pv(FILE *log, char *s, rvec x)
+{
+    int m;
+
+    fprintf(log, "%5s:", s);
+    for (m = 0; (m < DIM); m++)
+    {
+        fprintf(log, "  %10.3f", x[m]);
+    }
+    fprintf(log, "\n");
+    fflush(log);
+}
+
+/*! \brief Inner kernel for SHAKE constraints
+ *
+ * Original implementation from R.C. van Schaik and W.F. van Gunsteren
+ * (ETH Zuerich, June 1992), adapted for GROMACS by David van der
+ * Spoel November 1992.
+ *
+ * The algorithm here is based section five of Ryckaert, Ciccotti and
+ * Berendsen, J Comp Phys, 23, 327, 1977.
+ *
+ * \param[in]    iatom                         Mini-topology of triples of constraint type (unused in this
+ *                                             function) and indices of the two atoms involved
+ * \param[in]    ncon                          Number of constraints
+ * \param[out]   nnit                          Number of iterations performed
+ * \param[in]    maxnit                        Maximum number of iterations permitted
+ * \param[in]    constraint_distance_squared   The objective value for each constraint
+ * \param[inout] positions                     The initial (and final) values of the positions of all atoms
+ * \param[in]    initial_displacements         The initial displacements of each constraint
+ * \param[in]    half_of_reduced_mass          Half of the reduced mass for each constraint
+ * \param[in]    omega                         SHAKE over-relaxation factor (set non-1.0 by
+ *                                             using shake-sor=yes in the .mdp, but there is no documentation anywhere)
+ * \param[in]    invmass                       Inverse mass of each atom
+ * \param[in]    distance_squared_tolerance    Multiplicative tolerance on the difference in the
+ *                                             square of the constrained distance (see code)
+ * \param[out]   scaled_lagrange_multiplier    Scaled Lagrange multiplier for each constraint (-2 * eta from p. 336
+ *                                             of the paper, divided by the constraint distance)
+ * \param[out]   nerror                        Zero upon success, returns one more than the index of the
+ *                                             problematic constraint if the input was malformed
+ *
+ * \todo Make SHAKE use better data structures, in particular for iatom. */
+void cshake(const atom_id iatom[], int ncon, int *nnit, int maxnit,
+            const real constraint_distance_squared[], real positions[],
+            const real initial_displacements[], const real half_of_reduced_mass[], real omega,
+            const real invmass[], const real distance_squared_tolerance[],
+            real scaled_lagrange_multiplier[], int *nerror)
+{
+    /* default should be increased! MRS 8/4/2009 */
+    const real mytol = 1e-10;
+
+    int        ll, i, j, i3, j3, l3;
+    int        ix, iy, iz, jx, jy, jz;
+    real       r_dot_r_prime;
+    real       constraint_distance_squared_ll;
+    real       r_prime_squared;
+    real       scaled_lagrange_multiplier_ll;
+    real       r_prime_x, r_prime_y, r_prime_z, diff, im, jm;
+    real       xh, yh, zh, rijx, rijy, rijz;
+    int        nit, error, nconv;
+    real       iconvf;
+
+    // TODO nconv is used solely as a boolean, so we should write the
+    // code like that
+    error = 0;
+    nconv = 1;
+    for (nit = 0; (nit < maxnit) && (nconv != 0) && (error == 0); nit++)
+    {
+        nconv = 0;
+        for (ll = 0; (ll < ncon) && (error == 0); ll++)
+        {
+            l3    = 3*ll;
+            rijx  = initial_displacements[l3+XX];
+            rijy  = initial_displacements[l3+YY];
+            rijz  = initial_displacements[l3+ZZ];
+            i     = iatom[l3+1];
+            j     = iatom[l3+2];
+            i3    = 3*i;
+            j3    = 3*j;
+            ix    = i3+XX;
+            iy    = i3+YY;
+            iz    = i3+ZZ;
+            jx    = j3+XX;
+            jy    = j3+YY;
+            jz    = j3+ZZ;
+
+            /* Compute r prime between atoms i and j, which is the
+               displacement *before* this update stage */
+            r_prime_x       = positions[ix]-positions[jx];
+            r_prime_y       = positions[iy]-positions[jy];
+            r_prime_z       = positions[iz]-positions[jz];
+            r_prime_squared = (r_prime_x * r_prime_x +
+                               r_prime_y * r_prime_y +
+                               r_prime_z * r_prime_z);
+            constraint_distance_squared_ll = constraint_distance_squared[ll];
+            diff    = constraint_distance_squared_ll - r_prime_squared;
+
+            /* iconvf is less than 1 when the error is smaller than a bound */
+            iconvf = fabs(diff) * distance_squared_tolerance[ll];
+
+            if (iconvf > 1.0)
+            {
+                nconv         = static_cast<int>(iconvf);
+                r_dot_r_prime = (rijx * r_prime_x +
+                                 rijy * r_prime_y +
+                                 rijz * r_prime_z);
+
+                if (r_dot_r_prime < constraint_distance_squared_ll * mytol)
+                {
+                    error = ll+1;
+                }
+                else
+                {
+                    /* The next line solves equation 5.6 (neglecting
+                       the term in g^2), for g */
+                    scaled_lagrange_multiplier_ll   = omega*diff*half_of_reduced_mass[ll]/r_dot_r_prime;
+                    scaled_lagrange_multiplier[ll] += scaled_lagrange_multiplier_ll;
+                    xh                              = rijx * scaled_lagrange_multiplier_ll;
+                    yh                              = rijy * scaled_lagrange_multiplier_ll;
+                    zh                              = rijz * scaled_lagrange_multiplier_ll;
+                    im                              = invmass[i];
+                    jm                              = invmass[j];
+                    positions[ix]                  += xh*im;
+                    positions[iy]                  += yh*im;
+                    positions[iz]                  += zh*im;
+                    positions[jx]                  -= xh*jm;
+                    positions[jy]                  -= yh*jm;
+                    positions[jz]                  -= zh*jm;
+                }
+            }
+        }
+    }
+    *nnit   = nit;
+    *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)
+{
+    rvec    *rij;
+    real    *half_of_reduced_mass, *distance_squared_tolerance, *constraint_distance_squared;
+    int      maxnit = 1000;
+    int      nit    = 0, ll, i, j, d, d2, type;
+    t_iatom *ia;
+    real     L1;
+    real     mm    = 0., tmp;
+    int      error = 0;
+    real     constraint_distance;
+
+    if (ncon > shaked->nalloc)
+    {
+        shaked->nalloc = over_alloc_dd(ncon);
+        srenew(shaked->rij, shaked->nalloc);
+        srenew(shaked->half_of_reduced_mass, shaked->nalloc);
+        srenew(shaked->distance_squared_tolerance, shaked->nalloc);
+        srenew(shaked->constraint_distance_squared, shaked->nalloc);
+    }
+    rij                          = shaked->rij;
+    half_of_reduced_mass         = shaked->half_of_reduced_mass;
+    distance_squared_tolerance   = shaked->distance_squared_tolerance;
+    constraint_distance_squared  = shaked->constraint_distance_squared;
+
+    L1   = 1.0-lambda;
+    ia   = iatom;
+    for (ll = 0; (ll < ncon); ll++, ia += 3)
+    {
+        type  = ia[0];
+        i     = ia[1];
+        j     = ia[2];
+
+        mm                       = 2.0*(invmass[i]+invmass[j]);
+        rij[ll][XX]              = x[i][XX]-x[j][XX];
+        rij[ll][YY]              = x[i][YY]-x[j][YY];
+        rij[ll][ZZ]              = x[i][ZZ]-x[j][ZZ];
+        half_of_reduced_mass[ll] = 1.0/mm;
+        if (bFEP)
+        {
+            constraint_distance = L1*ip[type].constr.dA + lambda*ip[type].constr.dB;
+        }
+        else
+        {
+            constraint_distance = ip[type].constr.dA;
+        }
+        constraint_distance_squared[ll]  = sqr(constraint_distance);
+        distance_squared_tolerance[ll]   = 0.5/(constraint_distance_squared[ll]*tol);
+    }
+
+    switch (econq)
+    {
+        case econqCoord:
+            cshake(iatom, ncon, &nit, maxnit, constraint_distance_squared, prime[0], rij[0], half_of_reduced_mass, omega, invmass, distance_squared_tolerance, scaled_lagrange_multiplier, &error);
+            break;
+        case econqVeloc:
+            crattle(iatom, ncon, &nit, maxnit, constraint_distance_squared, prime[0], rij[0], half_of_reduced_mass, omega, invmass, distance_squared_tolerance, scaled_lagrange_multiplier, &error, invdt);
+            break;
+    }
+
+    if (nit >= maxnit)
+    {
+        if (fplog)
+        {
+            fprintf(fplog, "Shake did not converge in %d steps\n", maxnit);
+        }
+        fprintf(stderr, "Shake did not converge in %d steps\n", maxnit);
+        nit = 0;
+    }
+    else if (error != 0)
+    {
+        if (fplog)
+        {
+            fprintf(fplog, "Inner product between old and new vector <= 0.0!\n"
+                    "constraint #%d atoms %d and %d\n",
+                    error-1, iatom[3*(error-1)+1]+1, iatom[3*(error-1)+2]+1);
+        }
+        fprintf(stderr, "Inner product between old and new vector <= 0.0!\n"
+                "constraint #%d atoms %d and %d\n",
+                error-1, iatom[3*(error-1)+1]+1, iatom[3*(error-1)+2]+1);
+        nit = 0;
+    }
+
+    /* Constraint virial and correct the Lagrange multipliers for the length */
+
+    ia = iatom;
+
+    for (ll = 0; (ll < ncon); ll++, ia += 3)
+    {
+        type  = ia[0];
+        i     = ia[1];
+        j     = ia[2];
+
+        if ((econq == econqCoord) && v != NULL)
+        {
+            /* Correct the velocities */
+            mm = scaled_lagrange_multiplier[ll]*invmass[i]*invdt;
+            for (d = 0; d < DIM; d++)
+            {
+                v[ia[1]][d] += mm*rij[ll][d];
+            }
+            mm = scaled_lagrange_multiplier[ll]*invmass[j]*invdt;
+            for (d = 0; d < DIM; d++)
+            {
+                v[ia[2]][d] -= mm*rij[ll][d];
+            }
+            /* 16 flops */
+        }
+
+        /* constraint virial */
+        if (bCalcVir)
+        {
+            mm = scaled_lagrange_multiplier[ll];
+            for (d = 0; d < DIM; d++)
+            {
+                tmp = mm*rij[ll][d];
+                for (d2 = 0; d2 < DIM; d2++)
+                {
+                    vir_r_m_dr[d][d2] -= tmp*rij[ll][d2];
+                }
+            }
+            /* 21 flops */
+        }
+
+        /* cshake and crattle produce Lagrange multipliers scaled by
+           the reciprocal of the constraint length, so fix that */
+        if (bFEP)
+        {
+            constraint_distance = L1*ip[type].constr.dA + lambda*ip[type].constr.dB;
+        }
+        else
+        {
+            constraint_distance = ip[type].constr.dA;
+        }
+        scaled_lagrange_multiplier[ll] *= constraint_distance;
+    }
+
+    return nit;
+}
+
+static void check_cons(FILE *log, int nc, rvec x[], rvec prime[], rvec v[],
+                       t_iparams ip[], t_iatom *iatom,
+                       real invmass[], int econq)
+{
+    t_iatom *ia;
+    int      ai, aj;
+    int      i;
+    real     d, dp;
+    rvec     dx, dv;
+
+    fprintf(log,
+            "    i     mi      j     mj      before       after   should be\n");
+    ia = iatom;
+    for (i = 0; (i < nc); i++, ia += 3)
+    {
+        ai = ia[1];
+        aj = ia[2];
+        rvec_sub(x[ai], x[aj], dx);
+        d = norm(dx);
+
+        switch (econq)
+        {
+            case econqCoord:
+                rvec_sub(prime[ai], prime[aj], dx);
+                dp = norm(dx);
+                fprintf(log, "%5d  %5.2f  %5d  %5.2f  %10.5f  %10.5f  %10.5f\n",
+                        ai+1, 1.0/invmass[ai],
+                        aj+1, 1.0/invmass[aj], d, dp, ip[ia[0]].constr.dA);
+                break;
+            case econqVeloc:
+                rvec_sub(v[ai], v[aj], dv);
+                d = iprod(dx, dv);
+                rvec_sub(prime[ai], prime[aj], dv);
+                dp = iprod(dx, dv);
+                fprintf(log, "%5d  %5.2f  %5d  %5.2f  %10.5f  %10.5f  %10.5f\n",
+                        ai+1, 1.0/invmass[ai],
+                        aj+1, 1.0/invmass[aj], d, dp, 0.);
+                break;
+        }
+    }
+}
+
+gmx_bool bshakef(FILE *log, gmx_shakedata_t shaked,
+                 real invmass[], int nblocks, int sblock[],
+                 t_idef *idef, t_inputrec *ir, rvec x_s[], rvec prime[],
+                 t_nrnb *nrnb, real *scaled_lagrange_multiplier, real lambda, real *dvdlambda,
+                 real invdt, rvec *v, gmx_bool bCalcVir, tensor vir_r_m_dr,
+                 gmx_bool bDumpOnError, int econq)
+{
+    t_iatom *iatoms;
+    real     dt_2, dvdl;
+    int      i, n0, ncon, blen, type, ll;
+    int      tnit = 0, trij = 0;
+
+#ifdef DEBUG
+    fprintf(log, "nblocks=%d, sblock[0]=%d\n", nblocks, sblock[0]);
+#endif
+
+    ncon = idef->il[F_CONSTR].nr/3;
+
+    for (ll = 0; ll < ncon; ll++)
+    {
+        scaled_lagrange_multiplier[ll] = 0;
+    }
+
+    iatoms = &(idef->il[F_CONSTR].iatoms[sblock[0]]);
+    for (i = 0; (i < nblocks); )
+    {
+        blen  = (sblock[i+1]-sblock[i]);
+        blen /= 3;
+        n0    = vec_shakef(log, shaked, invmass, blen, idef->iparams,
+                           iatoms, ir->shake_tol, x_s, prime, shaked->omega,
+                           ir->efep != efepNO, lambda, scaled_lagrange_multiplier, invdt, v, bCalcVir, vir_r_m_dr,
+                           econq);
+
+#ifdef DEBUGSHAKE
+        check_cons(log, blen, x_s, prime, v, idef->iparams, iatoms, invmass, econq);
+#endif
+
+        if (n0 == 0)
+        {
+            if (bDumpOnError && log)
+            {
+                {
+                    check_cons(log, blen, x_s, prime, v, idef->iparams, iatoms, invmass, econq);
+                }
+            }
+            return FALSE;
+        }
+        tnit                       += n0*blen;
+        trij                       += blen;
+        iatoms                     += 3*blen; /* Increment pointer! */
+        scaled_lagrange_multiplier += blen;
+        i++;
+    }
+    /* only for position part? */
+    if (econq == econqCoord)
+    {
+        if (ir->efep != efepNO)
+        {
+            real bondA, bondB;
+            /* TODO This should probably use invdt, so that sd integrator scaling works properly */
+            dt_2 = 1/sqr(ir->delta_t);
+            dvdl = 0;
+            for (ll = 0; ll < ncon; ll++)
+            {
+                type  = idef->il[F_CONSTR].iatoms[3*ll];
+
+                /* Per equations in the manual, dv/dl = -2 \sum_ll lagrangian_ll * r_ll * (d_B - d_A) */
+                /* The vector scaled_lagrange_multiplier[ll] contains the value -2 r_ll eta_ll (eta_ll is the
+                   estimate of the Langrangian, definition on page 336 of Ryckaert et al 1977),
+                   so the pre-factors are already present. */
+                bondA = idef->iparams[type].constr.dA;
+                bondB = idef->iparams[type].constr.dB;
+                dvdl += scaled_lagrange_multiplier[ll] * dt_2 * (bondB - bondA);
+            }
+            *dvdlambda += dvdl;
+        }
+    }
+#ifdef DEBUG
+    fprintf(log, "tnit: %5d  omega: %10.5f\n", tnit, omega);
+#endif
+    if (ir->bShakeSOR)
+    {
+        if (tnit > shaked->gamma)
+        {
+            shaked->delta *= -0.5;
+        }
+        shaked->omega += shaked->delta;
+        shaked->gamma  = tnit;
+    }
+    inc_nrnb(nrnb, eNR_SHAKE, tnit);
+    inc_nrnb(nrnb, eNR_SHAKE_RIJ, trij);
+    if (v)
+    {
+        inc_nrnb(nrnb, eNR_CONSTR_V, trij*2);
+    }
+    if (bCalcVir)
+    {
+        inc_nrnb(nrnb, eNR_CONSTR_VIR, trij);
+    }
+
+    return TRUE;
+}
+
+void crattle(atom_id iatom[], int ncon, int *nnit, int maxnit,
+             real constraint_distance_squared[], real vp[], real rij[], real m2[], real omega,
+             real invmass[], real distance_squared_tolerance[], real scaled_lagrange_multiplier[],
+             int *nerror, real invdt)
+{
+    /*
+     *     r.c. van schaik and w.f. van gunsteren
+     *     eth zuerich
+     *     june 1992
+     *     Adapted for use with Gromacs by David van der Spoel november 92 and later.
+     *     rattle added by M.R. Shirts, April 2004, from code written by Jay Ponder in TINKER
+     *     second part of rattle algorithm
+     */
+
+    int          ll, i, j, i3, j3, l3;
+    int          ix, iy, iz, jx, jy, jz;
+    real         constraint_distance_squared_ll;
+    real         vpijd, vx, vy, vz, acor, fac, im, jm;
+    real         xh, yh, zh, rijx, rijy, rijz;
+    int          nit, error, nconv;
+    real         iconvf;
+
+    // TODO nconv is used solely as a boolean, so we should write the
+    // code like that
+    error = 0;
+    nconv = 1;
+    for (nit = 0; (nit < maxnit) && (nconv != 0) && (error == 0); nit++)
+    {
+        nconv = 0;
+        for (ll = 0; (ll < ncon) && (error == 0); ll++)
+        {
+            l3      = 3*ll;
+            rijx    = rij[l3+XX];
+            rijy    = rij[l3+YY];
+            rijz    = rij[l3+ZZ];
+            i       = iatom[l3+1];
+            j       = iatom[l3+2];
+            i3      = 3*i;
+            j3      = 3*j;
+            ix      = i3+XX;
+            iy      = i3+YY;
+            iz      = i3+ZZ;
+            jx      = j3+XX;
+            jy      = j3+YY;
+            jz      = j3+ZZ;
+            vx      = vp[ix]-vp[jx];
+            vy      = vp[iy]-vp[jy];
+            vz      = vp[iz]-vp[jz];
+
+            vpijd   = vx*rijx+vy*rijy+vz*rijz;
+            constraint_distance_squared_ll = constraint_distance_squared[ll];
+
+            /* iconv is zero when the error is smaller than a bound */
+            iconvf   = fabs(vpijd)*(distance_squared_tolerance[ll]/invdt);
+
+            if (iconvf > 1)
+            {
+                nconv     = static_cast<int>(iconvf);
+                fac       = omega*2.0*m2[ll]/constraint_distance_squared_ll;
+                acor      = -fac*vpijd;
+                scaled_lagrange_multiplier[ll] += acor;
+                xh        = rijx*acor;
+                yh        = rijy*acor;
+                zh        = rijz*acor;
+
+                im        = invmass[i];
+                jm        = invmass[j];
+
+                vp[ix] += xh*im;
+                vp[iy] += yh*im;
+                vp[iz] += zh*im;
+                vp[jx] -= xh*jm;
+                vp[jy] -= yh*jm;
+                vp[jz] -= zh*jm;
+            }
+        }
+    }
+    *nnit   = nit;
+    *nerror = error;
+}
similarity index 94%
rename from src/gromacs/mdlib/shellfc.c
rename to src/gromacs/mdlib/shellfc.cpp
index 9ba0868252bb52febcfca33cd525999087599fc1..1d044cc92354f29763314e1c4213f9830a91dab2 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/shellfc.h"
 
+#include <stdlib.h>
 #include <string.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "vec.h"
-#include "txtdump.h"
-#include "force.h"
-#include "mdrun.h"
-#include "mdatoms.h"
-#include "vsite.h"
-#include "network.h"
-#include "names.h"
-#include "constr.h"
-#include "domdec.h"
-#include "physics.h"
-#include "shellfc.h"
-#include "mtop_util.h"
-#include "chargegroup.h"
-#include "macros.h"
 
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int     nnucl;
@@ -125,7 +129,7 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
                            real mass[], gmx_mtop_t *mtop, gmx_bool bInit)
 {
     int                   i, m, s1, n1, n2, n3;
-    real                  dt_1, dt_2, dt_3, fudge, tm, m1, m2, m3;
+    real                  dt_1, fudge, tm, m1, m2, m3;
     rvec                 *ptr;
     gmx_mtop_atomlookup_t alook = NULL;
     t_atom               *atom;
@@ -183,8 +187,10 @@ 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... */
-                    m1 = atom[n1].m;
-                    m2 = atom[n2].m;
+                    gmx_mtop_atomnr_to_atom(alook, n1, &atom);
+                    m1 = atom->m;
+                    gmx_mtop_atomnr_to_atom(alook, n2, &atom);
+                    m2 = atom->m;
                 }
                 tm = dt_1/(m1+m2);
                 for (m = 0; (m < DIM); m++)
@@ -238,7 +244,7 @@ gmx_shellfc_t init_shell_flexcon(FILE *fplog,
     int                      *shell_index = NULL, *at2cg;
     t_atom                   *atom;
     int                       n[eptNR], ns, nshell, nsi;
-    int                       i, j, nmol, type, mb, mt, a_offset, cg, mol, ftype, nra;
+    int                       i, j, nmol, type, mb, a_offset, cg, mol, ftype, nra;
     real                      qS, alpha;
     int                       aS, aN = 0; /* Shell and nucleus */
     int                       bondtypes[] = { F_BONDS, F_HARMONIC, F_CUBICBONDS, F_POLARIZATION, F_ANHARM_POL, F_WATER_POL };
@@ -661,10 +667,11 @@ static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
                step_scale_increment = 0.2,
                step_scale_max       = 1.2,
                step_scale_multiple  = (step_scale_max - step_scale_min) / step_scale_increment;
-    int  i, shell, d;
-    real dx, df, k_est;
+    int        i, shell, d;
+    real       dx, df, k_est;
+    const real zero = 0;
 #ifdef PRINT_STEP
-    real step_min, step_max;
+    real       step_min, step_max;
 
     step_min = 1e30;
     step_max = 0;
@@ -678,8 +685,8 @@ static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
             {
                 s[i].step[d] = s[i].k_1;
 #ifdef PRINT_STEP
-                step_min = min(step_min, s[i].step[d]);
-                step_max = max(step_max, s[i].step[d]);
+                step_min = std::min(step_min, s[i].step[d]);
+                step_max = std::max(step_max, s[i].step[d]);
 #endif
             }
         }
@@ -701,7 +708,7 @@ static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
                      * step_scale_multiple * s[i].step[d] */
                     s[i].step[d] =
                         step_scale_min * s[i].step[d] +
-                        step_scale_increment * min(step_scale_multiple * s[i].step[d], max(k_est, 0));
+                        step_scale_increment * std::min(step_scale_multiple * s[i].step[d], std::max(k_est, zero));
                 }
                 else
                 {
@@ -717,8 +724,8 @@ static void shell_pos_sd(rvec xcur[], rvec xnew[], rvec f[],
                     }
                 }
 #ifdef PRINT_STEP
-                step_min = min(step_min, s[i].step[d]);
-                step_max = max(step_max, s[i].step[d]);
+                step_min = std::min(step_min, s[i].step[d]);
+                step_max = std::max(step_max, s[i].step[d]);
 #endif
             }
         }
@@ -844,11 +851,9 @@ static void init_adir(FILE *log, gmx_shellfc_t shfc,
 {
     rvec           *xnold, *xnew;
     double          w_dt;
-    int             gf, ga, gt;
-    real            dt, scale;
+    real            dt;
     int             n, d;
     unsigned short *ptype;
-    rvec            p, dx;
 
     if (DOMAINDECOMP(cr))
     {
@@ -890,14 +895,14 @@ static void init_adir(FILE *log, gmx_shellfc_t shfc,
             }
         }
     }
-    constrain(log, FALSE, FALSE, constr, idef, ir, NULL, cr, step, 0, 1.0, md,
+    constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
               x, xnold-start, NULL, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
-    constrain(log, FALSE, FALSE, constr, idef, ir, NULL, cr, step, 0, 1.0, md,
+              NULL, NULL, nrnb, econqCoord);
+    constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
               x, xnew-start, NULL, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
+              NULL, NULL, nrnb, econqCoord);
 
     for (n = start; n < end; n++)
     {
@@ -911,10 +916,10 @@ 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, NULL, cr, step, 0, 1.0, md,
+    constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
               x_old, xnew-start, acc_dir, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqDeriv_FlexCon, FALSE, 0, 0);
+              NULL, NULL, nrnb, econqDeriv_FlexCon);
 }
 
 int relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
@@ -942,14 +947,13 @@ int relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     t_idef    *idef;
     rvec      *pos[2], *force[2], *acc_dir = NULL, *x_old = NULL;
     real       Epot[2], df[2];
-    rvec       dx;
     real       sf_dir, invdt;
-    real       ftol, xiH, xiS, dum = 0;
+    real       ftol, dum = 0;
     char       sbuf[22];
     gmx_bool   bCont, bInit;
     int        nat, dd_ac0, dd_ac1 = 0, i;
     int        start = 0, homenr = md->homenr, end = start+homenr, cg0, cg1;
-    int        nflexcon, g, number_steps, d, Min = 0, count = 0;
+    int        nflexcon, number_steps, d, Min = 0, count = 0;
 #define  Try (1-Min)             /* At start Try = 1 */
 
     bCont        = (mdstep == inputrec->init_step) && inputrec->bContinuation;
@@ -968,7 +972,7 @@ int relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         if (nflexcon > 0)
         {
             dd_get_constraint_range(cr->dd, &dd_ac0, &dd_ac1);
-            nat = max(nat, dd_ac1);
+            nat = std::max(nat, dd_ac1);
         }
     }
     else
similarity index 91%
rename from src/gromacs/mdlib/sim_util.c
rename to src/gromacs/mdlib/sim_util.cpp
index 72a708f500580847d8de93446f9a707532a05f68..9e2fc4de1b61d1feec81c05982a9392a0c22e269 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/sim_util.h"
+
+#include "config.h"
 
 #include <assert.h>
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "names.h"
-#include "txtdump.h"
-#include "pbc.h"
-#include "chargegroup.h"
-#include "vec.h"
-#include "nrnb.h"
-#include "mshift.h"
-#include "mdrun.h"
-#include "sim_util.h"
-#include "update.h"
-#include "physics.h"
-#include "main.h"
-#include "mdatoms.h"
-#include "force.h"
-#include "bondf.h"
-#include "pme.h"
-#include "disre.h"
-#include "orires.h"
-#include "network.h"
-#include "calcmu.h"
-#include "constr.h"
-#include "xvgr.h"
-#include "copyrite.h"
-#include "domdec.h"
-#include "genborn.h"
-#include "nbnxn_atomdata.h"
-#include "nbnxn_search.h"
-#include "nbnxn_kernels/nbnxn_kernel_ref.h"
-#include "nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.h"
-#include "nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.h"
-#include "nbnxn_kernels/nbnxn_kernel_gpu_ref.h"
-#include "nonbonded.h"
-#include "../gmxlib/nonbonded/nb_kernel.h"
-#include "../gmxlib/nonbonded/nb_free_energy.h"
-
-#include "gromacs/timing/wallcycle.h"
-#include "gromacs/timing/walltime_accounting.h"
-#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/ewald/pme.h"
+#include "gromacs/gmxlib/nonbonded/nb_free_energy.h"
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/imd/imd.h"
+#include "gromacs/legacyheaders/calcmu.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/genborn.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_atomdata.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.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/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/pulling/pull_rotation.h"
-#include "gromacs/imd/imd.h"
-#include "adress.h"
-#include "qmmm.h"
-
-#include "gmx_omp_nthreads.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/sysinfo.h"
 
-#include "nbnxn_cuda_data_mgmt.h"
-#include "nbnxn_cuda/nbnxn_cuda.h"
+#include "adress.h"
 
 void print_time(FILE                     *out,
                 gmx_walltime_accounting_t walltime_accounting,
@@ -281,8 +279,7 @@ static void calc_virial(int start, int homenr, rvec x[], rvec f[],
                         tensor vir_part, t_graph *graph, matrix box,
                         t_nrnb *nrnb, const t_forcerec *fr, int ePBC)
 {
-    int    i, j;
-    tensor virtest;
+    int    i;
 
     /* The short-range virial from surrounding boxes */
     clear_mat(vir_part);
@@ -313,82 +310,7 @@ static void calc_virial(int start, int homenr, rvec x[], rvec f[],
     }
 }
 
-static void posres_wrapper(FILE *fplog,
-                           int flags,
-                           gmx_bool bSepDVDL,
-                           t_inputrec *ir,
-                           t_nrnb *nrnb,
-                           gmx_localtop_t *top,
-                           matrix box, rvec x[],
-                           gmx_enerdata_t *enerd,
-                           real *lambda,
-                           t_forcerec *fr)
-{
-    t_pbc pbc;
-    real  v, dvdl;
-    int   i;
-
-    /* Position restraints always require full pbc */
-    set_pbc(&pbc, ir->ePBC, box);
-    dvdl = 0;
-    v    = posres(top->idef.il[F_POSRES].nr, top->idef.il[F_POSRES].iatoms,
-                  top->idef.iparams_posres,
-                  (const rvec*)x, fr->f_novirsum, fr->vir_diag_posres,
-                  ir->ePBC == epbcNONE ? NULL : &pbc,
-                  lambda[efptRESTRAINT], &dvdl,
-                  fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
-    if (bSepDVDL)
-    {
-        gmx_print_sepdvdl(fplog, interaction_function[F_POSRES].longname, v, dvdl);
-    }
-    enerd->term[F_POSRES] += v;
-    /* If just the force constant changes, the FEP term is linear,
-     * but if k changes, it is not.
-     */
-    enerd->dvdl_nonlin[efptRESTRAINT] += dvdl;
-    inc_nrnb(nrnb, eNR_POSRES, top->idef.il[F_POSRES].nr/2);
-
-    if ((ir->fepvals->n_lambda > 0) && (flags & GMX_FORCE_DHDL))
-    {
-        for (i = 0; i < enerd->n_lambda; i++)
-        {
-            real dvdl_dum, lambda_dum;
-
-            lambda_dum = (i == 0 ? lambda[efptRESTRAINT] : ir->fepvals->all_lambda[efptRESTRAINT][i-1]);
-            v          = posres(top->idef.il[F_POSRES].nr, top->idef.il[F_POSRES].iatoms,
-                                top->idef.iparams_posres,
-                                (const rvec*)x, NULL, NULL,
-                                ir->ePBC == epbcNONE ? NULL : &pbc, lambda_dum, &dvdl,
-                                fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
-            enerd->enerpart_lambda[i] += v;
-        }
-    }
-}
-
-static void fbposres_wrapper(t_inputrec *ir,
-                             t_nrnb *nrnb,
-                             gmx_localtop_t *top,
-                             matrix box, rvec x[],
-                             gmx_enerdata_t *enerd,
-                             t_forcerec *fr)
-{
-    t_pbc pbc;
-    real  v;
-
-    /* Flat-bottomed position restraints always require full pbc */
-    set_pbc(&pbc, ir->ePBC, box);
-    v = fbposres(top->idef.il[F_FBPOSRES].nr, top->idef.il[F_FBPOSRES].iatoms,
-                 top->idef.iparams_fbposres,
-                 (const rvec*)x, fr->f_novirsum, fr->vir_diag_posres,
-                 ir->ePBC == epbcNONE ? NULL : &pbc,
-                 fr->rc_scaling, fr->ePBC, fr->posres_com);
-    enerd->term[F_FBPOSRES] += v;
-    inc_nrnb(nrnb, eNR_FBPOSRES, top->idef.il[F_FBPOSRES].nr/2);
-}
-
-static void pull_potential_wrapper(FILE *fplog,
-                                   gmx_bool bSepDVDL,
-                                   t_commrec *cr,
+static void pull_potential_wrapper(t_commrec *cr,
                                    t_inputrec *ir,
                                    matrix box, rvec x[],
                                    rvec f[],
@@ -413,22 +335,16 @@ static void pull_potential_wrapper(FILE *fplog,
     enerd->term[F_COM_PULL] +=
         pull_potential(ir->ePull, ir->pull, mdatoms, &pbc,
                        cr, t, lambda[efptRESTRAINT], x, f, vir_force, &dvdl);
-    if (bSepDVDL)
-    {
-        gmx_print_sepdvdl(fplog, "Com pull", enerd->term[F_COM_PULL], dvdl);
-    }
     enerd->dvdl_lin[efptRESTRAINT] += dvdl;
     wallcycle_stop(wcycle, ewcPULLPOT);
 }
 
-static void pme_receive_force_ener(FILE           *fplog,
-                                   gmx_bool        bSepDVDL,
-                                   t_commrec      *cr,
+static void pme_receive_force_ener(t_commrec      *cr,
                                    gmx_wallcycle_t wcycle,
                                    gmx_enerdata_t *enerd,
                                    t_forcerec     *fr)
 {
-    real   e_q, e_lj, v, dvdl_q, dvdl_lj;
+    real   e_q, e_lj, dvdl_q, dvdl_lj;
     float  cycles_ppdpme, cycles_seppme;
 
     cycles_ppdpme = wallcycle_stop(wcycle, ewcPPDURINGPME);
@@ -443,11 +359,6 @@ static void pme_receive_force_ener(FILE           *fplog,
     gmx_pme_receive_f(cr, fr->f_novirsum, fr->vir_el_recip, &e_q,
                       fr->vir_lj_recip, &e_lj, &dvdl_q, &dvdl_lj,
                       &cycles_seppme);
-    if (bSepDVDL)
-    {
-        gmx_print_sepdvdl(fplog, "Electrostatic PME mesh", e_q, dvdl_q);
-        gmx_print_sepdvdl(fplog, "Lennard-Jones PME mesh", e_lj, dvdl_lj);
-    }
     enerd->term[F_COUL_RECIP] += e_q;
     enerd->term[F_LJ_RECIP]   += e_lj;
     enerd->dvdl_lin[efptCOUL] += dvdl_q;
@@ -551,8 +462,7 @@ static void do_nb_verlet(t_forcerec *fr,
                          t_nrnb *nrnb,
                          gmx_wallcycle_t wcycle)
 {
-    int                        nnbl, kernel_type, enr_nbnxn_kernel_ljc, enr_nbnxn_kernel_lj;
-    char                      *env;
+    int                        enr_nbnxn_kernel_ljc, enr_nbnxn_kernel_lj;
     nonbonded_verlet_group_t  *nbvg;
     gmx_bool                   bCUDA;
 
@@ -802,6 +712,11 @@ static void do_nb_verlet_fep(nbnxn_pairlist_set_t *nbl_lists,
     wallcycle_sub_stop(wcycle, ewcsNONBONDED);
 }
 
+gmx_bool use_GPU(const nonbonded_verlet_t *nbv)
+{
+    return nbv != NULL && nbv->bUseGPU;
+}
+
 void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                          t_inputrec *inputrec,
                          gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
@@ -819,32 +734,25 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                          gmx_bool bBornRadii,
                          int flags)
 {
-    int                 cg0, cg1, i, j;
+    int                 cg1, i, j;
     int                 start, homenr;
-    int                 nb_kernel_type;
     double              mu[2*DIM];
-    gmx_bool            bSepDVDL, bStateChanged, bNS, bFillGrid, bCalcCGCM, bBS;
+    gmx_bool            bStateChanged, bNS, bFillGrid, bCalcCGCM;
     gmx_bool            bDoLongRange, bDoForces, bSepLRF, bUseGPU, bUseOrEmulGPU;
     gmx_bool            bDiffKernels = FALSE;
-    matrix              boxs;
     rvec                vzero, box_diag;
-    real                e, v, dvdl;
     float               cycles_pme, cycles_force, cycles_wait_gpu;
     nonbonded_verlet_t *nbv;
 
     cycles_force    = 0;
     cycles_wait_gpu = 0;
     nbv             = fr->nbv;
-    nb_kernel_type  = fr->nbv->grp[0].kernel_type;
 
     start  = 0;
     homenr = mdatoms->homenr;
 
-    bSepDVDL = (fr->bSepDVDL && do_per_step(step, inputrec->nstlog));
-
     clear_mat(vir_force);
 
-    cg0 = 0;
     if (DOMAINDECOMP(cr))
     {
         cg1 = cr->dd->ncg_tot;
@@ -910,6 +818,9 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 #ifdef GMX_MPI
     if (!(cr->duty & DUTY_PME))
     {
+        gmx_bool bBS;
+        matrix   boxs;
+
         /* Send particle coordinates to the pme nodes.
          * Since this is only implemented for domain decomposition
          * and domain decomposition does not use the graph,
@@ -1251,10 +1162,11 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
     }
 
     /* We calculate the non-bonded forces, when done on the CPU, here.
-     * We do this before calling do_force_lowlevel, as in there bondeds
-     * forces are calculated before PME, which does communication.
-     * With this order, non-bonded and bonded force calculation imbalance
-     * can be balanced out by the domain decomposition load balancing.
+     * We do this before calling do_force_lowlevel, because in that
+     * function, the listed forces are calculated before PME, which
+     * does communication.  With this order, non-bonded and listed
+     * force calculation imbalance can be balanced out by the domain
+     * decomposition load balancing.
      */
 
     if (!bUseOrEmulGPU)
@@ -1334,22 +1246,11 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         update_QMMMrec(cr, fr, x, mdatoms, box, top);
     }
 
-    if ((flags & GMX_FORCE_BONDED) && top->idef.il[F_POSRES].nr > 0)
-    {
-        posres_wrapper(fplog, flags, bSepDVDL, inputrec, nrnb, top, box, x,
-                       enerd, lambda, fr);
-    }
-
-    if ((flags & GMX_FORCE_BONDED) && top->idef.il[F_FBPOSRES].nr > 0)
-    {
-        fbposres_wrapper(inputrec, nrnb, top, box, x, enerd, fr);
-    }
-
     /* Compute the bonded and non-bonded energies and optionally forces */
-    do_force_lowlevel(fplog, step, fr, inputrec, &(top->idef),
+    do_force_lowlevel(fr, inputrec, &(top->idef),
                       cr, nrnb, wcycle, mdatoms,
                       x, hist, f, bSepLRF ? fr->f_twin : f, enerd, fcd, top, fr->born,
-                      &(top->atomtypes), bBornRadii, box,
+                      bBornRadii, box,
                       inputrec->fepvals, lambda, graph, &(top->excls), fr->mu_tot,
                       flags, &cycles_pme);
 
@@ -1562,7 +1463,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         /* Since the COM pulling is always done mass-weighted, no forces are
          * applied to vsites and this call can be done after vsite spreading.
          */
-        pull_potential_wrapper(fplog, bSepDVDL, cr, inputrec, box, x,
+        pull_potential_wrapper(cr, inputrec, box, x,
                                f, vir_force, mdatoms, enerd, lambda, t,
                                wcycle);
     }
@@ -1583,7 +1484,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         /* In case of node-splitting, the PP nodes receive the long-range
          * forces, virial and energy from the PME nodes here.
          */
-        pme_receive_force_ener(fplog, bSepDVDL, cr, wcycle, enerd, fr);
+        pme_receive_force_ener(cr, wcycle, enerd, fr);
     }
 
     if (bDoForces)
@@ -1616,20 +1517,15 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
     int        cg0, cg1, i, j;
     int        start, homenr;
     double     mu[2*DIM];
-    gmx_bool   bSepDVDL, bStateChanged, bNS, bFillGrid, bCalcCGCM, bBS;
-    gmx_bool   bDoLongRangeNS, bDoForces, bDoPotential, bSepLRF;
+    gmx_bool   bStateChanged, bNS, bFillGrid, bCalcCGCM;
+    gmx_bool   bDoLongRangeNS, bDoForces, bSepLRF;
     gmx_bool   bDoAdressWF;
-    matrix     boxs;
-    rvec       vzero, box_diag;
-    real       e, v, dvdlambda[efptNR];
     t_pbc      pbc;
     float      cycles_pme, cycles_force;
 
     start  = 0;
     homenr = mdatoms->homenr;
 
-    bSepDVDL = (fr->bSepDVDL && do_per_step(step, inputrec->nstlog));
-
     clear_mat(vir_force);
 
     cg0 = 0;
@@ -1654,7 +1550,6 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
     bFillGrid      = (bNS && bStateChanged);
     bCalcCGCM      = (bFillGrid && !DOMAINDECOMP(cr));
     bDoForces      = (flags & GMX_FORCE_FORCES);
-    bDoPotential   = (flags & GMX_FORCE_ENERGY);
     bSepLRF        = ((inputrec->nstcalclr > 1) && bDoForces &&
                       (flags & GMX_FORCE_SEPLRF) && (flags & GMX_FORCE_DO_LR));
 
@@ -1712,6 +1607,9 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 #ifdef GMX_MPI
     if (!(cr->duty & DUTY_PME))
     {
+        gmx_bool bBS;
+        matrix   boxs;
+
         /* Send particle coordinates to the pme nodes.
          * Since this is only implemented for domain decomposition
          * and domain decomposition does not use the graph,
@@ -1914,22 +1812,11 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         update_QMMMrec(cr, fr, x, mdatoms, box, top);
     }
 
-    if ((flags & GMX_FORCE_BONDED) && top->idef.il[F_POSRES].nr > 0)
-    {
-        posres_wrapper(fplog, flags, bSepDVDL, inputrec, nrnb, top, box, x,
-                       enerd, lambda, fr);
-    }
-
-    if ((flags & GMX_FORCE_BONDED) && top->idef.il[F_FBPOSRES].nr > 0)
-    {
-        fbposres_wrapper(inputrec, nrnb, top, box, x, enerd, fr);
-    }
-
     /* Compute the bonded and non-bonded energies and optionally forces */
-    do_force_lowlevel(fplog, step, fr, inputrec, &(top->idef),
+    do_force_lowlevel(fr, inputrec, &(top->idef),
                       cr, nrnb, wcycle, mdatoms,
                       x, hist, f, bSepLRF ? fr->f_twin : f, enerd, fcd, top, fr->born,
-                      &(top->atomtypes), bBornRadii, box,
+                      bBornRadii, box,
                       inputrec->fepvals, lambda,
                       graph, &(top->excls), fr->mu_tot,
                       flags,
@@ -2037,7 +1924,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 
     if (inputrec->ePull == epullUMBRELLA || inputrec->ePull == epullCONST_F)
     {
-        pull_potential_wrapper(fplog, bSepDVDL, cr, inputrec, box, x,
+        pull_potential_wrapper(cr, inputrec, box, x,
                                f, vir_force, mdatoms, enerd, lambda, t,
                                wcycle);
     }
@@ -2058,7 +1945,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         /* In case of node-splitting, the PP nodes receive the long-range
          * forces, virial and energy from the PME nodes here.
          */
-        pme_receive_force_ener(fplog, bSepDVDL, cr, wcycle, enerd, fr);
+        pme_receive_force_ener(cr, wcycle, enerd, fr);
     }
 
     if (bDoForces)
@@ -2167,24 +2054,21 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
 
     /* constrain the current position */
     constrain(NULL, TRUE, FALSE, constr, &(top->idef),
-              ir, NULL, cr, step, 0, 1.0, md,
+              ir, cr, step, 0, 1.0, md,
               state->x, state->x, NULL,
               fr->bMolPBC, state->box,
               state->lambda[efptBONDED], &dvdl_dum,
-              NULL, NULL, nrnb, econqCoord,
-              ir->epc == epcMTTK, state->veta, state->veta);
+              NULL, NULL, 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 */
-        /* might not yet treat veta correctly */
         constrain(NULL, TRUE, FALSE, constr, &(top->idef),
-                  ir, NULL, cr, step, 0, 1.0, md,
+                  ir, cr, step, 0, 1.0, md,
                   state->x, state->v, state->v,
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
-                  NULL, NULL, nrnb, econqVeloc,
-                  ir->epc == epcMTTK, state->veta, state->veta);
+                  NULL, NULL, nrnb, econqVeloc);
     }
     /* constrain the inital velocities at t-dt/2 */
     if (EI_STATE_VELOCITY(ir->eI) && ir->eI != eiVV)
@@ -2210,12 +2094,11 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
         }
         dvdl_dum = 0;
         constrain(NULL, TRUE, FALSE, constr, &(top->idef),
-                  ir, NULL, cr, step, -1, 1.0, md,
+                  ir, cr, step, -1, 1.0, md,
                   state->x, savex, NULL,
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
-                  state->v, NULL, nrnb, econqCoord,
-                  ir->epc == epcMTTK, state->veta, state->veta);
+                  state->v, NULL, nrnb, econqCoord);
 
         for (i = start; i < end; i++)
         {
@@ -2238,7 +2121,8 @@ integrate_table(real vdwtab[], real scale, int offstart, int rstart, int rend,
     double invscale, invscale2, invscale3;
     double r, ea, eb, ec, pa, pb, pc, pd;
     double y0, f, g, h;
-    int    ri, offset, tabfactor;
+    int    ri, offset;
+    double tabfactor;
 
     invscale  = 1.0/scale;
     invscale2 = invscale*invscale;
@@ -2299,11 +2183,10 @@ integrate_table(real vdwtab[], real scale, int offstart, int rstart, int rend,
 
 void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr)
 {
-    double   eners[2], virs[2], enersum, virsum, y0, f, g, h;
-    double   r0, r1, r, rc3, rc9, ea, eb, ec, pa, pb, pc, pd;
-    double   invscale, invscale2, invscale3;
-    int      ri0, ri1, ri, i, offstart, offset;
-    real     scale, *vdwtab, tabfactor, tmp;
+    double   eners[2], virs[2], enersum, virsum;
+    double   r0, rc3, rc9;
+    int      ri0, ri1, i;
+    real     scale, *vdwtab;
 
     fr->enershiftsix    = 0;
     fr->enershifttwelve = 0;
@@ -2338,8 +2221,8 @@ void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr)
             vdwtab = fr->nblists[0].table_vdw.data;
 
             /* Round the cut-offs to exact table values for precision */
-            ri0  = floor(fr->rvdw_switch*scale);
-            ri1  = ceil(fr->rvdw*scale);
+            ri0  = static_cast<int>(floor(fr->rvdw_switch*scale));
+            ri1  = static_cast<int>(ceil(fr->rvdw*scale));
 
             /* The code below has some support for handling force-switching, i.e.
              * when the force (instead of potential) is switched over a limited
@@ -2360,7 +2243,6 @@ void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr)
             ri0  = (fr->vdw_modifier == eintmodPOTSHIFT) ? ri1 : ri0;
 
             r0   = ri0/scale;
-            r1   = ri1/scale;
             rc3  = r0*r0*r0;
             rc9  = rc3*rc3*rc3;
 
@@ -2474,8 +2356,8 @@ void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr)
     }
 }
 
-void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr,
-                   gmx_int64_t step, int natoms,
+void calc_dispcorr(t_inputrec *ir, t_forcerec *fr,
+                   int natoms,
                    matrix box, real lambda, tensor pres, tensor virial,
                    real *prescorr, real *enercorr, real *dvdlcorr)
 {
@@ -2576,10 +2458,6 @@ void calc_dispcorr(FILE *fplog, t_inputrec *ir, t_forcerec *fr,
             }
         }
 
-        if (fr->bSepDVDL && do_per_step(step, ir->nstlog))
-        {
-            gmx_print_sepdvdl(fplog, "Dispersion correction", *enercorr, dvdlambda);
-        }
         if (fr->efep != efepNO)
         {
             *dvdlcorr += dvdlambda;
@@ -2684,13 +2562,12 @@ void finish_run(FILE *fplog, t_commrec *cr,
                 t_inputrec *inputrec,
                 t_nrnb nrnb[], gmx_wallcycle_t wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
-                wallclock_gpu_t *gputimes,
+                nonbonded_verlet_t *nbv,
                 gmx_bool bWriteStat)
 {
-    int     i, j;
     t_nrnb *nrnb_tot = NULL;
-    real    delta_t;
-    double  nbfs, mflop;
+    double  delta_t  = 0;
+    double  nbfs     = 0, mflop = 0;
     double  elapsed_time,
             elapsed_time_over_all_ranks,
             elapsed_time_over_all_threads,
@@ -2748,6 +2625,8 @@ void finish_run(FILE *fplog, t_commrec *cr,
 
     if (SIMMASTER(cr))
     {
+        wallclock_gpu_t* gputimes = use_GPU(nbv) ?
+            nbnxn_cuda_get_timings(nbv->cu_nbv) : NULL;
         wallcycle_print(fplog, cr->nnodes, cr->npmenodes,
                         elapsed_time_over_all_ranks,
                         wcycle, gputimes);
@@ -2756,10 +2635,6 @@ void finish_run(FILE *fplog, t_commrec *cr,
         {
             delta_t = inputrec->delta_t;
         }
-        else
-        {
-            delta_t = 0;
-        }
 
         if (fplog)
         {
@@ -2862,8 +2737,7 @@ void init_md(FILE *fplog,
              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags,
              gmx_wallcycle_t wcycle)
 {
-    int  i, j, n;
-    real tmpt, mod;
+    int  i;
 
     /* Initial values */
     *t = *t0       = ir->init_t;
similarity index 79%
rename from src/gromacs/mdlib/stat.c
rename to src/gromacs/mdlib/stat.cpp
index 393e4fe8840720bc125847f1e4196e5db61ff350..6a30e1f0347e375ce88fb2bad2e7af6955574453 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <string.h>
 #include <stdio.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "sysstuff.h"
-#include "gmx_fatal.h"
-#include "network.h"
-#include "txtdump.h"
-#include "names.h"
-#include "physics.h"
-#include "vec.h"
-#include "gromacs/math/utilities.h"
-#include "main.h"
-#include "force.h"
-#include "vcm.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "network.h"
-#include "rbin.h"
-#include "tgroup.h"
-#include "gromacs/fileio/xtcio.h"
+#include <string.h>
+
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trnio.h"
-#include "domdec.h"
-#include "constr.h"
-#include "checkpoint.h"
-#include "xvgr.h"
-#include "md_support.h"
-#include "mdrun.h"
-#include "sim_util.h"
+#include "gromacs/fileio/xtcio.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/md_support.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/rbin.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/vcm.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct gmx_global_stat
 {
@@ -165,14 +159,13 @@ void global_stat(FILE *fplog, gmx_global_stat_t gs,
     int        nener, j;
     real      *rmsd_data = NULL;
     double     nb;
-    gmx_bool   bVV, bTemp, bEner, bPres, bConstrVir, bEkinAveVel, bFirstIterate, bReadEkin;
+    gmx_bool   bVV, bTemp, bEner, bPres, bConstrVir, bEkinAveVel, bReadEkin;
 
     bVV           = EI_VV(inputrec->eI);
     bTemp         = flags & CGLO_TEMPERATURE;
     bEner         = flags & CGLO_ENERGY;
     bPres         = (flags & CGLO_PRESSURE);
     bConstrVir    = (flags & CGLO_CONSTRAINT);
-    bFirstIterate = (flags & CGLO_FIRSTITERATE);
     bEkinAveVel   = (inputrec->eI == eiVV || (inputrec->eI == eiVVAK && bPres));
     bReadEkin     = (flags & CGLO_READEKIN);
 
@@ -231,7 +224,7 @@ void global_stat(FILE *fplog, gmx_global_stat_t gs,
     }
     where();
 
-    if ((bPres || !bVV) && bFirstIterate)
+    if (bPres || !bVV)
     {
         ifv = add_binr(rb, DIM*DIM, fvir[0]);
     }
@@ -240,10 +233,7 @@ void global_stat(FILE *fplog, gmx_global_stat_t gs,
     if (bEner)
     {
         where();
-        if (bFirstIterate)
-        {
-            ie  = add_binr(rb, nener, copyenerd);
-        }
+        ie  = add_binr(rb, nener, copyenerd);
         where();
         if (constr)
         {
@@ -259,21 +249,18 @@ void global_stat(FILE *fplog, gmx_global_stat_t gs,
             where();
         }
 
-        if (bFirstIterate)
+        for (j = 0; (j < egNR); j++)
         {
-            for (j = 0; (j < egNR); j++)
+            inn[j] = add_binr(rb, enerd->grpp.nener, enerd->grpp.ener[j]);
+        }
+        where();
+        if (inputrec->efep != efepNO)
+        {
+            idvdll  = add_bind(rb, efptNR, enerd->dvdl_lin);
+            idvdlnl = add_bind(rb, efptNR, enerd->dvdl_nonlin);
+            if (enerd->n_lambda > 0)
             {
-                inn[j] = add_binr(rb, enerd->grpp.nener, enerd->grpp.ener[j]);
-            }
-            where();
-            if (inputrec->efep != efepNO)
-            {
-                idvdll  = add_bind(rb, efptNR, enerd->dvdl_lin);
-                idvdlnl = add_bind(rb, efptNR, enerd->dvdl_nonlin);
-                if (enerd->n_lambda > 0)
-                {
-                    iepl = add_bind(rb, enerd->n_lambda, enerd->enerpart_lambda);
-                }
+                iepl = add_bind(rb, enerd->n_lambda, enerd->enerpart_lambda);
             }
         }
     }
@@ -346,50 +333,47 @@ void global_stat(FILE *fplog, gmx_global_stat_t gs,
             where();
         }
     }
-    if ((bPres || !bVV) && bFirstIterate)
+    if (bPres || !bVV)
     {
         extract_binr(rb, ifv, DIM*DIM, fvir[0]);
     }
 
     if (bEner)
     {
-        if (bFirstIterate)
+        extract_binr(rb, ie, nener, copyenerd);
+        if (rmsd_data)
         {
-            extract_binr(rb, ie, nener, copyenerd);
-            if (rmsd_data)
-            {
-                extract_binr(rb, irmsd, inputrec->eI == eiSD2 ? 3 : 2, rmsd_data);
-            }
-            if (!NEED_MUTOT(*inputrec))
-            {
-                extract_binr(rb, imu, DIM, mu_tot);
-            }
+            extract_binr(rb, irmsd, inputrec->eI == eiSD2 ? 3 : 2, rmsd_data);
+        }
+        if (!NEED_MUTOT(*inputrec))
+        {
+            extract_binr(rb, imu, DIM, mu_tot);
+        }
 
-            for (j = 0; (j < egNR); j++)
+        for (j = 0; (j < egNR); j++)
+        {
+            extract_binr(rb, inn[j], enerd->grpp.nener, enerd->grpp.ener[j]);
+        }
+        if (inputrec->efep != efepNO)
+        {
+            extract_bind(rb, idvdll, efptNR, enerd->dvdl_lin);
+            extract_bind(rb, idvdlnl, efptNR, enerd->dvdl_nonlin);
+            if (enerd->n_lambda > 0)
             {
-                extract_binr(rb, inn[j], enerd->grpp.nener, enerd->grpp.ener[j]);
+                extract_bind(rb, iepl, enerd->n_lambda, enerd->enerpart_lambda);
             }
-            if (inputrec->efep != efepNO)
-            {
-                extract_bind(rb, idvdll, efptNR, enerd->dvdl_lin);
-                extract_bind(rb, idvdlnl, efptNR, enerd->dvdl_nonlin);
-                if (enerd->n_lambda > 0)
-                {
-                    extract_bind(rb, iepl, enerd->n_lambda, enerd->enerpart_lambda);
-                }
-            }
-            if (DOMAINDECOMP(cr))
+        }
+        if (DOMAINDECOMP(cr))
+        {
+            extract_bind(rb, inb, 1, &nb);
+            if ((int)(nb + 0.5) != cr->dd->nbonded_global)
             {
-                extract_bind(rb, inb, 1, &nb);
-                if ((int)(nb + 0.5) != cr->dd->nbonded_global)
-                {
-                    dd_print_missing_interactions(fplog, cr, (int)(nb + 0.5), top_global, state_local);
-                }
+                dd_print_missing_interactions(fplog, cr, (int)(nb + 0.5), top_global, state_local);
             }
-            where();
-
-            filter_enerdterm(copyenerd, FALSE, enerd->term, bTemp, bPres, bEner);
         }
+        where();
+
+        filter_enerdterm(copyenerd, FALSE, enerd->term, bTemp, bPres, bEner);
     }
 
     if (vcm)
index b5b628b3ea491fba8e3c8d531028f59f0e33943a..ad8e473cf7cfd90f1824d07de242f0471556dc5f 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/tables.h"
 
 #include <math.h>
+
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "typedefs.h"
-#include "names.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
-#include "xvgr.h"
-#include "vec.h"
-#include "main.h"
-#include "network.h"
-#include "physics.h"
-#include "force.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "macros.h"
-#include "tables.h"
 
 /* All the possible (implemented) table functions */
 enum {
@@ -1202,7 +1201,7 @@ static void fill_table(t_tabledata *td, int tp, const t_forcerec *fr,
     }
 
 #ifdef DEBUG_SWITCH
-    gmx_fio_fclose(fp);
+    xvgrclose(fp);
 #endif
 }
 
@@ -1536,7 +1535,7 @@ t_forcetable make_tables(FILE *out, const output_env_t oenv,
                 evaluate_table(table.data, 4*k, 12, table.scale, x0, &y0, &yp);
                 fprintf(fp, "%15.10e  %15.10e  %15.10e\n", x0, y0, yp);
             }
-            gmx_fio_fclose(fp);
+            xvgrclose(fp);
         }
         done_tabledata(&(td[k]));
     }
@@ -1646,7 +1645,7 @@ t_forcetable make_gb_table(const output_env_t oenv,
             fprintf(fp, "%15.10e  %15.10e  %15.10e\n", x0, y0, yp);
 
         }
-        gmx_fio_fclose(fp);
+        xvgrclose(fp);
     }
 
     /*
@@ -1785,7 +1784,7 @@ t_forcetable make_atf_table(FILE *out, const output_env_t oenv,
             fprintf(fp, "%15.10e  %15.10e  %15.10e\n", x0, y0, yp);
 
         }
-        gmx_ffclose(fp);
+        xvgrclose(fp);
     }
 
     done_tabledata(&(td[0]));
diff --git a/src/gromacs/mdlib/tests/CMakeLists.txt b/src/gromacs/mdlib/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ba2e729
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+gmx_add_unit_test(MdlibUnitTest mdlib-test
+                  shake.cpp)
diff --git a/src/gromacs/mdlib/tests/shake.cpp b/src/gromacs/mdlib/tests/shake.cpp
new file mode 100644 (file)
index 0000000..4ab751f
--- /dev/null
@@ -0,0 +1,347 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#include "gmxpre.h"
+
+#include <assert.h>
+
+#include <vector>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/types/simple.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+namespace
+{
+
+/*! \brief Stride of the vector of atom_id used to describe each SHAKE
+ * constraint
+ *
+ * Like other such code, SHAKE is hard-wired to use t_ilist.iatoms as
+ * a flat vector of tuples of general data. Here, they are triples
+ * containing the index of the constraint type, and then the indices
+ * of the two atoms involved. So for each constraint, we must stride
+ * this vector by three to get access to its information. */
+const int constraintStride = 3;
+
+/*! \brief Compute the displacements between pairs of constrained
+ * atoms described in the iatom "topology". */
+std::vector<real>
+computeDisplacements(const std::vector<atom_id> &iatom,
+                     const std::vector<real>    &positions)
+{
+    assert(0 == iatom.size() % constraintStride);
+    int               numConstraints = iatom.size() / constraintStride;
+    std::vector<real> displacements;
+
+    for (int ll = 0; ll != numConstraints; ++ll)
+    {
+        int atom_i = iatom[ll*constraintStride + 1];
+        int atom_j = iatom[ll*constraintStride + 2];
+
+        for (int d = 0; d != DIM; d++)
+        {
+            displacements.push_back(positions[atom_i*DIM + d] - positions[atom_j*DIM + d]);
+        }
+    }
+
+    return displacements;
+}
+
+/*! \brief Compute half of the reduced mass of each pair of constrained
+ * atoms in the iatom "topology".
+ *
+ * The reduced mass is m = 1/(1/m_i + 1/m_j)) */
+std::vector<real>
+computeHalfOfReducedMasses(const std::vector<atom_id> &iatom,
+                           const std::vector<real>    &inverseMasses)
+{
+    int               numConstraints = iatom.size() / constraintStride;
+    std::vector<real> halfOfReducedMasses;
+
+    for (int ll = 0; ll != numConstraints; ++ll)
+    {
+        int atom_i = iatom[ll*constraintStride + 1];
+        int atom_j = iatom[ll*constraintStride + 2];
+
+        halfOfReducedMasses.push_back(0.5 / (inverseMasses[atom_i] + inverseMasses[atom_j]));
+    }
+
+    return halfOfReducedMasses;
+}
+
+/*! \brief Compute the distances corresponding to the vector of displacements components */
+std::vector<real>
+computeDistancesSquared(const std::vector<real> &displacements)
+{
+    assert(0 == displacements.size() % DIM);
+    int               numDistancesSquared = displacements.size() / DIM;
+    std::vector<real> distanceSquared;
+
+    for (int i = 0; i != numDistancesSquared; ++i)
+    {
+        distanceSquared.push_back(0.0);
+        for (int d = 0; d != DIM; ++d)
+        {
+            real displacement = displacements[i*DIM + d];
+            distanceSquared.back() += displacement * displacement;
+        }
+    }
+
+    return distanceSquared;
+}
+
+/*! \brief Test fixture for testing SHAKE */
+class ShakeTest : public ::testing::Test
+{
+    public:
+        /*! \brief Set up data for test cases to use when constructing
+            their input */
+        void SetUp()
+        {
+            inverseMassesDatabase_.push_back(2.0);
+            inverseMassesDatabase_.push_back(3.0);
+            inverseMassesDatabase_.push_back(4.0);
+            inverseMassesDatabase_.push_back(1.0);
+
+            positionsDatabase_.push_back(2.5);
+            positionsDatabase_.push_back(-3.1);
+            positionsDatabase_.push_back(15.7);
+
+            positionsDatabase_.push_back(0.51);
+            positionsDatabase_.push_back(-3.02);
+            positionsDatabase_.push_back(15.55);
+
+            positionsDatabase_.push_back(-0.5);
+            positionsDatabase_.push_back(-3.0);
+            positionsDatabase_.push_back(15.2);
+
+            positionsDatabase_.push_back(-1.51);
+            positionsDatabase_.push_back(-2.95);
+            positionsDatabase_.push_back(15.05);
+        }
+
+        //! Run the test
+        void runTest(size_t gmx_unused           numAtoms,
+                     size_t                      numConstraints,
+                     const std::vector<atom_id> &iatom,
+                     const std::vector<real>    &constrainedDistances,
+                     const std::vector<real>    &inverseMasses,
+                     const std::vector<real>    &positions)
+        {
+            // Check the test input is consistent
+            assert(numConstraints * constraintStride == iatom.size());
+            assert(numConstraints == constrainedDistances.size());
+            assert(numAtoms == inverseMasses.size());
+            assert(numAtoms * DIM == positions.size());
+            for (size_t i = 0; i != numConstraints; ++i)
+            {
+                for (size_t j = 1; j < 3; j++)
+                {
+                    // Check that the topology refers to atoms that have masses and positions
+                    assert(iatom[i*constraintStride + j] >= 0);
+                    assert(iatom[i*constraintStride + j] < static_cast<atom_id>(numAtoms));
+                }
+            }
+            std::vector<real> distanceSquaredTolerances;
+            std::vector<real> lagrangianValues;
+            std::vector<real> constrainedDistancesSquared;
+
+            for (size_t i = 0; i != numConstraints; ++i)
+            {
+                constrainedDistancesSquared.push_back(constrainedDistances[i] * constrainedDistances[i]);
+                distanceSquaredTolerances.push_back(1.0 / (constrainedDistancesSquared.back() * ShakeTest::tolerance_));
+                lagrangianValues.push_back(0.0);
+            }
+            std::vector<real> halfOfReducedMasses  = computeHalfOfReducedMasses(iatom, inverseMasses);
+            std::vector<real> initialDisplacements = computeDisplacements(iatom, positions);
+
+            std::vector<real> finalPositions = positions;
+            int               numIterations  = 0;
+            int               numErrors      = 0;
+
+            cshake(&iatom[0], numConstraints, &numIterations,
+                   ShakeTest::maxNumIterations_, &constrainedDistancesSquared[0],
+                   &finalPositions[0], &initialDisplacements[0], &halfOfReducedMasses[0],
+                   omega_, &inverseMasses[0],
+                   &distanceSquaredTolerances[0],
+                   &lagrangianValues[0],
+                   &numErrors);
+
+            std::vector<real> finalDisplacements    = computeDisplacements(iatom, finalPositions);
+            std::vector<real> finalDistancesSquared = computeDistancesSquared(finalDisplacements);
+            assert(numConstraints == finalDistancesSquared.size());
+
+            EXPECT_EQ(0, numErrors);
+            EXPECT_GT(numIterations, 1);
+            EXPECT_LT(numIterations, ShakeTest::maxNumIterations_);
+            // TODO wrap this in a Google Mock matcher if there's
+            // other tests like it some time?
+            for (size_t i = 0; i != numConstraints; ++i)
+            {
+                gmx::test::FloatingPointTolerance constraintTolerance =
+                    gmx::test::relativeToleranceAsFloatingPoint(constrainedDistancesSquared[i],
+                                                                ShakeTest::tolerance_);
+                // Assert that the constrained distances are within the required tolerance
+                EXPECT_FLOAT_EQ_TOL(constrainedDistancesSquared[i],
+                                    finalDistancesSquared[i],
+                                    constraintTolerance);
+            }
+        }
+
+        //! Tolerance for SHAKE conversion (ie. shake-tol .mdp setting)
+        static const real tolerance_;
+        //! Maximum number of iterations permitted in these tests
+        static const int  maxNumIterations_;
+        //! SHAKE over-relaxation (SOR) factor
+        static const real omega_;
+        //! Database of inverse masses of atoms in the topology
+        std::vector<real> inverseMassesDatabase_;
+        //! Database of atom positions (three reals per atom)
+        std::vector<real> positionsDatabase_;
+};
+
+const real ShakeTest::tolerance_        = 1e-5;
+const int  ShakeTest::maxNumIterations_ = 30;
+const real ShakeTest::omega_            = 1.0;
+
+TEST_F(ShakeTest, ConstrainsOneBond)
+{
+    int                  numAtoms       = 2;
+    int                  numConstraints = 1;
+
+    std::vector<atom_id> iatom;
+    iatom.push_back(-1); // unused
+    iatom.push_back(0);  // i atom index
+    iatom.push_back(1);  // j atom index
+
+    std::vector<real> constrainedDistances;
+    constrainedDistances.push_back(2.0);
+
+    std::vector<real> inverseMasses(inverseMassesDatabase_.begin(),
+                                    inverseMassesDatabase_.begin() + numAtoms);
+    std::vector<real> positions(positionsDatabase_.begin(),
+                                positionsDatabase_.begin() + numAtoms * DIM);
+
+    runTest(numAtoms, numConstraints, iatom, constrainedDistances, inverseMasses, positions);
+}
+
+TEST_F(ShakeTest, ConstrainsTwoDisjointBonds)
+{
+    int                  numAtoms       = 4;
+    int                  numConstraints = 2;
+
+    std::vector<atom_id> iatom;
+    iatom.push_back(-1); // unused
+    iatom.push_back(0);  // i atom index
+    iatom.push_back(1);  // j atom index
+
+    iatom.push_back(-1); // unused
+    iatom.push_back(2);  // i atom index
+    iatom.push_back(3);  // j atom index
+
+    std::vector<real> constrainedDistances;
+    constrainedDistances.push_back(2.0);
+    constrainedDistances.push_back(1.0);
+
+    std::vector<real> inverseMasses(inverseMassesDatabase_.begin(),
+                                    inverseMassesDatabase_.begin() + numAtoms);
+    std::vector<real> positions(positionsDatabase_.begin(),
+                                positionsDatabase_.begin() + numAtoms * DIM);
+
+    runTest(numAtoms, numConstraints, iatom, constrainedDistances, inverseMasses, positions);
+}
+
+TEST_F(ShakeTest, ConstrainsTwoBondsWithACommonAtom)
+{
+    int                  numAtoms       = 3;
+    int                  numConstraints = 2;
+
+    std::vector<atom_id> iatom;
+    iatom.push_back(-1); // unused
+    iatom.push_back(0);  // i atom index
+    iatom.push_back(1);  // j atom index
+
+    iatom.push_back(-1); // unused
+    iatom.push_back(1);  // i atom index
+    iatom.push_back(2);  // j atom index
+
+    std::vector<real> constrainedDistances;
+    constrainedDistances.push_back(2.0);
+    constrainedDistances.push_back(1.0);
+
+    std::vector<real> inverseMasses(inverseMassesDatabase_.begin(),
+                                    inverseMassesDatabase_.begin() + numAtoms);
+    std::vector<real> positions(positionsDatabase_.begin(),
+                                positionsDatabase_.begin() + numAtoms * DIM);
+
+    runTest(numAtoms, numConstraints, iatom, constrainedDistances, inverseMasses, positions);
+}
+
+TEST_F(ShakeTest, ConstrainsThreeBondsWithCommonAtoms)
+{
+    int                  numAtoms       = 4;
+    int                  numConstraints = 3;
+
+    std::vector<atom_id> iatom;
+    iatom.push_back(-1); // unused
+    iatom.push_back(0);  // i atom index
+    iatom.push_back(1);  // j atom index
+
+    iatom.push_back(-1); // unused
+    iatom.push_back(1);  // i atom index
+    iatom.push_back(2);  // j atom index
+
+    iatom.push_back(-1); // unused
+    iatom.push_back(2);  // i atom index
+    iatom.push_back(3);  // j atom index
+
+    std::vector<real> constrainedDistances;
+    constrainedDistances.push_back(2.0);
+    constrainedDistances.push_back(1.0);
+    constrainedDistances.push_back(1.0);
+
+    std::vector<real> inverseMasses(inverseMassesDatabase_.begin(),
+                                    inverseMassesDatabase_.begin() + numAtoms);
+    std::vector<real> positions(positionsDatabase_.begin(),
+                                positionsDatabase_.begin() + numAtoms * DIM);
+
+    runTest(numAtoms, numConstraints, iatom, constrainedDistances, inverseMasses, positions);
+}
+
+} // namespace
index cd32b2477b56b8e75e481b042602e96f3e0ad10f..1baec82abd2d0075fe51910e871d8fb50f309b88 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/tgroup.h"
 
 #include <math.h>
-#include "macros.h"
-#include "main.h"
+
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/rbin.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "tgroup.h"
-#include "vec.h"
-#include "network.h"
-#include "update.h"
-#include "rbin.h"
-#include "mtop_util.h"
-#include "gmx_omp_nthreads.h"
 
 static void init_grptcstat(int ngtc, t_grp_tcstat tcstat[])
 {
similarity index 94%
rename from src/gromacs/mdlib/tpi.c
rename to src/gromacs/mdlib/tpi.cpp
index 5a584281e0a050e5c23b084c1dc2b68eab2b9f95..b95bb3b60a77d5847154b4539d70f083eb351767 100644 (file)
@@ -3,7 +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, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <math.h>
+#include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include <math.h>
-#include "sysstuff.h"
-#include "network.h"
-#include "gromacs/utility/smalloc.h"
-#include "nrnb.h"
-#include "main.h"
-#include "chargegroup.h"
-#include "force.h"
-#include "macros.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "update.h"
-#include "constr.h"
-#include "vec.h"
-#include "tgroup.h"
-#include "mdebin.h"
-#include "vsite.h"
-#include "force.h"
-#include "mdrun.h"
-#include "domdec.h"
-#include "gromacs/random/random.h"
-#include "physics.h"
-#include "xvgr.h"
-#include "mdatoms.h"
-#include "ns.h"
-#include "mtop_util.h"
-#include "pme.h"
-#include "gromacs/gmxlib/conformation-utilities.h"
-#include "gromacs/simd/simd.h"
 
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "gromacs/legacyheaders/chargegroup.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/random/random.h"
+#include "gromacs/simd/simd.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void global_max(t_commrec *cr, int *n)
 {
@@ -87,7 +86,7 @@ static void global_max(t_commrec *cr, int *n)
     gmx_sumi(cr->nnodes, sum, cr);
     for (i = 0; i < cr->nnodes; i++)
     {
-        *n = max(*n, sum[i]);
+        *n = std::max(*n, sum[i]);
     }
 
     sfree(sum);
@@ -129,7 +128,6 @@ double do_tpi(FILE *fplog, t_commrec *cr,
               unsigned long gmx_unused Flags,
               gmx_walltime_accounting_t walltime_accounting)
 {
-    const char     *TPI = "Test Particle Insertion";
     gmx_localtop_t *top;
     gmx_groups_t   *groups;
     gmx_enerdata_t *enerd;
@@ -149,7 +147,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
     gmx_int64_t     rnd_count_stride, rnd_count;
     gmx_int64_t     seed;
     double          rnd[4];
-    int             i, start, end;
+    int             i;
     FILE           *fp_tpi = NULL;
     char           *ptr, *dump_pdb, **leg, str[STRLEN], str2[STRLEN];
     double          dbl, dump_ener;
@@ -158,7 +156,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
     real           *mass_cavity = NULL, mass_tot;
     int             nbin;
     double          invbinw, *bin, refvolshift, logV, bUlogV;
-    real            dvdl, prescorr, enercorr, dvdlcorr;
+    real            prescorr, enercorr, dvdlcorr;
     gmx_bool        bEnergyOutOfBounds;
     const char     *tpid_leg[2] = {"direct", "reweighted"};
 
@@ -193,7 +191,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
              * The center of mass of the last atoms is then used for TPIC.
              */
             nat_cavity = 0;
-            while (sscanf(ptr, "%lf%n", &dbl, &i) > 0)
+            while (sscanf(ptr, "%20lf%n", &dbl, &i) > 0)
             {
                 srenew(mass_cavity, nat_cavity+1);
                 mass_cavity[nat_cavity] = dbl;
@@ -248,7 +246,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
     dump_ener = 0;
     if (dump_pdb)
     {
-        sscanf(dump_pdb, "%lf", &dump_ener);
+        sscanf(dump_pdb, "%20lf", &dump_ener);
     }
 
     atoms2md(top_global, inputrec, 0, NULL, top_global->natoms, mdatoms);
@@ -382,25 +380,25 @@ double do_tpi(FILE *fplog, t_commrec *cr,
         snew(leg, 4+nener);
         e = 0;
         sprintf(str, "-kT log(<Ve\\S-\\betaU\\N>/<V>)");
-        leg[e++] = strdup(str);
+        leg[e++] = gmx_strdup(str);
         sprintf(str, "f. -kT log<e\\S-\\betaU\\N>");
-        leg[e++] = strdup(str);
+        leg[e++] = gmx_strdup(str);
         sprintf(str, "f. <e\\S-\\betaU\\N>");
-        leg[e++] = strdup(str);
+        leg[e++] = gmx_strdup(str);
         sprintf(str, "f. V");
-        leg[e++] = strdup(str);
+        leg[e++] = gmx_strdup(str);
         sprintf(str, "f. <Ue\\S-\\betaU\\N>");
-        leg[e++] = strdup(str);
+        leg[e++] = gmx_strdup(str);
         for (i = 0; i < ngid; i++)
         {
             sprintf(str, "f. <U\\sVdW %s\\Ne\\S-\\betaU\\N>",
                     *(groups->grpname[groups->grps[egcENER].nm_ind[i]]));
-            leg[e++] = strdup(str);
+            leg[e++] = gmx_strdup(str);
         }
         if (bDispCorr)
         {
             sprintf(str, "f. <U\\sdisp c\\Ne\\S-\\betaU\\N>");
-            leg[e++] = strdup(str);
+            leg[e++] = gmx_strdup(str);
         }
         if (bCharge)
         {
@@ -408,17 +406,17 @@ double do_tpi(FILE *fplog, t_commrec *cr,
             {
                 sprintf(str, "f. <U\\sCoul %s\\Ne\\S-\\betaU\\N>",
                         *(groups->grpname[groups->grps[egcENER].nm_ind[i]]));
-                leg[e++] = strdup(str);
+                leg[e++] = gmx_strdup(str);
             }
             if (bRFExcl)
             {
                 sprintf(str, "f. <U\\sRF excl\\Ne\\S-\\betaU\\N>");
-                leg[e++] = strdup(str);
+                leg[e++] = gmx_strdup(str);
             }
             if (EEL_FULL(fr->eeltype))
             {
                 sprintf(str, "f. <U\\sCoul recip\\Ne\\S-\\betaU\\N>");
-                leg[e++] = strdup(str);
+                leg[e++] = gmx_strdup(str);
             }
         }
         xvgr_legend(fp_tpi, 4+nener, (const char**)leg, oenv);
@@ -661,7 +659,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
             bNS           = FALSE;
 
             /* Calculate long range corrections to pressure and energy */
-            calc_dispcorr(fplog, inputrec, fr, step, top_global->natoms, state->box,
+            calc_dispcorr(inputrec, fr, top_global->natoms, state->box,
                           lambda, pres, vir, &prescorr, &enercorr, &dvdlcorr);
             /* figure out how to rearrange the next 4 lines MRS 8/4/2009 */
             enerd->term[F_DISPCORR]  = enercorr;
@@ -838,7 +836,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
 
     if (fp_tpi != NULL)
     {
-        gmx_fio_fclose(fp_tpi);
+        xvgrclose(fp_tpi);
     }
 
     if (fplog != NULL)
@@ -873,7 +871,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
                     (int)(bin[i]+0.5),
                     bin[i]*exp(-bUlogV)*V_all/VembU_all);
         }
-        gmx_fio_fclose(fp_tpi);
+        xvgrclose(fp_tpi);
     }
     sfree(bin);
 
similarity index 93%
rename from src/gromacs/mdlib/update.c
rename to src/gromacs/mdlib/update.cpp
index c4bdfe3892908ec4b191ae80967367bb469df2a7..eab7fb193283abd5011841ce242a11dfd82f5593 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/update.h"
 
-#include <stdio.h>
 #include <math.h>
+#include <stdio.h>
 
-#include "types/commrec.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "nrnb.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "main.h"
-#include "update.h"
-#include "gromacs/random/random.h"
-#include "mshift.h"
-#include "tgroup.h"
-#include "force.h"
-#include "names.h"
-#include "txtdump.h"
-#include "mdrun.h"
-#include "constr.h"
-#include "disre.h"
-#include "orires.h"
-#include "gmx_omp_nthreads.h"
+#include <algorithm>
 
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/random/random.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxomp.h"
-#include "gromacs/pulling/pull.h"
+#include "gromacs/utility/smalloc.h"
 
 /*For debugging, start at v(-dt/2) for velolcity verlet -- uncomment next line */
 /*#define STARTFROMDT2*/
@@ -266,10 +264,8 @@ static void do_update_vv_vel(int start, int nrend, double dt,
                              unsigned short cACC[], rvec v[], rvec f[],
                              gmx_bool bExtended, real veta, real alpha)
 {
-    double imass, w_dt;
+    double w_dt;
     int    gf = 0, ga = 0;
-    rvec   vrel;
-    real   u, vn, vv, va, vb, vnrel;
     int    n, d;
     double g, mv1, mv2;
 
@@ -316,7 +312,6 @@ static void do_update_vv_pos(int start, int nrend, double dt,
                              rvec x[], rvec xprime[], rvec v[],
                              gmx_bool bExtended, real veta)
 {
-    double imass, w_dt;
     int    gf = 0;
     int    n, d;
     double g, mr1, mr2;
@@ -401,8 +396,6 @@ static void do_update_visc(int start, int nrend, double dt,
             }
             for (d = 0; d < DIM; d++)
             {
-                vn             = v[n][d];
-
                 if ((ptype[n] != eptVSite) && (ptype[n] != eptShell))
                 {
                     vn  = (lg*vrel[d] + dt*(imass*f[n][d] - 0.5*vxi*vrel[d]
@@ -469,7 +462,7 @@ static gmx_stochd_t *init_stochd(t_inputrec *ir)
 {
     gmx_stochd_t   *sd;
     gmx_sd_const_t *sdc;
-    int             ngtc, n, th;
+    int             ngtc, n;
     real            y;
 
     snew(sd, 1);
@@ -542,7 +535,7 @@ static gmx_stochd_t *init_stochd(t_inputrec *ir)
 
         for (n = 0; n < ngtc; n++)
         {
-            reft = max(0.0, opts->ref_t[n]);
+            reft = std::max<real>(0, opts->ref_t[n]);
             if ((opts->tau_t[n] > 0) && (reft > 0))  /* tau_t or ref_t = 0 means that no randomization is done */
             {
                 sd->randomize_group[n] = TRUE;
@@ -668,10 +661,6 @@ static void do_update_sd1(gmx_stochd_t *sd,
                 {
                     ga  = cACC[n];
                 }
-                if (cTC)
-                {
-                    gt  = cTC[n];
-                }
 
                 for (d = 0; d < DIM; d++)
                 {
@@ -701,10 +690,6 @@ static void do_update_sd1(gmx_stochd_t *sd,
                 {
                     gf  = cFREEZE[n];
                 }
-                if (cACC)
-                {
-                    ga  = cACC[n];
-                }
                 if (cTC)
                 {
                     gt  = cTC[n];
@@ -783,7 +768,6 @@ static void do_update_sd2(gmx_stochd_t *sd,
      * half of the update, needs to be remembered for the second half.
      */
     rvec  *sd_V;
-    real   kT;
     int    gf = 0, ga = 0, gt = 0;
     real   vn = 0, Vmh, Xmh;
     real   ism;
@@ -970,8 +954,7 @@ static void dump_it_all(FILE gmx_unused *fp, const char gmx_unused *title,
 }
 
 static void calc_ke_part_normal(rvec v[], t_grpopts *opts, t_mdatoms *md,
-                                gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel,
-                                gmx_bool bSaveEkinOld)
+                                gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel)
 {
     int           g;
     t_grp_tcstat *tcstat  = ekind->tcstat;
@@ -979,10 +962,8 @@ static void calc_ke_part_normal(rvec v[], t_grpopts *opts, t_mdatoms *md,
     int           nthread, thread;
 
     /* three main: VV with AveVel, vv with AveEkin, leap with AveEkin.  Leap with AveVel is also
-       an option, but not supported now.  Additionally, if we are doing iterations.
+       an option, but not supported now.
        bEkinAveVel: If TRUE, we sum into ekin, if FALSE, into ekinh.
-       bSavEkinOld: If TRUE (in the case of iteration = bIterate is TRUE), we don't copy over the ekinh_old.
-       If FALSE, we overrwrite it.
      */
 
     /* group velocities are calculated in update_ekindata and
@@ -991,27 +972,19 @@ static void calc_ke_part_normal(rvec v[], t_grpopts *opts, t_mdatoms *md,
      */
     for (g = 0; (g < opts->ngtc); g++)
     {
-
-        if (!bSaveEkinOld)
-        {
-            copy_mat(tcstat[g].ekinh, tcstat[g].ekinh_old);
-        }
+        copy_mat(tcstat[g].ekinh, tcstat[g].ekinh_old);
         if (bEkinAveVel)
         {
             clear_mat(tcstat[g].ekinf);
+            tcstat[g].ekinscalef_nhc = 1.0;   /* need to clear this -- logic is complicated! */
         }
         else
         {
             clear_mat(tcstat[g].ekinh);
         }
-        if (bEkinAveVel)
-        {
-            tcstat[g].ekinscalef_nhc = 1.0; /* need to clear this -- logic is complicated! */
-        }
     }
     ekind->dekindl_old = ekind->dekindl;
-
-    nthread = gmx_omp_nthreads_get(emntUpdate);
+    nthread            = gmx_omp_nthreads_get(emntUpdate);
 
 #pragma omp parallel for num_threads(nthread) schedule(static)
     for (thread = 0; thread < nthread; thread++)
@@ -1167,11 +1140,11 @@ static void calc_ke_part_visc(matrix box, rvec x[], rvec v[],
 }
 
 void calc_ke_part(t_state *state, t_grpopts *opts, t_mdatoms *md,
-                  gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel, gmx_bool bSaveEkinOld)
+                  gmx_ekindata_t *ekind, t_nrnb *nrnb, gmx_bool bEkinAveVel)
 {
     if (ekind->cosacc.cos_accel == 0)
     {
-        calc_ke_part_normal(state->v, opts, md, ekind, nrnb, bEkinAveVel, bSaveEkinOld);
+        calc_ke_part_normal(state->v, opts, md, ekind, nrnb, bEkinAveVel);
     }
     else
     {
@@ -1270,7 +1243,7 @@ void set_deform_reference_box(gmx_update_t upd, gmx_int64_t step, matrix box)
 }
 
 static void deform(gmx_update_t upd,
-                   int start, int homenr, rvec x[], matrix box, matrix *scale_tot,
+                   int start, int homenr, rvec x[], matrix box,
                    const t_inputrec *ir, gmx_int64_t step)
 {
     matrix bnew, invbox, mu;
@@ -1318,13 +1291,6 @@ static void deform(gmx_update_t upd,
         x[i][YY] = mu[YY][YY]*x[i][YY]+mu[ZZ][YY]*x[i][ZZ];
         x[i][ZZ] = mu[ZZ][ZZ]*x[i][ZZ];
     }
-    if (scale_tot != NULL)
-    {
-        /* The transposes of the scaling matrices are stored,
-         * so we need to do matrix multiplication in the inverse order.
-         */
-        mmul_ur0(*scale_tot, mu, *scale_tot);
-    }
 }
 
 void update_tcouple(gmx_int64_t       step,
@@ -1337,7 +1303,7 @@ void update_tcouple(gmx_int64_t       step,
 {
     gmx_bool   bTCouple = FALSE;
     real       dttc;
-    int        i, start, end, homenr, offset;
+    int        i, offset;
 
     /* if using vv with trotter decomposition methods, we do this elsewhere in the code */
     if (inputrec->etc != etcNO &&
@@ -1521,9 +1487,9 @@ static void combine_forces(gmx_update_t upd,
                 }
             }
         }
-        constrain(NULL, FALSE, FALSE, constr, idef, ir, NULL, cr, step, 0, 1.0, md,
+        constrain(NULL, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
                   state->x, xp, xp, bMolPBC, state->box, state->lambda[efptBONDED], NULL,
-                  NULL, vir_lr_constr, nrnb, econqCoord, ir->epc == epcMTTK, state->veta, state->veta);
+                  NULL, vir_lr_constr, nrnb, econqForce);
     }
 
     /* Add nstcalclr-1 times the LR force to the sum of both forces
@@ -1542,7 +1508,6 @@ void update_constraints(FILE             *fplog,
                         gmx_int64_t       step,
                         real             *dvdlambda, /* the contribution to be added to the bonded interactions */
                         t_inputrec       *inputrec,  /* input record and box stuff     */
-                        gmx_ekindata_t   *ekind,
                         t_mdatoms        *md,
                         t_state          *state,
                         gmx_bool          bMolPBC,
@@ -1556,15 +1521,13 @@ void update_constraints(FILE             *fplog,
                         gmx_update_t      upd,
                         gmx_constr_t      constr,
                         gmx_bool          bFirstHalf,
-                        gmx_bool          bCalcVir,
-                        real              vetanew)
+                        gmx_bool          bCalcVir)
 {
-    gmx_bool             bExtended, bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
+    gmx_bool             bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
     double               dt;
-    real                 dt_1;
-    int                  start, homenr, nrend, i, n, m, g, d;
+    int                  start, homenr, nrend, i, m;
     tensor               vir_con;
-    rvec                *vbuf, *xprime = NULL;
+    rvec                *xprime = NULL;
     int                  nth, th;
 
     if (constr)
@@ -1584,7 +1547,6 @@ void update_constraints(FILE             *fplog,
     nrend  = start+homenr;
 
     dt   = inputrec->delta_t;
-    dt_1 = 1.0/dt;
 
     /*
      *  Steps (7C, 8C)
@@ -1612,22 +1574,20 @@ void update_constraints(FILE             *fplog,
         if (EI_VV(inputrec->eI) && bFirstHalf)
         {
             constrain(NULL, bLog, bEner, constr, idef,
-                      inputrec, ekind, cr, step, 1, 1.0, md,
+                      inputrec, cr, step, 1, 1.0, md,
                       state->x, state->v, state->v,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      NULL, bCalcVir ? &vir_con : NULL, nrnb, econqVeloc,
-                      inputrec->epc == epcMTTK, state->veta, vetanew);
+                      NULL, bCalcVir ? &vir_con : NULL, nrnb, econqVeloc);
         }
         else
         {
             constrain(NULL, bLog, bEner, constr, idef,
-                      inputrec, ekind, cr, step, 1, 1.0, md,
+                      inputrec, cr, step, 1, 1.0, md,
                       state->x, xprime, NULL,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      state->v, bCalcVir ? &vir_con : NULL, nrnb, econqCoord,
-                      inputrec->epc == epcMTTK, state->veta, state->veta);
+                      state->v, bCalcVir ? &vir_con : NULL, nrnb, econqCoord);
         }
         wallcycle_stop(wcycle, ewcCONSTR);
 
@@ -1702,11 +1662,11 @@ void update_constraints(FILE             *fplog,
             wallcycle_start(wcycle, ewcCONSTR);
 
             constrain(NULL, bLog, bEner, constr, idef,
-                      inputrec, NULL, cr, step, 1, 0.5, md,
+                      inputrec, cr, step, 1, 0.5, md,
                       state->x, xprime, NULL,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      state->v, NULL, nrnb, econqCoord, FALSE, 0, 0);
+                      state->v, NULL, nrnb, econqCoord);
 
             wallcycle_stop(wcycle, ewcCONSTR);
         }
@@ -1746,11 +1706,11 @@ void update_constraints(FILE             *fplog,
             /* Constrain the coordinates xprime */
             wallcycle_start(wcycle, ewcCONSTR);
             constrain(NULL, bLog, bEner, constr, idef,
-                      inputrec, NULL, cr, step, 1, 1.0, md,
+                      inputrec, cr, step, 1, 1.0, md,
                       state->x, xprime, NULL,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      NULL, NULL, nrnb, econqCoord, FALSE, 0, 0);
+                      NULL, NULL, nrnb, econqCoord);
             wallcycle_stop(wcycle, ewcCONSTR);
         }
     }
@@ -1775,8 +1735,10 @@ void update_constraints(FILE             *fplog,
         }
         else
         {
+#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++)
             {
@@ -1796,25 +1758,15 @@ void update_box(FILE             *fplog,
                 t_mdatoms        *md,
                 t_state          *state,
                 rvec              force[],   /* forces on home particles */
-                matrix           *scale_tot,
                 matrix            pcoupl_mu,
                 t_nrnb           *nrnb,
                 gmx_update_t      upd)
 {
-    gmx_bool             bExtended, bLastStep, bLog = FALSE, bEner = FALSE;
     double               dt;
-    real                 dt_1;
-    int                  start, homenr, nrend, i, n, m, g;
-    tensor               vir_con;
+    int                  start, homenr, i, n, m;
 
     start  = 0;
     homenr = md->homenr;
-    nrend  = start+homenr;
-
-    bExtended =
-        (inputrec->etc == etcNOSEHOOVER) ||
-        (inputrec->epc == epcPARRINELLORAHMAN) ||
-        (inputrec->epc == epcMTTK);
 
     dt = inputrec->delta_t;
 
@@ -1878,17 +1830,9 @@ void update_box(FILE             *fplog,
             break;
     }
 
-    if ((!(IR_NPT_TROTTER(inputrec) || IR_NPH_TROTTER(inputrec))) && scale_tot)
-    {
-        /* The transposes of the scaling matrices are stored,
-         * therefore we need to reverse the order in the multiplication.
-         */
-        mmul_ur0(*scale_tot, pcoupl_mu, *scale_tot);
-    }
-
     if (DEFORM(*inputrec))
     {
-        deform(upd, start, homenr, state->x, state->box, scale_tot, inputrec, step);
+        deform(upd, start, homenr, state->x, state->box, inputrec, step);
     }
     where();
     dump_it_all(fplog, "After update",
@@ -1916,16 +1860,11 @@ void update_coords(FILE             *fplog,
                    gmx_constr_t      constr,
                    t_idef           *idef)
 {
-    gmx_bool          bNH, bPR, bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
+    gmx_bool          bNH, bPR, bDoConstr = FALSE;
     double            dt, alpha;
-    real             *imass, *imassin;
     rvec             *force;
-    real              dt_1;
-    int               start, homenr, nrend, i, j, d, n, m, g;
-    int               blen0, blen1, iatom, jatom, nshake, nsettle, nconstr, nexpand;
-    int              *icom = NULL;
-    tensor            vir_con;
-    rvec             *vcom, *xcom, *vall, *xall, *xin, *vin, *forcein, *fall, *xpall, *xprimein, *xprime;
+    int               start, homenr, nrend;
+    rvec             *xprime;
     int               nth, th;
 
     bDoConstr = (NULL != constr);
@@ -1944,7 +1883,6 @@ void update_coords(FILE             *fplog,
     xprime = get_xprime(state, upd);
 
     dt   = inputrec->delta_t;
-    dt_1 = 1.0/dt;
 
     /* We need to update the NMR restraint history when time averaging is used */
     if (state->flags & (1<<estDISRE_RM3TAV))
@@ -2160,7 +2098,6 @@ extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, co
                                             t_mdatoms *md, t_state *state, gmx_update_t upd, gmx_constr_t constr)
 {
 
-    int  i;
     real rate = (ir->delta_t)/ir->opts.tau_t[0];
 
     if (ir->etc == etcANDERSEN && constr != NULL)
similarity index 97%
rename from src/gromacs/mdlib/vcm.c
rename to src/gromacs/mdlib/vcm.cpp
index 3be1995d4071a9cc1e0677a35076cafb999a908a..b1d5a805481b5590cf1c2a527bf6a496ac1f5e05 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "macros.h"
-#include "vcm.h"
-#include "vec.h"
+#include "gromacs/legacyheaders/vcm.h"
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/utility/smalloc.h"
-#include "names.h"
-#include "txtdump.h"
-#include "network.h"
-#include "pbc.h"
 
 t_vcm *init_vcm(FILE *fp, gmx_groups_t *groups, t_inputrec *ir)
 {
@@ -130,7 +129,7 @@ void calc_vcm_grp(int start, int homenr, t_mdatoms *md,
                   rvec x[], rvec v[], t_vcm *vcm)
 {
     int    i, g, m;
-    real   m0, xx, xy, xz, yy, yz, zz;
+    real   m0;
     rvec   j0;
 
     if (vcm->mode != ecmNO)
@@ -188,8 +187,7 @@ void calc_vcm_grp(int start, int homenr, t_mdatoms *md,
 void do_stopcm_grp(int start, int homenr, unsigned short *group_id,
                    rvec x[], rvec v[], t_vcm *vcm)
 {
-    int  i, g, m;
-    real tm, tm_1;
+    int  i, g;
     rvec dv, dx;
 
     if (vcm->mode != ecmNO)
@@ -293,7 +291,7 @@ void check_cm_grp(FILE *fp, t_vcm *vcm, t_inputrec *ir, real Temp_Max)
     int    m, g;
     real   ekcm, ekrot, tm, tm_1, Temp_cm;
     rvec   jcm;
-    tensor Icm, Tcm;
+    tensor Icm;
 
     /* First analyse the total results */
     if (vcm->mode != ecmNO)
similarity index 98%
rename from src/gromacs/mdlib/vsite.c
rename to src/gromacs/mdlib/vsite.cpp
index c63d8aa756367a5ec7b87c15b879b5a5ca570bfc..34d3cfd2213dbdabee378f4942b76a9a357c1ec9 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/vsite.h"
 
 #include <stdio.h>
-#include "typedefs.h"
-#include "vsite.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "nrnb.h"
-#include "vec.h"
-#include "network.h"
-#include "mshift.h"
-#include "pbc.h"
-#include "domdec.h"
-#include "mtop_util.h"
-#include "gmx_omp_nthreads.h"
 
+#include <algorithm>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
 
 /* Routines to send/recieve coordinates and force
  * of constructing atoms.
@@ -270,7 +273,7 @@ static void constr_vsite4FDN(rvec xi, rvec xj, rvec xk, rvec xl, rvec x,
 static int constr_vsiten(t_iatom *ia, t_iparams ip[],
                          rvec *x, t_pbc *pbc)
 {
-    rvec xs, x1, dx;
+    rvec x1, dx;
     dvec dsum;
     int  n3, av, ai, i;
     real a;
@@ -315,12 +318,11 @@ void construct_vsites_thread(gmx_vsite_t *vsite,
     gmx_bool   bPBCAll;
     rvec       xpbc, xv, vv, dx;
     real       a1, b1, c1, inv_dt;
-    int        i, inc, ii, nra, nr, tp, ftype;
+    int        i, inc, nra, nr, tp, ftype;
     t_iatom    avsite, ai, aj, ak, al, pbc_atom;
     t_iatom   *ia;
     t_pbc     *pbc_null2;
     int       *vsite_pbc, ishift;
-    rvec       reftmp, vtmp, rtmp;
 
     if (v != NULL)
     {
@@ -489,7 +491,6 @@ void construct_vsites(gmx_vsite_t *vsite,
 {
     t_pbc     pbc, *pbc_null;
     gmx_bool  bDomDec;
-    int       nthreads;
 
     bDomDec = cr && DOMAINDECOMP(cr);
 
@@ -542,7 +543,6 @@ static void spread_vsite2(t_iatom ia[], real a,
     rvec    fi, fj, dx;
     t_iatom av, ai, aj;
     ivec    di;
-    real    b;
     int     siv, sij;
 
     av = ia[1];
@@ -669,10 +669,10 @@ static void spread_vsite3FD(t_iatom ia[], real a, real b,
                             gmx_bool VirCorr, matrix dxdf,
                             t_pbc *pbc, t_graph *g)
 {
-    real    fx, fy, fz, c, invl, fproj, a1;
+    real    c, invl, fproj, a1;
     rvec    xvi, xij, xjk, xix, fv, temp;
     t_iatom av, ai, aj, ak;
-    int     svi, sji, skj, d;
+    int     svi, sji, skj;
     ivec    di;
 
     av = ia[1];
@@ -1311,7 +1311,7 @@ static void spread_vsite_f_thread(gmx_vsite_t *vsite,
 {
     gmx_bool   bPBCAll;
     real       a1, b1, c1;
-    int        i, inc, m, nra, nr, tp, ftype;
+    int        i, inc, nra, nr, tp, ftype;
     t_iatom   *ia;
     t_pbc     *pbc_null2;
     int       *vsite_pbc;
@@ -1555,7 +1555,7 @@ static int *atom2cg(t_block *cgs)
 static int count_intercg_vsite(gmx_mtop_t *mtop,
                                gmx_bool   *bHaveChargeGroups)
 {
-    int             mb, mt, ftype, nral, i, cg, a;
+    int             mb, ftype, nral, i, cg, a;
     gmx_molblock_t *molb;
     gmx_moltype_t  *molt;
     int            *a2cg;
@@ -1608,7 +1608,7 @@ static int **get_vsite_pbc(t_iparams *iparams, t_ilist *ilist,
                            t_atom *atom, t_mdatoms *md,
                            t_block *cgs, int *a2cg)
 {
-    int      ftype, nral, i, j, vsi, vsite, cg_v, cg_c, a, nc3 = 0;
+    int      ftype, nral, i, j, vsi, vsite, cg_v, a, nc3 = 0;
     t_ilist *il;
     t_iatom *ia;
     int    **vsite_pbc, *vsite_pbc_f;
@@ -1750,11 +1750,10 @@ gmx_vsite_t *init_vsite(gmx_mtop_t *mtop, t_commrec *cr,
                         gmx_bool bSerial_NoPBC)
 {
     int            nvsite, i;
-    int           *a2cg, cg;
+    int           *a2cg;
     gmx_vsite_t   *vsite;
     int            mt;
     gmx_moltype_t *molt;
-    int            nthreads;
 
     /* check if there are vsites */
     nvsite = 0;
@@ -1889,7 +1888,7 @@ void split_vsites_over_threads(const t_ilist   *ilist,
                     {
                         for (j = i + 1; j < i + nral1; j++)
                         {
-                            vsite_atom_range = max(vsite_atom_range, iat[j]);
+                            vsite_atom_range = std::max(vsite_atom_range, iat[j]);
                         }
                     }
                 }
@@ -1905,10 +1904,10 @@ void split_vsites_over_threads(const t_ilist   *ilist,
                         /* The 3 below is from 1+NRAL(ftype)=3 */
                         vs_ind_end = i + ip[iat[i]].vsiten.n*3;
 
-                        vsite_atom_range = max(vsite_atom_range, iat[i+1]);
+                        vsite_atom_range = std::max(vsite_atom_range, iat[i+1]);
                         while (i < vs_ind_end)
                         {
-                            vsite_atom_range = max(vsite_atom_range, iat[i+2]);
+                            vsite_atom_range = std::max(vsite_atom_range, iat[i+2]);
                             i               += 3;
                         }
                     }
index 6de4e9e4478e65991a0d5b327c0bde341234699e..bdc5c90e404b06e96cd38a06e86a28b205c7f669 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/utilities.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "force.h"
-#include "gromacs/fileio/filenm.h"
-#include "nrnb.h"
-#include "vec.h"
 
 void make_wall_tables(FILE *fplog, const output_env_t oenv,
                       const t_inputrec *ir, const char *tabfn,
index eb99f7a3a4491854facafbfd6f8c1a2ae35bfc67..0e72450f564f0229d872adcc4a345210ddc6d48a 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdio.h>
 #include <string.h>
-#include "force.h"
-#include "gromacs/utility/smalloc.h"
-#include "types/commrec.h"
-#include "ns.h"
-#include "nrnb.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "gromacs/fileio/futil.h"
-#include "names.h"
-#include "domdec.h"
+
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define header "Neighborlist:"
 
index a6448783a801e320a773c693849876dd948bbe9d..c34de31cc06950baecba9262bd219fdd62bd2a03 100644 (file)
 file(GLOB ONLINEHELP_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ONLINEHELP_SOURCES} PARENT_SCOPE)
 
-set(ONLINEHELP_PUBLIC_HEADERS
-    helptopicinterface.h)
-gmx_install_headers(onlinehelp ${ONLINEHELP_PUBLIC_HEADERS})
-
 if (BUILD_TESTING)
     add_subdirectory(tests)
 endif()
index e98f6a63a9e5192c4617b6bc2d3193a8b7251e45..e5f7212393d66871c6804010df9e76efa066ef30 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
+#include "gmxpre.h"
+
 #include "helpformat.h"
 
 #include <algorithm>
index 6891adfb0845bdd56c32cb4822110f2b4d673146..99e16425b5639626944d081b034be8413d745ffb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,7 +45,7 @@
 
 #include <string>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 733509737dcf257e0f55e87310ca1a87912d1bcb..45193dcd5115c697cec4b0bb49d3cbf0bab71d39 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
+#include "gmxpre.h"
+
 #include "helpmanager.h"
 
 #include <string>
index 122d72242e5dd67f52e853c547e6b7ef7ec050cd..97f78e926d8c56a9ad6e34cbd47fc72a7b305cd5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,7 +45,7 @@
 
 #include <string>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 10a86d8553c47493f0aa7e866c574ca31c12d165..8bcaa6ac9443c44fadd5d74544de1e7990559583 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
+#include "gmxpre.h"
+
 #include "helptopic.h"
 
 #include <map>
index f67bc8e993b17702412700a44210bcda92154e9c..86343697ae57ffcb709343c2a927ff8208aaa917 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_ONLINEHELP_HELPTOPIC_H
 #define GMX_ONLINEHELP_HELPTOPIC_H
 
-#include "../utility/common.h"
-#include "../utility/stringutil.h"
-#include "../utility/uniqueptr.h"
-
-#include "helptopicinterface.h"
+#include "gromacs/onlinehelp/helptopicinterface.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
index 1c6926369fdceb45174d2515e307494f35e37a2e..2a6479ed273adfc8b2664fa89ea0a005f098a77e 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.
  */
-/*! \file
+/*! \libinternal \defgroup module_onlinehelp Help Formatting for Online Help (onlinehelp)
+ * \ingroup group_utilitymodules
+ * \brief
+ * Provides functionality for formatting help text for console and other
+ * formats.
+ *
+ * This module provides helper functions and classes for formatting console
+ * help, as well as man pages and HTML help from the source code.  It should
+ * not be necessary to call any methods in this module outside the \Gromacs
+ * library.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ */
+/*! \libinternal \file
  * \brief
  * Declares gmx::HelpTopicInterface.
  *
 #ifndef GMX_ONLINEHELP_HELPTOPICINTERFACE_H
 #define GMX_ONLINEHELP_HELPTOPICINTERFACE_H
 
-#include "../utility/uniqueptr.h"
+#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
 
 class HelpWriterContext;
 
-/*! \brief
+/*! \libinternal \brief
  * Provides a single online help topic.
  *
- * \if libapi
  * Implementations of these methods should not throw, except that writeHelp()
  * is allowed to throw on out-of-memory or I/O errors since those it cannot
  * avoid.
  *
  * Header helptopic.h contains classes that implement this interface and make
  * it simple to write concrete help topic classes.
- * \endif
- *
- * This class is in a public header, and exposed through HelpTopicPointer, but
- * it is not intended to be used outside the library.  To access a help topic
- * with public API methods, use HelpManager.
  *
  * \inlibraryapi
  * \ingroup module_onlinehelp
index 2a30686f39ccdd8077f28cec5799da392da6db6c..8ede31c71a48586095d50add97f27983b3c504a6 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
+#include "gmxpre.h"
+
 #include "helpwritercontext.h"
 
 #include <cctype>
@@ -61,7 +63,7 @@ namespace gmx
 namespace
 {
 
-//! \addtogroup module_onlinehelp
+//! \internal \addtogroup module_onlinehelp
 //! \{
 
 struct t_sandr
index 157ea00b8a584877bf46b8cf38646943392558df..204385b1b76273b93fef6f21bb57981cde886d53 100644 (file)
@@ -46,7 +46,7 @@
 #include <string>
 #include <vector>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index b7a03e94ac68ba7b9a92b30322e10652ae8b93e4..797593e6b899116ce3be98d93d914d508c279996 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/onlinehelp/helpformat.h"
 
+#include <gtest/gtest.h>
+
 #include "testutils/stringtest.h"
 
 namespace
index b3ce50e09fdc497715dc97da84abdbc6c89c1a88..09b22225f1c9a6b2beb304427c4bb704254bc0c9 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
+#include "gmxpre.h"
+
 #include "gromacs/onlinehelp/helpmanager.h"
 
 #include <string>
index f982a7ac16479594e5c7fd02f15e0174ca53fdd6..5d7484d1f902fb919c0993ec7e561565488808cb 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_onlinehelp
  */
+#include "gmxpre.h"
+
 #include "mock_helptopic.h"
 
 #include <gmock/gmock.h>
index 95ab62155747d1b4d0bc4596ed195832abb0909b..a6bc7e8362f7b94f4c5fa3077638f096e2411317 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_OPTIONS_H
 #define GMX_OPTIONS_H
 
-#include "options/basicoptions.h"
-#include "options/filenameoption.h"
-#include "options/options.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/filenameoptionmanager.h"
+#include "gromacs/options/options.h"
 
 #endif
index cfb6a36b5b04e938ecfbc6bb983680bc878506d1..a04d94e1a184ab50c61fe45137f0f43c1ec62f4c 100644 (file)
 file(GLOB OPTIONS_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${OPTIONS_SOURCES} PARENT_SCOPE)
 
-set(OPTIONS_PUBLIC_HEADERS
+gmx_install_headers(
     abstractoption.h
     basicoptions.h
     filenameoption.h
+    filenameoptionmanager.h
     optionfiletype.h
     optionflags.h
     options.h
-    timeunitmanager.h)
-gmx_install_headers(options ${OPTIONS_PUBLIC_HEADERS})
+    timeunitmanager.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index 0db9950f985cb337ae7324ad05e71ad457f1a9a7..a71ed24353a6867c35c2aceee5935a32e7c19c49 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include "gromacs/options/abstractoption.h"
+#include "gmxpre.h"
+
+#include "abstractoption.h"
 
 #include "gromacs/options/abstractoptionstorage.h"
 #include "gromacs/options/optionflags.h"
index ea365d2773b8f5fbf372e54537cdf1ef0789fcdc..aa5f2fb1e5b58e92d142c4a77effd1677501e974 100644 (file)
 #include <string>
 #include <vector>
 
-#include "../utility/common.h"
-#include "../utility/uniqueptr.h"
-
-#include "optionflags.h"
+#include "gromacs/options/optionflags.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
 
 class AbstractOptionStorage;
 template <typename T> class OptionStorageTemplate;
+class OptionManagerContainer;
 class Options;
 
-//! Smart pointer for managing an AbstractOptionStorage object.
-typedef gmx_unique_ptr<AbstractOptionStorage>::type
-    AbstractOptionStoragePointer;
-
 /*! \brief
  * Abstract base class for specifying option properties.
  *
@@ -108,8 +103,10 @@ class AbstractOption
         /*! \brief
          * Creates a default storage object for the option.
          *
-         * \returns The created storage object.
-         * \throws  APIError if invalid option settings have been provided.
+         * \param[in] managers  Manager container (unused if the option does
+         *     not use a manager).
+         * \returns   The created storage object.
+         * \throws    APIError if invalid option settings have been provided.
          *
          * This method is called by Options::addOption() when initializing an
          * option from the settings.
@@ -119,8 +116,16 @@ class AbstractOption
          * They should also throw APIError if they detect problems.
          *
          * Should only be called by Options::addOption().
+         *
+         * The ownership of the return value is passed, but is not using a
+         * smart pointer to avoid introducing such a dependency in an installed
+         * header.  The implementation will always consist of a single `new`
+         * call and returning that value, and the caller always immediately
+         * wraps the pointer in a smart pointer, so there is not exception
+         * safety issue.
          */
-        virtual AbstractOptionStoragePointer createStorage() const = 0;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const = 0;
 
         //! Sets the description for the option.
         void setDescription(const char *descr) { descr_ = descr; }
index 9cb9ff543e6e66ade451124b3f1a70c492381e67..4b85b41d401d3e1baaf90793dda1a884fbe0bed8 100644 (file)
@@ -45,9 +45,8 @@
 
 #include <string>
 
-#include "../utility/common.h"
-
-#include "optionflags.h"
+#include "gromacs/options/optionflags.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index f1af57aa32bed7ea3c075503fbfb457b610b6b42..412455560756b6325fa1fc173be892f898e05d84 100644 (file)
@@ -39,8 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
+#include "gmxpre.h"
+
 #include "basicoptions.h"
-#include "basicoptionstorage.h"
 
 #include <cerrno>
 #include <cstdio>
@@ -54,6 +55,8 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "basicoptionstorage.h"
+
 namespace
 {
 
@@ -138,9 +141,10 @@ bool BooleanOptionInfo::defaultValue() const
  * BooleanOption
  */
 
-AbstractOptionStoragePointer BooleanOption::createStorage() const
+AbstractOptionStorage *
+BooleanOption::createStorage(const OptionManagerContainer & /*managers*/) const
 {
-    return AbstractOptionStoragePointer(new BooleanOptionStorage(*this));
+    return new BooleanOptionStorage(*this);
 }
 
 
@@ -195,9 +199,10 @@ IntegerOptionInfo::IntegerOptionInfo(IntegerOptionStorage *option)
  * IntegerOption
  */
 
-AbstractOptionStoragePointer IntegerOption::createStorage() const
+AbstractOptionStorage *
+IntegerOption::createStorage(const OptionManagerContainer & /*managers*/) const
 {
-    return AbstractOptionStoragePointer(new IntegerOptionStorage(*this));
+    return new IntegerOptionStorage(*this);
 }
 
 
@@ -242,9 +247,10 @@ Int64OptionInfo::Int64OptionInfo(Int64OptionStorage *option)
  * Int64Option
  */
 
-AbstractOptionStoragePointer Int64Option::createStorage() const
+AbstractOptionStorage *
+Int64Option::createStorage(const OptionManagerContainer & /*managers*/) const
 {
-    return AbstractOptionStoragePointer(new Int64OptionStorage(*this));
+    return new Int64OptionStorage(*this);
 }
 
 
@@ -343,9 +349,10 @@ void DoubleOptionInfo::setScaleFactor(double factor)
  * DoubleOption
  */
 
-AbstractOptionStoragePointer DoubleOption::createStorage() const
+AbstractOptionStorage *
+DoubleOption::createStorage(const OptionManagerContainer & /*managers*/) const
 {
-    return AbstractOptionStoragePointer(new DoubleOptionStorage(*this));
+    return new DoubleOptionStorage(*this);
 }
 
 
@@ -446,9 +453,10 @@ void FloatOptionInfo::setScaleFactor(double factor)
  * FloatOption
  */
 
-AbstractOptionStoragePointer FloatOption::createStorage() const
+AbstractOptionStorage *
+FloatOption::createStorage(const OptionManagerContainer & /*managers*/) const
 {
-    return AbstractOptionStoragePointer(new FloatOptionStorage(*this));
+    return new FloatOptionStorage(*this);
 }
 
 
@@ -515,11 +523,6 @@ StringOptionStorage::StringOptionStorage(const StringOption &settings)
                 GMX_THROW(APIError("Conflicting default values"));
             }
         }
-        // If there is no default value, match is still -1.
-        if (enumIndexStore_ != NULL)
-        {
-            *enumIndexStore_ = match;
-        }
     }
     if (settings.defaultEnumIndex_ >= 0)
     {
@@ -527,6 +530,12 @@ StringOptionStorage::StringOptionStorage(const StringOption &settings)
         addValue(allowed_[settings.defaultEnumIndex_]);
         commitValues();
     }
+    // Somewhat subtly, this does not update the stored enum index if the
+    // caller has not provided store() or storeVector(), because values()
+    // will be empty in such a case.  This leads to (desired) behavior of
+    // preserving the existing value in the enum index store variable in such
+    // cases.
+    refreshEnumIndexStore();
 }
 
 std::string StringOptionStorage::formatExtraDescription() const
@@ -585,15 +594,27 @@ void StringOptionStorage::convertValue(const std::string &value)
 void StringOptionStorage::refreshValues()
 {
     MyBase::refreshValues();
+    refreshEnumIndexStore();
+}
+
+void StringOptionStorage::refreshEnumIndexStore()
+{
     if (enumIndexStore_ != NULL)
     {
         for (size_t i = 0; i < values().size(); ++i)
         {
-            ValueList::const_iterator match =
-                std::find(allowed_.begin(), allowed_.end(), values()[i]);
-            GMX_ASSERT(match != allowed_.end(),
-                       "Enum value not found (internal error)");
-            enumIndexStore_[i] = static_cast<int>(match - allowed_.begin());
+            if (values()[i].empty())
+            {
+                enumIndexStore_[i] = -1;
+            }
+            else
+            {
+                ValueList::const_iterator match =
+                    std::find(allowed_.begin(), allowed_.end(), values()[i]);
+                GMX_ASSERT(match != allowed_.end(),
+                           "Enum value not found (internal error)");
+                enumIndexStore_[i] = static_cast<int>(match - allowed_.begin());
+            }
         }
     }
 }
@@ -631,9 +652,10 @@ const std::vector<std::string> &StringOptionInfo::allowedValues() const
  * StringOption
  */
 
-AbstractOptionStoragePointer StringOption::createStorage() const
+AbstractOptionStorage *
+StringOption::createStorage(const OptionManagerContainer & /*managers*/) const
 {
-    return AbstractOptionStoragePointer(new StringOptionStorage(*this));
+    return new StringOptionStorage(*this);
 }
 
 } // namespace gmx
index e733ad876019ac37cf8d3fc9d3ac9d0b52a78883..4d58fcf241d53da5f9a4c9a343ee8837afc68642 100644 (file)
 
 #include <string>
 
-#include "../legacyheaders/types/simple.h"
-#include "../utility/gmxassert.h"
-
-#include "abstractoption.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxassert.h"
 
 namespace gmx
 {
@@ -98,7 +97,8 @@ class BooleanOption : public OptionTemplate<bool, BooleanOption>
 
     private:
         //! Creates a BooleanOptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 };
 
 /*! \brief
@@ -140,7 +140,8 @@ class IntegerOption : public OptionTemplate<int, IntegerOption>
 
     private:
         //! Creates an IntegerOptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
         /*! \brief
          * Needed to initialize IntegerOptionStorage from this class without
@@ -169,7 +170,8 @@ class Int64Option : public OptionTemplate<gmx_int64_t, Int64Option>
 
     private:
         //! Creates an Int64OptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
         /*! \brief
          * Needed to initialize Int64OptionStorage from this class without
@@ -214,7 +216,8 @@ class DoubleOption : public OptionTemplate<double, DoubleOption>
 
     private:
         //! Creates a DoubleOptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
         bool bTime_;
 
@@ -252,7 +255,8 @@ class FloatOption : public OptionTemplate<float, FloatOption>
 
     private:
         //! Creates a FloatOptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
         bool bTime_;
 
@@ -359,7 +363,10 @@ class StringOption : public OptionTemplate<std::string, StringOption>
          * The index (zero-based) of the selected value in the array \p values
          * provided to enumValues() is written into \p *store after the
          * option gets its value.  If the option has not been provided,
-         * and there is no default value, -1 is stored.
+         * and there is no default value, -1 is stored.  If store(),
+         * storeVector() or defaultEnumIndex() is not present, the value in
+         * \p *store is kept as a default value, otherwise it is always
+         * overwritten.
          *
          * Cannot be specified without enumValue().
          *
@@ -372,7 +379,8 @@ class StringOption : public OptionTemplate<std::string, StringOption>
 
     private:
         //! Creates a StringOptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
         const char *const      *enumValues_;
         int                     enumValuesCount_;
index 02529cd7a224c8cd665d300beca7034cc8134da7..59ab9f16fc86a54925b935acb11a22348eb1d578 100644 (file)
@@ -45,8 +45,8 @@
 #include <string>
 #include <vector>
 
-#include "basicoptions.h"
-#include "optionstoragetemplate.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/optionstoragetemplate.h"
 
 namespace gmx
 {
@@ -206,6 +206,8 @@ class StringOptionStorage : public OptionStorageTemplate<std::string>
         virtual void convertValue(const std::string &value);
         virtual void refreshValues();
 
+        void refreshEnumIndexStore();
+
         StringOptionInfo        info_;
         ValueList               allowed_;
         int                    *enumIndexStore_;
index f5b58f0665236e1ff7253f1bc251f4cc924d6e09..68843686536900ddce5b178f46de23cc4fd360ac 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
+#include "gmxpre.h"
+
 #include "filenameoption.h"
-#include "filenameoptionstorage.h"
+
+#include <cstring>
 
 #include <string>
 #include <vector>
 
 #include "gromacs/fileio/filenm.h"
-
+#include "gromacs/options/filenameoptionmanager.h"
+#include "gromacs/options/optionmanagercontainer.h"
 #include "gromacs/utility/arrayref.h"
-#include "gromacs/utility/file.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "filenameoptionstorage.h"
+
 namespace gmx
 {
 
 namespace
 {
 
-class FileTypeRegistry;
-
 //! \addtogroup module_options
 //! \{
 
-//! Shorthand for a list of file extensions.
-typedef std::vector<const char *> ExtensionList;
+/*! \brief
+ * Mapping from OptionFileType to a file type in filenm.h.
+ */
+struct FileTypeMapping
+{
+    //! OptionFileType value to map.
+    OptionFileType optionType;
+    //! Corresponding file type from filenm.h.
+    int            fileType;
+};
+
+//! Mappings from OptionFileType to file types in filenm.h.
+const FileTypeMapping c_fileTypeMapping[] =
+{
+    { eftTopology,    efTPS },
+    { eftTrajectory,  efTRX },
+    { eftPDB,         efPDB },
+    { eftIndex,       efNDX },
+    { eftPlot,        efXVG },
+    { eftGenericData, efDAT }
+};
 
 /********************************************************************
  * FileTypeHandler
  */
 
-/*! \internal \brief
+/*! \internal
+ * \brief
  * Handles a single file type known to FileNameOptionStorage.
+ *
+ * Methods in this class do not throw, except for a possible std::bad_alloc
+ * when constructing std::string return values.
  */
 class FileTypeHandler
 {
     public:
-        //! Returns the list of extensions for this file type.
-        const ExtensionList &extensions() const { return extensions_; }
-
-        //! Returns whether \p filename has a valid extension for this type.
-        bool hasKnownExtension(const std::string &filename) const;
-        //! Adds a default extension for this type to \p filename.
-        std::string addExtension(const std::string &filename) const;
         /*! \brief
-         * Adds an extension to \p filename if it results in an existing file.
+         * Returns a handler for a single file type.
          *
-         * Tries to add each extension for this file type to \p filename and
-         * checks whether this results in an existing file.
-         * The first match is returned.
-         * Returns an empty string if no existing file is found.
+         * \param[in] fileType  File type (from filenm.h) to use.
          */
-        std::string findFileWithExtension(const std::string &filename) const;
+        explicit FileTypeHandler(int fileType);
 
-    private:
-        //! Possible extensions for this file type.
-        ExtensionList extensions_;
+        //! Returns the number of acceptable extensions for this file type.
+        int extensionCount() const;
+        //! Returns the extension with the given index.
+        const char *extension(int i) const;
+
+        //! Returns whether \p fileType (from filenm.h) is accepted for this type.
+        bool isValidType(int fileType) const;
 
+    private:
         /*! \brief
-         * Needed for initialization; all initialization is handled by
-         * FileTypeRegistry.
+         * File type (from filenm.h) represented by this handler.
+         *
+         * -1 represents an unknown file type.
          */
-        friend class FileTypeRegistry;
+        int        fileType_;
+        //! Number of different extensions this type supports.
+        int        extensionCount_;
+        /*! \brief
+         * List of simple file types that are included in this type.
+         *
+         * If `fileType_` represents a generic type in filenm.h, i.e., a type
+         * that accepts multiple different types of files, then this is an
+         * array of `extensionCount_` elements, each element specifying one
+         * non-generic file type that this option accepts.
+         * `NULL` for single-extension types.
+         */
+        const int *genericTypes_;
 };
 
-bool
-FileTypeHandler::hasKnownExtension(const std::string &filename) const
+FileTypeHandler::FileTypeHandler(int fileType)
+    : fileType_(fileType), extensionCount_(0), genericTypes_(NULL)
 {
-    for (size_t i = 0; i < extensions_.size(); ++i)
+    if (fileType_ >= 0)
     {
-        if (endsWith(filename, extensions_[i]))
+        const int genericTypeCount = ftp2generic_count(fileType_);
+        if (genericTypeCount > 0)
         {
-            return true;
+            extensionCount_ = genericTypeCount;
+            genericTypes_   = ftp2generic_list(fileType_);
         }
-    }
-    return false;
-}
-
-std::string
-FileTypeHandler::addExtension(const std::string &filename) const
-{
-    if (extensions_.empty())
-    {
-        return filename;
-    }
-    return filename + extensions_[0];
-}
-
-std::string
-FileTypeHandler::findFileWithExtension(const std::string &filename) const
-{
-    for (size_t i = 0; i < extensions_.size(); ++i)
-    {
-        std::string testFilename(filename + extensions_[i]);
-        if (File::exists(testFilename))
+        else if (ftp2ext_with_dot(fileType_)[0] != '\0')
         {
-            return testFilename;
+            extensionCount_ = 1;
         }
     }
-    return std::string();
 }
 
-/********************************************************************
- * FileTypeRegistry
- */
-
-/*! \internal \brief
- * Singleton for managing static file type info for FileNameOptionStorage.
- */
-class FileTypeRegistry
+int FileTypeHandler::extensionCount() const
 {
-    public:
-        //! Returns a singleton instance of this class.
-        static const FileTypeRegistry &instance();
-        //! Returns a handler for a single file type.
-        const FileTypeHandler &
-        handlerForType(OptionFileType type, int legacyType) const;
-
-    private:
-        //! Initializes the file type registry.
-        FileTypeRegistry();
-
-        //! Registers a file type that corresponds to a ftp in filenm.h.
-        void registerType(int type, int ftp);
-        //! Registers a file type with a single extension.
-        void registerType(int type, const char *extension);
-
-        std::vector<FileTypeHandler> filetypes_;
-};
-
-// static
-const FileTypeRegistry &
-FileTypeRegistry::instance()
-{
-    static FileTypeRegistry singleton;
-    return singleton;
-}
-
-const FileTypeHandler &
-FileTypeRegistry::handlerForType(OptionFileType type, int legacyType) const
-{
-    int index = type;
-    if (type == eftUnknown && legacyType >= 0)
-    {
-        index = eftOptionFileType_NR + legacyType;
-    }
-    GMX_RELEASE_ASSERT(index >= 0 && static_cast<size_t>(index) < filetypes_.size(),
-                       "Invalid file type");
-    return filetypes_[index];
+    return extensionCount_;
 }
 
-FileTypeRegistry::FileTypeRegistry()
+const char *FileTypeHandler::extension(int i) const
 {
-    filetypes_.resize(eftOptionFileType_NR + efNR);
-    registerType(eftTopology,    efTPS);
-    registerType(eftTrajectory,  efTRX);
-    registerType(eftPDB,         efPDB);
-    registerType(eftIndex,       efNDX);
-    registerType(eftPlot,        efXVG);
-    registerType(eftGenericData, efDAT);
-    for (int i = 0; i < efNR; ++i)
+    GMX_ASSERT(i >= 0 && i < extensionCount_, "Invalid extension index");
+    if (genericTypes_ != NULL)
     {
-        registerType(eftOptionFileType_NR + i, i);
+        return ftp2ext_with_dot(genericTypes_[i]);
     }
+    return ftp2ext_with_dot(fileType_);
 }
 
-void FileTypeRegistry::registerType(int type, int ftp)
+bool
+FileTypeHandler::isValidType(int fileType) const
 {
-    GMX_RELEASE_ASSERT(type >= 0 && static_cast<size_t>(type) < filetypes_.size(),
-                       "Invalid file type");
-    const int genericTypeCount = ftp2generic_count(ftp);
-    if (genericTypeCount > 0)
+    if (genericTypes_ != NULL)
     {
-        const int *const genericTypes = ftp2generic_list(ftp);
-        filetypes_[type].extensions_.clear();
-        filetypes_[type].extensions_.reserve(genericTypeCount);
-        for (int i = 0; i < genericTypeCount; ++i)
+        for (int i = 0; i < extensionCount(); ++i)
         {
-            filetypes_[type].extensions_.push_back(ftp2ext_with_dot(genericTypes[i]));
+            if (fileType == genericTypes_[i])
+            {
+                return true;
+            }
         }
+        return false;
     }
     else
     {
-        registerType(type, ftp2ext_with_dot(ftp));
-    }
-}
-
-void FileTypeRegistry::registerType(int type, const char *extension)
-{
-    GMX_RELEASE_ASSERT(type >= 0 && static_cast<size_t>(type) < filetypes_.size(),
-                       "Invalid file type");
-    filetypes_[type].extensions_.assign(1, extension);
-}
-
-/*! \brief
- * Helper method to complete a file name provided to a file name option.
- *
- * \param[in] value      Value provided to the file name option.
- * \param[in] filetype   File type for the option.
- * \param[in] legacyType If \p filetype is eftUnknown, this gives the type as
- *     an enum value from filenm.h.
- * \param[in] bCompleteToExisting
- *     Whether to check existing files when completing the extension.
- * \returns   \p value with possible extension added.
- */
-std::string completeFileName(const std::string &value, OptionFileType filetype,
-                             int legacyType, bool bCompleteToExisting)
-{
-    if (bCompleteToExisting && File::exists(value))
-    {
-        // TODO: This may not work as expected if the value is passed to a
-        // function that uses fn2ftp() to determine the file type and the input
-        // file has an unrecognized extension.
-        return value;
-    }
-    const FileTypeRegistry &registry    = FileTypeRegistry::instance();
-    const FileTypeHandler  &typeHandler = registry.handlerForType(filetype, legacyType);
-    if (typeHandler.hasKnownExtension(value))
-    {
-        return value;
-    }
-    if (bCompleteToExisting)
-    {
-        std::string newValue = typeHandler.findFileWithExtension(value);
-        if (!newValue.empty())
-        {
-            return newValue;
-        }
+        return fileType == fileType_;
     }
-    return typeHandler.addExtension(value);
 }
 
 //! \}
@@ -278,19 +200,58 @@ std::string completeFileName(const std::string &value, OptionFileType filetype,
  * FileNameOptionStorage
  */
 
-FileNameOptionStorage::FileNameOptionStorage(const FileNameOption &settings)
-    : MyBase(settings), info_(this), filetype_(settings.filetype_),
-      legacyType_(settings.legacyType_),
-      bRead_(settings.bRead_), bWrite_(settings.bWrite_),
-      bLibrary_(settings.bLibrary_)
+FileNameOptionStorage::FileNameOptionStorage(const FileNameOption  &settings,
+                                             FileNameOptionManager *manager)
+    : MyBase(settings), info_(this), manager_(manager), fileType_(-1),
+      defaultExtension_(""), bRead_(settings.bRead_), bWrite_(settings.bWrite_),
+      bLibrary_(settings.bLibrary_), bAllowMissing_(settings.bAllowMissing_)
 {
+    GMX_RELEASE_ASSERT(!hasFlag(efOption_MultipleTimes),
+                       "allowMultiple() is not supported for file name options");
+    if (settings.optionType_ == eftUnknown && settings.legacyType_ >= 0)
+    {
+        fileType_ = settings.legacyType_;
+    }
+    else
+    {
+        ConstArrayRef<FileTypeMapping>                 map(c_fileTypeMapping);
+        ConstArrayRef<FileTypeMapping>::const_iterator i;
+        for (i = map.begin(); i != map.end(); ++i)
+        {
+            if (i->optionType == settings.optionType_)
+            {
+                fileType_ = i->fileType;
+                break;
+            }
+        }
+    }
+    FileTypeHandler typeHandler(fileType_);
+    if (settings.defaultType_ >= 0 && settings.defaultType_ < efNR)
+    {
+        // This also assures that the default type is not a generic type.
+        GMX_RELEASE_ASSERT(typeHandler.isValidType(settings.defaultType_),
+                           "Default type for a file option is not an accepted "
+                           "type for the option");
+        FileTypeHandler defaultHandler(settings.defaultType_);
+        defaultExtension_ = defaultHandler.extension(0);
+    }
+    else if (typeHandler.extensionCount() > 0)
+    {
+        defaultExtension_ = typeHandler.extension(0);
+    }
     if (settings.defaultBasename_ != NULL)
     {
-        std::string defaultValue =
-            completeFileName(settings.defaultBasename_, filetype_,
-                             legacyType_, false);
+        std::string defaultValue(settings.defaultBasename_);
+        int         type = fn2ftp(settings.defaultBasename_);
+        GMX_RELEASE_ASSERT(type == efNR || type == settings.defaultType_,
+                           "Default basename has an extension that does not "
+                           "match the default type");
+        if (type == efNR)
+        {
+            defaultValue.append(defaultExtension());
+        }
         setDefaultValueIfSet(defaultValue);
-        if (isRequired())
+        if (isRequired() || settings.bLegacyOptionalBehavior_)
         {
             setDefaultValue(defaultValue);
         }
@@ -299,27 +260,24 @@ FileNameOptionStorage::FileNameOptionStorage(const FileNameOption &settings)
 
 std::string FileNameOptionStorage::typeString() const
 {
-    const FileTypeRegistry       &registry    = FileTypeRegistry::instance();
-    const FileTypeHandler        &typeHandler = registry.handlerForType(filetype_, legacyType_);
-    const ExtensionList          &extensions  = typeHandler.extensions();
-    std::string                   result;
-    ExtensionList::const_iterator i;
-    int                           count = 0;
-    for (i = extensions.begin(); count < 2 && i != extensions.end(); ++i, ++count)
+    FileTypeHandler typeHandler(fileType_);
+    std::string     result;
+    int             count;
+    for (count = 0; count < 2 && count < typeHandler.extensionCount(); ++count)
     {
-        if (i != extensions.begin())
+        if (count > 0)
         {
             result.append("/");
         }
-        result.append(*i);
+        result.append(typeHandler.extension(count));
     }
-    if (i != extensions.end())
+    if (count < typeHandler.extensionCount())
     {
         result.append("/...");
     }
     if (result.empty())
     {
-        if (legacyType_ == efRND)
+        if (isDirectoryOption())
         {
             result = "dir";
         }
@@ -333,18 +291,16 @@ std::string FileNameOptionStorage::typeString() const
 
 std::string FileNameOptionStorage::formatExtraDescription() const
 {
-    const FileTypeRegistry       &registry    = FileTypeRegistry::instance();
-    const FileTypeHandler        &typeHandler = registry.handlerForType(filetype_, legacyType_);
-    const ExtensionList          &extensions  = typeHandler.extensions();
-    std::string                   result;
-    if (extensions.size() > 2)
+    FileTypeHandler typeHandler(fileType_);
+    std::string     result;
+    if (typeHandler.extensionCount() > 2)
     {
         result.append(":");
-        ExtensionList::const_iterator i;
-        for (i = extensions.begin(); i != extensions.end(); ++i)
+        for (int i = 0; i < typeHandler.extensionCount(); ++i)
         {
             result.append(" ");
-            result.append((*i) + 1);
+            // Skip the dot.
+            result.append(typeHandler.extension(i) + 1);
         }
     }
     return result;
@@ -357,21 +313,136 @@ std::string FileNameOptionStorage::formatSingleValue(const std::string &value) c
 
 void FileNameOptionStorage::convertValue(const std::string &value)
 {
-    bool bInput = isInputFile() || isInputOutputFile();
-    addValue(completeFileName(value, filetype_, legacyType_, bInput));
+    if (manager_ != NULL)
+    {
+        std::string processedValue = manager_->completeFileName(value, info_);
+        if (!processedValue.empty())
+        {
+            // If the manager returns a value, use it without further checks,
+            // except for sanity checking.
+            if (!isDirectoryOption())
+            {
+                const int fileType = fn2ftp(processedValue.c_str());
+                if (fileType == efNR)
+                {
+                    // If the manager returned an invalid file name, assume
+                    // that it knows what it is doing.  But assert that it
+                    // only does that for the only case that it is currently
+                    // required for: VMD plugins.
+                    GMX_ASSERT(isInputFile() && isTrajectoryOption(),
+                               "Manager returned an invalid file name");
+                }
+                else
+                {
+                    GMX_ASSERT(isValidType(fileType),
+                               "Manager returned an invalid file name");
+                }
+            }
+            addValue(processedValue);
+            return;
+        }
+    }
+    // Currently, directory options are simple, and don't need any
+    // special processing.
+    // TODO: Consider splitting them into a separate DirectoryOption.
+    if (isDirectoryOption())
+    {
+        addValue(value);
+        return;
+    }
+    const int fileType = fn2ftp(value.c_str());
+    if (fileType == efNR)
+    {
+        std::string message
+            = formatString("File '%s' cannot be used by GROMACS because it "
+                           "does not have a recognizable extension.\n"
+                           "The following extensions are possible for this option:\n  %s",
+                           value.c_str(), joinStrings(extensions(), ", ").c_str());
+        GMX_THROW(InvalidInputError(message));
+    }
+    else if (!isValidType(fileType))
+    {
+        std::string message
+            = formatString("File name '%s' cannot be used for this option.\n"
+                           "Only the following extensions are possible:\n  %s",
+                           value.c_str(), joinStrings(extensions(), ", ").c_str());
+        GMX_THROW(InvalidInputError(message));
+    }
+    addValue(value);
+}
+
+void FileNameOptionStorage::processAll()
+{
+    if (manager_ != NULL && hasFlag(efOption_HasDefaultValue))
+    {
+        ValueList &valueList = values();
+        GMX_RELEASE_ASSERT(valueList.size() == 1,
+                           "There should be only one default value");
+        if (!valueList[0].empty())
+        {
+            const std::string &oldValue = valueList[0];
+            GMX_ASSERT(endsWith(oldValue, defaultExtension()),
+                       "Default value does not have the expected extension");
+            const std::string  prefix
+                = stripSuffixIfPresent(oldValue, defaultExtension());
+            const std::string  newValue
+                = manager_->completeDefaultFileName(prefix, info_);
+            if (!newValue.empty() && newValue != oldValue)
+            {
+                GMX_ASSERT(isValidType(fn2ftp(newValue.c_str())),
+                           "Manager returned an invalid default value");
+                valueList[0] = newValue;
+                refreshValues();
+            }
+        }
+    }
 }
 
 bool FileNameOptionStorage::isDirectoryOption() const
 {
-    return legacyType_ == efRND;
+    return fileType_ == efRND;
+}
+
+bool FileNameOptionStorage::isTrajectoryOption() const
+{
+    return fileType_ == efTRX;
+}
+
+const char *FileNameOptionStorage::defaultExtension() const
+{
+    return defaultExtension_;
 }
 
-ConstArrayRef<const char *> FileNameOptionStorage::extensions() const
+std::vector<const char *> FileNameOptionStorage::extensions() const
 {
-    const FileTypeRegistry &registry    = FileTypeRegistry::instance();
-    const FileTypeHandler  &typeHandler = registry.handlerForType(filetype_, legacyType_);
-    const ExtensionList    &extensions  = typeHandler.extensions();
-    return constArrayRefFromVector<const char *>(extensions.begin(), extensions.end());
+    FileTypeHandler           typeHandler(fileType_);
+    std::vector<const char *> result;
+    result.reserve(typeHandler.extensionCount());
+    for (int i = 0; i < typeHandler.extensionCount(); ++i)
+    {
+        result.push_back(typeHandler.extension(i));
+    }
+    return result;
+}
+
+bool FileNameOptionStorage::isValidType(int fileType) const
+{
+    FileTypeHandler typeHandler(fileType_);
+    return typeHandler.isValidType(fileType);
+}
+
+ConstArrayRef<int> FileNameOptionStorage::fileTypes() const
+{
+    if (fileType_ < 0)
+    {
+        return ConstArrayRef<int>();
+    }
+    const int genericTypeCount = ftp2generic_count(fileType_);
+    if (genericTypeCount > 0)
+    {
+        return constArrayRefFromArray<int>(ftp2generic_list(fileType_), genericTypeCount);
+    }
+    return constArrayRefFromArray<int>(&fileType_, 1);
 }
 
 /********************************************************************
@@ -408,23 +479,49 @@ bool FileNameOptionInfo::isLibraryFile() const
     return option().isLibraryFile();
 }
 
+bool FileNameOptionInfo::allowMissing() const
+{
+    return option().allowMissing();
+}
+
 bool FileNameOptionInfo::isDirectoryOption() const
 {
     return option().isDirectoryOption();
 }
 
+bool FileNameOptionInfo::isTrajectoryOption() const
+{
+    return option().isTrajectoryOption();
+}
+
+const char *FileNameOptionInfo::defaultExtension() const
+{
+    return option().defaultExtension();
+}
+
 FileNameOptionInfo::ExtensionList FileNameOptionInfo::extensions() const
 {
     return option().extensions();
 }
 
+bool FileNameOptionInfo::isValidType(int fileType) const
+{
+    return option().isValidType(fileType);
+}
+
+ConstArrayRef<int> FileNameOptionInfo::fileTypes() const
+{
+    return option().fileTypes();
+}
+
 /********************************************************************
  * FileNameOption
  */
 
-AbstractOptionStoragePointer FileNameOption::createStorage() const
+AbstractOptionStorage *
+FileNameOption::createStorage(const OptionManagerContainer &managers) const
 {
-    return AbstractOptionStoragePointer(new FileNameOptionStorage(*this));
+    return new FileNameOptionStorage(*this, managers.get<FileNameOptionManager>());
 }
 
 } // namespace gmx
index 21e48aa7a54fb2b60206fb94a0005a71acc34de9..07fefeb3c805fe332e04d0995bf38ac6979b48af 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,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.
 #define GMX_OPTIONS_FILENAMEOPTION_H
 
 #include <string>
+#include <vector>
 
-#include "abstractoption.h"
-#include "optionfiletype.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/options/optionfiletype.h"
 
 namespace gmx
 {
 
 template <typename T> class ConstArrayRef;
 class FileNameOptionInfo;
+class FileNameOptionManager;
 class FileNameOptionStorage;
 
 /*! \brief
@@ -71,9 +73,11 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
 
         //! Initializes an option with the given name.
         explicit FileNameOption(const char *name)
-            : MyBase(name), filetype_(eftUnknown), legacyType_(-1),
-              defaultBasename_(NULL),
-              bRead_(false), bWrite_(false), bLibrary_(false)
+            : MyBase(name), optionType_(eftUnknown), legacyType_(-1),
+              defaultBasename_(NULL), defaultType_(-1),
+              bLegacyOptionalBehavior_(false),
+              bRead_(false), bWrite_(false), bLibrary_(false),
+              bAllowMissing_(false)
         {
         }
 
@@ -83,7 +87,7 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
          * Either this attribute or legacyType() must be provided.
          */
         MyClass &filetype(OptionFileType type)
-        { filetype_ = type; return me(); }
+        { optionType_ = type; return me(); }
         /*! \brief
          * Sets the type of the file from an enum in filenm.h.
          *
@@ -92,6 +96,16 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
          */
         MyClass &legacyType(int type)
         { legacyType_ = type; return me(); }
+        /*! \brief
+         * Changes the behavior of optional options to match old t_filenm.
+         *
+         * If this is not set, optional options return an empty string if not
+         * set.  If this is set, a non-empty value is always returned.
+         * In the latter case, whether the option is set only affects the
+         * return value of OptionInfo::isSet() and Options::isSet().
+         */
+        MyClass &legacyOptionalBehavior()
+        { bLegacyOptionalBehavior_ = true; return me(); }
         //! Tells that the file provided by this option is used for input only.
         MyClass &inputFile()
         { bRead_ = true; bWrite_ = false; return me(); }
@@ -121,19 +135,62 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
          */
         MyClass &libraryFile(bool bLibrary = true)
         { bLibrary_ = bLibrary; return me(); }
+        /*! \brief
+         * Tells that missing file names explicitly provided by the user are
+         * valid for this input option.
+         *
+         * If this method is not called, an error will be raised if the user
+         * explicitly provides a file name that does not name an existing file,
+         * or if the default value does not resolve to a valid file name for a
+         * required option that the user has not set.
+         *
+         * This method only has effect with input files, and only if a
+         * FileNameOptionManager is being used.
+         */
+        MyClass &allowMissing(bool bAllow = true)
+        { bAllowMissing_ = bAllow; return me(); }
         /*! \brief
          * Sets a default basename for the file option.
          *
          * Use this method instead of defaultValue() or defaultValueIfSet() to
          * set a default value for a file name option.  No extension needs to
-         * be provided; it is automatically added based on filetype().
+         * be provided; it is automatically added based on filetype() or
+         * defaultType().
          * The behavior is also adjusted based on required(): if the option is
          * required, the value given to defaultBasename() is treated as for
          * both defaultValue() and defaultValueIfSet(), otherwise it is treated
          * as for defaultValueIfSet().
+         *
+         * For input files that accept multiple extensions, the extension is
+         * completed to the default extension on creation of the option or at
+         * time of parsing an option without a value.
+         *
+         * If FileNameOptionManager is used, the extension may change during
+         * Options::finish(), as this is the time when the default names are
+         * checked against the file system to provide an extension that matches
+         * an existing file if that is possible.
+         *
+         * If FileNameOptionManager is used, and
+         * FileNameOptionManager::addDefaultFileNameOption() is used, and the
+         * user provides a global default file name using that option, then the
+         * global default takes precedence over defaultBasename().
          */
         MyClass &defaultBasename(const char *basename)
         { defaultBasename_ = basename; return me(); }
+        /*! \brief
+         * Sets a default type/extension for the file option.
+         *
+         * For options that accept multiple types of files (e.g.,
+         * eftTrajectory), this method sets the default extension used
+         * for completing defaultBasename(), as well as the default extension
+         * used by FileNameOptionManager to complete various file names.
+         *
+         * The value should be one of the enumerated `ef*` values from
+         * filenm.h, and be a valid type for the type specified with
+         * filetype().
+         */
+        MyClass &defaultType(int filetype)
+        { defaultType_ = filetype; return me(); }
 
     private:
         // Use defaultBasename() instead.
@@ -141,14 +198,18 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
         using MyBase::defaultValueIfSet;
 
         //! Creates a FileNameOptionStorage object.
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
-        OptionFileType          filetype_;
+        OptionFileType          optionType_;
         int                     legacyType_;
         const char             *defaultBasename_;
+        int                     defaultType_;
+        bool                    bLegacyOptionalBehavior_;
         bool                    bRead_;
         bool                    bWrite_;
         bool                    bLibrary_;
+        bool                    bAllowMissing_;
 
         /*! \brief
          * Needed to initialize FileNameOptionStorage from this class without
@@ -167,7 +228,7 @@ class FileNameOptionInfo : public OptionInfo
 {
     public:
         //! Shorthand for a list of extensions.
-        typedef ConstArrayRef<const char *> ExtensionList;
+        typedef std::vector<const char *> ExtensionList;
 
         //! Creates an option info object for the given option.
         explicit FileNameOptionInfo(FileNameOptionStorage *option);
@@ -184,11 +245,21 @@ class FileNameOptionInfo : public OptionInfo
          * \see FileNameOption::libraryFile()
          */
         bool isLibraryFile() const;
+        //! Whether the (input) option allows missing files to be provided.
+        bool allowMissing() const;
 
         //! Whether the option specifies directories.
         bool isDirectoryOption() const;
+        //! Whether the option specifies a generic trajectory file.
+        bool isTrajectoryOption() const;
+        //! Returns the default extension for this option.
+        const char *defaultExtension() const;
         //! Returns the list of extensions this option accepts.
         ExtensionList extensions() const;
+        //! Returns whether \p fileType (from filenm.h) is accepted for this option.
+        bool isValidType(int fileType) const;
+        //! Returns the list of file types this option accepts.
+        ConstArrayRef<int> fileTypes() const;
 
     private:
         const FileNameOptionStorage &option() const;
diff --git a/src/gromacs/options/filenameoptionmanager.cpp b/src/gromacs/options/filenameoptionmanager.cpp
new file mode 100644 (file)
index 0000000..fc630df
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements gmx::FileNameOptionManager.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#include "gmxpre.h"
+
+#include "filenameoptionmanager.h"
+
+#include <cstring>
+
+#include <string>
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+//! Extensions that are recognized as compressed files.
+const char *const c_compressedExtensions[] =
+{ ".gz", ".Z" };
+
+/********************************************************************
+ * Helper functions
+ */
+
+/*! \brief
+ * Adds an extension to \p prefix if it results in an existing file.
+ *
+ * Tries to add each extension for this file type to \p prefix and
+ * checks whether this results in an existing file.
+ * The first match is returned.
+ * Returns an empty string if no existing file is found.
+ */
+std::string findExistingExtension(const std::string        &prefix,
+                                  const FileNameOptionInfo &option)
+{
+    ConstArrayRef<int>                 types = option.fileTypes();
+    ConstArrayRef<int>::const_iterator i;
+    for (i = types.begin(); i != types.end(); ++i)
+    {
+        std::string testFilename(prefix + ftp2ext_with_dot(*i));
+        if (File::exists(testFilename))
+        {
+            return testFilename;
+        }
+    }
+    return std::string();
+}
+
+}   // namespace
+
+/********************************************************************
+ * FileNameOptionManager::Impl
+ */
+
+/*! \internal \brief
+ * Private implemention class for FileNameOptionManager.
+ *
+ * \ingroup module_options
+ */
+class FileNameOptionManager::Impl
+{
+    public:
+        Impl() : bInputCheckingDisabled_(false) {}
+
+        //! Global default file name, if set.
+        std::string     defaultFileName_;
+        //! Whether input option processing has been disabled.
+        bool            bInputCheckingDisabled_;
+};
+
+/********************************************************************
+ * FileNameOptionManager
+ */
+
+FileNameOptionManager::FileNameOptionManager()
+    : impl_(new Impl())
+{
+}
+
+FileNameOptionManager::~FileNameOptionManager()
+{
+}
+
+void FileNameOptionManager::disableInputOptionChecking(bool bDisable)
+{
+    impl_->bInputCheckingDisabled_ = bDisable;
+}
+
+void FileNameOptionManager::addDefaultFileNameOption(
+        Options *options, const char *name)
+{
+    options->addOption(
+            StringOption(name).store(&impl_->defaultFileName_)
+                .description("Set the default filename for all file options"));
+}
+
+std::string FileNameOptionManager::completeFileName(
+        const std::string &value, const FileNameOptionInfo &option)
+{
+    const bool bAllowMissing = option.allowMissing();
+    const bool bInput
+        = option.isInputFile() || option.isInputOutputFile();
+    // Currently, directory options are simple, and don't need any
+    // special processing.
+    // TODO: Consider splitting them into a separate DirectoryOption.
+    if (option.isDirectoryOption())
+    {
+        if (!impl_->bInputCheckingDisabled_ && bInput && !bAllowMissing
+            && !Directory::exists(value))
+        {
+            std::string message
+                = formatString("Directory '%s' does not exist or is not accessible.",
+                               value.c_str());
+            // TODO: Get actual errno value from the attempt to open the file
+            // to provide better feedback to the user.
+            GMX_THROW(InvalidInputError(message));
+        }
+        return value;
+    }
+    const int fileType = fn2ftp(value.c_str());
+    if (bInput && !impl_->bInputCheckingDisabled_)
+    {
+        if (fileType == efNR && File::exists(value))
+        {
+            ConstArrayRef<const char *>                 compressedExtensions(c_compressedExtensions);
+            ConstArrayRef<const char *>::const_iterator ext;
+            for (ext = compressedExtensions.begin(); ext != compressedExtensions.end(); ++ext)
+            {
+                if (endsWith(value, *ext))
+                {
+                    std::string newValue = value.substr(0, value.length() - std::strlen(*ext));
+                    if (option.isValidType(fn2ftp(newValue.c_str())))
+                    {
+                        return newValue;
+                    }
+                    else
+                    {
+                        return std::string();
+                    }
+                }
+            }
+            // VMD plugins may be able to read the file.
+            if (option.isInputFile() && option.isTrajectoryOption())
+            {
+                return value;
+            }
+        }
+        else if (fileType == efNR)
+        {
+            std::string processedValue = findExistingExtension(value, option);
+            if (!processedValue.empty())
+            {
+                return processedValue;
+            }
+            if (bAllowMissing)
+            {
+                return value + option.defaultExtension();
+            }
+            else if (option.isLibraryFile())
+            {
+                // TODO: Treat also library files here.
+                return value + option.defaultExtension();
+            }
+            else
+            {
+                std::string message
+                    = formatString("File '%s' does not exist or is not accessible.\n"
+                                   "The following extensions were tried to complete the file name:\n  %s",
+                                   value.c_str(), joinStrings(option.extensions(), ", ").c_str());
+                GMX_THROW(InvalidInputError(message));
+            }
+        }
+        else if (option.isValidType(fileType))
+        {
+            if (option.isLibraryFile())
+            {
+                // TODO: Treat also library files.
+            }
+            else if (!bAllowMissing && !File::exists(value))
+            {
+                std::string message
+                    = formatString("File '%s' does not exist or is not accessible.",
+                                   value.c_str());
+                // TODO: Get actual errno value from the attempt to open the file
+                // to provide better feedback to the user.
+                GMX_THROW(InvalidInputError(message));
+            }
+            return value;
+        }
+    }
+    else // Not an input file
+    {
+        if (fileType == efNR)
+        {
+            return value + option.defaultExtension();
+        }
+        else if (option.isValidType(fileType))
+        {
+            return value;
+        }
+    }
+    return std::string();
+}
+
+std::string FileNameOptionManager::completeDefaultFileName(
+        const std::string &prefix, const FileNameOptionInfo &option)
+{
+    if (option.isDirectoryOption() || impl_->bInputCheckingDisabled_)
+    {
+        return std::string();
+    }
+    const bool        bInput = option.isInputFile() || option.isInputOutputFile();
+    const std::string realPrefix
+        = !impl_->defaultFileName_.empty() ? impl_->defaultFileName_ : prefix;
+    const bool        bAllowMissing = option.allowMissing();
+    if (bInput)
+    {
+        std::string completedName = findExistingExtension(realPrefix, option);
+        if (!completedName.empty())
+        {
+            return completedName;
+        }
+        if (bAllowMissing)
+        {
+            return realPrefix + option.defaultExtension();
+        }
+        else if (option.isLibraryFile())
+        {
+            // TODO: Treat also library files here.
+            return realPrefix + option.defaultExtension();
+        }
+        else if (option.isSet())
+        {
+            std::string message
+                = formatString("No file name was provided, and the default file "
+                               "'%s' does not exist or is not accessible.\n"
+                               "The following extensions were tried to complete the file name:\n  %s",
+                               prefix.c_str(), joinStrings(option.extensions(), ", ").c_str());
+            GMX_THROW(InvalidInputError(message));
+        }
+        else if (option.isRequired())
+        {
+            std::string message
+                = formatString("Required option was not provided, and the default file "
+                               "'%s' does not exist or is not accessible.\n"
+                               "The following extensions were tried to complete the file name:\n  %s",
+                               prefix.c_str(), joinStrings(option.extensions(), ", ").c_str());
+            GMX_THROW(InvalidInputError(message));
+        }
+        // We get here with the legacy optional behavior.
+    }
+    return realPrefix + option.defaultExtension();
+}
+
+} // namespace gmx
diff --git a/src/gromacs/options/filenameoptionmanager.h b/src/gromacs/options/filenameoptionmanager.h
new file mode 100644 (file)
index 0000000..ac588a0
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::FileNameOptionManager.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inpublicapi
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_FILENAMEOPTIONMANAGER_H
+#define GMX_OPTIONS_FILENAMEOPTIONMANAGER_H
+
+#include <string>
+
+#include "gromacs/options/options.h"
+#include "gromacs/utility/classhelpers.h"
+
+namespace gmx
+{
+
+class FileNameOptionInfo;
+class Options;
+
+/*! \brief
+ * Handles interaction of file name options with global options.
+ *
+ * This class contains all logic that completes file names based on user input
+ * and file system contents.  Additionally, this class implements support for a
+ * global default file name that overrides any option-specific default, as well
+ * as additional control over how the completion is done.
+ *
+ * \todo
+ * Most of the functionality in this class is specific to command line parsing,
+ * so it would be cleaner to replace this with an interface, and have the
+ * actual code in the `commandline` module.
+ *
+ * Adding a FileNameOptionManager for an Options object is optional, even if
+ * the Options contains FileNameOption options.  Features from the manager are
+ * not available if the manager is not created, but otherwise the options work:
+ * the values provided to FileNameOption are used as they are, and exceptions
+ * are thrown if they are no valid instead of attempting to complete them.
+ *
+ * \see Options::addManager()
+ *
+ * \inpublicapi
+ * \ingroup module_selection
+ */
+class FileNameOptionManager : public OptionManagerInterface
+{
+    public:
+        FileNameOptionManager();
+        virtual ~FileNameOptionManager();
+
+        /*! \brief
+         * Disables special input file option handling.
+         *
+         * If disabled, this removes all file system calls from the file
+         * name option parsing.
+         * The values returned by FileNameOption for input and input/output
+         * files are handled with the same simple rule as for output files:
+         * the default extension is added if the file does not end in a
+         * recognized extension, and no other checking is done.
+         *
+         * This changes the following behavior:
+         *  - Providing non-existent files does not trigger errors.
+         *  - Extensions for input files are not completed to an existing file.
+         *  - Compressed input files do not work.
+         */
+        void disableInputOptionChecking(bool bDisable);
+
+        /*! \brief
+         * Adds an option for setting the default global file name.
+         *
+         * \param     options Options to add the option to.
+         * \param[in] name    Name of the option to add.
+         *
+         * If the user sets the option, it affects all file name options that
+         * would normally return a default value: the basename for the returned
+         * value is taken from the value of the default file name option,
+         * instead from an option-specific default
+         * (FileNameOption::defaultBaseName()).
+         */
+        void addDefaultFileNameOption(Options *options, const char *name);
+
+        /*! \brief
+         * Completes file name option values.
+         *
+         * \param[in] value  Value provided by the user.
+         * \param[in] option Option for which the value should be completed.
+         * \returns   Value for the file name option.
+         * \throws    std::bad_alloc if out of memory.
+         * \throws    InvalidInputError if the value is not valid for this
+         *     option.
+         *
+         * This method is called for each value that the user provides to
+         * a FileNameOption.  The return value (if non-empty) is used as the
+         * value of the option instead of the user-provided one.
+         */
+        std::string completeFileName(const std::string        &value,
+                                     const FileNameOptionInfo &option);
+        /*! \brief
+         * Completes default values for file name options.
+         *
+         * \param[in] prefix Default prefix for the file name.
+         * \param[in] option Option for which the value should be completed.
+         * \returns   Value for the file name option.
+         * \throws    std::bad_alloc if out of memory.
+         * \throws    InvalidInputError if the value is not valid for this
+         *     option.
+         *
+         * This method is called for each FileNameOption that has a default
+         * value (either a standard default value, or if the user provided the
+         * option without an explicit value).  \p prefix is the default value
+         * without the default extension for the option.
+         * If the return value is non-empty, it is used as the default value
+         * for the option instead of \p prefix + default extension.
+         */
+        std::string completeDefaultFileName(const std::string        &prefix,
+                                            const FileNameOptionInfo &option);
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace gmx
+
+#endif
index f5f94c60a19e6a3203a36af70b0dc3ce118ad019..8e799687dd4e2de2157a5032fa8af7c7f96c6016 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,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.
 #define GMX_OPTIONS_FILENAMEOPTIONSTORAGE_H
 
 #include <string>
+#include <vector>
 
-#include "filenameoption.h"
-#include "optionfiletype.h"
-#include "optionstoragetemplate.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/optionfiletype.h"
+#include "gromacs/options/optionstoragetemplate.h"
 
 namespace gmx
 {
 
 class FileNameOption;
+class FileNameOptionManager;
 
 /*! \internal \brief
  * Converts, validates, and stores file names.
@@ -59,8 +61,14 @@ class FileNameOption;
 class FileNameOptionStorage : public OptionStorageTemplate<std::string>
 {
     public:
-        //! \copydoc StringOptionStorage::StringOptionStorage()
-        explicit FileNameOptionStorage(const FileNameOption &settings);
+        /*! \brief
+         * Initializes the storage from option settings.
+         *
+         * \param[in] settings   Storage settings.
+         * \param     manager    Manager for this object (can be NULL).
+         */
+        FileNameOptionStorage(const FileNameOption  &settings,
+                              FileNameOptionManager *manager);
 
         virtual OptionInfo &optionInfo() { return info_; }
         virtual std::string typeString() const;
@@ -75,21 +83,34 @@ class FileNameOptionStorage : public OptionStorageTemplate<std::string>
         bool isInputOutputFile() const { return bRead_ && bWrite_; }
         //! \copydoc FileNameOptionInfo::isLibraryFile()
         bool isLibraryFile() const { return bLibrary_; }
+        //! \copydoc FileNameOptionInfo::allowMissing()
+        bool allowMissing() const { return bAllowMissing_; }
 
         //! \copydoc FileNameOptionInfo::isDirectoryOption()
         bool isDirectoryOption() const;
+        //! \copydoc FileNameOptionInfo::isTrajectoryOption()
+        bool isTrajectoryOption() const;
+        //! \copydoc FileNameOptionInfo::defaultExtension()
+        const char *defaultExtension() const;
         //! \copydoc FileNameOptionInfo::extensions()
-        ConstArrayRef<const char *> extensions() const;
+        std::vector<const char *> extensions() const;
+        //! \copydoc FileNameOptionInfo::isValidType()
+        bool isValidType(int fileType) const;
+        //! \copydoc FileNameOptionInfo::fileTypes()
+        ConstArrayRef<int> fileTypes() const;
 
     private:
         virtual void convertValue(const std::string &value);
+        virtual void processAll();
 
         FileNameOptionInfo      info_;
-        OptionFileType          filetype_;
-        int                     legacyType_;
+        FileNameOptionManager  *manager_;
+        int                     fileType_;
+        const char             *defaultExtension_;
         bool                    bRead_;
         bool                    bWrite_;
         bool                    bLibrary_;
+        bool                    bAllowMissing_;
 };
 
 } // namespace gmx
index 5a4ff6399b42411315ade14685c8a8c1b772a21d..9157ecba9dabaf72dfc55cb5134a2954dff33fe9 100644 (file)
@@ -46,7 +46,7 @@
 #ifndef GMX_OPTIONS_OPTIONFLAGS_H
 #define GMX_OPTIONS_OPTIONFLAGS_H
 
-#include "../utility/flags.h"
+#include "gromacs/utility/flags.h"
 
 namespace gmx
 {
diff --git a/src/gromacs/options/optionmanagercontainer.h b/src/gromacs/options/optionmanagercontainer.h
new file mode 100644 (file)
index 0000000..860b7a2
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx::OptionManagerContainer.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_options
+ */
+#ifndef GMX_OPTIONS_OPTIONMANAGERCONTAINER_H
+#define GMX_OPTIONS_OPTIONMANAGERCONTAINER_H
+
+#include <vector>
+
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/gmxassert.h"
+
+namespace gmx
+{
+
+class OptionManagerInterface;
+
+/*! \libinternal
+ * \brief
+ * Container to keep managers added with Options::addManager() and pass them
+ * to options.
+ *
+ * Consistency of the managers (e.g., that there is at most one manager of a
+ * certain type) is only checked when the managers are accessed.
+ *
+ * \inlibraryapi
+ * \ingroup module_options
+ */
+class OptionManagerContainer
+{
+    public:
+        OptionManagerContainer()
+        {
+        }
+
+        //! Returns `true` if there are no managers.
+        bool empty() const { return list_.empty(); }
+
+        //! Adds a manager to the container.
+        void add(OptionManagerInterface *manager)
+        {
+            list_.push_back(manager);
+        }
+        /*! \brief
+         * Retrieves a manager of a certain type.
+         *
+         * \tparam  ManagerType  Type of manager to retrieve
+         *     (should derive from OptionManagerInterface).
+         * \returns The manager, or `NULL` if there is none.
+         *
+         * This method is used in AbstractOption::createStorage() to retrieve
+         * a manager of a certain type for options that use a manager.
+         *
+         * The return value is `NULL` if there is no manager of the given type.
+         * The caller needs to handle this (either by asserting, or by handling
+         * the manager as optional).
+         */
+        template <class ManagerType>
+        ManagerType *get() const
+        {
+            ManagerType *result = NULL;
+            for (ListType::const_iterator i = list_.begin(); i != list_.end(); ++i)
+            {
+                ManagerType *curr = dynamic_cast<ManagerType *>(*i);
+                if (curr != NULL)
+                {
+                    GMX_RELEASE_ASSERT(result == NULL,
+                                       "More than one applicable option manager is set");
+                    result = curr;
+                }
+            }
+            return result;
+        }
+
+    private:
+        //! Shorthand for the internal container type.
+        typedef std::vector<OptionManagerInterface *> ListType;
+
+        ListType  list_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(OptionManagerContainer);
+};
+
+} // namespace gmx
+
+#endif
index 6b06f1fcd7c4820941f66733dd3be0b91b53843a..3fba6da02ad8efc80378ae11bceb42d12fa4fd30 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include <string>
 #include <vector>
 
-#include "abstractoption.h"
-#include "options.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/options/optionmanagercontainer.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -65,6 +67,9 @@ class AbstractOptionStorage;
 class Options::Impl
 {
     public:
+        //! Smart pointer for managing an AbstractOptionStorage object.
+        typedef gmx_unique_ptr<AbstractOptionStorage>::type
+            AbstractOptionStoragePointer;
         //! Convenience type for list of sections.
         typedef std::vector<Options *> SubSectionList;
         //! Convenience type for list of options.
@@ -107,6 +112,12 @@ class Options::Impl
         std::string             title_;
         //! Full description for the Options object.
         std::string             description_;
+        /*! \brief
+         * Option managers set for this collection.
+         *
+         * This is non-empty only for the top-level Options object.
+         */
+        OptionManagerContainer  managers_;
         /*! \brief
          * List of subsections, in insertion order.
          *
index 8b3c22e2646ec3970f1bff7054c397d1c187d1e9..cd6732ec6b99ac4abdef8ebb593baac7e33b28ad 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include "gromacs/options/options.h"
+#include "gmxpre.h"
+
+#include "options.h"
 
 #include "gromacs/options/abstractoption.h"
 #include "gromacs/options/abstractoptionstorage.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/messagestringcollector.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "options-impl.h"
 namespace gmx
 {
 
+/********************************************************************
+ * OptionManagerInterface
+ */
+
+OptionManagerInterface::~OptionManagerInterface()
+{
+}
+
 /********************************************************************
  * Options::Impl
  */
@@ -148,8 +157,28 @@ void Options::setDescription(const ConstArrayRef<const char *> &descArray)
     impl_->description_ = concatenateStrings(descArray.data(), descArray.size());
 }
 
+void Options::addManager(OptionManagerInterface *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_->options_.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(),
+                       "Can only add a manager before subsections");
+    impl_->managers_.add(manager);
+}
+
 void Options::addSubSection(Options *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_->options_.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");
@@ -162,7 +191,12 @@ void Options::addSubSection(Options *section)
 
 OptionInfo *Options::addOption(const AbstractOption &settings)
 {
-    AbstractOptionStoragePointer option(settings.createStorage());
+    Options::Impl *root = impl_.get();
+    while (root->parent_ != NULL)
+    {
+        root = root->parent_->impl_.get();
+    }
+    Impl::AbstractOptionStoragePointer option(settings.createStorage(root->managers_));
     if (impl_->findOption(option->name().c_str()) != NULL)
     {
         GMX_THROW(APIError("Duplicate option: " + option->name()));
index cd5f1dc7b012c1cc5da47db40b596c08214c0aa2..1605fb88ace51c51b4ac8b49881af55f303325d1 100644 (file)
 
 #include <string>
 
-#include "../utility/common.h"
-#include "../utility/gmxassert.h"
-
-#include "abstractoption.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/gmxassert.h"
 
 namespace gmx
 {
@@ -62,6 +61,27 @@ class AbstractOption;
 class OptionsAssigner;
 class OptionsIterator;
 
+/*! \brief
+ * Base class for option managers.
+ *
+ * This class is used as a marker for all classes that are used with
+ * Options::addManager().  It doesn't provide any methods, but only supports
+ * transporting these classes through the Options collection into the
+ * individual option implementation classes.
+ *
+ * The virtual destructor is present to make this class polymorphic, such that
+ * `dynamic_cast` can be used when retrieving a manager of a certain type for
+ * the individual options.
+ *
+ * \inlibraryapi
+ * \ingroup module_options
+ */
+class OptionManagerInterface
+{
+    protected:
+        virtual ~OptionManagerInterface();
+};
+
 /*! \brief
  * Collection of options.
  *
@@ -152,6 +172,28 @@ class Options
          */
         void setDescription(const ConstArrayRef<const char *> &descArray);
 
+        /*! \brief
+         * Adds an option manager.
+         *
+         * \param    manager Manager to add.
+         * \throws   std::bad_alloc if out of memory.
+         *
+         * Option managers are used by some types of options that require
+         * interaction between different option instances (e.g., selection
+         * options), or need to support globally set properties (e.g., a global
+         * default file prefix).  Option objects can retrieve the pointer to
+         * their manager when they are created, and the caller can alter the
+         * behavior of the options through the manager.
+         * See the individual managers for details.
+         *
+         * Caller is responsible for memory management of \p manager.
+         * The Options object (and its contained options) only stores a
+         * reference to the object.
+         *
+         * This method cannot be called after adding options or subsections.
+         */
+        void addManager(OptionManagerInterface *manager);
+
         /*! \brief
          * Adds an option collection as a subsection of this collection.
          *
@@ -161,9 +203,8 @@ class Options
          * subsection.  If an attempt is made to add two different subsections
          * with the same name, this function asserts.
          *
-         * For certain functionality to work properly, no options should
-         * be added to the subsection after it has been added to another
-         * collection.
+         * \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
index a5ed703beeaea29552f82a7b26ddea693fb057dc..df3f1320d89da7ddb54996b610e7c5885d30a614 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include "gromacs/options/optionsassigner.h"
+#include "gmxpre.h"
+
+#include "optionsassigner.h"
 
 #include <deque>
 
index 5047b180dc7682899a2ac382e475893dae3cae28..3d06fd2095ed3b15593fe3f0c1a90cced3406155 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,7 +47,7 @@
 
 #include <string>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index dae027c79ad8a08309ba1cd3b435b4b92eb4c08e..4bbf08d48fd3966c5ea3eec5f04e0ae90c5f2b8d 100644 (file)
 
 #include <boost/scoped_ptr.hpp>
 
-#include "../utility/common.h"
-#include "../utility/exceptions.h"
-#include "../utility/gmxassert.h"
-
-#include "abstractoption.h"
-#include "abstractoptionstorage.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/options/abstractoptionstorage.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
 
 namespace gmx
 {
index 4d0b3f678b746ca8f3cdb5a0e61291fa1631e02f..814ae734fdb2e19efa27e985ac0163ffb26b039c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include "gromacs/options/optionsvisitor.h"
+#include "gmxpre.h"
+
+#include "optionsvisitor.h"
 
 #include "gromacs/options/abstractoptionstorage.h"
 #include "gromacs/options/options.h"
index 862b28ee57c2eaa32c92beb27892e866eb0f831e..44e265a2f78dd4e3ffd1127d5306085a248e9fdf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,9 +47,8 @@
 
 #include <string>
 
-#include "../utility/common.h"
-
-#include "abstractoption.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 0991c1fb4d2bc7ea88cd7c8e5574e57aa72e9a11..21806d0aed9d027c61fbd37d476f7336763d8f89 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2011,2012, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -35,6 +35,7 @@
 gmx_add_unit_test(OptionsUnitTests options-test
                   abstractoptionstorage.cpp
                   filenameoption.cpp
+                  filenameoptionmanager.cpp
                   option.cpp
                   optionsassigner.cpp
                   timeunitmanager.cpp)
index 716e0b1f56de278c8b101c4d6015b84ad2a7f437..1682129575a0eec6f53c8cd1fd2ef746797d64d5 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include <vector>
+#include "gmxpre.h"
+
 #include <string>
+#include <vector>
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
 #include "gromacs/options/abstractoption.h"
 #include "gromacs/options/options.h"
-#include "gromacs/options/optionstoragetemplate.h"
 #include "gromacs/options/optionsassigner.h"
+#include "gromacs/options/optionstoragetemplate.h"
 #include "gromacs/utility/exceptions.h"
 
 #include "testutils/testasserts.h"
@@ -151,9 +153,10 @@ class MockOption : public gmx::OptionTemplate<std::string, MockOption>
         }
 
     private:
-        virtual gmx::AbstractOptionStoragePointer createStorage() const
+        virtual gmx::AbstractOptionStorage *createStorage(
+            const gmx::OptionManagerContainer & /*managers*/) const
         {
-            return gmx::AbstractOptionStoragePointer(new MockOptionStorage(*this));
+            return new MockOptionStorage(*this);
         }
 };
 
index 76956c69505ace344544f90a0ab9b3fb564634a2..6097d3232c987f2aab9c427e95aeab88d6b2d88e 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Tests file name option implementation.
+ * Tests basic file name option implementation.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include <vector>
+#include "gmxpre.h"
+
+#include "gromacs/options/filenameoption.h"
 
 #include <gtest/gtest.h>
 
-#include "gromacs/options/filenameoption.h"
+#include "gromacs/fileio/filenm.h"
 #include "gromacs/options/options.h"
 #include "gromacs/options/optionsassigner.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/file.h"
 
 #include "testutils/testasserts.h"
-#include "testutils/testfilemanager.h"
 
 namespace
 {
 
 using gmx::FileNameOption;
-using gmx::test::TestFileManager;
 
-TEST(FileNameOptionTest, AddsMissingExtension)
+TEST(FileNameOptionTest, HandlesRequiredDefaultValueWithoutExtension)
 {
     gmx::Options           options(NULL, NULL);
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
-                                FileNameOption("f").store(&value)
-                                    .filetype(gmx::eftTrajectory).outputFile()));
+                                FileNameOption("f").store(&value).required()
+                                    .filetype(gmx::eftGenericData).outputFile()
+                                    .defaultBasename("testfile")));
+    EXPECT_EQ("testfile.dat", value);
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW_GMX(assigner.start());
-    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
-    EXPECT_NO_THROW_GMX(assigner.appendValue("testfile"));
-    EXPECT_NO_THROW_GMX(assigner.finishOption());
     EXPECT_NO_THROW_GMX(assigner.finish());
     EXPECT_NO_THROW_GMX(options.finish());
 
-    EXPECT_EQ("testfile.xtc", value);
+    EXPECT_EQ("testfile.dat", value);
 }
 
-TEST(FileNameOptionTest, HandlesRequiredDefaultValueWithoutExtension)
+TEST(FileNameOptionTest, HandlesRequiredOptionWithoutValue)
 {
     gmx::Options           options(NULL, NULL);
     std::string            value;
@@ -89,29 +87,30 @@ TEST(FileNameOptionTest, HandlesRequiredDefaultValueWithoutExtension)
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
     EXPECT_NO_THROW_GMX(assigner.finish());
     EXPECT_NO_THROW_GMX(options.finish());
 
     EXPECT_EQ("testfile.dat", value);
 }
 
-TEST(FileNameOptionTest, HandlesRequiredOptionWithoutValue)
+TEST(FileNameOptionTest, HandlesOptionalUnsetOption)
 {
     gmx::Options           options(NULL, NULL);
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
-                                FileNameOption("f").store(&value).required()
-                                    .filetype(gmx::eftGenericData).outputFile()
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).outputFile()
                                     .defaultBasename("testfile")));
+    EXPECT_TRUE(value.empty());
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW_GMX(assigner.start());
-    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
-    EXPECT_NO_THROW_GMX(assigner.finishOption());
     EXPECT_NO_THROW_GMX(assigner.finish());
     EXPECT_NO_THROW_GMX(options.finish());
 
-    EXPECT_EQ("testfile.dat", value);
+    EXPECT_TRUE(value.empty());
 }
 
 TEST(FileNameOptionTest, HandlesOptionalDefaultValueWithoutExtension)
@@ -134,27 +133,84 @@ TEST(FileNameOptionTest, HandlesOptionalDefaultValueWithoutExtension)
     EXPECT_EQ("testfile.ndx", value);
 }
 
-TEST(FileNameOptionTest, AddsMissingExtensionBasedOnExistingFile)
+TEST(FileNameOptionTest, HandlesRequiredCustomDefaultExtension)
+{
+    gmx::Options           options(NULL, NULL);
+    std::string            value;
+    ASSERT_NO_THROW_GMX(options.addOption(
+                                FileNameOption("f").store(&value).required()
+                                    .filetype(gmx::eftTrajectory).outputFile()
+                                    .defaultBasename("testfile")
+                                    .defaultType(efPDB)));
+    EXPECT_EQ("testfile.pdb", 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("testfile.pdb", value);
+}
+
+TEST(FileNameOptionTest, HandlesOptionalCustomDefaultExtension)
 {
     gmx::Options           options(NULL, NULL);
     std::string            value;
     ASSERT_NO_THROW_GMX(options.addOption(
                                 FileNameOption("f").store(&value)
-                                    .filetype(gmx::eftTrajectory).inputFile()));
-    TestFileManager      tempFiles;
-    std::string          filename(tempFiles.getTemporaryFilePath(".trr"));
-    gmx::File::writeFileFromString(filename, "Dummy trajectory file");
-    std::string          inputValue(filename.substr(0, filename.length() - 4));
+                                    .filetype(gmx::eftTrajectory).outputFile()
+                                    .defaultBasename("testfile")
+                                    .defaultType(efPDB)));
+    EXPECT_TRUE(value.empty());
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW_GMX(assigner.start());
     EXPECT_NO_THROW_GMX(assigner.startOption("f"));
-    EXPECT_NO_THROW_GMX(assigner.appendValue(inputValue));
     EXPECT_NO_THROW_GMX(assigner.finishOption());
     EXPECT_NO_THROW_GMX(assigner.finish());
     EXPECT_NO_THROW_GMX(options.finish());
 
-    EXPECT_EQ(filename, value);
+    EXPECT_EQ("testfile.pdb", value);
+}
+
+TEST(FileNameOptionTest, GivesErrorOnUnknownFileSuffix)
+{
+    gmx::Options           options(NULL, NULL);
+    std::string            value;
+    ASSERT_NO_THROW_GMX(options.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftIndex).outputFile()));
+    EXPECT_TRUE(value.empty());
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_THROW_GMX(assigner.appendValue("testfile.foo"), gmx::InvalidInputError);
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    EXPECT_TRUE(value.empty());
+}
+
+TEST(FileNameOptionTest, GivesErrorOnInvalidFileSuffix)
+{
+    gmx::Options           options(NULL, NULL);
+    std::string            value;
+    ASSERT_NO_THROW_GMX(options.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).outputFile()));
+    EXPECT_TRUE(value.empty());
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_THROW_GMX(assigner.appendValue("testfile.dat"), gmx::InvalidInputError);
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options.finish());
+
+    EXPECT_TRUE(value.empty());
 }
 
 } // namespace
diff --git a/src/gromacs/options/tests/filenameoptionmanager.cpp b/src/gromacs/options/tests/filenameoptionmanager.cpp
new file mode 100644 (file)
index 0000000..bb01302
--- /dev/null
@@ -0,0 +1,369 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests file name option implementation dependent on gmx::FileNameOptionManager.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_options
+ */
+#include "gmxpre.h"
+
+#include "gromacs/options/filenameoptionmanager.h"
+
+#include <gtest/gtest.h>
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/options.h"
+#include "gromacs/options/optionsassigner.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/path.h"
+
+#include "testutils/testasserts.h"
+#include "testutils/testfilemanager.h"
+
+namespace
+{
+
+using gmx::FileNameOption;
+
+class FileNameOptionManagerTest : public ::testing::Test
+{
+    public:
+        FileNameOptionManagerTest()
+            : options_(NULL, NULL)
+        {
+            options_.addManager(&manager_);
+        }
+
+        std::string createDummyFile(const char *suffix)
+        {
+            std::string filename(tempFiles_.getTemporaryFilePath(suffix));
+            gmx::File::writeFileFromString(filename, "Dummy file");
+            return filename;
+        }
+
+        gmx::FileNameOptionManager manager_;
+        gmx::Options               options_;
+        gmx::test::TestFileManager tempFiles_;
+};
+
+/********************************************************************
+ * Actual tests
+ */
+
+TEST_F(FileNameOptionManagerTest, AddsMissingExtension)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).outputFile()));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("testfile"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ("testfile.xtc", value);
+}
+
+TEST_F(FileNameOptionManagerTest, AddsMissingCustomDefaultExtension)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).outputFile()
+                                    .defaultType(efPDB)));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("testfile"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ("testfile.pdb", value);
+}
+
+TEST_F(FileNameOptionManagerTest, GivesErrorOnMissingInputFile)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftIndex).inputFile()));
+    EXPECT_TRUE(value.empty());
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_THROW_GMX(assigner.appendValue("missing.ndx"), gmx::InvalidInputError);
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_TRUE(value.empty());
+}
+
+TEST_F(FileNameOptionManagerTest, GivesErrorOnMissingGenericInputFile)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).inputFile()));
+    EXPECT_TRUE(value.empty());
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_THROW_GMX(assigner.appendValue("missing.trr"), gmx::InvalidInputError);
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_TRUE(value.empty());
+}
+
+TEST_F(FileNameOptionManagerTest, GivesErrorOnMissingDefaultInputFile)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftIndex).inputFile()
+                                    .defaultBasename("missing")));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_THROW_GMX(options_.finish(), gmx::InvalidInputError);
+}
+
+TEST_F(FileNameOptionManagerTest, GivesErrorOnMissingRequiredInputFile)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value).required()
+                                    .filetype(gmx::eftIndex).inputFile()
+                                    .defaultBasename("missing")));
+    EXPECT_EQ("missing.ndx", value);
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_THROW_GMX(options_.finish(), gmx::InvalidInputError);
+}
+
+TEST_F(FileNameOptionManagerTest, AcceptsMissingInputFileIfSpecified)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftIndex).inputFile()
+                                    .allowMissing()));
+    EXPECT_TRUE(value.empty());
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue("missing.ndx"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ("missing.ndx", value);
+}
+
+TEST_F(FileNameOptionManagerTest, AcceptsMissingDefaultInputFileIfSpecified)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftIndex).inputFile()
+                                    .defaultBasename("missing")
+                                    .allowMissing()));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ("missing.ndx", value);
+}
+
+TEST_F(FileNameOptionManagerTest, AcceptsMissingRequiredInputFileIfSpecified)
+{
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value).required()
+                                    .filetype(gmx::eftIndex).inputFile()
+                                    .defaultBasename("missing")
+                                    .allowMissing()));
+    EXPECT_EQ("missing.ndx", 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("missing.ndx", value);
+}
+
+TEST_F(FileNameOptionManagerTest, AddsMissingExtensionBasedOnExistingFile)
+{
+    std::string filename(createDummyFile(".trr"));
+    std::string inputValue(gmx::Path::stripExtension(filename));
+
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).inputFile()));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue(inputValue));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ(filename, value);
+}
+
+TEST_F(FileNameOptionManagerTest,
+       AddsMissingExtensionForRequiredDefaultNameBasedOnExistingFile)
+{
+    std::string filename(createDummyFile(".trr"));
+    std::string inputValue(gmx::Path::stripExtension(filename));
+
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value).required()
+                                    .filetype(gmx::eftTrajectory).inputFile()
+                                    .defaultBasename(inputValue.c_str())));
+    EXPECT_EQ(inputValue + ".xtc", value);
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ(filename, value);
+}
+
+TEST_F(FileNameOptionManagerTest,
+       AddsMissingExtensionForOptionalDefaultNameBasedOnExistingFile)
+{
+    std::string filename(createDummyFile(".trr"));
+    std::string inputValue(gmx::Path::stripExtension(filename));
+
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).inputFile()
+                                    .defaultBasename(inputValue.c_str())));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ(filename, value);
+}
+
+TEST_F(FileNameOptionManagerTest,
+       AddsMissingExtensionForRequiredFromDefaultNameOptionBasedOnExistingFile)
+{
+    std::string filename(createDummyFile(".trr"));
+    std::string inputValue(gmx::Path::stripExtension(filename));
+
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value).required()
+                                    .filetype(gmx::eftTrajectory).inputFile()
+                                    .defaultBasename("foo")));
+    ASSERT_NO_THROW_GMX(manager_.addDefaultFileNameOption(&options_, "deffnm"));
+    EXPECT_EQ("foo.xtc", value);
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("deffnm"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue(inputValue));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ(filename, value);
+}
+
+TEST_F(FileNameOptionManagerTest,
+       AddsMissingExtensionForOptionalFromDefaultNameOptionBasedOnExistingFile)
+{
+    std::string filename(createDummyFile(".trr"));
+    std::string inputValue(gmx::Path::stripExtension(filename));
+
+    std::string value;
+    ASSERT_NO_THROW_GMX(options_.addOption(
+                                FileNameOption("f").store(&value)
+                                    .filetype(gmx::eftTrajectory).inputFile()
+                                    .defaultBasename("foo")));
+    ASSERT_NO_THROW_GMX(manager_.addDefaultFileNameOption(&options_, "deffnm"));
+
+    gmx::OptionsAssigner assigner(&options_);
+    EXPECT_NO_THROW_GMX(assigner.start());
+    EXPECT_NO_THROW_GMX(assigner.startOption("deffnm"));
+    EXPECT_NO_THROW_GMX(assigner.appendValue(inputValue));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.startOption("f"));
+    EXPECT_NO_THROW_GMX(assigner.finishOption());
+    EXPECT_NO_THROW_GMX(assigner.finish());
+    EXPECT_NO_THROW_GMX(options_.finish());
+
+    EXPECT_EQ(filename, value);
+}
+
+} // namespace
index 97e7d9a5f7015824edd8e709d739df83b801c64d..70b513bdb79a3609c3ee92280d8d7a5d699184f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include <vector>
+#include "gmxpre.h"
+
 #include <string>
+#include <vector>
 
 #include <gtest/gtest.h>
 
index e12d787ba2c29ff7ce3222a5fe123106c58aa992..cf9648cc1cb269251fa421740ab36e7a0bfff30b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
+#include "gmxpre.h"
+
+#include "gromacs/options/optionsassigner.h"
+
 #include <limits>
 #include <vector>
 
@@ -52,7 +56,6 @@
 
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
-#include "gromacs/options/optionsassigner.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/stringutil.h"
 
@@ -183,11 +186,11 @@ TEST(OptionsAssignerTest, HandlesSubSections)
     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(options.addSubSection(&sub1));
-    ASSERT_NO_THROW(options.addSubSection(&sub2));
 
     gmx::OptionsAssigner assigner(&options);
     EXPECT_NO_THROW(assigner.start());
@@ -223,13 +226,13 @@ TEST(OptionsAssignerTest, HandlesNoStrictSubSections)
     int          pvalue2 = 2;
     int          rvalue  = 5;
     using gmx::IntegerOption;
+    ASSERT_NO_THROW(options.addSubSection(&sub1));
+    ASSERT_NO_THROW(options.addSubSection(&sub2));
     ASSERT_NO_THROW(options.addOption(IntegerOption("p").store(&pvalue)));
     ASSERT_NO_THROW(sub1.addOption(IntegerOption("p").store(&pvalue1)));
     ASSERT_NO_THROW(sub1.addOption(IntegerOption("q").store(&qvalue)));
     ASSERT_NO_THROW(sub2.addOption(IntegerOption("p").store(&pvalue2)));
     ASSERT_NO_THROW(sub2.addOption(IntegerOption("r").store(&rvalue)));
-    ASSERT_NO_THROW(options.addSubSection(&sub1));
-    ASSERT_NO_THROW(options.addSubSection(&sub2));
 
     gmx::OptionsAssigner assigner(&options);
     assigner.setNoStrictSectioning(true);
@@ -824,6 +827,56 @@ TEST(OptionsAssignerStringTest, HandlesEnumDefaultValue)
     EXPECT_EQ(1, index);
 }
 
+TEST(OptionsAssignerStringTest, HandlesEnumDefaultValueFromVariable)
+{
+    gmx::Options           options(NULL, NULL);
+    std::string            value("test");
+    const char * const     allowed[] = { "none", "test", "value" };
+    int                    index     = -1;
+    using gmx::StringOption;
+    ASSERT_NO_THROW(options.addOption(
+                            StringOption("p").store(&value)
+                                .enumValue(allowed).storeEnumIndex(&index)));
+    EXPECT_EQ("test", value);
+    EXPECT_EQ(1, index);
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW(assigner.start());
+    EXPECT_NO_THROW(assigner.finish());
+    EXPECT_NO_THROW(options.finish());
+
+    EXPECT_EQ("test", value);
+    EXPECT_EQ(1, index);
+}
+
+TEST(OptionsAssignerStringTest, HandlesEnumDefaultValueFromVector)
+{
+    gmx::Options             options(NULL, NULL);
+    std::vector<std::string> value;
+    value.push_back("test");
+    value.push_back("value");
+    const char * const       allowed[] = { "none", "test", "value" };
+    int                      index[2]  = {-1, -1};
+    using gmx::StringOption;
+    ASSERT_NO_THROW(options.addOption(
+                            StringOption("p").storeVector(&value).valueCount(2)
+                                .enumValue(allowed).storeEnumIndex(index)));
+    EXPECT_EQ("test", value[0]);
+    EXPECT_EQ("value", value[1]);
+    EXPECT_EQ(1, index[0]);
+    EXPECT_EQ(2, index[1]);
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW(assigner.start());
+    EXPECT_NO_THROW(assigner.finish());
+    EXPECT_NO_THROW(options.finish());
+
+    EXPECT_EQ("test", value[0]);
+    EXPECT_EQ("value", value[1]);
+    EXPECT_EQ(1, index[0]);
+    EXPECT_EQ(2, index[1]);
+}
+
 TEST(OptionsAssignerStringTest, HandlesEnumDefaultIndex)
 {
     gmx::Options           options(NULL, NULL);
@@ -847,4 +900,23 @@ TEST(OptionsAssignerStringTest, HandlesEnumDefaultIndex)
     EXPECT_EQ(1, index);
 }
 
+TEST(OptionsAssignerStringTest, HandlesEnumDefaultIndexFromVariable)
+{
+    gmx::Options           options(NULL, NULL);
+    const char * const     allowed[] = { "none", "test", "value" };
+    int                    index     = 1;
+    using gmx::StringOption;
+    ASSERT_NO_THROW(options.addOption(
+                            StringOption("p")
+                                .enumValue(allowed).storeEnumIndex(&index)));
+    EXPECT_EQ(1, index);
+
+    gmx::OptionsAssigner assigner(&options);
+    EXPECT_NO_THROW(assigner.start());
+    EXPECT_NO_THROW(assigner.finish());
+    EXPECT_NO_THROW(options.finish());
+
+    EXPECT_EQ(1, index);
+}
+
 } // namespace
index 5f19d51b9cee7997f8cbdf24c6d02519562bfc56..9e5f57fd183107c56ec194894d50bb47811fdb29 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
+#include "gmxpre.h"
+
+#include "gromacs/options/timeunitmanager.h"
+
 #include <gtest/gtest.h>
 
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/options/optionsassigner.h"
-#include "gromacs/options/timeunitmanager.h"
 
 #include "testutils/testasserts.h"
 
index ec2882d3cd2e7b2c67e3caf9728dc978541ddf74..b687c31bb7518ac606a33b23edfd94edd296683a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_options
  */
-#include "gromacs/options/timeunitmanager.h"
+#include "gmxpre.h"
+
+#include "timeunitmanager.h"
+
+#include <cstdlib>
+
+#include <algorithm>
 
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/options/optionsvisitor.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/stringutil.h"
 
 namespace
 {
@@ -108,6 +117,27 @@ double TimeUnitManager::inverseTimeScaleFactor() const
     return 1.0 / timeScaleFactor();
 }
 
+void TimeUnitManager::setTimeUnitFromEnvironment()
+{
+    const char *const value = std::getenv("GMXTIMEUNIT");
+    if (value != NULL)
+    {
+        ConstArrayRef<const char *>                 timeUnits(g_timeUnits);
+        ConstArrayRef<const char *>::const_iterator i =
+            std::find(timeUnits.begin(), timeUnits.end(), std::string(value));
+        if (i == timeUnits.end())
+        {
+            std::string message = formatString(
+                        "Time unit provided with environment variable GMXTIMEUNIT=%s "
+                        "is not recognized as a valid time unit.\n"
+                        "Possible values are: %s",
+                        value, joinStrings(timeUnits, ", ").c_str());
+            GMX_THROW(InvalidInputError(message));
+        }
+        timeUnit_ = i - timeUnits.begin();
+    }
+}
+
 void TimeUnitManager::addTimeUnitOption(Options *options, const char *name)
 {
     options->addOption(StringOption(name).enumValue(g_timeUnits)
index 34f11d97fa1bb40819054f48264c0a951ced1a50..76e08312bebfe16603db5e5e015ba24f21d29c6f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,7 +43,7 @@
 #ifndef GMX_OPTIONS_TIMEUNITMANAGER_H
 #define GMX_OPTIONS_TIMEUNITMANAGER_H
 
-#include "../utility/gmxassert.h"
+#include "gromacs/utility/gmxassert.h"
 
 namespace gmx
 {
@@ -117,6 +117,10 @@ class TimeUnitManager
         //! Returns the scaling factor to convert times from ps.
         double inverseTimeScaleFactor() const;
 
+        /*! \brief
+         * Sets the time unit in this manager from an environment variable.
+         */
+        void setTimeUnitFromEnvironment();
         /*! \brief
          * Adds a common option for selecting the time unit.
          *
diff --git a/src/gromacs/pbcutil/CMakeLists.txt b/src/gromacs/pbcutil/CMakeLists.txt
new file mode 100644 (file)
index 0000000..793ba19
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+file(GLOB PBCUTIL_SOURCES *.cpp *.c)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${PBCUTIL_SOURCES} PARENT_SCOPE)
+
+gmx_install_headers(
+    ishift.h
+    pbc.h
+    rmpbc.h
+    )
+
+if (BUILD_TESTING)
+#    add_subdirectory(tests)
+endif()
similarity index 93%
rename from src/gromacs/legacyheaders/types/ishift.h
rename to src/gromacs/pbcutil/ishift.h
index 4c44dfe92e4ac073537d207dd28fb534527c79ac..464f3c0139069ac9d85d4f83a7465165aa736a7d 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-
-
-/* not really neccesary, right now: */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
+#ifndef GMX_PBCUTIL_ISHIFT_H
+#define GMX_PBCUTIL_ISHIFT_H
 
 #define D_BOX_Z 1
 #define D_BOX_Y 1
@@ -58,7 +53,4 @@ extern "C" {
 #define IS2Y(iv)      ((((iv) / N_BOX_X) % N_BOX_Y) - D_BOX_Y)
 #define IS2Z(iv)      ((iv) / (N_BOX_X*N_BOX_Y) - D_BOX_Z)
 
-
-#ifdef __cplusplus
-}
 #endif
similarity index 97%
rename from src/gromacs/gmxlib/mshift.c
rename to src/gromacs/pbcutil/mshift.cpp
index 6b6ad831a216389af6ef77e2d2aa5557b398382f..e95ccff45d3ce10b1c522a519ffb2f5acd7ea598 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "mshift.h"
 
 #include <string.h>
+
+#include <algorithm>
+
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "vec.h"
-#include "gromacs/fileio/futil.h"
-#include "mshift.h"
-#include "main.h"
-#include "pbc.h"
 
 /************************************************************
  *
@@ -144,7 +144,7 @@ static void mk_igraph(t_graph *g, int ftype, t_ilist *il,
     }
 }
 
-GMX_ATTRIBUTE_NORETURN static void g_error(int line, const char *file)
+gmx_noreturn static void g_error(int line, const char *file)
 {
     gmx_fatal(FARGS, "Tring to print non existant graph (file %s, line %d)",
               file, line);
@@ -175,7 +175,7 @@ void p_graph(FILE *log, const char *title, t_graph *g)
                     g->nedge[i]);
             for (j = 0; (j < g->nedge[i]); j++)
             {
-                fprintf(log, " %5u", g->edge[i][j]+1);
+                fprintf(log, " %5d", g->edge[i][j]+1);
             }
             fprintf(log, "\n");
         }
@@ -204,8 +204,8 @@ static void calc_1se(t_graph *g, int ftype, t_ilist *il,
                 nbond[iaa]   += 2;
                 nbond[ia[2]] += 1;
                 nbond[ia[3]] += 1;
-                g->at_start   = min(g->at_start, iaa);
-                g->at_end     = max(g->at_end, iaa+2+1);
+                g->at_start   = std::min(g->at_start, iaa);
+                g->at_end     = std::max(g->at_end, iaa+2+1);
             }
         }
         else
@@ -215,8 +215,8 @@ static void calc_1se(t_graph *g, int ftype, t_ilist *il,
                 iaa = ia[k];
                 if (iaa >= at_start && iaa < at_end)
                 {
-                    g->at_start = min(g->at_start, iaa);
-                    g->at_end   = max(g->at_end,  iaa+1);
+                    g->at_start = std::min(g->at_start, iaa);
+                    g->at_end   = std::max(g->at_end,  iaa+1);
                     /* When making the graph we (might) link all atoms in an interaction
                      * sequentially. Therefore the end atoms add 1 to the count,
                      * the middle atoms 2.
@@ -270,7 +270,7 @@ static int calc_start_end(FILE *fplog, t_graph *g, t_ilist il[],
     for (i = g->at_start; (i < g->at_end); i++)
     {
         nbtot += nbond[i];
-        nnb    = max(nnb, nbond[i]);
+        nnb    = std::max(nnb, nbond[i]);
     }
     if (fplog)
     {
@@ -285,7 +285,6 @@ static int calc_start_end(FILE *fplog, t_graph *g, t_ilist il[],
 static void compact_graph(FILE *fplog, t_graph *g)
 {
     int      i, j, n, max_nedge;
-    atom_id *e;
 
     max_nedge = 0;
     n         = 0;
@@ -295,7 +294,7 @@ static void compact_graph(FILE *fplog, t_graph *g)
         {
             g->edge[0][n++] = g->edge[i][j];
         }
-        max_nedge = max(max_nedge, g->nedge[i]);
+        max_nedge = std::max(max_nedge, g->nedge[i]);
     }
     srenew(g->edge[0], n);
     /* set pointers after srenew because edge[0] might move */
@@ -486,8 +485,6 @@ t_graph *mk_graph(FILE *fplog,
 
 void done_graph(t_graph *g)
 {
-    int i;
-
     GCHECK(g);
     if (g->nnodes > 0)
     {
similarity index 68%
rename from src/gromacs/legacyheaders/mshift.h
rename to src/gromacs/pbcutil/mshift.h
index d4b5c9fa3d5ed8fa0f4041e60a2daa9fa9eac7f8..3c8783663da8ea09b5cf4330862bb1453112626f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_PBCUTIL_MSHIFT_H
+#define GMX_PBCUTIL_MSHIFT_H
 
-#ifndef _mshift_h
-#define _mshift_h
+#include <stdio.h>
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_idef;
+struct t_ilist;
+
+typedef enum {
+    egcolWhite, egcolGrey, egcolBlack, egcolNR
+} egCol;
+
+typedef struct t_graph {
+    int          at0;       /* The first atom the graph was constructed for */
+    int          at1;       /* The last atom the graph was constructed for  */
+    int          nnodes;    /* The number of nodes, nnodes=at_end-at_start  */
+    int          nbound;    /* The number of nodes with edges               */
+    int          at_start;  /* The first connected atom in this graph       */
+    int          at_end;    /* The last+1 connected atom in this graph      */
+    int         *nedge;     /* For each node the number of edges            */
+    atom_id    **edge;      /* For each node, the actual edges (bidirect.)  */
+    gmx_bool     bScrewPBC; /* Screw boundary conditions                    */
+    ivec        *ishift;    /* Shift for each particle                      */
+    int          negc;
+    egCol       *egc;       /* color of each node */
+} t_graph;
+
+#define SHIFT_IVEC(g, i) ((g)->ishift[i])
+
 t_graph *mk_graph(FILE *fplog,
-                  t_idef *idef, int at_start, int at_end,
+                  struct t_idef *idef, int at_start, int at_end,
                   gmx_bool bShakeOnly, gmx_bool bSettle);
 /* Build a graph from an idef description. The graph can be used
  * to generate mol-shift indices.
@@ -56,7 +83,7 @@ t_graph *mk_graph(FILE *fplog,
  */
 
 void mk_graph_ilist(FILE *fplog,
-                    t_ilist *ilist, int at_start, int at_end,
+                    struct t_ilist *ilist, int at_start, int at_end,
                     gmx_bool bShakeOnly, gmx_bool bSettle,
                     t_graph *g);
 /* As mk_graph, but takes t_ilist iso t_idef and does not allocate g */
@@ -87,4 +114,4 @@ void unshift_self(t_graph *g, matrix box, rvec x[]);
 }
 #endif
 
-#endif  /* _mshift_h */
+#endif
similarity index 99%
rename from src/gromacs/gmxlib/pbc.c
rename to src/gromacs/pbcutil/pbc.c
index c96eba4f063ba40dcfd3ca446584b0442838406b..e6d4c49230387450964755547dd7aa24bfc51182 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "pbc.h"
 
-#include <math.h>
 #include <assert.h>
+#include <math.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "vec.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/utilities.h"
-#include "main.h"
-#include "pbc.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "txtdump.h"
-#include "gmx_fatal.h"
-#include "names.h"
-#include "macros.h"
-#include "gmx_omp_nthreads.h"
 
 /* Skip 0 so we have more chance of detecting if we forgot to call set_pbc. */
 enum {
similarity index 89%
rename from src/gromacs/legacyheaders/pbc.h
rename to src/gromacs/pbcutil/pbc.h
index be7e51fa9e421344d1dea33f5f1fe409873ab068..8fc7b68224ff6a0082ed7146ff07eb08c202b188 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_PBCUTIL_PBC_H
+#define GMX_PBCUTIL_PBC_H
 
-#ifndef _types_pbc_h
-#define _types_pbc_h
+#include <stdio.h>
 
-#include "sysstuff.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/* Maximum number of combinations of single triclinic box vectors
+ * required to shift atoms that are within a brick of the size of
+ * the diagonal of the box to within the maximum cut-off distance.
+ */
+#define MAX_NTRICVEC 12
+
+typedef struct t_pbc {
+    int        ePBC;
+    int        ndim_ePBC;
+    int        ePBCDX;
+    int        dim;
+    matrix     box;
+    rvec       fbox_diag;
+    rvec       hbox_diag;
+    rvec       mhbox_diag;
+    real       max_cutoff2;
+    gmx_bool   bLimitDistance;
+    real       limit_distance2;
+    int        ntric_vec;
+    ivec       tric_shift[MAX_NTRICVEC];
+    rvec       tric_vec[MAX_NTRICVEC];
+} t_pbc;
+
 #define TRICLINIC(box) (box[YY][XX] != 0 || box[ZZ][XX] != 0 || box[ZZ][YY] != 0)
 
 #define NTRICIMG 14
@@ -58,6 +85,8 @@ enum {
     ecenterDEF = ecenterTRIC
 };
 
+struct t_graph;
+
 int ePBC2npbcdim(int ePBC);
 /* Returns the number of dimensions that use pbc, starting at X */
 
@@ -84,7 +113,7 @@ real max_cutoff2(int ePBC, matrix box);
 int guess_ePBC(matrix box);
 /* Guesses the type of periodic boundary conditions using the box */
 
-gmx_bool correct_box(FILE *fplog, int step, tensor box, t_graph *graph);
+gmx_bool correct_box(FILE *fplog, int step, tensor box, struct t_graph *graph);
 /* Checks for un-allowed box angles and corrects the box
  * and the integer shift vectors in the graph (if graph!=NULL) if necessary.
  * Returns TRUE when the box was corrected.
@@ -225,4 +254,4 @@ const char *put_atoms_in_compact_unitcell(int ePBC, int ecenter,
 }
 #endif
 
-#endif  /* _pbc_h */
+#endif
similarity index 95%
rename from src/gromacs/gmxlib/rmpbc.c
rename to src/gromacs/pbcutil/rmpbc.c
index 1c0e0c9acff32da4ce714f96ded71ea260274325..4d91ac47830c3ed9280429680ea764e8746bd7e7 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "mshift.h"
-#include "pbc.h"
+#include "gmxpre.h"
+
 #include "rmpbc.h"
-#include "vec.h"
 
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
@@ -54,13 +53,13 @@ typedef struct {
     t_graph *gr;
 } rmpbc_graph_t;
 
-typedef struct gmx_rmpbc {
+struct gmx_rmpbc {
     t_idef        *idef;
     int            natoms_init;
     int            ePBC;
     int            ngraph;
     rmpbc_graph_t *graph;
-} koeiepoep;
+};
 
 static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
 {
similarity index 84%
rename from src/gromacs/legacyheaders/rmpbc.h
rename to src/gromacs/pbcutil/rmpbc.h
index 0b9c21a04a4b5a48ddd7dd4b2cf7f616c8e8f7cb..ff9107a7d2a27a8b4d5859530358eeccc674fa7c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_PBCUTIL_RMPBC_H
+#define GMX_PBCUTIL_RMPBC_H
 
-#ifndef _rmpbc_h
-#define _rmpbc_h
-
-#include "typedefs.h"
+#include "gromacs/math/vectypes.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_atoms;
+struct t_idef;
+struct t_trxframe;
+
 typedef struct gmx_rmpbc *gmx_rmpbc_t;
 
-gmx_rmpbc_t gmx_rmpbc_init(t_idef *idef, int ePBC, int natoms);
+gmx_rmpbc_t gmx_rmpbc_init(struct t_idef *idef, int ePBC, int natoms);
 
 void gmx_rmpbc_done(gmx_rmpbc_t gpbc);
 
@@ -62,14 +65,10 @@ void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[],
                     rvec x_s[]);
 /* As gmx_rmpbc, but outputs in x_s and does not modify x. */
 
-void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, t_trxframe *fr);
+void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, struct t_trxframe *fr);
 /* As gmx_rmpbc but operates on a t_trxframe data structure. */
 
-/*void rm_pbc(t_idef *idef,int ePBC,int natoms,
-   matrix box,rvec x[],rvec x_s[]);*/
-/* Convenience function that still holds a static variable. */
-
-void rm_gropbc(t_atoms *atoms, rvec x[], matrix box);
+void rm_gropbc(struct t_atoms *atoms, rvec x[], matrix box);
 /* Simple routine for use in analysis tools that just have a pdb or
  * similar file.
  */
@@ -78,4 +77,4 @@ void rm_gropbc(t_atoms *atoms, rvec x[], matrix box);
 }
 #endif
 
-#endif  /* _rmpbc_h */
+#endif
index 458a2fb4723fd345c99a356966ebc42fea1e33cf..575e07ca87a405a6e0acf5720bdea51391f62a6d 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "pull.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include "gromacs/fileio/futil.h"
-#include "index.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "vec.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "gromacs/fileio/filenm.h"
 #include <string.h>
+
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "pull.h"
-#include "xvgr.h"
-#include "names.h"
-#include "pbc.h"
-#include "mtop_util.h"
-#include "mdrun.h"
-#include "gmx_ga2la.h"
-#include "copyrite.h"
-#include "macros.h"
-#include "vec.h"
 
 static void pull_print_group_x(FILE *out, ivec dim, const t_pull_group *pgrp)
 {
@@ -180,7 +177,7 @@ static FILE *open_pull_out(const char *fn, t_pull *pull, const output_env_t oenv
                         if (pull->dim[m])
                         {
                             sprintf(buf, "%d %s%c", c+1, "c", 'X'+m);
-                            setname[nsets] = strdup(buf);
+                            setname[nsets] = gmx_strdup(buf);
                             nsets++;
                         }
                     }
@@ -190,7 +187,7 @@ static FILE *open_pull_out(const char *fn, t_pull *pull, const output_env_t oenv
                     if (pull->dim[m])
                     {
                         sprintf(buf, "%d %s%c", c+1, "d", 'X'+m);
-                        setname[nsets] = strdup(buf);
+                        setname[nsets] = gmx_strdup(buf);
                         nsets++;
                     }
                 }
@@ -198,7 +195,7 @@ static FILE *open_pull_out(const char *fn, t_pull *pull, const output_env_t oenv
             else
             {
                 sprintf(buf, "%d", c+1);
-                setname[nsets] = strdup(buf);
+                setname[nsets] = gmx_strdup(buf);
                 nsets++;
             }
         }
index 4ef61ba6ad448e5f196f24294dfe0fc5f571a461..3a5f8d6b575553e4706f40acbd275d51e4cfc9e6 100644 (file)
 #ifndef GMX_PULLING_PULL_H
 #define GMX_PULLING_PULL_H
 
-#include "typedefs.h"
-#include "../fileio/filenm.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_pbc;
 
 /*! \brief Get the distance to the reference and deviation for pull coord coord_ind.
  *
@@ -69,7 +70,7 @@ extern "C" {
  */
 void get_pull_coord_distance(const t_pull *pull,
                              int coord_ind,
-                             const t_pbc *pbc, double t,
+                             const struct t_pbc *pbc, double t,
                              dvec dr, double *dev);
 
 
@@ -96,7 +97,7 @@ void clear_pull_forces(t_pull *pull);
  *
  * \returns The pull potential energy.
  */
-real pull_potential(int ePull, t_pull *pull, t_mdatoms *md, t_pbc *pbc,
+real pull_potential(int ePull, t_pull *pull, t_mdatoms *md, struct t_pbc *pbc,
                     t_commrec *cr, double t, real lambda,
                     rvec *x, rvec *f, tensor vir, real *dvdlambda);
 
@@ -115,7 +116,7 @@ real pull_potential(int ePull, t_pull *pull, t_mdatoms *md, t_pbc *pbc,
  * \param[in,out] v      Velocities, which may get a pull correction.
  * \param[in,out] vir    The virial, which, if != NULL, gets a pull correction.
  */
-void pull_constraint(t_pull *pull, t_mdatoms *md, t_pbc *pbc,
+void pull_constraint(t_pull *pull, t_mdatoms *md, struct t_pbc *pbc,
                      t_commrec *cr, double dt, double t,
                      rvec *x, rvec *xp, rvec *v, tensor vir);
 
@@ -185,13 +186,13 @@ void pull_print_output(t_pull *pull, gmx_int64_t step, double time);
  * \param[in,out] xp   Updated x, can be NULL.
  *
  */
-void pull_calc_coms(t_commrec *cr,
-                    t_pull    *pull,
-                    t_mdatoms *md,
-                    t_pbc     *pbc,
-                    double     t,
-                    rvec       x[],
-                    rvec      *xp);
+void pull_calc_coms(t_commrec        *cr,
+                    t_pull           *pull,
+                    t_mdatoms        *md,
+                    struct t_pbc     *pbc,
+                    double            t,
+                    rvec              x[],
+                    rvec             *xp);
 
 #ifdef __cplusplus
 }
index 4ab6b30cb8c7d73b3ec2429a60e5addaa23538d9..5b7358a761d8f770dd0c611431a1b05818175c0f 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "pull_rotation.h"
+
+#include "config.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "domdec.h"
-#include "gromacs/utility/smalloc.h"
-#include "network.h"
-#include "pbc.h"
-#include "mdrun.h"
-#include "txtdump.h"
-#include "names.h"
-#include "mtop_util.h"
-#include "names.h"
-#include "vec.h"
-#include "gmx_ga2la.h"
-#include "xvgr.h"
-#include "copyrite.h"
-#include "macros.h"
-
-#include "gromacs/fileio/futil.h"
+#include "gromacs/domdec/domdec.h"
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/linearalgebra/nrjac.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/qsort_threadsafe.h"
-#include "gromacs/pulling/pull_rotation.h"
-#include "gromacs/mdlib/groupcoord.h"
-#include "gromacs/math/utilities.h"
+#include "gromacs/utility/smalloc.h"
 
 static char *RotStr = {"Enforced rotation:"};
 
@@ -943,7 +942,7 @@ static FILE *open_rot_out(const char *fn, t_rot *rot, const output_env_t oenv)
             add_to_string_aligned(&LegendStr, buf);
 
             sprintf(buf2, "%s (degrees)", buf);
-            setname[nsets] = strdup(buf2);
+            setname[nsets] = gmx_strdup(buf2);
             nsets++;
         }
         for (g = 0; g < rot->ngrp; g++)
@@ -963,19 +962,19 @@ static FILE *open_rot_out(const char *fn, t_rot *rot, const output_env_t oenv)
             }
             add_to_string_aligned(&LegendStr, buf);
             sprintf(buf2, "%s (degrees)", buf);
-            setname[nsets] = strdup(buf2);
+            setname[nsets] = gmx_strdup(buf2);
             nsets++;
 
             sprintf(buf, "tau%d", g);
             add_to_string_aligned(&LegendStr, buf);
             sprintf(buf2, "%s (kJ/mol)", buf);
-            setname[nsets] = strdup(buf2);
+            setname[nsets] = gmx_strdup(buf2);
             nsets++;
 
             sprintf(buf, "energy%d", g);
             add_to_string_aligned(&LegendStr, buf);
             sprintf(buf2, "%s (kJ/mol)", buf);
-            setname[nsets] = strdup(buf2);
+            setname[nsets] = gmx_strdup(buf2);
             nsets++;
         }
         fprintf(fp, "#\n");
index e7d1cfd1c465c415a7a29fef8672339a8fbfec2a..28d380195b714029ad11e855aa49d709aef1c568 100644 (file)
@@ -48,8 +48,9 @@
 #ifndef GMX_PULLING_PULL_ROTATION_H
 #define GMX_PULLING_PULL_ROTATION_H
 
-#include "typedefs.h"
-#include "../fileio/filenm.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/timing/wallcycle.h"
 
 
 #ifdef __cplusplus
index 19e762346c77e98eddfd8ea64a0d285b859b0662..53072c1ef20393f2ae4c95eaf6ae6581d5bb5db8 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdlib.h>
 
-#include "sysstuff.h"
-#include "princ.h"
-#include "gromacs/fileio/futil.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "names.h"
-#include "gmx_fatal.h"
-#include "macros.h"
-#include "symtab.h"
-#include "index.h"
 #include "gromacs/fileio/confio.h"
-#include "network.h"
-#include "pbc.h"
-#include "pull.h"
-#include "gmx_ga2la.h"
+#include "gromacs/legacyheaders/gmx_ga2la.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void pull_set_pbcatom(t_commrec *cr, t_pull_group *pgrp,
                              rvec *x,
index b70fddfcde280037528a0856fc1d5f564230831d..1e8390abe24ffcb323a0c2c261709d1afec06e03 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "random.h"
 
+#include "config.h"
+
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 #include <time.h>
-#include <math.h>
-#ifdef GMX_NATIVE_WINDOWS
-#include <process.h>
-#endif
 
 #include "external/Random123-1.08/include/Random123/threefry.h"
 
 #include "gromacs/math/utilities.h"
-#include "random_gausstable.h"
+#include "gromacs/random/random_gausstable.h"
+#include "gromacs/utility/sysinfo.h"
 
 #define RNG_N 624
 #define RNG_M 397
@@ -236,12 +231,8 @@ gmx_rng_make_seed(void)
     else
     {
         /* No random device available, use time-of-day and process id */
-#ifdef GMX_NATIVE_WINDOWS
-        my_pid = (long)_getpid();
-#else
-        my_pid = (long)getpid();
-#endif
-        data = (unsigned int)(((long)time(NULL)+my_pid) % (long)1000000);
+        my_pid = gmx_getpid();
+        data   = (unsigned int)(((long)time(NULL)+my_pid) % (long)1000000);
     }
     return data;
 }
index e1a938b3fd6a39c7a813a44841a916056dfcb130..a4eb24ebb4c47bb21748bd67e89ddaae6a8c53f4 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifndef _GMX_RANDOM_H_
-#define _GMX_RANDOM_H_
+#ifndef GMX_RANDOM_RANDOM_H
+#define GMX_RANDOM_RANDOM_H
 
-#include <stdio.h>
-#include "types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /*! Fixed random number seeds for different types of RNG */
-#define RND_SEED_UPDATE    1 /*!< For coordinate update (sd, bd, ..) */
-#define RND_SEED_REPLEX    2 /*!< For replica exchange */
-#define RND_SEED_VRESCALE  3 /*!< For V-rescale thermostat */
-#define RND_SEED_ANDERSEN  4 /*!< For Andersen thermostat */
-#define RND_SEED_TPI       5 /*!< For test particle insertion */
-#define RND_SEED_EXPANDED  6 /*!< For expanded emseble methods */
+#define RND_SEED_UPDATE    1 /**< For coordinate update (sd, bd, ..) */
+#define RND_SEED_REPLEX    2 /**< For replica exchange */
+#define RND_SEED_VRESCALE  3 /**< For V-rescale thermostat */
+#define RND_SEED_ANDERSEN  4 /**< For Andersen thermostat */
+#define RND_SEED_TPI       5 /**< For test particle insertion */
+#define RND_SEED_EXPANDED  6 /**< For expanded emseble methods */
 
 /*! \brief Abstract datatype for a random number generator
  *
@@ -322,4 +322,4 @@ gmx_rng_cycle_6gaussian_table(gmx_int64_t ctr1, gmx_int64_t ctr2,
 }
 #endif
 
-#endif /* _GMX_RANDOM_H_ */
+#endif
index 835a638011b37b509f6c2c6051ff22923d0fe21c..e52a67d7a4185aaa59e721140bc0e1879a5d2e8b 100644 (file)
@@ -39,6 +39,8 @@
  * \author Roland Schulz <roland@utk.edu>
  * \ingroup module_random
  */
+#include "gmxpre.h"
+
 #include <vector>
 
 #include <gtest/gtest.h>
index 0588ce36aaf531ca92d83e64735644c2708e961f..ef47702a211575f0ba0ce3314649fe117c22cef5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,9 +81,9 @@
 #ifndef GMX_SELECTION_H
 #define GMX_SELECTION_H
 
-#include "selection/selection.h"
-#include "selection/selectioncollection.h"
-#include "selection/selectionoption.h"
-#include "selection/selectionoptionmanager.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectioncollection.h"
+#include "gromacs/selection/selectionoption.h"
+#include "gromacs/selection/selectionoptionmanager.h"
 
 #endif
index 4788a17578a1aa2e0b96d86260c94bd50ba163a5..02e565c82ac7d1b67c79d8e9e5b6f53438c32e2f 100644 (file)
@@ -35,7 +35,7 @@
 file(GLOB SELECTION_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SELECTION_SOURCES} PARENT_SCOPE)
 
-set(SELECTION_PUBLIC_HEADERS
+gmx_install_headers(
     nbsearch.h
     indexutil.h
     position.h
@@ -43,8 +43,8 @@ set(SELECTION_PUBLIC_HEADERS
     selectioncollection.h
     selectionenums.h
     selectionoption.h
-    selectionoptionmanager.h)
-gmx_install_headers(selection ${SELECTION_PUBLIC_HEADERS})
+    selectionoptionmanager.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index a46facd626b4ef26e9ef16f8b91d0ea4253743f3..474175ef89d0961fa9274a5606af9ea568917841 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/selection/centerofmass.h"
+#include "gmxpre.h"
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
+#include "centerofmass.h"
+
+#include <errno.h>
+
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/topology.h"
 
 int
 gmx_calc_cog(t_topology * /* top */, rvec x[], int nrefat, atom_id index[], rvec xout)
index 7cefe1a02be3bc4be8dc2dbc449c73cd233a3e2b..4aa7cf8288139ef599f024c977ed446427144a6c 100644 (file)
 #ifndef GMX_SELECTION_CENTEROFMASS_H
 #define GMX_SELECTION_CENTEROFMASS_H
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
+
+struct t_block;
+struct t_blocka;
+struct t_pbc;
+struct t_topology;
 
 /*! \brief
  * Calculate a single center of geometry.
index 2cc7655e150458f3219d01c6f28dad56a788dd0d..87ab39f543d0819c7a4c94459f91073effcd0847 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,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.
  * calculated.
  * Currently, no other processing is done.
  */
-#include "compiler.h"
+#include "gmxpre.h"
 
-#include <algorithm>
+#include "compiler.h"
 
 #include <math.h>
 #include <stdarg.h>
 
-#include "gromacs/legacyheaders/vec.h"
+#include <algorithm>
 
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/selection.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 #include "evaluate.h"
 #include "keywords.h"
 #include "mempool.h"
+#include "poscalc.h"
 #include "selectioncollection-impl.h"
 #include "selelem.h"
+#include "selmethod.h"
 
 using std::min;
+using gmx::SelectionLocation;
 using gmx::SelectionTreeElement;
 using gmx::SelectionTreeElementPointer;
 
@@ -785,20 +787,21 @@ extract_item_subselections(const SelectionTreeElementPointer &sel,
         /* The latter check excludes variable references. */
         if (child->type == SEL_SUBEXPRREF && child->child->type != SEL_SUBEXPR)
         {
+            SelectionLocation location = child->child->location();
             /* Create the root element for the subexpression */
             if (!root)
             {
-                root.reset(new SelectionTreeElement(SEL_ROOT));
+                root.reset(new SelectionTreeElement(SEL_ROOT, location));
                 subexpr = root;
             }
             else
             {
-                subexpr->next.reset(new SelectionTreeElement(SEL_ROOT));
+                subexpr->next.reset(new SelectionTreeElement(SEL_ROOT, location));
                 subexpr = subexpr->next;
             }
             /* Create the subexpression element and
              * move the actual subexpression under the created element. */
-            subexpr->child.reset(new SelectionTreeElement(SEL_SUBEXPR));
+            subexpr->child.reset(new SelectionTreeElement(SEL_SUBEXPR, location));
             _gmx_selelem_set_vtype(subexpr->child, child->v.type);
             subexpr->child->child = child->child;
             child->child          = subexpr->child;
@@ -977,7 +980,7 @@ reorder_boolean_static_children(const SelectionTreeElementPointer &sel)
     {
         // Add a dummy head element that precedes the first child.
         SelectionTreeElementPointer dummy(
-                new SelectionTreeElement(SEL_BOOLEAN));
+                new SelectionTreeElement(SEL_BOOLEAN, SelectionLocation::createEmpty()));
         dummy->next = sel->child;
         SelectionTreeElementPointer prev  = dummy;
         SelectionTreeElementPointer child = dummy;
@@ -1602,7 +1605,7 @@ init_item_minmax_groups(const SelectionTreeElementPointer &sel)
  * \param[in,out] sc   Selection collection data.
  *
  * The evaluation group of each \ref SEL_ROOT element corresponding to a
- * selection in \p sc is set to NULL.  The evaluation grop for \ref SEL_ROOT
+ * selection in \p sc is set to NULL.  The evaluation group for \ref SEL_ROOT
  * elements corresponding to subexpressions that need full evaluation is set
  * to \c sc->gall.
  */
@@ -1872,7 +1875,7 @@ init_method(const SelectionTreeElementPointer &sel, t_topology *top, int isize)
             if ((sel->flags & SEL_DYNAMIC)
                 && sel->v.type != GROUP_VALUE && sel->v.type != POS_VALUE)
             {
-                sel->v.nr = isize;
+                sel->v.nr = ((sel->flags & SEL_SINGLEVAL) ? 1 : isize);
             }
             /* If the method is char-valued, pre-allocate the strings. */
             if (sel->u.expr.method->flags & SMETH_CHARVAL)
@@ -1941,7 +1944,7 @@ evaluate_boolean_static_part(gmx_sel_evaluate_t                *data,
         child->next.reset();
         sel->cdata->evaluate(data, sel, g);
         /* Replace the subexpressions with the result */
-        child.reset(new SelectionTreeElement(SEL_CONST));
+        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;
@@ -1977,8 +1980,7 @@ evaluate_boolean_static_part(gmx_sel_evaluate_t                *data,
     {
         child->cdata->evaluate = &_gmx_sel_evaluate_static;
         /* The cgrp has only been allocated if it originated from an
-         * external index group. In that case, we need special handling
-         * to preserve the name of the group and to not leak memory.
+         * external index group.
          * If cgrp has been set in make_static(), it is not allocated,
          * and hence we can overwrite it safely. */
         if (child->u.cgrp.nalloc_index > 0)
@@ -2440,6 +2442,54 @@ init_root_item(const SelectionTreeElementPointer &root,
 }
 
 
+/********************************************************************
+ * REQUIRED ATOMS ANALYSIS
+ ********************************************************************/
+
+/*! \brief
+ * Finds the highest atom index required to evaluate a selection subtree.
+ *
+ * \param[in]     sel           Root of the selection subtree to process.
+ * \param[in,out] maxAtomIndex  The highest atom index required to evaluate the
+ *      subtree.  The existing value is never decreased, so multiple calls with
+ *      the same parameter will compute the maximum over several subtrees.
+ *
+ * For evaluation that starts from a \ref SEL_ROOT element with a fixed group,
+ * children will never extend the evaluation group except for method parameter
+ * evaluation (which have their own root element), so it is sufficient to check
+ * the root.  However, children of \ref SEL_EXPRESSION elements (i.e., the
+ * method parameters) may have been independently evaluated to a static group
+ * that no longer has a separate root, so those need to be checked as well.
+ *
+ * Position calculations are not considered here, but are analyzed through the
+ * position calculation collection in the main compilation method.
+ */
+static void
+init_required_atoms(const SelectionTreeElementPointer &sel, int *maxAtomIndex)
+{
+    // Process children.
+    if (sel->type != SEL_SUBEXPRREF)
+    {
+        SelectionTreeElementPointer child = sel->child;
+        while (child)
+        {
+            init_required_atoms(child, maxAtomIndex);
+            child = child->next;
+        }
+    }
+
+    if (sel->type == SEL_ROOT
+        || (sel->type == SEL_CONST && sel->v.type == GROUP_VALUE))
+    {
+        if (sel->u.cgrp.isize > 0)
+        {
+            *maxAtomIndex =
+                std::max(*maxAtomIndex, gmx_ana_index_get_max_index(&sel->u.cgrp));
+        }
+    }
+}
+
+
 /********************************************************************
  * FINAL SUBEXPRESSION OPTIMIZATION
  ********************************************************************/
@@ -2833,9 +2883,10 @@ SelectionCompiler::compile(SelectionCollection *coll)
         coll->printTree(stderr, false);
     }
 
-    /* Initialize evaluation groups, position calculations for methods, perform
-     * some final optimization, and free the memory allocated for the
-     * compilation. */
+    // Initialize evaluation groups, maximum atom index needed for evaluation,
+    // position calculations for methods, perform some final optimization, and
+    // free the memory allocated for the compilation.
+    coll->impl_->maxAtomIndex_ = 0;
     /* By default, use whole residues/molecules. */
     flags = POS_COMPLWHOLE;
     PositionCalculationCollection::typeFromEnum(coll->impl_->rpost_.c_str(),
@@ -2845,10 +2896,14 @@ SelectionCompiler::compile(SelectionCollection *coll)
     {
         init_root_item(item, &sc->gall);
         postprocess_item_subexpressions(item);
+        init_required_atoms(item, &coll->impl_->maxAtomIndex_);
         init_item_comg(item, &sc->pcc, post, flags);
         free_item_compilerdata(item);
         item = item->next;
     }
+    coll->impl_->maxAtomIndex_ =
+        std::max(coll->impl_->maxAtomIndex_,
+                 sc->pcc.getHighestRequiredAtomIndex());
 
     /* Allocate memory for the evaluation memory pool. */
     _gmx_sel_mempool_reserve(sc->mempool, 0);
index 9b1fb6ed213baca33ef062148cdb4f38b2f14924..e1f4df2f90be4d300eb740e54ab66ede04508446 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "evaluate.h"
+
 #include <string.h>
 
-#include "gromacs/legacyheaders/vec.h"
+#include <algorithm>
 
 #include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/selection.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "evaluate.h"
 #include "mempool.h"
+#include "poscalc.h"
 #include "selectioncollection-impl.h"
 #include "selelem.h"
+#include "selmethod.h"
 
 using gmx::SelectionTreeElement;
 using gmx::SelectionTreeElementPointer;
@@ -236,8 +240,7 @@ class SelelemTemporaryValueAssigner
                                "Can only assign one element with one instance");
             GMX_RELEASE_ASSERT(sel->v.type == vsource.v.type,
                                "Mismatching selection value types");
-            old_ptr_    = sel->v.u.ptr;
-            old_nalloc_ = sel->v.nalloc;
+            _gmx_selvalue_getstore_and_release(&sel->v, &old_ptr_, &old_nalloc_);
             _gmx_selvalue_setstore(&sel->v, vsource.v.u.ptr);
             sel_ = sel;
         }
@@ -248,6 +251,42 @@ class SelelemTemporaryValueAssigner
         int                             old_nalloc_;
 };
 
+/*! \brief
+ * Expands a value array from one-per-position to one-per-atom.
+ *
+ * \param[in,out] value  Array to expand.
+ * \param[in,out] nr     Number of values in \p value.
+ * \param[in]     pos    Position data.
+ * \tparam        T      Value type of the array to expand.
+ *
+ * On input, \p value contains one value for each position in \p pos (and `*nr`
+ * must match).  On output, \p value will contain a value for each atom used to
+ * evaluate `pos`: each input value is replicated to all atoms that make up the
+ * corresponding position.
+ * The operation is done in-place.
+ *
+ * Does not throw.
+ */
+template <typename T>
+void expandValueForPositions(T value[], int *nr, gmx_ana_pos_t *pos)
+{
+    GMX_RELEASE_ASSERT(*nr == pos->count(),
+                       "Position update method did not return the correct number of values");
+    *nr = pos->m.mapb.nra;
+    // Loop over the positions in reverse order so that the expansion can be
+    // done in-place (assumes that each position has at least one atom, which
+    // should always be the case).
+    int outputIndex = pos->m.mapb.nra;
+    for (int i = pos->count() - 1; i >= 0; --i)
+    {
+        const int atomCount = pos->m.mapb.index[i + 1] - pos->m.mapb.index[i];
+        outputIndex -= atomCount;
+        GMX_ASSERT(outputIndex >= i,
+                   "In-place algorithm would overwrite data not yet used");
+        std::fill(&value[outputIndex], &value[outputIndex + atomCount], value[i]);
+    }
+}
+
 } // namespace
 
 /*!
@@ -935,6 +974,18 @@ _gmx_sel_evaluate_method(gmx_sel_evaluate_t                     *data,
         sel->u.expr.method->pupdate(data->top, data->fr, data->pbc,
                                     sel->u.expr.pos, &sel->v,
                                     sel->u.expr.mdata);
+        if ((sel->flags & SEL_ATOMVAL) && sel->v.nr < g->isize)
+        {
+            switch (sel->v.type)
+            {
+                case REAL_VALUE:
+                    expandValueForPositions(sel->v.u.r, &sel->v.nr,
+                                            sel->u.expr.pos);
+                    break;
+                default:
+                    GMX_RELEASE_ASSERT(false, "Unimplemented value type for position update method");
+            }
+        }
     }
     else
     {
@@ -970,15 +1021,12 @@ _gmx_sel_evaluate_modifier(gmx_sel_evaluate_t                     *data,
         sel->u.expr.method->init_frame(data->top, data->fr, data->pbc,
                                        sel->u.expr.mdata);
     }
-    GMX_RELEASE_ASSERT(sel->child != NULL,
-                       "Modifier element with a value must have a child");
-    if (sel->child->v.type != POS_VALUE)
+    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,
-                                sel->child->v.u.p,
-                                &sel->v, sel->u.expr.mdata);
+                                NULL, &sel->v, sel->u.expr.mdata);
 }
 
 
index df0aefeb061e41420ec6e36501c56e6cfcda387b..337e9be336f59b3cbcfdff32d8319d34a29376d0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_SELECTION_EVALUATE_H
 #define GMX_SELECTION_EVALUATE_H
 
-#include "gromacs/legacyheaders/typedefs.h"
-
-#include "gromacs/selection/indexutil.h"
-
 #include "selelem.h"
 
+struct gmx_ana_index_t;
 struct gmx_sel_mempool_t;
+struct t_pbc;
+struct t_topology;
+struct t_trxframe;
 
 /*! \internal \brief
  * Data structure for passing information required during evaluation.
  */
-typedef struct gmx_sel_evaluate_t
+struct gmx_sel_evaluate_t
 {
     /** Memory pool for intermediate values. */
-    struct gmx_sel_mempool_t *mp;
+    gmx_sel_mempool_t        *mp;
     /** Index group that contains all the atoms. */
     gmx_ana_index_t          *gall;
     /** Topology information. */
@@ -72,7 +72,7 @@ typedef struct gmx_sel_evaluate_t
     t_trxframe               *fr;
     /** PBC data. */
     t_pbc                    *pbc;
-} gmx_sel_evaluate_t;
+};
 
 /*! \name Utility functions
  */
@@ -80,7 +80,7 @@ typedef struct gmx_sel_evaluate_t
 /** Initializes an evaluation data structure. */
 void
 _gmx_sel_evaluate_init(gmx_sel_evaluate_t *data,
-                       struct gmx_sel_mempool_t *mp, gmx_ana_index_t *gall,
+                       gmx_sel_mempool_t *mp, gmx_ana_index_t *gall,
                        t_topology *top, t_trxframe *fr, t_pbc *pbc);
 /** Evaluates the children of a general selection element. */
 void
index 27b867a9a1436b943a10375ee83b4fca051d4f7a..2e85724ac4d8e43ee679f2e55269a643fb5c03eb 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/selection/indexutil.h"
+#include "gmxpre.h"
 
+#include "indexutil.h"
+
+#include <cstdlib>
 #include <cstring>
 
+#include <algorithm>
 #include <string>
 #include <vector>
 
-#include "gromacs/legacyheaders/index.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/typedefs.h"
-
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 /********************************************************************
@@ -246,7 +251,7 @@ gmx_ana_indexgrps_find(gmx_ana_index_t *dest, std::string *destName,
     int n = find_group(const_cast<char *>(name), src->nr,
                        const_cast<char **>(names));
     sfree(names);
-    if (n == NOTSET)
+    if (n < 0)
     {
         dest->isize = 0;
         return false;
@@ -419,6 +424,19 @@ gmx_ana_index_dump(FILE *fp, gmx_ana_index_t *g, int maxn)
     fprintf(fp, "\n");
 }
 
+int
+gmx_ana_index_get_max_index(gmx_ana_index_t *g)
+{
+    if (g->isize == 0)
+    {
+        return 0;
+    }
+    else
+    {
+        return *std::max_element(g->index, g->index + g->isize);
+    }
+}
+
 /*!
  * \param[in]  g      Index group to check.
  * \returns    true if the index group is sorted and has no duplicates,
@@ -439,6 +457,19 @@ gmx_ana_index_check_sorted(gmx_ana_index_t *g)
     return true;
 }
 
+bool
+gmx_ana_index_check_range(gmx_ana_index_t *g, int natoms)
+{
+    for (int i = 0; i < g->isize; ++i)
+    {
+        if (g->index[i] < 0 || g->index[i] >= natoms)
+        {
+            return false;
+        }
+    }
+    return true;
+}
+
 /********************************************************************
  * Set operations
  ********************************************************************/
@@ -464,7 +495,7 @@ cmp_atomid(const void *a, const void *b)
 void
 gmx_ana_index_sort(gmx_ana_index_t *g)
 {
-    qsort(g->index, g->isize, sizeof(*g->index), cmp_atomid);
+    std::qsort(g->index, g->isize, sizeof(*g->index), cmp_atomid);
 }
 
 /*!
@@ -711,6 +742,52 @@ gmx_ana_index_merge(gmx_ana_index_t *dest,
  * gmx_ana_indexmap_t and related things
  ********************************************************************/
 
+/*! \brief
+ * Helper for splitting a sequence of atom indices into groups.
+ *
+ * \param[in]     atomIndex  Index of the next atom in the sequence.
+ * \param[in]     top        Topology structure.
+ * \param[in]     type       Type of group to split into.
+ * \param[in,out] id         Variable to receive the next group id.
+ * \returns  `true` if \p atomIndex starts a new group in the sequence, i.e.,
+ *     if \p *id was changed.
+ *
+ * \p *id should be initialized to `-1` before first call of this function, and
+ * then each atom index in the sequence passed to the function in turn.
+ *
+ * \ingroup module_selection
+ */
+static bool
+next_group_index(int atomIndex, t_topology *top, e_index_t type, int *id)
+{
+    int prev = *id;
+    switch (type)
+    {
+        case INDEX_ATOM:
+            *id = atomIndex;
+            break;
+        case INDEX_RES:
+            *id = top->atoms.atom[atomIndex].resind;
+            break;
+        case INDEX_MOL:
+            if (*id >= 0 && top->mols.index[*id] > atomIndex)
+            {
+                *id = 0;
+            }
+            while (*id < top->mols.nr && atomIndex >= top->mols.index[*id+1])
+            {
+                ++*id;
+            }
+            GMX_ASSERT(*id < top->mols.nr, "Molecules do not span all the atoms");
+            break;
+        case INDEX_UNKNOWN:
+        case INDEX_ALL:
+            *id = 0;
+            break;
+    }
+    return prev != *id;
+}
+
 /*!
  * \param[in,out] t    Output block.
  * \param[in]  top  Topology structure
@@ -724,21 +801,18 @@ gmx_ana_index_merge(gmx_ana_index_t *dest,
  *   (depending on \p type) that is partially contained in the group.
  *   If \p type is not INDEX_RES or INDEX_MOL, this has no effect.
  *
- * \p m should have been initialized somehow (calloc() is enough) unless
- * \p type is INDEX_UNKNOWN.
+ * \p m should have been initialized somehow (calloc() is enough).
  * \p g should be sorted.
  */
 void
 gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
                          e_index_t type, bool bComplete)
 {
-    int      i, j, ai;
-    int      id, cur;
-
     if (type == INDEX_UNKNOWN)
     {
+        sfree(t->a);
+        srenew(t->index, 2);
         t->nr           = 1;
-        snew(t->index, 2);
         t->nalloc_index = 2;
         t->index[0]     = 0;
         t->index[1]     = 0;
@@ -748,6 +822,13 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
         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),
+                       "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");
+
     /* bComplete only does something for INDEX_RES or INDEX_MOL, so turn it
      * off otherwise. */
     if (type != INDEX_RES && type != INDEX_MOL)
@@ -787,36 +868,16 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
         t->nalloc_index = g->isize + 1;
     }
     /* Clear counters */
-    t->nr = 0;
-    j     = 0; /* j is used by residue completion for the first atom not stored */
-    id    = cur = -1;
-    for (i = 0; i < g->isize; ++i)
+    t->nr  = 0;
+    int j  = 0; /* j is used by residue completion for the first atom not stored */
+    int id = -1;
+    for (int i = 0; i < g->isize; ++i)
     {
-        ai = g->index[i];
         /* Find the ID number of the atom/residue/molecule corresponding to
-         * atom ai. */
-        switch (type)
-        {
-            case INDEX_ATOM:
-                id = ai;
-                break;
-            case INDEX_RES:
-                id = top->atoms.atom[ai].resind;
-                break;
-            case INDEX_MOL:
-                while (ai >= top->mols.index[id+1])
-                {
-                    id++;
-                }
-                break;
-            case INDEX_UNKNOWN: /* Should not occur */
-            case INDEX_ALL:
-                id = 0;
-                break;
-        }
-        /* If this is the first atom in a new block, initialize the block. */
-        if (id != cur)
+         * the atom. */
+        if (next_group_index(g->index[i], top, type, &id))
         {
+            /* If this is the first atom in a new block, initialize the block. */
             if (bComplete)
             {
                 /* For completion, we first set the start of the block. */
@@ -844,7 +905,7 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
                         break;
 
                     default: /* Should not be reached */
-                        gmx_bug("internal error");
+                        GMX_RELEASE_ASSERT(false, "Unreachable code was reached");
                         break;
                 }
             }
@@ -853,7 +914,6 @@ gmx_ana_index_make_block(t_blocka *t, t_topology *top, gmx_ana_index_t *g,
                 /* If not using completion, simply store the start of the block. */
                 t->index[t->nr++] = i;
             }
-            cur = id;
         }
     }
     /* Set the end of the last block */
@@ -1085,39 +1145,17 @@ void
 gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
                       t_topology *top, e_index_t type)
 {
-    int      i, ii, mi;
-
     m->type   = type;
     gmx_ana_index_make_block(&m->b, top, g, type, false);
     gmx_ana_indexmap_reserve(m, m->b.nr, m->b.nra);
-    for (i = mi = 0; i < m->b.nr; ++i)
-    {
-        ii = (type == INDEX_UNKNOWN ? 0 : m->b.a[m->b.index[i]]);
-        switch (type)
-        {
-            case INDEX_ATOM:
-                m->orgid[i] = ii;
-                break;
-            case INDEX_RES:
-                m->orgid[i] = top->atoms.atom[ii].resind;
-                break;
-            case INDEX_MOL:
-                while (top->mols.index[mi+1] <= ii)
-                {
-                    ++mi;
-                }
-                m->orgid[i] = mi;
-                break;
-            case INDEX_ALL:
-            case INDEX_UNKNOWN:
-                m->orgid[i] = 0;
-                break;
-        }
-    }
-    for (i = 0; i < m->b.nr; ++i)
+    int id = -1;
+    for (int i = 0; i < m->b.nr; ++i)
     {
+        const int ii = (type == INDEX_UNKNOWN ? 0 : m->b.a[m->b.index[i]]);
+        next_group_index(ii, top, type, &id);
         m->refid[i] = i;
-        m->mapid[i] = m->orgid[i];
+        m->mapid[i] = id;
+        m->orgid[i] = id;
     }
     m->mapb.nr  = m->b.nr;
     m->mapb.nra = m->b.nra;
@@ -1126,6 +1164,57 @@ gmx_ana_indexmap_init(gmx_ana_indexmap_t *m, gmx_ana_index_t *g,
     m->bStatic  = true;
 }
 
+int
+gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, t_topology *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),
+                       "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");
+    // Check that all atoms in each block belong to the same group.
+    // This is a separate loop for better error handling (no state is modified
+    // if there is an error.
+    if (type == INDEX_RES || type == INDEX_MOL)
+    {
+        int id = -1;
+        for (int i = 0; i < m->b.nr; ++i)
+        {
+            const int ii = m->b.a[m->b.index[i]];
+            if (next_group_index(ii, top, type, &id))
+            {
+                for (int j = m->b.index[i] + 1; j < m->b.index[i+1]; ++j)
+                {
+                    if (next_group_index(m->b.a[j], top, type, &id))
+                    {
+                        std::string message("Grouping into residues/molecules is ambiguous");
+                        GMX_THROW(gmx::InconsistentInputError(message));
+                    }
+                }
+            }
+        }
+    }
+    // Do a second loop, where things are actually set.
+    int id    = -1;
+    int group = -1;
+    for (int i = 0; i < m->b.nr; ++i)
+    {
+        const int ii = (type == INDEX_UNKNOWN ? 0 : m->b.a[m->b.index[i]]);
+        if (next_group_index(ii, top, type, &id))
+        {
+            ++group;
+        }
+        m->mapid[i] = group;
+        m->orgid[i] = group;
+    }
+    // Count also the last group.
+    ++group;
+    return group;
+}
+
 /*!
  * \param[in,out] m    Mapping structure to initialize.
  * \param[in]     b    Block information to use for data.
index 9092febb4a8754a628d34f35b4ae79dbcfad72a2..7ec5bd96916b0d2610fcedbe87cd9ab2868b4784 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_SELECTION_INDEXUTIL_H
 #define GMX_SELECTION_INDEXUTIL_H
 
+#include <cstdio>
+
 #include <string>
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/topology/block.h"
+
+struct t_topology;
 
 /** Stores a set of index groups. */
-typedef struct gmx_ana_indexgrps_t gmx_ana_indexgrps_t;
+struct gmx_ana_indexgrps_t;
 
 /*! \brief
  * Specifies the type of index partition or index mapping in several contexts.
@@ -85,7 +90,7 @@ typedef enum
 /*! \brief
  * Stores a single index group.
  */
-typedef struct gmx_ana_index_t
+struct gmx_ana_index_t
 {
     /** Number of atoms. */
     int                 isize;
@@ -93,12 +98,12 @@ typedef struct gmx_ana_index_t
     atom_id            *index;
     /** Number of items allocated for \p index. */
     int                 nalloc_index;
-} gmx_ana_index_t;
+};
 
 /*! \brief
  * Data structure for calculating index group mappings.
  */
-typedef struct gmx_ana_indexmap_t
+struct gmx_ana_indexmap_t
 {
     /** Type of the mapping. */
     e_index_t           type;
@@ -117,10 +122,10 @@ typedef struct gmx_ana_indexmap_t
     /*! \brief
      * Current mapped IDs.
      *
-     * This array provides an arbitrary mapping from the current index group
-     * to the original index group. Instead of a zero-based mapping, the
-     * values from the \p orgid array are used. That is,
-     * \c mapid[i]=orgid[refid[i]].
+     * This array provides IDs for the current index group.  Instead of a
+     * zero-based mapping that \p refid provides, the values from the \p orgid
+     * array are used, thus allowing the mapping to be customized.
+     * In other words, `mapid[i] = orgid[refid[i]]`.
      * If \p bMaskOnly is provided to gmx_ana_indexmap_update(), this array
      * equals \p orgid.
      */
@@ -134,17 +139,18 @@ typedef struct gmx_ana_indexmap_t
     t_blocka            mapb;
 
     /*! \brief
-     * Arbitrary ID numbers for the blocks.
+     * Customizable ID numbers for the original blocks.
      *
-     * This array has \p b.nr elements, each defining an ID number for a
-     * block in \p b.
+     * This array has \p b.nr elements, each defining an original ID number for
+     * a block in \p b (i.e., in the original group passed to
+     * gmx_ana_indexmap_init()).
      * These are initialized in gmx_ana_indexmap_init() based on the type:
      *  - \ref INDEX_ATOM : the atom indices
-     *  - \ref INDEX_RES :  the residue numbers
-     *  - \ref INDEX_MOL :  the molecule numbers
+     *  - \ref INDEX_RES :  the residue indices
+     *  - \ref INDEX_MOL :  the molecule indices
      *
      * All the above numbers are zero-based.
-     * After gmx_ana_indexmap_init(), the user is free to change these values
+     * After gmx_ana_indexmap_init(), the caller is free to change these values
      * if the above are not appropriate.
      * The mapped values can be read through \p mapid.
      */
@@ -168,7 +174,7 @@ typedef struct gmx_ana_indexmap_t
      * actually static.
      */
     bool                bStatic;
-} gmx_ana_indexmap_t;
+};
 
 
 /*! \name Functions for handling gmx_ana_indexgrps_t
@@ -231,9 +237,27 @@ gmx_ana_index_copy(gmx_ana_index_t *dest, gmx_ana_index_t *src, bool bAlloc);
 void
 gmx_ana_index_dump(FILE *fp, gmx_ana_index_t *g, int maxn);
 
+/*! \brief
+ * Returns maximum atom index that appears in an index group.
+ *
+ * \param[in]  g      Index group to query.
+ * \returns    Largest atom index that appears in \p g, or zero if \p g is empty.
+ */
+int
+gmx_ana_index_get_max_index(gmx_ana_index_t *g);
 /** Checks whether an index group is sorted. */
 bool
 gmx_ana_index_check_sorted(gmx_ana_index_t *g);
+/*! \brief
+ * Checks whether an index group has atoms from a defined range.
+ *
+ * \param[in]  g      Index group to check.
+ * \param[in]  natoms Largest atom number allowed.
+ * \returns    true if all atoms in the index group are in the
+ *     range 0 to \p natoms (i.e., no atoms over \p natoms are referenced).
+ */
+bool
+gmx_ana_index_check_range(gmx_ana_index_t *g, int natoms);
 /*@}*/
 
 /*! \name Functions for set operations on gmx_ana_index_t
@@ -301,6 +325,33 @@ 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);
+/*! \brief
+ * Initializes `orgid` entries based on topology grouping.
+ *
+ * \param[in,out] m     Mapping structure to use/initialize.
+ * \param[in]     top   Topology structure
+ *     (can be NULL if not required for \p type).
+ * \param[in]     type  Type of groups to use.
+ * \returns  The number of groups of type \p type that were present in \p m.
+ * \throws   InconsistentInputError if the blocks in \p m do not have a unique
+ *     group (e.g., contain atoms from multiple residues with `type == INDEX_RES`).
+ *
+ * By default, the gmx_ana_indexmap_t::orgid fields are initialized to
+ * atom/residue/molecule indices from the topology (see documentation for the
+ * struct for more details).
+ * This function can be used to set the field to a zero-based group index
+ * instead.  The first block will always get `orgid[0] = 0`, and all following
+ * blocks that belong to the same residue/molecule (\p type) will get the same
+ * index.  Each time a block does not belong to the same group, it will get the
+ * next available number.
+ * If `type == INDEX_ATOM`, the `orgid` field is initialized as 0, 1, ...,
+ * independent of whether the blocks are single atoms or not.
+ *
+ * Strong exception safety guarantee.
+ */
+int
+gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, t_topology *top,
+                                  e_index_t type);
 /** Sets an index group mapping to be static. */
 void
 gmx_ana_indexmap_set_static(gmx_ana_indexmap_t *m, t_blocka *b);
index c6b3affa91ac404be4a4a387264e3dba26cec9c0..eb503a7e7e9d4350fc817b200e758a9445edd8c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -78,15 +78,28 @@ _gmx_selelem_set_kwstr_match_type(const gmx::SelectionTreeElementPointer &sel,
                                   gmx::SelectionStringMatchType           matchType);
 
 /** Does custom processing for parameters of the \c same selection method. */
-int
+void
 _gmx_selelem_custom_init_same(struct gmx_ana_selmethod_t                    **method,
                               const gmx::SelectionParserParameterListPointer &params,
                               void                                           *scanner);
 
-/** Initializes a selection element for evaluating a keyword in a given group. */
+/*! \brief
+ * Initializes a selection element for evaluating a keyword in a given group.
+ *
+ * \param[in]   method  Keyword selection method to evaluate.
+ * \param[in]   child   The group/positions to evaluate \p method in.
+ * \param[in]   scanner Scanner data structure.
+ * \returns     Pointer to the created selection element.
+ *
+ * Creates a \ref SEL_EXPRESSION selection element that evaluates the keyword
+ * method given by \p method in the group/positions given by \p child.
+ *
+ * \p child should be a selection tree that evaluates to \ref GROUP_VALUE or
+ * \ref POS_VALUE.
+ */
 gmx::SelectionTreeElementPointer
 _gmx_sel_init_keyword_evaluator(struct gmx_ana_selmethod_t              *method,
-                                const gmx::SelectionParserParameterList &params,
+                                const gmx::SelectionTreeElementPointer  &child,
                                 void                                    *scanner);
 
 #endif
index 177ff0f77bd7ab7993d622992e7dbff89d1fee1a..675932440febc6ce87158d6791ae37dd609570c9 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "mempool.h"
+
 #include <stdlib.h>
 
 #include <new>
@@ -48,8 +52,6 @@
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "mempool.h"
-
 //! Alignment in bytes for all returned blocks.
 #define ALIGN_STEP 8
 
index 352ed5fab6aef921ea3801cfe2b5db147a659c77..d131eb9d068e544425a9acc8f9d0b58efa52b35f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,6 +47,8 @@
 #ifndef GMX_SELECTION_MEMPOOL_H
 #define GMX_SELECTION_MEMPOOL_H
 
+#include <cstddef>
+
 struct gmx_ana_index_t;
 
 /** Opaque struct for memory pooling. */
index 599d4218812acaea132c5fb533d554e65633a307..8d808900fc69c9eb6dee895855ec218fd8f12e89 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,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.
  *
  * \todo
  * The grid implementation could still be optimized in several different ways:
- *   - Triclinic grid cells are not the most efficient shape, but make PBC
- *     handling easier.
- *   - Precalculating the required PBC shift for a pair of cells outside the
- *     inner loop. After this is done, it should be quite straightforward to
- *     move to rectangular cells.
  *   - 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
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/selection/nbsearch.h"
+#include "gmxpre.h"
 
-#include <math.h>
+#include "nbsearch.h"
+
+#include <cmath>
+#include <cstring>
 
 #include <algorithm>
 #include <vector>
 
 #include "thread_mpi/mutex.h"
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
-
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/position.h"
+#include "gromacs/topology/block.h"
 #include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 namespace gmx
 {
 
+namespace
+{
+
+/*! \brief
+ * Computes the bounding box for a set of positions.
+ *
+ * \param[in]  posCount Number of positions in \p x.
+ * \param[in]  x        Positions to compute the bounding box for.
+ * \param[out] origin   Origin of the bounding box.
+ * \param[out] size     Size of the bounding box.
+ */
+void computeBoundingBox(int posCount, const rvec x[], rvec origin, rvec size)
+{
+    rvec maxBound;
+    copy_rvec(x[0], origin);
+    copy_rvec(x[0], maxBound);
+    for (int i = 1; i < posCount; ++i)
+    {
+        for (int d = 0; d < DIM; ++d)
+        {
+            if (origin[d] > x[i][d])
+            {
+                origin[d] = x[i][d];
+            }
+            if (maxBound[d] < x[i][d])
+            {
+                maxBound[d] = x[i][d];
+            }
+        }
+    }
+    rvec_sub(maxBound, origin, size);
+}
+
+}   // namespace
+
 namespace internal
 {
 
@@ -97,11 +131,15 @@ class AnalysisNeighborhoodSearchImpl
         /*! \brief
          * Initializes the search with a given box and reference positions.
          *
-         * \param[in]     mode      Search mode to use.
-         * \param[in]     pbc       PBC information.
-         * \param[in]     positions Set of reference positions.
+         * \param[in] mode            Search mode to use.
+         * \param[in] bXY             Whether to use 2D searching.
+         * \param[in] excls           Exclusions.
+         * \param[in] pbc             PBC information.
+         * \param[in] positions       Set of reference positions.
          */
         void init(AnalysisNeighborhood::SearchMode     mode,
+                  bool                                 bXY,
+                  const t_blocka                      *excls,
                   const t_pbc                         *pbc,
                   const AnalysisNeighborhoodPositions &positions);
         PairSearchImplPointer getPairSearch();
@@ -110,45 +148,108 @@ class AnalysisNeighborhoodSearchImpl
         bool usesGridSearch() const { return bGrid_; }
 
     private:
-        //! Calculates offsets to neighboring grid cells that should be considered.
-        void initGridCellNeighborList();
+        /*! \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.
          *
-         * \param[in]     pbc  Information about the box.
-         * \returns  false if grid search is not suitable.
+         * \param[in] box          Box vectors (should not have zero vectors).
+         * \param[in] bSingleCell  If `true`, the corresponding dimension will
+         *     be forced to use a single cell.
+         * \param[in] posCount     Number of positions that will be put on the
+         *     grid.
+         * \returns   `false` if grid search is not suitable.
          */
-        bool initGridCells(const t_pbc *pbc);
+        bool initGridCells(const matrix box, bool bSingleCell[DIM],
+                           int posCount);
         /*! \brief
          * Sets ua a search grid for a given box.
          *
-         * \param[in]     pbc  Information about the box.
-         * \returns  false if grid search is not suitable.
+         * \param[in] pbc      Information about the box.
+         * \param[in] posCount Number of positions in \p x.
+         * \param[in] x        Reference positions that will be put on the grid.
+         * \param[in] bForce   If `true`, grid searching will be used if at all
+         *     possible, even if a simple search might give better performance.
+         * \returns   `false` if grid search is not suitable.
          */
-        bool initGrid(const t_pbc *pbc);
+        bool initGrid(const t_pbc &pbc, int posCount, const rvec x[], bool bForce);
         /*! \brief
          * Maps a point into a grid cell.
          *
          * \param[in]  x    Point to map.
-         * \param[out] cell Indices of the grid cell in which \p x lies.
-         * \param[out] xout Coordinates to use
-         *     (will be within the triclinic unit cell).
+         * \param[out] cell Fractional cell coordinates of \p x on the grid.
+         * \param[out] xout Coordinates to use.
+         *
+         * \p xout will be within the rectangular unit cell in dimensions where
+         * the grid is periodic.  For other dimensions, both \p xout and
+         * \p cell can be outside the grid/unit cell.
          */
-        void mapPointToGridCell(const rvec x, ivec cell, rvec xout) const;
+        void mapPointToGridCell(const rvec x, rvec cell, rvec xout) const;
         /*! \brief
          * Calculates linear index of a grid cell.
          *
-         * \param[in]  cell Cell indices.
+         * \param[in]  cell Cell indices (must be within the grid).
          * \returns    Linear index of \p cell.
          */
         int getGridCellIndex(const ivec cell) const;
         /*! \brief
          * Adds an index into a grid cell.
          *
-         * \param[in]     cell Cell into which \p i should be added.
-         * \param[in]     i    Index to add.
+         * \param[in]  cell Fractional cell coordinates into which \p i should
+         *     be added.
+         * \param[in]  i    Index to add.
+         *
+         * \p cell should satisfy the conditions that \p mapPointToGridCell()
+         * produces.
+         */
+        void addToGridCell(const rvec cell, int i);
+        /*! \brief
+         * Initializes a cell pair loop for a dimension.
+         *
+         * \param[in]     centerCell Fractional cell coordiates of the particle
+         *     for which pairs are being searched.
+         * \param[in,out] cell       Current/initial cell to loop over.
+         * \param[in,out] upperBound Last cell to loop over.
+         * \param[in]     dim        Dimension to initialize in this call.
+         *
+         * Initializes `cell[dim]` and `upperBound[dim]` for looping over
+         * neighbors of a particle at position given by \p centerCell.
+         * If 'dim != ZZ`, `cell[d]` (`d > dim`) set the plane/row of cells
+         * for which the loop is initialized.  The loop should then go from
+         * `cell[dim]` until `upperBound[dim]`, inclusive.
+         * `cell[d]` with `d < dim` or `upperBound[d]` with `d != dim` are not
+         * modified by this function.
+         *
+         * `cell` and `upperBound` may be outside the grid for periodic
+         * dimensions and need to be shifted separately: to simplify the
+         * looping, the range is always (roughly) symmetric around the value in
+         * `centerCell`.
          */
-        void addToGridCell(const ivec cell, int i);
+        void initCellRange(const rvec centerCell, ivec cell,
+                           ivec upperBound, int dim) const;
+        /*! \brief
+         * Advances cell pair loop to the next cell.
+         *
+         * \param[in]     centerCell Fractional cell coordiates of the particle
+         *     for which pairs are being searched.
+         * \param[in,out] cell       Current (in)/next (out) cell in the loop.
+         * \param[in,out] upperBound Last cell in the loop for each dimension.
+         */
+        bool nextCell(const rvec centerCell, ivec cell, ivec upperBound) const;
+        /*! \brief
+         * Calculates the index and shift of a grid cell during looping.
+         *
+         * \param[in]  cell       Unshifted cell index.
+         * \param[out] shift      Shift to apply to get the periodic distance
+         *     for distances between the cells.
+         * \returns    Grid cell index corresponding to `cell`.
+         */
+        int shiftCell(const ivec cell, rvec shift) const;
 
         //! Whether to try grid searching.
         bool                    bTryGrid_;
@@ -156,43 +257,55 @@ class AnalysisNeighborhoodSearchImpl
         real                    cutoff_;
         //! The cutoff squared.
         real                    cutoff2_;
+        //! Whether to do searching in XY plane only.
+        bool                    bXY_;
 
         //! Number of reference points for the current frame.
         int                     nref_;
         //! Reference point positions.
         const rvec             *xref_;
-        //! Reference position ids (NULL if not available).
-        const int              *refid_;
+        //! Reference position exclusion IDs.
+        const int              *refExclusionIds_;
+        //! Reference position indices (NULL if no indices).
+        const int              *refIndices_;
+        //! Exclusions.
+        const t_blocka         *excls_;
         //! PBC data.
-        t_pbc                  *pbc_;
-
-        //! Number of excluded reference positions for current test particle.
-        int                     nexcl_;
-        //! Exclusions for current test particle.
-        int                    *excl_;
+        t_pbc                   pbc_;
 
         //! Whether grid searching is actually used for the current positions.
         bool                    bGrid_;
-        //! Array allocated for storing in-unit-cell reference positions.
-        rvec                   *xref_alloc_;
-        //! Allocation count for xref_alloc.
-        int                     xref_nalloc_;
         //! false if the box is rectangular.
         bool                    bTric_;
-        //! Box vectors of a single grid cell.
-        matrix                  cellbox_;
-        //! The reciprocal cell vectors as columns; the inverse of \p cellbox.
-        matrix                  recipcell_;
+        //! Whether the grid is periodic in a dimension.
+        bool                    bGridPBC_[DIM];
+        //! Array for storing in-unit-cell reference positions.
+        std::vector<RVec>       xrefAlloc_;
+        //! Origin of the grid (zero for periodic dimensions).
+        rvec                    gridOrigin_;
+        //! Size of a single grid cell.
+        rvec                    cellSize_;
+        //! Inverse of \p cellSize_. Zero for dimensions where grid is not used.
+        rvec                    invCellSize_;
+        /*! \brief
+         * Shift in cell coordinates (for triclinic boxes) in X when crossing
+         * the Z periodic boundary.
+         */
+        real                    cellShiftZX_;
+        /*! \brief
+         * Shift in cell coordinates (for triclinic boxes) in Y when crossing
+         * the Z periodic boundary.
+         */
+        real                    cellShiftZY_;
+        /*! \brief
+         * Shift in cell coordinates (for triclinic boxes) in X when crossing
+         * the Y periodic boundary.
+         */
+        real                    cellShiftYX_;
         //! Number of cells along each dimension.
         ivec                    ncelldim_;
         //! Data structure to hold the grid cell contents.
         CellList                cells_;
-        //! Number of neighboring cells to consider.
-        int                     ngridnb_;
-        //! Offsets of the neighboring cells to consider.
-        ivec                   *gnboffs_;
-        //! Allocation count for \p gnboffs.
-        int                     gnboffs_nalloc_;
 
         tMPI::mutex             createPairSearchMutex_;
         PairSearchList          pairSearchList_;
@@ -208,8 +321,16 @@ class AnalysisNeighborhoodPairSearchImpl
         explicit AnalysisNeighborhoodPairSearchImpl(const AnalysisNeighborhoodSearchImpl &search)
             : search_(search)
         {
+            testPosCount_     = 0;
+            testPositions_    = NULL;
+            testExclusionIds_ = NULL;
+            testIndices_      = NULL;
+            nexcl_            = 0;
+            excl_             = NULL;
             clear_rvec(xtest_);
-            clear_ivec(testcell_);
+            clear_rvec(testcell_);
+            clear_ivec(currCell_);
+            clear_ivec(cellBound_);
             reset(-1);
         }
 
@@ -231,20 +352,36 @@ class AnalysisNeighborhoodPairSearchImpl
 
         //! Parent search object.
         const AnalysisNeighborhoodSearchImpl   &search_;
+        //! Number of test positions.
+        int                                     testPosCount_;
         //! Reference to the test positions.
-        ConstArrayRef<rvec>                     testPositions_;
+        const rvec                             *testPositions_;
+        //! Reference to the test exclusion indices.
+        const int                              *testExclusionIds_;
+        //! Reference to the test position indices.
+        const int                              *testIndices_;
+        //! Number of excluded reference positions for current test particle.
+        int                                     nexcl_;
+        //! Exclusions for current test particle.
+        const int                              *excl_;
         //! Index of the currently active test position in \p testPositions_.
         int                                     testIndex_;
         //! Stores test position during a pair loop.
         rvec                                    xtest_;
         //! Stores the previous returned position during a pair loop.
         int                                     previ_;
+        //! Stores the pair distance corresponding to previ_;
+        real                                    prevr2_;
+        //! Stores the shortest distance vector corresponding to previ_;
+        rvec                                    prevdx_;
         //! Stores the current exclusion index during loops.
         int                                     exclind_;
-        //! Stores the test particle cell index during loops.
-        ivec                                    testcell_;
-        //! Stores the current cell neighbor index during pair loops.
-        int                                     prevnbi_;
+        //! Stores the fractional test particle cell location during loops.
+        rvec                                    testcell_;
+        //! Stores the current cell during pair loops.
+        ivec                                    currCell_;
+        //! Stores the current loop upper bounds for each dimension during pair loops.
+        ivec                                    cellBound_;
         //! Stores the index within the current cell during pair loops.
         int                                     prevcai_;
 
@@ -261,31 +398,30 @@ AnalysisNeighborhoodSearchImpl::AnalysisNeighborhoodSearchImpl(real cutoff)
     cutoff_         = cutoff;
     if (cutoff_ <= 0)
     {
-        cutoff_     = GMX_REAL_MAX;
+        cutoff_     = cutoff2_ = GMX_REAL_MAX;
         bTryGrid_   = false;
     }
-    cutoff2_        = sqr(cutoff_);
-
-    nref_           = 0;
-    xref_           = NULL;
-    refid_          = NULL;
-    pbc_            = NULL;
-
-    nexcl_          = 0;
-    excl_           = NULL;
+    else
+    {
+        cutoff2_        = sqr(cutoff_);
+    }
+    bXY_             = false;
+    nref_            = 0;
+    xref_            = NULL;
+    refExclusionIds_ = NULL;
+    refIndices_      = NULL;
+    std::memset(&pbc_, 0, sizeof(pbc_));
 
     bGrid_          = false;
-
-    xref_alloc_     = NULL;
-    xref_nalloc_    = 0;
     bTric_          = false;
-    clear_mat(cellbox_);
-    clear_mat(recipcell_);
-    clear_ivec(ncelldim_);
+    bGridPBC_[XX]   = true;
+    bGridPBC_[YY]   = true;
+    bGridPBC_[ZZ]   = true;
 
-    ngridnb_        = 0;
-    gnboffs_        = NULL;
-    gnboffs_nalloc_ = 0;
+    clear_rvec(gridOrigin_);
+    clear_rvec(cellSize_);
+    clear_rvec(invCellSize_);
+    clear_ivec(ncelldim_);
 }
 
 AnalysisNeighborhoodSearchImpl::~AnalysisNeighborhoodSearchImpl()
@@ -296,8 +432,6 @@ AnalysisNeighborhoodSearchImpl::~AnalysisNeighborhoodSearchImpl()
         GMX_RELEASE_ASSERT(i->unique(),
                            "Dangling AnalysisNeighborhoodPairSearch reference");
     }
-    sfree(xref_alloc_);
-    sfree(gnboffs_);
 }
 
 AnalysisNeighborhoodSearchImpl::PairSearchImplPointer
@@ -319,154 +453,258 @@ AnalysisNeighborhoodSearchImpl::getPairSearch()
     return pairSearch;
 }
 
-void AnalysisNeighborhoodSearchImpl::initGridCellNeighborList()
+bool AnalysisNeighborhoodSearchImpl::checkGridSearchEfficiency(bool bForce)
 {
-    int   maxx, maxy, maxz;
-    real  rvnorm;
-
-    /* Find the extent of the sphere in triclinic coordinates */
-    maxz   = static_cast<int>(cutoff_ * recipcell_[ZZ][ZZ]) + 1;
-    rvnorm = sqrt(sqr(recipcell_[YY][YY]) + sqr(recipcell_[ZZ][YY]));
-    maxy   = static_cast<int>(cutoff_ * rvnorm) + 1;
-    rvnorm = sqrt(sqr(recipcell_[XX][XX]) + sqr(recipcell_[YY][XX])
-                  + sqr(recipcell_[ZZ][XX]));
-    maxx   = static_cast<int>(cutoff_ * rvnorm) + 1;
-
-    /* Calculate the number of cells and reallocate if necessary */
-    ngridnb_ = (2 * maxx + 1) * (2 * maxy + 1) * (2 * maxz + 1);
-    if (gnboffs_nalloc_ < ngridnb_)
+    // Find the extent of the sphere in cells.
+    ivec  range;
+    for (int dd = 0; dd < DIM; ++dd)
     {
-        gnboffs_nalloc_ = ngridnb_;
-        srenew(gnboffs_, gnboffs_nalloc_);
+        range[dd] = static_cast<int>(ceil(cutoff_ * invCellSize_[dd]));
     }
 
-    /* Store the whole cube */
-    /* TODO: Prune off corners that are not needed */
-    int i = 0;
-    for (int x = -maxx; x <= maxx; ++x)
+    // 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)
     {
-        for (int y = -maxy; y <= maxy; ++y)
+        const int cellCount    = ncelldim_[dd];
+        const int coveredCount = 2 * range[dd] + 1;
+        if (bGridPBC_[dd])
         {
-            for (int z = -maxz; z <= maxz; ++z)
+            if (coveredCount > cellCount)
             {
-                gnboffs_[i][XX] = x;
-                gnboffs_[i][YY] = y;
-                gnboffs_[i][ZZ] = z;
-                ++i;
+                // 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 t_pbc *pbc)
+bool AnalysisNeighborhoodSearchImpl::initGridCells(
+        const matrix box, bool bSingleCell[DIM], int posCount)
 {
-    const real targetsize =
-        pow(pbc->box[XX][XX] * pbc->box[YY][YY] * pbc->box[ZZ][ZZ]
-            * 10 / nref_, static_cast<real>(1./3.));
+    // Determine the size of cubes where there are on average 10 positions.
+    // The loop takes care of cases where some of the box edges are shorter
+    // than the the desired cube size; in such cases, a single grid cell is
+    // used in these dimensions, and the cube size is determined only from the
+    // larger box vectors.  Such boxes should be rare, but the bounding box
+    // approach can result in very flat boxes with certain types of selections
+    // (e.g., for interfacial systems or for small number of atoms).
+    real targetsize   = 0.0;
+    int  prevDimCount = 4;
+    while (true)
+    {
+        real volume   = 1.0;
+        int  dimCount = 3;
+        for (int dd = 0; dd < DIM; ++dd)
+        {
+            const real boxSize = box[dd][dd];
+            if (boxSize < targetsize)
+            {
+                bSingleCell[dd] = true;
+                if (bGridPBC_[dd])
+                {
+                    return false;
+                }
+            }
+            if (bSingleCell[dd])
+            {
+                --dimCount;
+            }
+            else
+            {
+                volume *= boxSize;
+            }
+        }
+        if (dimCount == 0 || dimCount == prevDimCount)
+        {
+            break;
+        }
+        targetsize   = pow(volume * 10 / posCount, static_cast<real>(1./dimCount));
+        prevDimCount = dimCount;
+    }
 
-    int cellCount = 1;
+    int totalCellCount = 1;
     for (int dd = 0; dd < DIM; ++dd)
     {
-        ncelldim_[dd] = static_cast<int>(pbc->box[dd][dd] / targetsize);
-        cellCount    *= ncelldim_[dd];
-        if (ncelldim_[dd] < 3)
+        int cellCount;
+        if (bSingleCell[dd])
         {
-            return false;
+            cellCount = 1;
+        }
+        else
+        {
+            cellCount = std::max(1, static_cast<int>(box[dd][dd] / targetsize));
+            if (bGridPBC_[dd] && cellCount < 3)
+            {
+                return false;
+            }
         }
+        totalCellCount *= cellCount;
+        ncelldim_[dd]   = cellCount;
+    }
+    if (totalCellCount <= 3)
+    {
+        return false;
     }
     // Never decrease the size of the cell vector to avoid reallocating
     // memory for the nested vectors.  The actual size of the vector is not
     // used outside this function.
-    if (cells_.size() < static_cast<size_t>(cellCount))
+    if (cells_.size() < static_cast<size_t>(totalCellCount))
     {
-        cells_.resize(cellCount);
+        cells_.resize(totalCellCount);
     }
-    for (int ci = 0; ci < cellCount; ++ci)
+    for (int ci = 0; ci < totalCellCount; ++ci)
     {
         cells_[ci].clear();
     }
     return true;
 }
 
-bool AnalysisNeighborhoodSearchImpl::initGrid(const t_pbc *pbc)
+bool AnalysisNeighborhoodSearchImpl::initGrid(
+        const t_pbc &pbc, int posCount, const rvec x[], bool bForce)
 {
-    /* TODO: This check could be improved. */
-    if (0.5*pbc->max_cutoff2 < cutoff2_)
+    if (posCount == 0)
     {
         return false;
     }
 
-    if (!initGridCells(pbc))
+    switch (pbc.ePBC)
     {
-        return false;
+        case epbcNONE:
+            bGridPBC_[XX] = false;
+            bGridPBC_[YY] = false;
+            bGridPBC_[ZZ] = false;
+            break;
+        case epbcXY:
+            bGridPBC_[XX] = true;
+            bGridPBC_[YY] = true;
+            bGridPBC_[ZZ] = false;
+            break;
+        case epbcXYZ:
+            bGridPBC_[XX] = true;
+            bGridPBC_[YY] = true;
+            bGridPBC_[ZZ] = true;
+            break;
+        default:
+            // Grid searching not supported for now with screw.
+            return false;
     }
 
-    bTric_ = TRICLINIC(pbc->box);
-    if (bTric_)
+    bool   bSingleCell[DIM] = {false, false, bXY_};
+    matrix box;
+    copy_mat(pbc.box, box);
+    // TODO: In principle, we could use the bounding box for periodic
+    // dimensions as well if the bounding box is sufficiently far from the box
+    // edges.
+    rvec   origin, boundingBoxSize;
+    computeBoundingBox(posCount, x, origin, boundingBoxSize);
+    clear_rvec(gridOrigin_);
+    for (int dd = 0; dd < DIM; ++dd)
     {
-        for (int dd = 0; dd < DIM; ++dd)
+        if (!bGridPBC_[dd] && !bSingleCell[dd])
         {
-            svmul(1.0 / ncelldim_[dd], pbc->box[dd], cellbox_[dd]);
+            gridOrigin_[dd] = origin[dd];
+            clear_rvec(box[dd]);
+            box[dd][dd] = boundingBoxSize[dd];
+        }
+        // TODO: In case the zero vector comes from the bounding box, this does
+        // not lead to a very efficient grid search, but that should be rare.
+        if (box[dd][dd] <= 0.0)
+        {
+            GMX_ASSERT(!bGridPBC_[dd], "Periodic box vector is zero");
+            bSingleCell[dd] = true;
+            clear_rvec(box[dd]);
+            box[dd][dd] = 1.0;
         }
-        m_inv_ur0(cellbox_, recipcell_);
     }
-    else
+
+    if (!initGridCells(box, bSingleCell, posCount))
     {
-        for (int dd = 0; dd < DIM; ++dd)
+        return false;
+    }
+
+    bTric_ = TRICLINIC(pbc.box);
+    for (int dd = 0; dd < DIM; ++dd)
+    {
+        cellSize_[dd] = box[dd][dd] / ncelldim_[dd];
+        if (bSingleCell[dd])
+        {
+            invCellSize_[dd] = 0.0;
+        }
+        else
         {
-            cellbox_[dd][dd]   = pbc->box[dd][dd] / ncelldim_[dd];
-            recipcell_[dd][dd] = 1.0 / cellbox_[dd][dd];
+            invCellSize_[dd] = 1.0 / cellSize_[dd];
         }
     }
-    initGridCellNeighborList();
-    return true;
+    if (bTric_)
+    {
+        cellShiftZY_ = box[ZZ][YY] * invCellSize_[YY];
+        cellShiftZX_ = box[ZZ][XX] * invCellSize_[XX];
+        cellShiftYX_ = box[YY][XX] * invCellSize_[XX];
+    }
+    return checkGridSearchEfficiency(bForce);
 }
 
 void AnalysisNeighborhoodSearchImpl::mapPointToGridCell(const rvec x,
-                                                        ivec       cell,
+                                                        rvec       cell,
                                                         rvec       xout) const
 {
     rvec xtmp;
-    copy_rvec(x, xtmp);
-    if (bTric_)
-    {
-        rvec tx;
-        tmvmul_ur0(recipcell_, xtmp, tx);
-        for (int dd = 0; dd < DIM; ++dd)
-        {
-            const int cellCount = ncelldim_[dd];
-            int       cellIndex = static_cast<int>(floor(tx[dd]));
-            while (cellIndex < 0)
-            {
-                cellIndex += cellCount;
-                rvec_add(xtmp, pbc_->box[dd], xtmp);
-            }
-            while (cellIndex >= cellCount)
-            {
-                cellIndex -= cellCount;
-                rvec_sub(xtmp, pbc_->box[dd], xtmp);
-            }
-            cell[dd] = cellIndex;
-        }
-    }
-    else
+    rvec_sub(x, gridOrigin_, xtmp);
+    // The reverse order is necessary for triclinic cells: shifting in Z may
+    // modify also X and Y, and shifting in Y may modify X, so the mapping to
+    // a rectangular grid needs to be done in this order.
+    for (int dd = DIM - 1; dd >= 0; --dd)
     {
-        for (int dd = 0; dd < DIM; ++dd)
+        real cellIndex = xtmp[dd] * invCellSize_[dd];
+        if (bGridPBC_[dd])
         {
-            const int cellCount = ncelldim_[dd];
-            int       cellIndex = static_cast<int>(floor(xtmp[dd] * recipcell_[dd][dd]));
+            const real cellCount = ncelldim_[dd];
             while (cellIndex < 0)
             {
                 cellIndex += cellCount;
-                xtmp[dd]  += pbc_->box[dd][dd];
+                rvec_inc(xtmp, pbc_.box[dd]);
             }
             while (cellIndex >= cellCount)
             {
                 cellIndex -= cellCount;
-                xtmp[dd]  -= pbc_->box[dd][dd];
+                rvec_dec(xtmp, pbc_.box[dd]);
             }
-            cell[dd] = cellIndex;
         }
+        cell[dd] = cellIndex;
     }
     copy_rvec(xtmp, xout);
 }
@@ -483,76 +721,243 @@ int AnalysisNeighborhoodSearchImpl::getGridCellIndex(const ivec cell) const
            + cell[ZZ] * ncelldim_[XX] * ncelldim_[YY];
 }
 
-void AnalysisNeighborhoodSearchImpl::addToGridCell(const ivec cell, int i)
+void AnalysisNeighborhoodSearchImpl::addToGridCell(const rvec cell, int i)
 {
-    const int ci = getGridCellIndex(cell);
+    ivec icell;
+    for (int dd = 0; dd < DIM; ++dd)
+    {
+        int cellIndex = static_cast<int>(floor(cell[dd]));
+        if (!bGridPBC_[dd])
+        {
+            const int cellCount = ncelldim_[dd];
+            if (cellIndex < 0)
+            {
+                cellIndex = 0;
+            }
+            else if (cellIndex >= cellCount)
+            {
+                cellIndex = cellCount - 1;
+            }
+        }
+        icell[dd] = cellIndex;
+    }
+    const int ci = getGridCellIndex(icell);
     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;
+    if (bTric_)
+    {
+        switch (dim)
+        {
+            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;
+        }
+    }
+    // For non-periodic dimensions, clamp to the actual grid edges.
+    if (!bGridPBC_[dim])
+    {
+        // If endOffset < 0 or startOffset > N, these may cause the whole
+        // test position/grid plane/grid row to be skipped.
+        if (startOffset < 0)
+        {
+            startOffset = 0;
+        }
+        const int cellCount = ncelldim_[dim];
+        if (endOffset > cellCount - 1)
+        {
+            endOffset = cellCount - 1;
+        }
+    }
+    currCell[dim]   = static_cast<int>(floor(startOffset));
+    upperBound[dim] = static_cast<int>(floor(endOffset));
+}
+
+bool AnalysisNeighborhoodSearchImpl::nextCell(
+        const rvec centerCell, ivec cell, ivec upperBound) const
+{
+    int dim = 0;
+    while (dim < DIM)
+    {
+next:
+        ++cell[dim];
+        if (cell[dim] > upperBound[dim])
+        {
+            ++dim;
+            continue;
+        }
+        for (int d = dim - 1; d >= 0; --d)
+        {
+            initCellRange(centerCell, cell, upperBound, d);
+            if (cell[d] > upperBound[d])
+            {
+                dim = d + 1;
+                goto next;
+            }
+        }
+        return true;
+    }
+    return false;
+}
+
+int AnalysisNeighborhoodSearchImpl::shiftCell(const ivec cell, rvec shift) const
+{
+    ivec shiftedCell;
+    copy_ivec(cell, shiftedCell);
+
+    clear_rvec(shift);
+    for (int d = 0; d < DIM; ++d)
+    {
+        const int cellCount = ncelldim_[d];
+        if (bGridPBC_[d])
+        {
+            // A single shift may not be sufficient if the cell must be shifted
+            // in more than one dimension, although for each individual
+            // dimension it would be.
+            while (shiftedCell[d] < 0)
+            {
+                shiftedCell[d] += cellCount;
+                rvec_inc(shift, pbc_.box[d]);
+            }
+            while (shiftedCell[d] >= cellCount)
+            {
+                shiftedCell[d] -= cellCount;
+                rvec_dec(shift, pbc_.box[d]);
+            }
+        }
+    }
+
+    return getGridCellIndex(shiftedCell);
+}
+
 void AnalysisNeighborhoodSearchImpl::init(
         AnalysisNeighborhood::SearchMode     mode,
+        bool                                 bXY,
+        const t_blocka                      *excls,
         const t_pbc                         *pbc,
         const AnalysisNeighborhoodPositions &positions)
 {
     GMX_RELEASE_ASSERT(positions.index_ == -1,
                        "Individual indexed positions not supported as reference");
-    pbc_  = const_cast<t_pbc *>(pbc);
+    bXY_ = bXY;
+    if (bXY_ && pbc != NULL && pbc->ePBC != epbcNONE)
+    {
+        if (pbc->ePBC != epbcXY && pbc->ePBC != epbcXYZ)
+        {
+            std::string message =
+                formatString("Computations in the XY plane are not supported with PBC type '%s'",
+                             EPBC(pbc->ePBC));
+            GMX_THROW(NotImplementedError(message));
+        }
+        if (pbc->ePBC == epbcXYZ &&
+            (std::fabs(pbc->box[ZZ][XX]) > GMX_REAL_EPS*pbc->box[ZZ][ZZ] ||
+             std::fabs(pbc->box[ZZ][YY]) > GMX_REAL_EPS*pbc->box[ZZ][ZZ]))
+        {
+            GMX_THROW(NotImplementedError("Computations in the XY plane are not supported when the last box vector is not parallel to the Z axis"));
+        }
+        // Use a single grid cell in Z direction.
+        matrix box;
+        copy_mat(pbc->box, box);
+        clear_rvec(box[ZZ]);
+        set_pbc(&pbc_, epbcXY, box);
+    }
+    else if (pbc != NULL)
+    {
+        pbc_ = *pbc;
+    }
+    else
+    {
+        pbc_.ePBC = epbcNONE;
+        clear_mat(pbc_.box);
+    }
     nref_ = positions.count_;
-    // TODO: Consider whether it would be possible to support grid searching in
-    // more cases.
-    if (mode == AnalysisNeighborhood::eSearchMode_Simple
-        || pbc_ == NULL || pbc_->ePBC != epbcXYZ)
+    if (mode == AnalysisNeighborhood::eSearchMode_Simple)
     {
         bGrid_ = false;
     }
     else if (bTryGrid_)
     {
-        // TODO: Actually implement forcing eSearchMode_Grid
-        bGrid_ = initGrid(pbc_);
+        bGrid_ = initGrid(pbc_, positions.count_, positions.x_,
+                          mode == AnalysisNeighborhood::eSearchMode_Grid);
     }
+    refIndices_ = positions.indices_;
     if (bGrid_)
     {
-        if (xref_nalloc_ < nref_)
-        {
-            srenew(xref_alloc_, nref_);
-            xref_nalloc_ = nref_;
-        }
-        xref_ = xref_alloc_;
+        xrefAlloc_.resize(nref_);
+        xref_ = as_rvec_array(&xrefAlloc_[0]);
 
         for (int i = 0; i < nref_; ++i)
         {
-            ivec refcell;
-            mapPointToGridCell(positions.x_[i], refcell, xref_alloc_[i]);
+            const int ii = (refIndices_ != NULL) ? refIndices_[i] : i;
+            rvec      refcell;
+            mapPointToGridCell(positions.x_[ii], refcell, xrefAlloc_[i]);
             addToGridCell(refcell, i);
         }
     }
+    else if (refIndices_ != NULL)
+    {
+        xrefAlloc_.resize(nref_);
+        xref_ = as_rvec_array(&xrefAlloc_[0]);
+        for (int i = 0; i < nref_; ++i)
+        {
+            copy_rvec(positions.x_[refIndices_[i]], xrefAlloc_[i]);
+        }
+    }
     else
     {
         xref_ = positions.x_;
     }
-    // TODO: Once exclusions are supported, this may need to be initialized.
-    refid_ = NULL;
-}
-
-#if 0
-/*! \brief
- * Sets the exclusions for the next neighborhood search.
- *
- * \param[in,out] d     Neighborhood search data structure.
- * \param[in]     nexcl Number of reference positions to exclude from next
- *      search.
- * \param[in]     excl  Indices of reference positions to exclude.
- *
- * The set exclusions remain in effect until the next call of this function.
- */
-void
-gmx_ana_nbsearch_set_excl(gmx_ana_nbsearch_t *d, int nexcl, int excl[])
-{
-
-    d->nexcl = nexcl;
-    d->excl  = excl;
+    excls_           = excls;
+    refExclusionIds_ = NULL;
+    if (excls != NULL)
+    {
+        // TODO: Check that the IDs are ascending, or remove the limitation.
+        refExclusionIds_ = positions.exclusionIds_;
+        GMX_RELEASE_ASSERT(refExclusionIds_ != NULL,
+                           "Exclusion IDs must be set for reference positions "
+                           "when exclusions are enabled");
+    }
 }
-#endif
 
 /********************************************************************
  * AnalysisNeighborhoodPairSearchImpl
@@ -561,26 +966,47 @@ gmx_ana_nbsearch_set_excl(gmx_ana_nbsearch_t *d, int nexcl, int excl[])
 void AnalysisNeighborhoodPairSearchImpl::reset(int testIndex)
 {
     testIndex_ = testIndex;
-    if (testIndex_ >= 0 && testIndex_ < static_cast<int>(testPositions_.size()))
+    if (testIndex_ >= 0 && testIndex_ < testPosCount_)
     {
+        const int index =
+            (testIndices_ != NULL ? testIndices_[testIndex] : testIndex);
         if (search_.bGrid_)
         {
-            search_.mapPointToGridCell(testPositions_[testIndex], testcell_, xtest_);
+            search_.mapPointToGridCell(testPositions_[index], testcell_, xtest_);
+            search_.initCellRange(testcell_, currCell_, cellBound_, ZZ);
+            search_.initCellRange(testcell_, currCell_, cellBound_, YY);
+            search_.initCellRange(testcell_, currCell_, cellBound_, XX);
         }
         else
         {
-            copy_rvec(testPositions_[testIndex_], xtest_);
+            copy_rvec(testPositions_[index], xtest_);
+        }
+        if (search_.excls_ != NULL)
+        {
+            const int exclIndex  = testExclusionIds_[index];
+            if (exclIndex < search_.excls_->nr)
+            {
+                const int startIndex = search_.excls_->index[exclIndex];
+                nexcl_ = search_.excls_->index[exclIndex + 1] - startIndex;
+                excl_  = &search_.excls_->a[startIndex];
+            }
+            else
+            {
+                nexcl_ = 0;
+                excl_  = NULL;
+            }
         }
     }
     previ_     = -1;
+    prevr2_    = 0.0;
+    clear_rvec(prevdx_);
     exclind_   = 0;
-    prevnbi_   = 0;
     prevcai_   = -1;
 }
 
 void AnalysisNeighborhoodPairSearchImpl::nextTestPosition()
 {
-    if (testIndex_ < static_cast<int>(testPositions_.size()))
+    if (testIndex_ < testPosCount_)
     {
         ++testIndex_;
         reset(testIndex_);
@@ -589,34 +1015,19 @@ void AnalysisNeighborhoodPairSearchImpl::nextTestPosition()
 
 bool AnalysisNeighborhoodPairSearchImpl::isExcluded(int j)
 {
-    if (exclind_ < search_.nexcl_)
+    if (exclind_ < nexcl_)
     {
-        if (search_.refid_)
+        const int index =
+            (search_.refIndices_ != NULL ? search_.refIndices_[j] : j);
+        const int refId = search_.refExclusionIds_[index];
+        while (exclind_ < nexcl_ && excl_[exclind_] < refId)
         {
-            while (exclind_ < search_.nexcl_
-                   && search_.excl_[exclind_] < search_.refid_[j])
-            {
-                ++exclind_;
-            }
-            if (exclind_ < search_.nexcl_
-                && search_.refid_[j] == search_.excl_[exclind_])
-            {
-                ++exclind_;
-                return true;
-            }
+            ++exclind_;
         }
-        else
+        if (exclind_ < nexcl_ && refId == excl_[exclind_])
         {
-            while (search_.bGrid_ && exclind_ < search_.nexcl_
-                   && search_.excl_[exclind_] < j)
-            {
-                ++exclind_;
-            }
-            if (search_.excl_[exclind_] == j)
-            {
-                ++exclind_;
-                return true;
-            }
+            ++exclind_;
+            return true;
         }
     }
     return false;
@@ -625,16 +1036,21 @@ bool AnalysisNeighborhoodPairSearchImpl::isExcluded(int j)
 void AnalysisNeighborhoodPairSearchImpl::startSearch(
         const AnalysisNeighborhoodPositions &positions)
 {
+    testPosCount_     = positions.count_;
+    testPositions_    = positions.x_;
+    testExclusionIds_ = positions.exclusionIds_;
+    testIndices_      = positions.indices_;
+    GMX_RELEASE_ASSERT(search_.excls_ == NULL || testExclusionIds_ != NULL,
+                       "Exclusion IDs must be set when exclusions are enabled");
     if (positions.index_ < 0)
     {
-        testPositions_ = constArrayRefFromArray<rvec>(positions.x_, positions.count_);
         reset(0);
     }
     else
     {
         // Somewhat of a hack: setup the array such that only the last position
         // will be used.
-        testPositions_ = constArrayRefFromArray<rvec>(positions.x_, positions.index_ + 1);
+        testPosCount_ = positions.index_ + 1;
         reset(positions.index_);
     }
 }
@@ -642,25 +1058,17 @@ void AnalysisNeighborhoodPairSearchImpl::startSearch(
 template <class Action>
 bool AnalysisNeighborhoodPairSearchImpl::searchNext(Action action)
 {
-    while (testIndex_ < static_cast<int>(testPositions_.size()))
+    while (testIndex_ < testPosCount_)
     {
         if (search_.bGrid_)
         {
-            int nbi = prevnbi_;
             int cai = prevcai_ + 1;
 
-            for (; nbi < search_.ngridnb_; ++nbi)
+            do
             {
-                ivec cell;
-
-                ivec_add(testcell_, search_.gnboffs_[nbi], cell);
-                cell[XX] = (cell[XX] + search_.ncelldim_[XX]) % search_.ncelldim_[XX];
-                cell[YY] = (cell[YY] + search_.ncelldim_[YY]) % search_.ncelldim_[YY];
-                cell[ZZ] = (cell[ZZ] + search_.ncelldim_[ZZ]) % search_.ncelldim_[ZZ];
-
-                const int ci       = search_.getGridCellIndex(cell);
+                rvec      shift;
+                const int ci       = search_.shiftCell(currCell_, shift);
                 const int cellSize = static_cast<int>(search_.cells_[ci].size());
-                /* TODO: Calculate the required PBC shift outside the inner loop */
                 for (; cai < cellSize; ++cai)
                 {
                     const int i = search_.cells_[ci][cai];
@@ -669,15 +1077,20 @@ bool AnalysisNeighborhoodPairSearchImpl::searchNext(Action action)
                         continue;
                     }
                     rvec       dx;
-                    pbc_dx_aiuc(search_.pbc_, xtest_, search_.xref_[i], dx);
-                    const real r2 = norm2(dx);
+                    rvec_sub(search_.xref_[i], xtest_, dx);
+                    rvec_sub(dx, shift, dx);
+                    const real r2
+                        = search_.bXY_
+                            ? dx[XX]*dx[XX] + dx[YY]*dx[YY]
+                            : norm2(dx);
                     if (r2 <= search_.cutoff2_)
                     {
-                        if (action(i, r2))
+                        if (action(i, r2, dx))
                         {
-                            prevnbi_ = nbi;
                             prevcai_ = cai;
                             previ_   = i;
+                            prevr2_  = r2;
+                            copy_rvec(dx, prevdx_);
                             return true;
                         }
                     }
@@ -685,6 +1098,7 @@ bool AnalysisNeighborhoodPairSearchImpl::searchNext(Action action)
                 exclind_ = 0;
                 cai      = 0;
             }
+            while (search_.nextCell(testcell_, currCell_, cellBound_));
         }
         else
         {
@@ -695,20 +1109,25 @@ bool AnalysisNeighborhoodPairSearchImpl::searchNext(Action action)
                     continue;
                 }
                 rvec dx;
-                if (search_.pbc_)
+                if (search_.pbc_.ePBC != epbcNONE)
                 {
-                    pbc_dx(search_.pbc_, xtest_, search_.xref_[i], dx);
+                    pbc_dx(&search_.pbc_, search_.xref_[i], xtest_, dx);
                 }
                 else
                 {
-                    rvec_sub(xtest_, search_.xref_[i], dx);
+                    rvec_sub(search_.xref_[i], xtest_, dx);
                 }
-                const real r2 = norm2(dx);
+                const real r2
+                    = search_.bXY_
+                        ? dx[XX]*dx[XX] + dx[YY]*dx[YY]
+                        : norm2(dx);
                 if (r2 <= search_.cutoff2_)
                 {
-                    if (action(i, r2))
+                    if (action(i, r2, dx))
                     {
-                        previ_ = i;
+                        previ_  = i;
+                        prevr2_ = r2;
+                        copy_rvec(dx, prevdx_);
                         return true;
                     }
                 }
@@ -728,7 +1147,7 @@ void AnalysisNeighborhoodPairSearchImpl::initFoundPair(
     }
     else
     {
-        *pair = AnalysisNeighborhoodPair(previ_, testIndex_);
+        *pair = AnalysisNeighborhoodPair(previ_, testIndex_, prevr2_, prevdx_);
     }
 }
 
@@ -745,7 +1164,7 @@ namespace
  *
  * Simply breaks the loop on the first found neighbor.
  */
-bool withinAction(int /*i*/, real /*r2*/)
+bool withinAction(int /*i*/, real /*r2*/, const rvec /* dx */)
 {
     return true;
 }
@@ -769,23 +1188,25 @@ class MindistAction
          *
          * \param[out] closestPoint Index of the closest reference location.
          * \param[out] minDist2     Minimum distance squared.
+         * \param[out] dx           Shortest distance vector.
          *
          * The constructor call does not modify the pointed values, but only
          * stores the pointers for later use.
          * See the class description for additional semantics.
          */
-        MindistAction(int *closestPoint, real *minDist2)
-            : closestPoint_(*closestPoint), minDist2_(*minDist2)
+        MindistAction(int *closestPoint, real *minDist2, rvec *dx)
+            : closestPoint_(*closestPoint), minDist2_(*minDist2), dx_(*dx)
         {
         }
 
         //! Processes a neighbor to find the nearest point.
-        bool operator()(int i, real r2)
+        bool operator()(int i, real r2, const rvec dx)
         {
             if (r2 < minDist2_)
             {
                 closestPoint_ = i;
                 minDist2_     = r2;
+                copy_rvec(dx, dx_);
             }
             return false;
         }
@@ -793,6 +1214,7 @@ class MindistAction
     private:
         int     &closestPoint_;
         real    &minDist2_;
+        rvec    &dx_;
 
         GMX_DISALLOW_ASSIGN(MindistAction);
 };
@@ -809,7 +1231,8 @@ class AnalysisNeighborhood::Impl
         typedef AnalysisNeighborhoodSearch::ImplPointer SearchImplPointer;
         typedef std::vector<SearchImplPointer> SearchList;
 
-        Impl() : cutoff_(0), mode_(eSearchMode_Automatic)
+        Impl()
+            : cutoff_(0), excls_(NULL), mode_(eSearchMode_Automatic), bXY_(false)
         {
         }
         ~Impl()
@@ -827,7 +1250,9 @@ class AnalysisNeighborhood::Impl
         tMPI::mutex             createSearchMutex_;
         SearchList              searchList_;
         real                    cutoff_;
+        const t_blocka         *excls_;
         SearchMode              mode_;
+        bool                    bXY_;
 };
 
 AnalysisNeighborhood::Impl::SearchImplPointer
@@ -869,6 +1294,18 @@ void AnalysisNeighborhood::setCutoff(real cutoff)
     impl_->cutoff_ = cutoff;
 }
 
+void AnalysisNeighborhood::setXYMode(bool bXY)
+{
+    impl_->bXY_ = bXY;
+}
+
+void AnalysisNeighborhood::setTopologyExclusions(const t_blocka *excls)
+{
+    GMX_RELEASE_ASSERT(impl_->searchList_.empty(),
+                       "Changing the exclusions after initSearch() not currently supported");
+    impl_->excls_ = excls;
+}
+
 void AnalysisNeighborhood::setMode(SearchMode mode)
 {
     impl_->mode_ = mode;
@@ -884,7 +1321,8 @@ AnalysisNeighborhood::initSearch(const t_pbc                         *pbc,
                                  const AnalysisNeighborhoodPositions &positions)
 {
     Impl::SearchImplPointer search(impl_->getSearch());
-    search->init(mode(), pbc, positions);
+    search->init(mode(), impl_->bXY_, impl_->excls_,
+                 pbc, positions);
     return AnalysisNeighborhoodSearch(search);
 }
 
@@ -931,7 +1369,8 @@ real AnalysisNeighborhoodSearch::minimumDistance(
     pairSearch.startSearch(positions);
     real          minDist2     = impl_->cutoffSquared();
     int           closestPoint = -1;
-    MindistAction action(&closestPoint, &minDist2);
+    rvec          dx           = {0.0, 0.0, 0.0};
+    MindistAction action(&closestPoint, &minDist2, &dx);
     (void)pairSearch.searchNext(action);
     return sqrt(minDist2);
 }
@@ -945,9 +1384,10 @@ AnalysisNeighborhoodSearch::nearestPoint(
     pairSearch.startSearch(positions);
     real          minDist2     = impl_->cutoffSquared();
     int           closestPoint = -1;
-    MindistAction action(&closestPoint, &minDist2);
+    rvec          dx           = {0.0, 0.0, 0.0};
+    MindistAction action(&closestPoint, &minDist2, &dx);
     (void)pairSearch.searchNext(action);
-    return AnalysisNeighborhoodPair(closestPoint, 0);
+    return AnalysisNeighborhoodPair(closestPoint, 0, minDist2, dx);
 }
 
 AnalysisNeighborhoodPairSearch
index c3a299482433f3c011f0cd5ede6ada73b0303de0..d5ae8d41c417f126324520bb99a70ae683d903dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
 #ifndef GMX_SELECTION_NBSEARCH_H
 #define GMX_SELECTION_NBSEARCH_H
 
-#include <boost/shared_ptr.hpp>
+#include <vector>
 
-#include "../legacyheaders/typedefs.h"
-#include "../utility/common.h"
-#include "../utility/gmxassert.h"
+#include <boost/shared_ptr.hpp>
 
-#include "indexutil.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 
-struct gmx_ana_pos_t;
+struct t_blocka;
+struct t_pbc;
 
 namespace gmx
 {
@@ -107,17 +111,56 @@ class AnalysisNeighborhoodPositions
          * to methods that accept positions.
          */
         AnalysisNeighborhoodPositions(const rvec &x)
-            : count_(1), index_(-1), x_(&x)
+            : count_(1), index_(-1), x_(&x), exclusionIds_(NULL), indices_(NULL)
         {
         }
         /*! \brief
          * Initializes positions from an array of position vectors.
          */
         AnalysisNeighborhoodPositions(const rvec x[], int count)
-            : count_(count), index_(-1), x_(x)
+            : count_(count), index_(-1), x_(x), exclusionIds_(NULL), indices_(NULL)
+        {
+        }
+        /*! \brief
+         * Initializes positions from a vector of position vectors.
+         */
+        AnalysisNeighborhoodPositions(const std::vector<RVec> &x)
+            : count_(x.size()), index_(-1), x_(as_rvec_array(&x[0])),
+              exclusionIds_(NULL), indices_(NULL)
         {
         }
 
+        /*! \brief
+         * Sets indices to use for mapping exclusions to these positions.
+         *
+         * The exclusion IDs can always be set, but they are ignored unless
+         * actual exclusions have been set with
+         * AnalysisNeighborhood::setTopologyExclusions().
+         */
+        AnalysisNeighborhoodPositions &
+        exclusionIds(ConstArrayRef<int> ids)
+        {
+            GMX_ASSERT(static_cast<int>(ids.size()) == count_,
+                       "Exclusion id array should match the number of positions");
+            exclusionIds_ = ids.data();
+            return *this;
+        }
+        /*! \brief
+         * Sets indices that select a subset of all positions from the array.
+         *
+         * If called, selected positions from the array of positions passed to
+         * the constructor is used instead of the whole array.
+         * All returned indices from AnalysisNeighborhoodPair objects are
+         * indices to the \p indices array passed here.
+         */
+        AnalysisNeighborhoodPositions &
+        indexed(ConstArrayRef<int> indices)
+        {
+            count_   = indices.size();
+            indices_ = indices.data();
+            return *this;
+        }
+
         /*! \brief
          * Selects a single position to use from an array.
          *
@@ -126,6 +169,9 @@ class AnalysisNeighborhoodPositions
          * In contrast to the AnalysisNeighborhoodPositions(const rvec &)
          * constructor, AnalysisNeighborhoodPair objects return \p index
          * instead of zero.
+         *
+         * If used together with indexed(), \p index references the index array
+         * passed to indexed() instead of the position array.
          */
         AnalysisNeighborhoodPositions &selectSingleFromArray(int index)
         {
@@ -138,6 +184,8 @@ class AnalysisNeighborhoodPositions
         int                     count_;
         int                     index_;
         const rvec             *x_;
+        const int              *exclusionIds_;
+        const int              *indices_;
 
         //! To access the positions for initialization.
         friend class internal::AnalysisNeighborhoodSearchImpl;
@@ -168,12 +216,8 @@ class AnalysisNeighborhoodPositions
  * a single thread.
  *
  * \todo
- * Support for exclusions.
- * The 4.5/4.6 C API had very low-level support for exclusions, which was not
- * very convenient to use, and hadn't been tested much.  The internal code that
- * it used to do the exclusion during the search itself is still there, but it
- * needs more thought on what would be a convenient way to initialize it.
- * Can be implemented once there is need for it in some calling code.
+ * Generalize the exclusion machinery to make it easier to use for other cases
+ * than atom-atom exclusions from the topology.
  *
  * \inpublicapi
  * \ingroup module_selection
@@ -197,7 +241,7 @@ class AnalysisNeighborhood
         ~AnalysisNeighborhood();
 
         /*! \brief
-         * Set cutoff distance for the neighborhood searching.
+         * Sets cutoff distance for the neighborhood searching.
          *
          * \param[in]  cutoff Cutoff distance for the search
          *   (<=0 stands for no cutoff).
@@ -208,6 +252,34 @@ class AnalysisNeighborhood
          * Does not throw.
          */
         void setCutoff(real cutoff);
+        /*! \brief
+         * Sets the search to only happen in the XY plane.
+         *
+         * Z component of the coordinates is not used in the searching,
+         * and returned distances are computed in the XY plane.
+         * Only boxes with the third box vector parallel to the Z axis are
+         * currently implemented.
+         *
+         * Does not throw.
+         */
+        void setXYMode(bool bXY);
+        /*! \brief
+         * Sets atom exclusions from a topology.
+         *
+         * The \p excls structure specifies the exclusions from test positions
+         * to reference positions, i.e., a block starting at `excls->index[i]`
+         * specifies the exclusions for test position `i`, and the indices in
+         * `excls->a` are indices of the reference positions.  If `excls->nr`
+         * is smaller than a test position id, then such test positions do not
+         * have any exclusions.
+         * It is assumed that the indices within a block of indices in
+         * `excls->a` is ascending.
+         *
+         * Does not throw.
+         *
+         * \see AnalysisNeighborhoodPositions::exclusionIds()
+         */
+        void setTopologyExclusions(const t_blocka *excls);
         /*! \brief
          * Sets the algorithm to use for searching.
          *
@@ -258,11 +330,16 @@ class AnalysisNeighborhoodPair
 {
     public:
         //! Initializes an invalid pair.
-        AnalysisNeighborhoodPair() : refIndex_(-1), testIndex_(0) {}
+        AnalysisNeighborhoodPair() : refIndex_(-1), testIndex_(0), distance2_(0.0)
+        {
+            clear_rvec(dx_);
+        }
         //! Initializes a pair object with the given data.
-        AnalysisNeighborhoodPair(int refIndex, int testIndex)
-            : refIndex_(refIndex), testIndex_(testIndex)
+        AnalysisNeighborhoodPair(int refIndex, int testIndex, real distance2,
+                                 const rvec dx)
+            : refIndex_(refIndex), testIndex_(testIndex), distance2_(distance2)
         {
+            copy_rvec(dx, dx_);
         }
 
         /*! \brief
@@ -295,10 +372,30 @@ class AnalysisNeighborhoodPair
             GMX_ASSERT(isValid(), "Accessing invalid object");
             return testIndex_;
         }
+        /*! \brief
+         * Returns the squared distance between the pair of positions.
+         */
+        real distance2() const
+        {
+            GMX_ASSERT(isValid(), "Accessing invalid object");
+            return distance2_;
+        }
+        /*! \brief
+         * Returns the shortest vector between the pair of positions.
+         *
+         * The vector is from the test position to the reference position.
+         */
+        const rvec &dx() const
+        {
+            GMX_ASSERT(isValid(), "Accessing invalid object");
+            return dx_;
+        }
 
     private:
         int                     refIndex_;
         int                     testIndex_;
+        real                    distance2_;
+        rvec                    dx_;
 };
 
 /*! \brief
index e0305da77297c723957ef572e65a65e5ae269e96..d4806d71eb57b5522550e2dab58a6388c17b5f53 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include <algorithm>
 #include <string>
 
-#include "gromacs/legacyheaders/vec.h"
-
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
-#include "gromacs/selection/selparam.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/messagestringcollector.h"
+#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "parsetree.h"
-#include "position.h"
 #include "scanner.h"
 #include "selelem.h"
+#include "selmethod.h"
+#include "selparam.h"
 
-using gmx::SelectionParserValue;
-using gmx::SelectionParserValueList;
-using gmx::SelectionParserParameter;
-using gmx::SelectionParserParameterList;
-using gmx::SelectionTreeElement;
-using gmx::SelectionTreeElementPointer;
+using namespace gmx;
 
 /*!
  * \param[in] name   Name of the parameter to search.
@@ -116,15 +112,16 @@ gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param)
  *
  * \param[in,out] value    Value to convert.
  * \param[in]     type     Type to convert to.
+ * \param[in]     errors   Errors will be reported into this as nested exceptions.
  * \param[in]     scanner  Scanner data structure.
- * \returns       0 on success, a non-zero value on error.
  */
-static int
-convert_value(SelectionParserValue *value, e_selvalue_t type, void *scanner)
+static void
+convert_value(SelectionParserValue *value, e_selvalue_t type,
+              ExceptionInitializer *errors, void *scanner)
 {
     if (value->type == type || type == NO_VALUE)
     {
-        return 0;
+        return;
     }
     if (value->hasExpressionValue())
     {
@@ -132,17 +129,21 @@ convert_value(SelectionParserValue *value, e_selvalue_t type, void *scanner)
          * reference positions. */
         if (value->type == GROUP_VALUE && type == POS_VALUE)
         {
-            SelectionTreeElementPointer expr =
-                _gmx_sel_init_position(value->expr, NULL, scanner);
-            // FIXME: Use exceptions
-            if (!expr)
+            try
+            {
+                SelectionTreeElementPointer expr =
+                    _gmx_sel_init_position(value->expr, NULL, scanner);
+                *value = SelectionParserValue::createExpr(expr);
+            }
+            catch (UserInputError &ex)
             {
-                return -1;
+                std::string text(_gmx_sel_lexer_get_text(scanner, value->location()));
+                std::string context(formatString("In '%s'", text.c_str()));
+                ex.prependContext(context);
+                errors->addCurrentExceptionAsNested();
             }
-            *value = SelectionParserValue::createExpr(expr);
-            return 0;
+            return;
         }
-        return -1;
     }
     else
     {
@@ -150,8 +151,9 @@ convert_value(SelectionParserValue *value, e_selvalue_t type, void *scanner)
         if (value->type == INT_VALUE && type == REAL_VALUE)
         {
             *value = SelectionParserValue::createRealRange(value->u.i.i1,
-                                                           value->u.i.i2);
-            return 0;
+                                                           value->u.i.i2,
+                                                           value->location());
+            return;
         }
         /* Reals that are integer-valued can also be converted */
         if (value->type == REAL_VALUE && type == INT_VALUE)
@@ -161,12 +163,17 @@ convert_value(SelectionParserValue *value, e_selvalue_t type, void *scanner)
             if (gmx_within_tol(value->u.r.r1, i1, GMX_REAL_EPS)
                 && gmx_within_tol(value->u.r.r2, i2, GMX_REAL_EPS))
             {
-                *value = SelectionParserValue::createIntegerRange(i1, i2);
-                return 0;
+                *value = SelectionParserValue::createIntegerRange(i1, i2, value->location());
+                return;
             }
         }
     }
-    return -1;
+    std::string text(_gmx_sel_lexer_get_text(scanner, value->location()));
+    std::string message(
+            formatString("Expression '%s' evaluates to a type is not valid in this context",
+                         text.c_str()));
+    InvalidInputError ex(message);
+    errors->addNested(ex);
 }
 
 /*! \brief
@@ -175,23 +182,20 @@ convert_value(SelectionParserValue *value, e_selvalue_t type, void *scanner)
  * \param[in,out] values   Values to convert.
  * \param[in]     type     Type to convert to.
  * \param[in]     scanner  Scanner data structure.
- * \returns       0 on success, a non-zero value on error.
  */
-static int
+static void
 convert_values(SelectionParserValueList *values, e_selvalue_t type, void *scanner)
 {
-    int rc = 0;
+    ExceptionInitializer               errors("");
     SelectionParserValueList::iterator value;
     for (value = values->begin(); value != values->end(); ++value)
     {
-        int rc1 = convert_value(&*value, type, scanner);
-        if (rc1 != 0 && rc == 0)
-        {
-            rc = rc1;
-        }
+        convert_value(&*value, type, &errors, scanner);
+    }
+    if (errors.hasNestedExceptions())
+    {
+        GMX_THROW(InvalidInputError(errors));
     }
-    /* FIXME: More informative error messages */
-    return rc;
 }
 
 /*! \brief
@@ -294,40 +298,44 @@ cmp_real_range(const void *a, const void *b)
  * \param[in] values List of values.
  * \param     param  Parameter to parse.
  * \param[in] scanner Scanner data structure.
- * \returns   true if the values were parsed successfully, false otherwise.
  */
-static bool
+static void
 parse_values_range(const SelectionParserValueList &values,
                    gmx_ana_selparam_t *param, void *scanner)
 {
-    int                *idata;
-    real               *rdata;
     int                 i, j, n;
 
     param->flags &= ~SPAR_DYNAMIC;
     GMX_RELEASE_ASSERT(param->val.type == INT_VALUE || param->val.type == REAL_VALUE,
                        "Invalid range parameter type");
-    idata = NULL;
-    rdata = NULL;
+    int                *idata = NULL;
+    real               *rdata = NULL;
+    scoped_guard_sfree  dataGuard;
     if (param->val.type == INT_VALUE)
     {
         snew(idata, values.size()*2);
+        dataGuard.reset(idata);
     }
     else
     {
         snew(rdata, values.size()*2);
+        dataGuard.reset(rdata);
     }
     i = 0;
     SelectionParserValueList::const_iterator value;
     for (value = values.begin(); value != values.end(); ++value)
     {
+        GMX_RELEASE_ASSERT(value->type == param->val.type,
+                           "Invalid range value type (should have been caught earlier)");
         if (value->hasExpressionValue())
         {
-            _gmx_selparser_error(scanner, "expressions not supported within range parameters");
-            return false;
+            std::string       text(_gmx_sel_lexer_get_text(scanner, value->location()));
+            std::string       message("Only simple values or 'A to B' ranges are "
+                                      "supported in this context");
+            InvalidInputError ex(message);
+            ex.prependContext(formatString("Invalid expression '%s'", text.c_str()));
+            GMX_THROW(ex);
         }
-        GMX_RELEASE_ASSERT(value->type == param->val.type,
-                           "Invalid range value type (should have been caught earlier)");
         if (param->val.type == INT_VALUE)
         {
             int i1 = std::min(value->u.i.i1, value->u.i.i2);
@@ -407,6 +415,7 @@ parse_values_range(const SelectionParserValueList &values,
     /* Store the values */
     if (param->flags & SPAR_VARNUM)
     {
+        dataGuard.release();
         param->val.nr  = n;
         if (param->val.type == INT_VALUE)
         {
@@ -423,20 +432,18 @@ parse_values_range(const SelectionParserValueList &values,
     {
         if (n != param->val.nr)
         {
-            _gmx_selparser_error(scanner, "the value should consist of exactly one range");
-            sfree(idata);
-            sfree(rdata);
-            return false;
+            GMX_ASSERT(n == 1,
+                       "Range parameters with a fixed count > 1 do not make sense");
+            GMX_THROW(InvalidInputError("Only one value or 'A to B' range is "
+                                        "supported in this context"));
         }
         if (param->val.type == INT_VALUE)
         {
             memcpy(param->val.u.i, idata, 2*n*sizeof(int));
-            sfree(idata);
         }
         else
         {
             memcpy(param->val.u.r, rdata, 2*n*sizeof(real));
-            sfree(rdata);
         }
     }
     if (param->nvalptr)
@@ -444,8 +451,6 @@ parse_values_range(const SelectionParserValueList &values,
         *param->nvalptr = param->val.nr;
     }
     param->nvalptr = NULL;
-
-    return true;
 }
 
 /*! \brief
@@ -455,12 +460,11 @@ parse_values_range(const SelectionParserValueList &values,
  * \param     param  Parameter to parse.
  * \param     root   Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   true if the values were parsed successfully, false otherwise.
  *
  * For integer ranges, the sequence of numbers from the first to second value
  * is stored, each as a separate value.
  */
-static bool
+static void
 parse_values_varnum(const SelectionParserValueList    &values,
                     gmx_ana_selparam_t                *param,
                     const SelectionTreeElementPointer &root,
@@ -470,7 +474,7 @@ parse_values_varnum(const SelectionParserValueList    &values,
 
     param->flags &= ~SPAR_DYNAMIC;
     /* Compute number of values, considering also integer ranges. */
-    size_t valueCount = values.size();
+    int valueCount = static_cast<int>(values.size());
     if (param->val.type == INT_VALUE)
     {
         SelectionParserValueList::const_iterator value;
@@ -487,7 +491,7 @@ parse_values_varnum(const SelectionParserValueList    &values,
     if (param->val.type != INT_VALUE && param->val.type != REAL_VALUE
         && param->val.type != STR_VALUE && param->val.type != POS_VALUE)
     {
-        GMX_THROW(gmx::InternalError("Variable-count value type not implemented"));
+        GMX_THROW(InternalError("Variable-count value type not implemented"));
     }
 
     /* Reserve appropriate amount of memory */
@@ -501,18 +505,42 @@ parse_values_varnum(const SelectionParserValueList    &values,
     {
         _gmx_selvalue_reserve(&param->val, valueCount);
     }
+    /* Create a dummy child element to store the string values.
+     * This element is responsible for freeing the values, but carries no
+     * other function. */
+    if (param->val.type == STR_VALUE)
+    {
+        SelectionTreeElementPointer child(
+                new SelectionTreeElement(SEL_CONST, SelectionLocation::createEmpty()));
+        _gmx_selelem_set_vtype(child, STR_VALUE);
+        child->setName(param->name);
+        child->flags &= ~SEL_ALLOCVAL;
+        child->flags |= SEL_FLAGSSET | SEL_VARNUMVAL | SEL_ALLOCDATA;
+        child->v.nr   = valueCount;
+        _gmx_selvalue_setstore(&child->v, param->val.u.s);
+        /* Because the child is not group-valued, the u union is not used
+         * for anything, so we can abuse it by storing the parameter value
+         * as place_child() expects, but this is really ugly... */
+        child->u.param = param;
+        place_child(root, child, param);
+    }
+    param->val.nr = valueCount;
 
     i     = 0;
     SelectionParserValueList::const_iterator value;
     for (value = values.begin(); value != values.end(); ++value)
     {
+        GMX_RELEASE_ASSERT(value->type == param->val.type,
+                           "Invalid value type (should have been caught earlier)");
         if (value->hasExpressionValue())
         {
-            _gmx_selparser_error(scanner, "expressions not supported within value lists");
-            return false;
+            std::string       text(_gmx_sel_lexer_get_text(scanner, value->location()));
+            std::string       message("Selection expressions are not supported in this "
+                                      "context when multiple values are provided");
+            InvalidInputError ex(message);
+            ex.prependContext(formatString("Invalid expression '%s'", text.c_str()));
+            GMX_THROW(ex);
         }
-        GMX_RELEASE_ASSERT(value->type == param->val.type,
-                           "Invalid value type (should have been caught earlier)");
         switch (param->val.type)
         {
             case INT_VALUE:
@@ -534,45 +562,30 @@ parse_values_varnum(const SelectionParserValueList    &values,
             case REAL_VALUE:
                 if (value->u.r.r1 != value->u.r.r2)
                 {
-                    _gmx_selparser_error(scanner, "real ranges not supported");
-                    return false;
+                    std::string text(_gmx_sel_lexer_get_text(scanner, value->location()));
+                    std::string message
+                        = formatString("Real range ('%s') is not supported in this context",
+                                       text.c_str());
+                    InvalidInputError ex(message);
+                    GMX_THROW(ex);
                 }
                 param->val.u.r[i++] = value->u.r.r1;
                 break;
             case STR_VALUE:
-                param->val.u.s[i++] = strdup(value->stringValue().c_str());
+                param->val.u.s[i++] = gmx_strdup(value->stringValue().c_str());
                 break;
             case POS_VALUE:  copy_rvec(value->u.x, param->val.u.p->x[i++]); break;
             default: /* Should not be reached */
-                GMX_THROW(gmx::InternalError("Variable-count value type not implemented"));
+                GMX_RELEASE_ASSERT(false, "Variable-count value type not implemented");
         }
     }
-    param->val.nr = i;
+    GMX_RELEASE_ASSERT(i == valueCount,
+                       "Inconsistent value count wrt. the actual value population");
     if (param->nvalptr)
     {
         *param->nvalptr = param->val.nr;
     }
     param->nvalptr = NULL;
-    /* Create a dummy child element to store the string values.
-     * This element is responsible for freeing the values, but carries no
-     * other function. */
-    if (param->val.type == STR_VALUE)
-    {
-        SelectionTreeElementPointer child(new SelectionTreeElement(SEL_CONST));
-        _gmx_selelem_set_vtype(child, STR_VALUE);
-        child->setName(param->name);
-        child->flags &= ~SEL_ALLOCVAL;
-        child->flags |= SEL_FLAGSSET | SEL_VARNUMVAL | SEL_ALLOCDATA;
-        child->v.nr   = param->val.nr;
-        _gmx_selvalue_setstore(&child->v, param->val.u.s);
-        /* Because the child is not group-valued, the u union is not used
-         * for anything, so we can abuse it by storing the parameter value
-         * as place_child() expects, but this is really ugly... */
-        child->u.param = param;
-        place_child(root, child, param);
-    }
-
-    return true;
 }
 
 /*! \brief
@@ -603,7 +616,8 @@ add_child(const SelectionTreeElementPointer &root, gmx_ana_selparam_t *param,
     }
     else
     {
-        child.reset(new SelectionTreeElement(SEL_SUBEXPRREF));
+        // TODO: Initialize such that it includes the parameter.
+        child.reset(new SelectionTreeElement(SEL_SUBEXPRREF, expr->location()));
         _gmx_selelem_set_vtype(child, expr->v.type);
         child->child  = expr;
     }
@@ -612,16 +626,23 @@ add_child(const SelectionTreeElementPointer &root, gmx_ana_selparam_t *param,
     child->u.param = param;
     if (child->v.type != param->val.type)
     {
-        _gmx_selparser_error(scanner, "invalid expression value");
-        // FIXME: Use exceptions.
-        return SelectionTreeElementPointer();
+        // TODO: It would be nice to say what is the expected type.
+        std::string text(_gmx_sel_lexer_get_text(scanner, expr->location()));
+        std::string message
+            = formatString("Expression '%s' is not valid in this context "
+                           "(produces the wrong type of values)",
+                           text.c_str());
+        GMX_THROW(InvalidInputError(message));
     }
     _gmx_selelem_update_flags(child);
     if ((child->flags & SEL_DYNAMIC) && !(param->flags & SPAR_DYNAMIC))
     {
-        _gmx_selparser_error(scanner, "dynamic values not supported");
-        // FIXME: Use exceptions.
-        return SelectionTreeElementPointer();
+        std::string text(_gmx_sel_lexer_get_text(scanner, expr->location()));
+        std::string message
+            = formatString("Expression '%s' is dynamic, which is not "
+                           "valid in this context",
+                           text.c_str());
+        GMX_THROW(InvalidInputError(message));
     }
     if (!(child->flags & SEL_DYNAMIC))
     {
@@ -639,9 +660,8 @@ add_child(const SelectionTreeElementPointer &root, gmx_ana_selparam_t *param,
  * \param     param  Parameter to parse.
  * \param     root   Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   true if the values were parsed successfully, false otherwise.
  */
-static bool
+static void
 parse_values_varnum_expr(const SelectionParserValueList    &values,
                          gmx_ana_selparam_t                *param,
                          const SelectionTreeElementPointer &root,
@@ -652,10 +672,6 @@ parse_values_varnum_expr(const SelectionParserValueList    &values,
 
     SelectionTreeElementPointer child
         = add_child(root, param, values.front().expr, scanner);
-    if (!child)
-    {
-        return false;
-    }
 
     /* Process single-valued expressions */
     /* TODO: We should also handle SEL_SINGLEVAL expressions here */
@@ -669,13 +685,16 @@ parse_values_varnum_expr(const SelectionParserValueList    &values,
             *param->nvalptr = param->val.nr;
         }
         param->nvalptr = NULL;
-        return true;
+        return;
     }
 
     if (!(child->flags & SEL_VARNUMVAL))
     {
-        _gmx_selparser_error(scanner, "invalid expression value");
-        return false;
+        std::string text(_gmx_sel_lexer_get_text(scanner, values.front().location()));
+        std::string message
+            = formatString("Expression '%s' is invalid in this context",
+                           text.c_str());
+        GMX_THROW(InvalidInputError(message));
     }
 
     child->flags   |= SEL_ALLOCVAL;
@@ -683,8 +702,6 @@ parse_values_varnum_expr(const SelectionParserValueList    &values,
     *param->nvalptr = param->val.nr;
     /* Rest of the initialization is done during compilation in
      * init_method(). */
-
-    return true;
 }
 
 /*! \brief
@@ -700,14 +717,17 @@ parse_values_varnum_expr(const SelectionParserValueList    &values,
  * as the value \p i of \p param.
  * This function is used internally by parse_values_std().
  */
-static bool
+static void
 set_expr_value_store(const SelectionTreeElementPointer &sel,
                      gmx_ana_selparam_t *param, int i, void *scanner)
 {
     if (sel->v.type != GROUP_VALUE && !(sel->flags & SEL_SINGLEVAL))
     {
-        _gmx_selparser_error(scanner, "invalid expression value");
-        return false;
+        std::string text(_gmx_sel_lexer_get_text(scanner, sel->location()));
+        std::string message
+            = formatString("Expression '%s' is invalid in this context",
+                           text.c_str());
+        GMX_THROW(InvalidInputError(message));
     }
     switch (sel->v.type)
     {
@@ -717,11 +737,10 @@ set_expr_value_store(const SelectionTreeElementPointer &sel,
         case POS_VALUE:   sel->v.u.p = &param->val.u.p[i]; break;
         case GROUP_VALUE: sel->v.u.g = &param->val.u.g[i]; break;
         default: /* Error */
-            GMX_THROW(gmx::InternalError("Invalid value type"));
+            GMX_THROW(InternalError("Invalid value type"));
     }
     sel->v.nr     = 1;
     sel->v.nalloc = -1;
-    return true;
 }
 
 /*! \brief
@@ -731,12 +750,11 @@ set_expr_value_store(const SelectionTreeElementPointer &sel,
  * \param     param  Parameter to parse.
  * \param     root   Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   true if the values were parsed successfully, false otherwise.
  *
  * For integer ranges, the sequence of numbers from the first to second value
  * is stored, each as a separate value.
  */
-static bool
+static void
 parse_values_std(const SelectionParserValueList &values,
                  gmx_ana_selparam_t *param,
                  const SelectionTreeElementPointer &root, void *scanner)
@@ -749,17 +767,14 @@ parse_values_std(const SelectionParserValueList &values,
     {
         if (values.size() > 1)
         {
-            _gmx_selparser_error(scanner, "more than one value not supported");
-            return false;
+            GMX_THROW(InvalidInputError(
+                              "Only a single value or a single expression is "
+                              "supported in this context"));
         }
         if (values.front().hasExpressionValue())
         {
             SelectionTreeElementPointer child
-                = add_child(root, param, values.front().expr, scanner);
-            if (!child)
-            {
-                return false;
-            }
+                          = add_child(root, param, values.front().expr, scanner);
             child->flags |= SEL_ALLOCVAL;
             if (child->v.type != GROUP_VALUE && (child->flags & SEL_ATOMVAL))
             {
@@ -771,7 +786,7 @@ parse_values_std(const SelectionParserValueList &values,
                 {
                     *param->nvalptr = -1;
                 }
-                return true;
+                return;
             }
             param->flags  &= ~SPAR_ATOMVAL;
             param->val.nr  = 1;
@@ -785,7 +800,8 @@ parse_values_std(const SelectionParserValueList &values,
             {
                 _gmx_selvalue_reserve(&param->val, 1);
             }
-            return set_expr_value_store(child, param, 0, scanner);
+            set_expr_value_store(child, param, 0, scanner);
+            return;
         }
         /* If we reach here, proceed with normal parameter handling */
         param->val.nr = 1;
@@ -803,24 +819,13 @@ parse_values_std(const SelectionParserValueList &values,
     SelectionParserValueList::const_iterator value;
     for (value = values.begin(); value != values.end() && i < param->val.nr; ++value)
     {
-        if (value->type != param->val.type)
-        {
-            _gmx_selparser_error(scanner, "incorrect value skipped");
-            continue;
-        }
+        GMX_RELEASE_ASSERT(value->type == param->val.type,
+                           "Invalid value type (should have been caught earlier)");
         if (value->hasExpressionValue())
         {
             SelectionTreeElementPointer child
                 = add_child(root, param, value->expr, scanner);
-            /* Check that the expression is valid */
-            if (!child)
-            {
-                return false;
-            }
-            if (!set_expr_value_store(child, param, i, scanner))
-            {
-                return false;
-            }
+            set_expr_value_store(child, param, i, scanner);
             if (child->flags & SEL_DYNAMIC)
             {
                 bDynamic = true;
@@ -832,16 +837,15 @@ parse_values_std(const SelectionParserValueList &values,
             switch (value->type)
             {
                 case INT_VALUE:
+                {
+                    bool bTooManyValues;
                     if (value->u.i.i1 <= value->u.i.i2)
                     {
                         for (j = value->u.i.i1; j <= value->u.i.i2 && i < param->val.nr; ++j)
                         {
                             param->val.u.i[i++] = j;
                         }
-                        if (j != value->u.i.i2 + 1)
-                        {
-                            _gmx_selparser_error(scanner, "extra values skipped");
-                        }
+                        bTooManyValues = (j != value->u.i.i2 + 1);
                     }
                     else
                     {
@@ -849,43 +853,57 @@ parse_values_std(const SelectionParserValueList &values,
                         {
                             param->val.u.i[i++] = j;
                         }
-                        if (j != value->u.i.i2 - 1)
-                        {
-                            _gmx_selparser_error(scanner, "extra values skipped");
-                        }
+                        bTooManyValues = (j != value->u.i.i2 - 1);
+                    }
+                    if (bTooManyValues)
+                    {
+                        std::string text(_gmx_sel_lexer_get_text(scanner, value->location()));
+                        std::string message
+                            = formatString("Range ('%s') produces more values than is "
+                                           "accepted in this context",
+                                           text.c_str());
+                        GMX_THROW(InvalidInputError(message));
                     }
                     --i;
                     break;
+                }
                 case REAL_VALUE:
                     if (value->u.r.r1 != value->u.r.r2)
                     {
-                        _gmx_selparser_error(scanner, "real ranges not supported");
-                        return false;
+                        std::string text(_gmx_sel_lexer_get_text(scanner, value->location()));
+                        std::string message
+                            = formatString("Real range ('%s') is not supported in this context",
+                                           text.c_str());
+                        GMX_THROW(InvalidInputError(message));
                     }
                     param->val.u.r[i] = value->u.r.r1;
                     break;
                 case STR_VALUE:
-                    param->val.u.s[i] = strdup(value->stringValue().c_str());
+                    param->val.u.s[i] = gmx_strdup(value->stringValue().c_str());
                     break;
                 case POS_VALUE:
                     gmx_ana_pos_init_const(&param->val.u.p[i], value->u.x);
                     break;
                 case NO_VALUE:
                 case GROUP_VALUE:
-                    GMX_THROW(gmx::InternalError("Invalid non-expression value type"));
+                    GMX_THROW(InternalError("Invalid non-expression value type"));
             }
         }
         ++i;
     }
     if (value != values.end())
     {
-        _gmx_selparser_error(scanner, "extra values");
-        return false;
+        std::string message
+            = formatString("Too many values provided, expected %d",
+                           param->val.nr);
+        GMX_THROW(InvalidInputError(message));
     }
     if (i < param->val.nr)
     {
-        _gmx_selparser_error(scanner, "not enough values");
-        return false;
+        std::string message
+            = formatString("Too few values provided, expected %d",
+                           param->val.nr);
+        GMX_THROW(InvalidInputError(message));
     }
     if (!bDynamic)
     {
@@ -896,8 +914,6 @@ parse_values_std(const SelectionParserValueList &values,
         *param->nvalptr = param->val.nr;
     }
     param->nvalptr = NULL;
-
-    return true;
 }
 
 /*! \brief
@@ -907,19 +923,21 @@ parse_values_std(const SelectionParserValueList &values,
  * \param[in] values List of values.
  * \param     param  Parameter to parse.
  * \param[in] scanner Scanner data structure.
- * \returns   true if the values were parsed successfully, false otherwise.
  */
-static bool
+static void
 parse_values_bool(const std::string &name,
                   const SelectionParserValueList &values,
                   gmx_ana_selparam_t *param, void *scanner)
 {
+    GMX_UNUSED_VALUE(scanner);
     GMX_ASSERT(param->val.type == NO_VALUE,
                "Boolean parser called for non-boolean parameter");
     if (values.size() > 1 || (!values.empty() && values.front().type != INT_VALUE))
     {
-        _gmx_selparser_error(scanner, "parameter takes only a yes/no/on/off/0/1 value");
-        return false;
+        std::string message
+            = formatString("'%s' only accepts yes/no/on/off/0/1 (and empty) as a value",
+                           param->name);
+        GMX_THROW(InvalidInputError(message));
     }
 
     bool bSetNo = false;
@@ -931,9 +949,10 @@ parse_values_bool(const std::string &name,
     }
     if (bSetNo && !values.empty())
     {
-        _gmx_selparser_error(scanner, "parameter 'no%s' should not have a value",
-                             param->name);
-        return false;
+        std::string message
+            = formatString("'no%s' cannot be followed by any value",
+                           param->name);
+        GMX_THROW(InvalidInputError(message));
     }
     if (!values.empty() && values.front().u.i.i1 == 0)
     {
@@ -941,7 +960,6 @@ parse_values_bool(const std::string &name,
     }
 
     *param->val.u.b = bSetNo ? false : true;
-    return true;
 }
 
 /*! \brief
@@ -952,7 +970,7 @@ parse_values_bool(const std::string &name,
  * \param[in] scanner Scanner data structure.
  * \returns   true if the values were parsed successfully, false otherwise.
  */
-static bool
+static void
 parse_values_enum(const SelectionParserValueList &values,
                   gmx_ana_selparam_t             *param,
                   void                           *scanner)
@@ -961,16 +979,19 @@ parse_values_enum(const SelectionParserValueList &values,
                "Enum parser called for non-string parameter");
     if (values.size() != 1)
     {
-        _gmx_selparser_error(scanner, "a single value is required");
-        return false;
+        GMX_THROW(InvalidInputError(
+                          "Only a single string value is supported in this context"));
     }
     const SelectionParserValue &value = values.front();
     GMX_RELEASE_ASSERT(value.type == param->val.type,
                        "Invalid value type (should have been caught earlier)");
     if (value.hasExpressionValue())
     {
-        _gmx_selparser_error(scanner, "expression value for enumerated parameter not supported");
-        return false;
+        std::string text(_gmx_sel_lexer_get_text(scanner, value.location()));
+        std::string message
+            = formatString("Expression ('%s') is not supported in this context",
+                           text.c_str());
+        GMX_THROW(InvalidInputError(message));
     }
 
     const std::string &svalue = value.stringValue();
@@ -978,13 +999,14 @@ parse_values_enum(const SelectionParserValueList &values,
     int                match  = 0;
     while (param->val.u.s[i] != NULL)
     {
-        if (gmx::startsWith(param->val.u.s[i], svalue))
+        if (startsWith(param->val.u.s[i], svalue))
         {
             /* Check if there is a duplicate match */
             if (match > 0)
             {
-                _gmx_selparser_error(scanner, "ambiguous value");
-                return false;
+                std::string message
+                    = formatString("Value '%s' is ambiguous", svalue.c_str());
+                GMX_THROW(InvalidInputError(message));
             }
             match = i;
         }
@@ -992,11 +1014,11 @@ parse_values_enum(const SelectionParserValueList &values,
     }
     if (match == 0)
     {
-        _gmx_selparser_error(scanner, "invalid value");
-        return false;
+        std::string message
+            = formatString("Value '%s' is not recognized", svalue.c_str());
+        GMX_THROW(InvalidInputError(message));
     }
     param->val.u.s[0] = param->val.u.s[match];
-    return true;
 }
 
 /*! \brief
@@ -1013,24 +1035,25 @@ convert_const_values(SelectionParserValueList *values)
         if (value->hasExpressionValue() && value->expr->v.type != GROUP_VALUE &&
             value->expr->type == SEL_CONST)
         {
-            SelectionTreeElementPointer expr = value->expr;
+            SelectionTreeElementPointer expr     = value->expr;
+            const SelectionLocation    &location = value->location();
             switch (expr->v.type)
             {
                 case INT_VALUE:
-                    *value = SelectionParserValue::createInteger(expr->v.u.i[0]);
+                    *value = SelectionParserValue::createInteger(expr->v.u.i[0], location);
                     break;
                 case REAL_VALUE:
-                    *value = SelectionParserValue::createReal(expr->v.u.r[0]);
+                    *value = SelectionParserValue::createReal(expr->v.u.r[0], location);
                     break;
                 case STR_VALUE:
-                    *value = SelectionParserValue::createString(expr->v.u.s[0]);
+                    *value = SelectionParserValue::createString(expr->v.u.s[0], location);
                     break;
                 case POS_VALUE:
-                    *value = SelectionParserValue::createPosition(expr->v.u.p->x[0]);
+                    *value = SelectionParserValue::createPosition(expr->v.u.p->x[0], location);
                     break;
                 default:
-                    GMX_THROW(gmx::InternalError(
-                                      "Unsupported constant expression value type"));
+                    GMX_RELEASE_ASSERT(false,
+                                       "Unsupported constant expression value type");
             }
         }
     }
@@ -1042,7 +1065,6 @@ convert_const_values(SelectionParserValueList *values)
  * \param     params  Array of parameters to parse.
  * \param     root    Selection element to which child expressions are added.
  * \param[in] scanner Scanner data structure.
- * \returns   true if the parameters were parsed successfully, false otherwise.
  *
  * Initializes the \p params array based on the parameters in \p pparams.
  * See the documentation of \c gmx_ana_selparam_t for different options
@@ -1051,155 +1073,157 @@ convert_const_values(SelectionParserValueList *values)
  * The list \p pparams and any associated values are freed after the parameters
  * have been processed, no matter is there was an error or not.
  */
-bool
+void
 _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
                       int nparam, gmx_ana_selparam_t *params,
                       const gmx::SelectionTreeElementPointer &root,
                       void *scanner)
 {
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    gmx_ana_selparam_t          *oparam;
-    bool                         bOk, rc;
-    int                          i;
-
+    ExceptionInitializer errors("");
     /* Check that the value pointers of SPAR_VARNUM parameters are NULL and
      * that they are not NULL for other parameters */
-    bOk = true;
-    for (i = 0; i < nparam; ++i)
+    for (int i = 0; i < nparam; ++i)
     {
-        std::string                contextStr = gmx::formatString("In parameter '%s'", params[i].name);
-        gmx::MessageStringContext  context(errors, contextStr);
-        if (params[i].val.type != POS_VALUE && (params[i].flags & (SPAR_VARNUM | SPAR_ATOMVAL)))
+        if (params[i].val.type != POS_VALUE
+            && (params[i].flags & (SPAR_VARNUM | SPAR_ATOMVAL)))
         {
-            if (params[i].val.u.ptr != NULL)
-            {
-                _gmx_selparser_error(scanner, "value pointer is not NULL "
-                                     "although it should be for SPAR_VARNUM "
-                                     "and SPAR_ATOMVAL parameters");
-            }
-            if ((params[i].flags & SPAR_VARNUM)
-                && (params[i].flags & SPAR_DYNAMIC) && !params[i].nvalptr)
-            {
-                _gmx_selparser_error(scanner, "nvalptr is NULL but both "
-                                     "SPAR_VARNUM and SPAR_DYNAMIC are specified");
-                bOk = false;
-            }
+            GMX_RELEASE_ASSERT(params[i].val.u.ptr == NULL,
+                               "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,
+                               "nvalptr is NULL but both "
+                               "SPAR_VARNUM and SPAR_DYNAMIC are specified");
         }
         else
         {
-            if (params[i].val.u.ptr == NULL)
-            {
-                _gmx_selparser_error(scanner, "value pointer is NULL");
-                bOk = false;
-            }
+            GMX_RELEASE_ASSERT(params[i].val.u.ptr != NULL,
+                               "value pointer is NULL");
         }
     }
-    if (!bOk)
-    {
-        return false;
-    }
     /* Parse the parameters */
-    i = 0;
+    int nullParamIndex = 0;
     SelectionParserParameterList::const_iterator pparam;
     for (pparam = pparams.begin(); pparam != pparams.end(); ++pparam)
     {
-        std::string contextStr;
-        /* Find the parameter and make some checks */
-        if (!pparam->name().empty())
-        {
-            contextStr = gmx::formatString("In parameter '%s'", pparam->name().c_str());
-            i          = -1;
-            oparam     = gmx_ana_selparam_find(pparam->name().c_str(), nparam, params);
-        }
-        else if (i >= 0)
+        try
         {
-            contextStr = gmx::formatString("In value %d", i + 1);
-            oparam     = &params[i];
-            if (oparam->name != NULL)
+            // Always assigned afterwards, but cppcheck does not see that.
+            gmx_ana_selparam_t *oparam = NULL;
+            /* Find the parameter and make some checks */
+            if (!pparam->name().empty())
             {
-                oparam = NULL;
-                _gmx_selparser_error(scanner, "too many NULL parameters provided");
-                bOk = false;
-                continue;
+                nullParamIndex = -1;
+                oparam
+                    = gmx_ana_selparam_find(pparam->name().c_str(), nparam, params);
+                GMX_RELEASE_ASSERT(oparam != NULL, "Inconsistent selection parameter");
             }
-            ++i;
-        }
-        else
-        {
-            _gmx_selparser_error(scanner, "all NULL parameters should appear in the beginning of the list");
-            bOk = false;
-            continue;
-        }
-        gmx::MessageStringContext  context(errors, contextStr);
-        if (!oparam)
-        {
-            _gmx_selparser_error(scanner, "unknown parameter skipped");
-            bOk = false;
-            continue;
-        }
-        if (oparam->val.type != NO_VALUE && pparam->values().empty())
-        {
-            _gmx_selparser_error(scanner, "no value provided");
-            bOk = false;
-            continue;
-        }
-        if (oparam->flags & SPAR_SET)
-        {
-            _gmx_selparser_error(scanner, "parameter set multiple times, extra values skipped");
-            bOk = false;
-            continue;
-        }
-        oparam->flags |= SPAR_SET;
-        /* Process the values for the parameter */
-        convert_const_values(pparam->values_.get());
-        if (convert_values(pparam->values_.get(), oparam->val.type, scanner) != 0)
-        {
-            _gmx_selparser_error(scanner, "invalid value");
-            bOk = false;
-            continue;
-        }
-        if (oparam->val.type == NO_VALUE)
-        {
-            rc = parse_values_bool(pparam->name(), pparam->values(), oparam, scanner);
-        }
-        else if (oparam->flags & SPAR_RANGES)
-        {
-            rc = parse_values_range(pparam->values(), oparam, scanner);
-        }
-        else if (oparam->flags & SPAR_VARNUM)
-        {
-            if (pparam->values().size() == 1
-                && pparam->values().front().hasExpressionValue())
+            else if (nullParamIndex >= 0)
+            {
+                oparam = &params[nullParamIndex];
+                if (oparam->name != NULL)
+                {
+                    std::string text(_gmx_sel_lexer_get_text(scanner, pparam->location()));
+                    std::string message
+                        = formatString("Unexpected '%s'", text.c_str());
+                    GMX_THROW(InvalidInputError(message));
+                }
+                ++nullParamIndex;
+            }
+            else
+            {
+                GMX_RELEASE_ASSERT(false, "All NULL parameters should appear in "
+                                   "the beginning of the list");
+            }
+            if (oparam->flags & SPAR_SET)
+            {
+                std::string message
+                    = formatString("'%s' appears multiple times",
+                                   pparam->name().c_str());
+                GMX_THROW(InvalidInputError(message));
+            }
+            oparam->flags |= SPAR_SET;
+            if (oparam->val.type != NO_VALUE && pparam->values().empty())
+            {
+                std::string text;
+                if (pparam->name().empty())
+                {
+                    text = root->name();
+                }
+                else
+                {
+                    text = _gmx_sel_lexer_get_text(scanner, pparam->location());
+                }
+                std::string message
+                    = formatString("'%s' should be followed by a value/expression",
+                                   text.c_str());
+                GMX_THROW(InvalidInputError(message));
+            }
+            /* Process the values for the parameter */
+            convert_const_values(pparam->values_.get());
+            convert_values(pparam->values_.get(), oparam->val.type, scanner);
+            if (oparam->val.type == NO_VALUE)
+            {
+                parse_values_bool(pparam->name(), pparam->values(), oparam, scanner);
+            }
+            else if (oparam->flags & SPAR_RANGES)
+            {
+                parse_values_range(pparam->values(), oparam, scanner);
+            }
+            else if (oparam->flags & SPAR_VARNUM)
+            {
+                if (pparam->values().size() == 1
+                    && pparam->values().front().hasExpressionValue())
+                {
+                    parse_values_varnum_expr(pparam->values(), oparam, root, scanner);
+                }
+                else
+                {
+                    parse_values_varnum(pparam->values(), oparam, root, scanner);
+                }
+            }
+            else if (oparam->flags & SPAR_ENUMVAL)
             {
-                rc = parse_values_varnum_expr(pparam->values(), oparam, root, scanner);
+                parse_values_enum(pparam->values(), oparam, scanner);
             }
             else
             {
-                rc = parse_values_varnum(pparam->values(), oparam, root, scanner);
+                parse_values_std(pparam->values(), oparam, root, scanner);
             }
         }
-        else if (oparam->flags & SPAR_ENUMVAL)
-        {
-            rc = parse_values_enum(pparam->values(), oparam, scanner);
-        }
-        else
-        {
-            rc = parse_values_std(pparam->values(), oparam, root, scanner);
-        }
-        if (!rc)
+        catch (UserInputError &ex)
         {
-            bOk = false;
+            if (!pparam->name().empty())
+            {
+                std::string text(_gmx_sel_lexer_get_text(scanner, pparam->location()));
+                ex.prependContext(formatString("In '%s'", text.c_str()));
+            }
+            errors.addCurrentExceptionAsNested();
         }
     }
     /* Check that all required parameters are present */
-    for (i = 0; i < nparam; ++i)
+    for (int i = 0; i < nparam; ++i)
     {
         if (!(params[i].flags & SPAR_OPTIONAL) && !(params[i].flags & SPAR_SET))
         {
-            _gmx_selparser_error(scanner, "required parameter '%s' not specified", params[i].name);
-            bOk = false;
+            std::string message;
+            if (params[i].name == NULL)
+            {
+                message = formatString("'%s' should be followed by a value/expression",
+                                       root->name().c_str());
+            }
+            else
+            {
+                message = formatString("'%s' is missing", params[i].name);
+            }
+            InvalidInputError ex(message);
+            errors.addNested(ex);
         }
     }
-
-    return bOk;
+    if (errors.hasNestedExceptions())
+    {
+        GMX_THROW(InvalidInputError(errors));
+    }
 }
index bf326b2516e6e6c7358d71e567ab6f2975b856c0..4c864432341baf91f84499cdd15d380b83ed33f7 100644 (file)
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.6.2.  */
+/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
 
 /* Bison implementation for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2013 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
@@ -44,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.6.2"
+#define YYBISON_VERSION "2.7.12-4996"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
 /* Pull parsers.  */
 #define YYPULL 0
 
+/* "%code top" blocks.  */
+/* Line 349 of yacc.c  */
+#line 43 "parser.y"
+
+/*! \internal \file parser.cpp
+ * \brief Generated (from parser.y by Bison) parser for the selection language.
+ *
+ * \ingroup module_selection
+ */
+/*! \internal \file parser.h
+ * \brief Generated (from parser.y by Bison) parser include file.
+ *
+ * \ingroup module_selection
+ */
+#include "gmxpre.h"
+
+
+/* Line 349 of yacc.c  */
+#line 80 "parser.cpp"
 
 /* Substitute the variable and function names.  */
 #define yypush_parse    _gmx_sel_yypush_parse
 #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 336 of yacc.c  */
-#line 43 "parser.y"
+/* Line 371 of yacc.c  */
+#line 56 "parser.y"
 
-/*! \internal \file parser.cpp
- * \brief Generated (from parser.y by Bison) parser for the selection language.
- *
- * \ingroup module_selection
- */
-/*! \internal \file parser.h
- * \brief Generated (from parser.y by Bison) parser include file.
- *
- * \ingroup module_selection
- */
-#include "gromacs/utility/scoped_ptr_sfree.h"
+#include "gromacs/utility/scoped_cptr.h"
 
 #include "parser_internal.h"
 
-using gmx::scoped_ptr_sfree;
+using gmx::scoped_guard_sfree;
 using gmx::SelectionParserValue;
 using gmx::SelectionParserValueList;
 using gmx::SelectionParserValueListPointer;
@@ -103,8 +113,8 @@ using gmx::SelectionTreeElementPointer;
 #pragma warning(disable: 4065)
 #endif
 
-/* Line 336 of yacc.c  */
-#line 108 "parser.cpp"
+/* Line 371 of yacc.c  */
+#line 118 "parser.cpp"
 
 # ifndef YY_NULL
 #  if defined __cplusplus && 201103L <= __cplusplus
@@ -124,8 +134,8 @@ using gmx::SelectionTreeElementPointer;
 
 /* In a future release of Bison, this section will be replaced
    by #include "parser.h".  */
-#ifndef _GMX_SEL_YY_PARSER_H
-# define _GMX_SEL_YY_PARSER_H
+#ifndef YY__GMX_SEL_YY_PARSER_H_INCLUDED
+# define YY__GMX_SEL_YY_PARSER_H_INCLUDED
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 1
@@ -134,7 +144,7 @@ using gmx::SelectionTreeElementPointer;
 extern int _gmx_sel_yydebug;
 #endif
 /* "%code requires" blocks.  */
-/* Line 350 of yacc.c  */
+/* Line 387 of yacc.c  */
 #line 1 "parser.y"
 
 /*
@@ -172,15 +182,17 @@ extern int _gmx_sel_yydebug;
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-/* Line 350 of yacc.c  */
-#line 73 "parser.y"
+/* Line 387 of yacc.c  */
+#line 76 "parser.y"
 
 #include "parsetree.h"
 #include "selelem.h"
 
+#define YYLTYPE ::gmx::SelectionLocation
 
-/* Line 350 of yacc.c  */
-#line 184 "parser.cpp"
+
+/* Line 387 of yacc.c  */
+#line 196 "parser.cpp"
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
@@ -226,8 +238,8 @@ extern int _gmx_sel_yydebug;
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
 {
-/* Line 350 of yacc.c  */
-#line 78 "parser.y"
+/* Line 387 of yacc.c  */
+#line 83 "parser.y"
 
     int                         i;
     real                        r;
@@ -243,14 +255,27 @@ typedef union YYSTYPE
     gmx::SelectionParserParameterListPointer    *plist;
 
 
-/* Line 350 of yacc.c  */
-#line 248 "parser.cpp"
+/* Line 387 of yacc.c  */
+#line 260 "parser.cpp"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef 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
@@ -260,7 +285,7 @@ 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, void *scanner);
+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
@@ -276,12 +301,12 @@ void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
 void _gmx_sel_yypstate_delete ();
 #endif
 
-#endif /* !_GMX_SEL_YY_PARSER_H  */
+#endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED  */
 
 /* Copy the second part of user declarations.  */
 
-/* Line 353 of yacc.c  */
-#line 285 "parser.cpp"
+/* Line 390 of yacc.c  */
+#line 310 "parser.cpp"
 
 #ifdef short
 # undef short
@@ -334,24 +359,33 @@ typedef short int yytype_int16;
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
 #  endif
 # endif
 # ifndef YY_
-#  define YY_(msgid) msgid
+#  define YY_(Msgid) Msgid
+# 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 */
 # endif
 #endif
 
 /* Suppress unused-variable warnings by "using" E.  */
 #if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
 #else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
 #endif
 
+
 /* Identity function, used to suppress warnings about constant conditions.  */
 #ifndef lint
-# define YYID(n) (n)
+# define YYID(N) (N)
 #else
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
@@ -414,14 +448,16 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
 
 
 #if (! defined yyoverflow \
-     && (! defined __cplusplus \
-        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+     && (! defined __cplusplus || defined GMX_YYFORCE_C_STACK_EXTENSION \
+        || (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
 {
   yytype_int16 yyss_alloc;
   YYSTYPE yyvs_alloc;
+  YYLTYPE yyls_alloc;
 };
 
 /* The size of the maximum gap between one aligned stack and the next.  */
@@ -430,8 +466,8 @@ union yyalloc
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+      + 2 * YYSTACK_GAP_MAXIMUM)
 
 # define YYCOPY_NEEDED 1
 
@@ -476,16 +512,16 @@ union yyalloc
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  2
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   378
+#define YYLAST   367
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  49
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  25
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  89
+#define YYNRULES  90
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  149
+#define YYNSTATES  154
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -531,17 +567,18 @@ static const yytype_uint8 yytranslate[] =
 #if YYDEBUG
 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    YYRHS.  */
-static const yytype_uint8 yyprhs[] =
+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,   131,   135,   139,
-     143,   147,   150,   154,   158,   160,   163,   171,   175,   178,
-     182,   184,   186,   188,   190,   193,   194,   197,   200,   202,
-     206,   207,   210,   214,   216,   220,   222,   225,   229,   231,
-     233,   235,   237,   239,   241,   243,   245,   247,   251,   255
+     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.  */
@@ -549,7 +586,7 @@ 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,
-      57,    53,    -1,     7,    39,    58,    -1,     7,    39,    61,
+       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,
@@ -559,34 +596,36 @@ static const yytype_int8 yyrhs[] =
       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,    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
+       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.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   193,   193,   198,   209,   210,   232,   237,   248,   260,
-     266,   273,   280,   287,   297,   298,   305,   306,   320,   321,
-     325,   326,   329,   330,   333,   334,   342,   353,   364,   375,
-     379,   390,   397,   406,   407,   412,   413,   414,   418,   426,
-     434,   442,   453,   468,   479,   493,   501,   512,   518,   524,
-     530,   536,   542,   548,   555,   566,   581,   590,   594,   604,
-     618,   626,   634,   647,   649,   655,   660,   671,   680,   681,
-     686,   691,   699,   710,   711,   715,   721,   729,   739,   745,
-     751,   757,   763,   767,   773,   779,   786,   790,   796,   802
+       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
 };
 #endif
 
@@ -633,10 +672,11 @@ static const yytype_uint8 yyr1[] =
       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,    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
+      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 composing right hand side of rule YYN.  */
@@ -646,11 +686,12 @@ static const yytype_uint8 yyr2[] =
        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,     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
+       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
 };
 
 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
@@ -658,59 +699,61 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-       2,     0,     1,     0,    43,    44,    24,    25,     0,    61,
-      60,    62,    34,    65,    33,     0,     0,     0,     0,     3,
-       0,     9,     8,    15,     0,     0,    14,     5,     0,    32,
-      25,    31,     0,    58,    63,    43,    34,     0,    26,     0,
-       0,    51,     0,    15,     0,    14,    18,    20,     0,    22,
-      23,     0,     4,    65,    10,     0,     0,    45,     0,    38,
-      65,    65,     0,     0,     0,     0,     0,     0,     0,    11,
-      12,    13,    59,    70,    64,    66,     0,     0,    45,    16,
-      29,    53,    57,    19,    21,     0,    17,    28,    27,     0,
-      83,    84,    85,    41,    73,    75,    86,    37,    35,    36,
-       0,    39,    46,    42,    30,    47,    48,    49,    50,    52,
-       0,    70,    67,    68,     0,     0,     0,     0,     0,    76,
-      40,     0,    43,    44,     0,     0,     0,     0,    54,    78,
-       0,    80,    81,    79,    71,    82,     0,    74,    87,    88,
-      89,    77,    69,    43,    44,    72,    55,     0,    56
+       2,     0,     1,     0,    43,    44,    24,    25,     0,    62,
+      61,    63,    34,    66,    33,     0,     0,     0,     0,     3,
+       0,     9,     8,    15,     0,     0,    14,     5,    43,    10,
+       0,    32,    24,    25,    31,     0,    59,    64,    34,     0,
+      26,     0,     0,    52,     0,    15,     0,    14,    18,    20,
+       0,    22,    23,     0,     4,    66,     0,     0,    45,     0,
+      38,    66,    66,     0,     0,     0,     0,     0,     0,     0,
+      11,    12,    13,    60,    71,    65,    67,     0,     0,    45,
+      16,    29,    54,    58,    19,    21,     0,    17,    28,    27,
+       0,     0,    84,    85,    86,    41,    74,    76,    87,    37,
+      35,    36,     0,    39,    47,    42,    30,    48,    49,    50,
+      51,    53,     0,    71,    68,    69,     0,     0,     0,    46,
+       0,     0,     0,     0,    77,    40,     0,    43,    44,     0,
+       0,     0,     0,    55,    79,     0,    81,    82,    80,    72,
+      83,     0,    75,    88,    89,    90,    78,    70,    43,    44,
+      73,    56,     0,    57
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
-      -1,     1,    19,    20,    21,    90,    91,    51,    92,   129,
-      24,   100,    25,   132,   133,    33,    34,    75,   112,   113,
-     101,    94,   134,    95,    96
+      -1,     1,    19,    20,    21,    92,    93,    53,    94,   134,
+      24,   102,    25,   137,   138,    36,    37,    76,   114,   115,
+     103,    96,   139,    97,    98
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -84
+#define YYPACT_NINF -85
 static const yytype_int16 yypact[] =
 {
-     -84,   148,   -84,     4,     6,   -84,   -84,   -20,   189,   -84,
-     -84,   -84,     1,   -84,   -84,   322,   216,   285,     0,   -84,
-      27,    16,   285,    22,   122,   173,   -84,   -84,   308,   -84,
-     -84,   -84,   322,   -84,    71,   -84,   -84,   322,   -84,   216,
-      49,    24,   -11,   -13,   232,    23,   -84,   -84,   140,   -84,
-     -84,    21,   -84,   -84,    16,   322,   322,    40,   197,   -84,
-     -84,   -84,   216,   216,   216,   216,   216,   216,   308,    22,
-     173,   -84,    22,    30,   -84,   -84,   -13,    47,   -84,   -84,
-     -84,   -84,   -84,   -84,   -84,     0,   -84,    56,   -84,    85,
-      93,    99,   -84,   -84,   210,   -84,   -84,   -84,   -84,   -84,
-      36,   -84,   -84,   -84,   139,    94,    94,    24,    24,    24,
-      23,   -84,   -84,   241,    78,    17,     0,     0,    85,   -84,
-     -84,   178,   116,   125,   338,   271,    93,    99,   -84,    22,
-     349,   139,   -84,   -84,   -84,   -84,     0,   -84,   -84,   -84,
-     -84,   -84,   -84,   133,   136,   -84,   197,   104,   -84
+     -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[] =
 {
-     -84,   -84,   -84,   -84,    -4,   -17,   -15,   -83,    -1,   110,
-       9,   -84,    -8,   -84,    10,    54,   -84,   -84,   -84,    51,
-     -51,    62,    33,   -79,   -28
+     -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
@@ -719,92 +762,90 @@ static const yytype_int8 yypgoto[] =
 #define YYTABLE_NINF -22
 static const yytype_int16 yytable[] =
 {
-      22,    49,   114,    50,    46,    47,    93,    31,    41,    44,
-      53,    26,    27,    42,    -7,   119,    55,    56,    54,    28,
-      70,    46,    47,     6,    30,    40,    32,    45,    80,    44,
-      79,    77,    26,    48,   140,    52,   119,    53,    71,   141,
-      46,    47,     6,    30,    46,    47,     6,    30,    40,   120,
-      48,    55,    56,   147,   104,   105,   106,   107,   108,   109,
-      44,    67,   118,    78,    82,   137,    85,    60,    49,    48,
-      50,    40,    40,    40,    40,    40,    40,   111,   110,    63,
-      64,    65,    66,    89,    67,   135,    56,    89,    81,    46,
-      47,     6,    30,   135,    73,    74,   126,   135,   127,   138,
-      49,   139,    50,   116,   126,   131,   127,    86,   126,   117,
-     127,    23,   128,   131,   102,   103,    41,   131,    48,    49,
-     128,    50,   130,   136,   128,    38,   -18,    43,    65,    66,
-     130,    67,    23,    40,   130,   -20,    57,    58,    69,    59,
-      60,    61,    72,   -19,    83,    84,   -21,    76,     2,     3,
-     148,   115,     4,     5,     6,     7,    -6,     8,   145,     9,
-      10,    11,   121,     0,    12,    87,    88,     0,    13,     0,
-      14,    63,    64,    65,    66,     0,    67,     0,    76,    15,
-       0,    16,   122,   123,     6,    30,     0,     8,    17,     9,
-      10,    11,    18,    29,    12,     6,    30,     0,    13,    62,
-      14,    46,    47,     6,    30,    63,    64,    65,    66,    15,
-      67,   124,     0,     0,    46,    47,     6,    30,    68,     0,
-      35,     5,    18,   125,     0,     0,   142,     9,     0,     0,
-      48,     0,    36,     0,     0,     0,    97,     0,    14,    98,
-      99,     0,     0,    48,    89,   122,   123,     6,    30,    16,
-       8,     0,     9,    10,    11,   118,    39,    12,    62,     0,
-       0,    13,     0,    14,    63,    64,    65,    66,     0,    67,
-       0,     0,    15,    81,   124,   122,   123,     6,    30,     0,
-       8,    68,     9,    10,    11,    18,   125,    12,     0,    35,
-       5,    13,     0,    14,     8,     0,     9,    10,    11,     0,
-       0,    12,    15,     0,   124,    13,     0,    14,     0,     0,
-       0,    68,    35,     5,     0,    18,    15,     8,    16,     9,
-      10,    11,     0,     0,    12,    17,    35,     5,    13,    18,
-      14,     8,     0,     9,    10,     0,     0,     0,    36,    15,
-       0,    16,   143,   144,    14,     0,     0,     0,    68,     9,
-       0,     0,    18,    15,    36,    16,     0,     0,     0,     0,
-      14,     0,    37,    57,   146,     0,    59,    60,    61,     0,
-       0,    16,     0,     0,     0,     0,     0,     0,    39
+      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,
+     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,
+     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,
+      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,
+      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,
+      15,     0,   129,    13,     0,    14,     0,     0,     0,    69,
+      28,     5,     0,    18,    15,     8,    16,     9,    10,    11,
+       0,     0,    12,    17,    28,     5,    13,    18,    14,     8,
+       0,     9,    10,     0,     0,     0,    38,    15,     0,    16,
+     148,   149,    14,     0,     0,     0,    69,     9,    63,     0,
+      18,    15,    38,    16,    64,    65,    66,    67,    14,    68,
+      39,    64,    65,    66,    67,     0,    68,     0,     0,    16,
+      82,     0,    64,    65,    66,    67,    41,    68
 };
 
-#define yypact_value_is_default(yystate) \
-  ((yystate) == (-84))
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-85)))
 
-#define yytable_value_is_error(yytable_value) \
+#define yytable_value_is_error(Yytable_value) \
   YYID (0)
 
 static const yytype_int16 yycheck[] =
 {
-       1,    18,    85,    18,     4,     5,    57,     8,    16,    17,
-      21,     1,     8,    17,     8,    94,    29,    30,    22,    39,
-      28,     4,     5,     6,     7,    16,    25,    17,    41,    37,
-      41,    39,    22,    33,   117,     8,   115,    21,    28,   118,
-       4,     5,     6,     7,     4,     5,     6,     7,    39,   100,
-      33,    29,    30,   136,    62,    63,    64,    65,    66,    67,
-      68,    37,    45,    14,    41,    48,    45,    18,    85,    33,
-      85,    62,    63,    64,    65,    66,    67,    47,    68,    32,
-      33,    34,    35,    47,    37,   113,    30,    47,    41,     4,
-       5,     6,     7,   121,    23,    24,   113,   125,   113,   116,
-     117,   116,   117,    10,   121,   113,   121,    53,   125,    10,
-     125,     1,   113,   121,    60,    61,   124,   125,    33,   136,
-     121,   136,   113,    45,   125,    15,    10,    17,    34,    35,
-     121,    37,    22,   124,   125,    10,    14,    15,    28,    17,
-      18,    19,    32,    10,     4,     5,    10,    37,     0,     1,
-      46,    89,     4,     5,     6,     7,     8,     9,   125,    11,
-      12,    13,   111,    -1,    16,    55,    56,    -1,    20,    -1,
-      22,    32,    33,    34,    35,    -1,    37,    -1,    68,    31,
-      -1,    33,     4,     5,     6,     7,    -1,     9,    40,    11,
-      12,    13,    44,     4,    16,     6,     7,    -1,    20,    26,
-      22,     4,     5,     6,     7,    32,    33,    34,    35,    31,
-      37,    33,    -1,    -1,     4,     5,     6,     7,    40,    -1,
-       4,     5,    44,    45,    -1,    -1,    48,    11,    -1,    -1,
-      33,    -1,    16,    -1,    -1,    -1,    39,    -1,    22,    42,
-      43,    -1,    -1,    33,    47,     4,     5,     6,     7,    33,
-       9,    -1,    11,    12,    13,    45,    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,    31,    -1,    33,    20,    -1,    22,    -1,    -1,
-      -1,    40,     4,     5,    -1,    44,    31,     9,    33,    11,
-      12,    13,    -1,    -1,    16,    40,     4,     5,    20,    44,
-      22,     9,    -1,    11,    12,    -1,    -1,    -1,    16,    31,
-      -1,    33,     4,     5,    22,    -1,    -1,    -1,    40,    11,
-      -1,    -1,    44,    31,    16,    33,    -1,    -1,    -1,    -1,
-      22,    -1,    40,    14,    15,    -1,    17,    18,    19,    -1,
-      -1,    33,    -1,    -1,    -1,    -1,    -1,    -1,    40
+       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,
+      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,
+      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,
+      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,
+       5,     6,     7,    14,    15,    40,    17,    18,    19,    44,
+      45,    14,    15,    48,    17,    18,    19,    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,
+      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,
+      31,    -1,    33,    20,    -1,    22,    -1,    -1,    -1,    40,
+       4,     5,    -1,    44,    31,     9,    33,    11,    12,    13,
+      -1,    -1,    16,    40,     4,     5,    20,    44,    22,     9,
+      -1,    11,    12,    -1,    -1,    -1,    16,    31,    -1,    33,
+       4,     5,    22,    -1,    -1,    -1,    40,    11,    26,    -1,
+      44,    31,    16,    33,    32,    33,    34,    35,    22,    37,
+      40,    32,    33,    34,    35,    -1,    37,    -1,    -1,    33,
+      41,    -1,    32,    33,    34,    35,    40,    37
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -813,19 +854,20 @@ static const yytype_uint8 yystos[] =
 {
        0,    50,     0,     1,     4,     5,     6,     7,     9,    11,
       12,    13,    16,    20,    22,    31,    33,    40,    44,    51,
-      52,    53,    57,    58,    59,    61,    63,     8,    39,     4,
-       7,    57,    25,    64,    65,     4,    16,    40,    58,    40,
-      59,    61,    53,    58,    61,    63,     4,     5,    33,    54,
-      55,    56,     8,    21,    53,    29,    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,    47,
-      54,    55,    57,    69,    70,    72,    73,    39,    42,    43,
-      60,    69,    64,    64,    61,    61,    61,    61,    61,    61,
-      63,    47,    67,    68,    56,    70,    10,    10,    45,    72,
-      69,    68,     4,     5,    33,    45,    54,    55,    57,    58,
-      59,    61,    62,    63,    71,    73,    45,    48,    54,    55,
-      56,    72,    48,     4,     5,    71,    15,    56,    46
+      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,
+      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,
+      25,    47,    54,    55,    57,    69,    70,    72,    73,    39,
+      42,    43,    60,    69,    64,    64,    61,    61,    61,    61,
+      61,    61,    63,    47,    67,    68,    56,    16,    40,    63,
+      70,    10,    10,    45,    72,    69,    68,     4,     5,    33,
+      45,    54,    55,    57,    58,    59,    61,    62,    63,    71,
+      73,    45,    48,    54,    55,    56,    72,    48,     4,     5,
+      71,    15,    56,    46
 };
 
 #define yyerrok                (yyerrstatus = 0)
@@ -867,15 +909,16 @@ do                                                              \
     }                                                           \
   else                                                          \
     {                                                           \
-      yyerror (scanner, YY_("syntax error: cannot back up")); \
+      yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
       YYERROR;                                                 \
     }                                                          \
 while (YYID (0))
 
-
+/* Error token number */
 #define YYTERROR       1
 #define YYERRCODE      256
 
+
 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    If N is 0, then set CURRENT to the empty location which ends
    the previous symbol: RHS[0] (always defined).  */
@@ -903,20 +946,63 @@ while (YYID (0))
 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
 
-
-/* This macro is provided for backward compatibility. */
+/* 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.  */
 
 #ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+
+/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
+
+__attribute__((__unused__))
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+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);
+      if (0 <= yylocp->first_column)
+        res += fprintf (yyo, ".%d", yylocp->first_column);
+    }
+  if (0 <= yylocp->last_line)
+    {
+      if (yylocp->first_line < yylocp->last_line)
+        {
+          res += fprintf (yyo, "-%d", yylocp->last_line);
+          if (0 <= end_col)
+            res += fprintf (yyo, ".%d", end_col);
+        }
+      else if (0 <= end_col && yylocp->first_column < end_col)
+        res += fprintf (yyo, "-%d", end_col);
+    }
+  return res;
+ }
+
+#  define YY_LOCATION_PRINT(File, Loc)          \
+  yy_location_print_ (File, &(Loc))
+
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
 #endif
 
 
 /* YYLEX -- calling `yylex' with the right arguments.  */
-
 #ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, YYLEX_PARAM)
+# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
 #else
-# define YYLEX yylex (&yylval)
+# define YYLEX yylex (&yylval, &yylloc)
 #endif
 
 /* Enable debugging if requested.  */
@@ -939,7 +1025,7 @@ do {                                                                         \
     {                                                                    \
       YYFPRINTF (stderr, "%s ", Title);                                          \
       yy_symbol_print (stderr,                                           \
-                 Type, Value, scanner); \
+                 Type, Value, Location, scanner); \
       YYFPRINTF (stderr, "\n");                                                  \
     }                                                                    \
 } while (YYID (0))
@@ -953,13 +1039,14 @@ do {                                                                       \
 #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, void *scanner)
+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, scanner)
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
     FILE *yyoutput;
     int yytype;
     YYSTYPE const * const yyvaluep;
+    YYLTYPE const * const yylocationp;
     void *scanner;
 #endif
 {
@@ -967,6 +1054,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner)
   YYUSE (yyo);
   if (!yyvaluep)
     return;
+  YYUSE (yylocationp);
   YYUSE (scanner);
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
@@ -974,11 +1062,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner)
 # else
   YYUSE (yyoutput);
 # endif
-  switch (yytype)
-    {
-      default:
-       break;
-    }
+  YYUSE (yytype);
 }
 
 
@@ -989,13 +1073,14 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner)
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner)
+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, scanner)
+yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner)
     FILE *yyoutput;
     int yytype;
     YYSTYPE const * const yyvaluep;
+    YYLTYPE const * const yylocationp;
     void *scanner;
 #endif
 {
@@ -1004,7 +1089,9 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, scanner)
   else
     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
 
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner);
+  YY_LOCATION_PRINT (yyoutput, *yylocationp);
+  YYFPRINTF (yyoutput, ": ");
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner);
   YYFPRINTF (yyoutput, ")");
 }
 
@@ -1047,11 +1134,12 @@ do {                                                            \
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner)
+yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
 #else
 static void
-yy_reduce_print (yyvsp, yyrule, scanner)
+yy_reduce_print (yyvsp, yylsp, yyrule, scanner)
     YYSTYPE *yyvsp;
+    YYLTYPE *yylsp;
     int yyrule;
     void *scanner;
 #endif
@@ -1067,7 +1155,7 @@ yy_reduce_print (yyvsp, yyrule, scanner)
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
                       &(yyvsp[(yyi + 1) - (yynrhs)])
-                                      , scanner);
+                      , &(yylsp[(yyi + 1) - (yynrhs)])                , scanner);
       YYFPRINTF (stderr, "\n");
     }
 }
@@ -1075,7 +1163,7 @@ yy_reduce_print (yyvsp, yyrule, scanner)
 # define YY_REDUCE_PRINT(Rule)         \
 do {                                   \
   if (yydebug)                         \
-    yy_reduce_print (yyvsp, Rule, scanner); \
+    yy_reduce_print (yyvsp, yylsp, Rule, scanner); \
 } while (YYID (0))
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
@@ -1221,7 +1309,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 {
   YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
-  YYSIZE_T yysize1;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
   const char *yyformat = YY_NULL;
@@ -1284,11 +1371,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                     break;
                   }
                 yyarg[yycount++] = yytname[yyx];
-                yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
-                if (! (yysize <= yysize1
-                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                  return 2;
-                yysize = yysize1;
+                {
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+                  if (! (yysize <= yysize1
+                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                    return 2;
+                  yysize = yysize1;
+                }
               }
         }
     }
@@ -1308,10 +1397,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 # undef YYCASE_
     }
 
-  yysize1 = yysize + yystrlen (yyformat);
-  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-    return 2;
-  yysize = yysize1;
+  {
+    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+      return 2;
+    yysize = yysize1;
+  }
 
   if (*yymsg_alloc < yysize)
     {
@@ -1352,17 +1443,19 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner)
 #else
 static void
-yydestruct (yymsg, yytype, yyvaluep, scanner)
+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)
@@ -1372,183 +1465,183 @@ yydestruct (yymsg, yytype, yyvaluep, scanner)
   switch (yytype)
     {
       case 6: /* STR */
-/* Line 1381 of yacc.c  */
-#line 173 "parser.y"
-       { free(((*yyvaluep).str));        };
-/* Line 1381 of yacc.c  */
-#line 1380 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 178 "parser.y"
+        { free(((*yyvaluep).str));        };
+/* Line 1393 of yacc.c  */
+#line 1473 "parser.cpp"
+        break;
       case 7: /* IDENTIFIER */
-/* Line 1381 of yacc.c  */
-#line 173 "parser.y"
-       { free(((*yyvaluep).str));        };
-/* Line 1381 of yacc.c  */
-#line 1387 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 178 "parser.y"
+        { free(((*yyvaluep).str));        };
+/* Line 1393 of yacc.c  */
+#line 1480 "parser.cpp"
+        break;
       case 16: /* KEYWORD_POS */
-/* Line 1381 of yacc.c  */
-#line 173 "parser.y"
-       { free(((*yyvaluep).str));        };
-/* Line 1381 of yacc.c  */
-#line 1394 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 178 "parser.y"
+        { free(((*yyvaluep).str));        };
+/* Line 1393 of yacc.c  */
+#line 1487 "parser.cpp"
+        break;
       case 23: /* PARAM */
-/* Line 1381 of yacc.c  */
-#line 174 "parser.y"
-       { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
-/* Line 1381 of yacc.c  */
-#line 1401 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 179 "parser.y"
+        { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
+/* Line 1393 of yacc.c  */
+#line 1494 "parser.cpp"
+        break;
       case 26: /* CMP_OP */
-/* Line 1381 of yacc.c  */
-#line 173 "parser.y"
-       { free(((*yyvaluep).str));        };
-/* Line 1381 of yacc.c  */
-#line 1408 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 178 "parser.y"
+        { free(((*yyvaluep).str));        };
+/* Line 1393 of yacc.c  */
+#line 1501 "parser.cpp"
+        break;
       case 50: /* commands */
-/* Line 1381 of yacc.c  */
-#line 175 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1415 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 180 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1508 "parser.cpp"
+        break;
       case 51: /* command */
-/* Line 1381 of yacc.c  */
-#line 175 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1422 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 180 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1515 "parser.cpp"
+        break;
       case 52: /* cmd_plain */
-/* Line 1381 of yacc.c  */
-#line 175 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1429 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 180 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1522 "parser.cpp"
+        break;
       case 53: /* selection */
-/* Line 1381 of yacc.c  */
-#line 175 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1436 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 180 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1529 "parser.cpp"
+        break;
       case 57: /* string */
-/* Line 1381 of yacc.c  */
-#line 173 "parser.y"
-       { free(((*yyvaluep).str));        };
-/* Line 1381 of yacc.c  */
-#line 1443 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 178 "parser.y"
+        { free(((*yyvaluep).str));        };
+/* Line 1393 of yacc.c  */
+#line 1536 "parser.cpp"
+        break;
       case 58: /* sel_expr */
-/* Line 1381 of yacc.c  */
-#line 176 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1450 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 181 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1543 "parser.cpp"
+        break;
       case 59: /* pos_mod */
-/* Line 1381 of yacc.c  */
-#line 174 "parser.y"
-       { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
-/* Line 1381 of yacc.c  */
-#line 1457 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 179 "parser.y"
+        { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
+/* Line 1393 of yacc.c  */
+#line 1550 "parser.cpp"
+        break;
       case 61: /* num_expr */
-/* Line 1381 of yacc.c  */
-#line 176 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1464 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 181 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1557 "parser.cpp"
+        break;
       case 62: /* str_expr */
-/* Line 1381 of yacc.c  */
-#line 176 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1471 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 181 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1564 "parser.cpp"
+        break;
       case 63: /* pos_expr */
-/* Line 1381 of yacc.c  */
-#line 176 "parser.y"
-       { delete ((*yyvaluep).sel);       };
-/* Line 1381 of yacc.c  */
-#line 1478 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 181 "parser.y"
+        { delete ((*yyvaluep).sel);       };
+/* Line 1393 of yacc.c  */
+#line 1571 "parser.cpp"
+        break;
       case 64: /* method_params */
-/* Line 1381 of yacc.c  */
-#line 177 "parser.y"
-       { delete ((*yyvaluep).plist);       };
-/* Line 1381 of yacc.c  */
-#line 1485 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 182 "parser.y"
+        { delete ((*yyvaluep).plist);       };
+/* Line 1393 of yacc.c  */
+#line 1578 "parser.cpp"
+        break;
       case 65: /* method_param_list */
-/* Line 1381 of yacc.c  */
-#line 177 "parser.y"
-       { delete ((*yyvaluep).plist);       };
-/* Line 1381 of yacc.c  */
-#line 1492 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 182 "parser.y"
+        { delete ((*yyvaluep).plist);       };
+/* Line 1393 of yacc.c  */
+#line 1585 "parser.cpp"
+        break;
       case 66: /* method_param */
-/* Line 1381 of yacc.c  */
-#line 177 "parser.y"
-       { delete ((*yyvaluep).param);       };
-/* Line 1381 of yacc.c  */
-#line 1499 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 182 "parser.y"
+        { delete ((*yyvaluep).param);       };
+/* Line 1393 of yacc.c  */
+#line 1592 "parser.cpp"
+        break;
       case 67: /* value_list */
-/* Line 1381 of yacc.c  */
-#line 178 "parser.y"
-       { delete ((*yyvaluep).vlist);       };
-/* Line 1381 of yacc.c  */
-#line 1506 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 183 "parser.y"
+        { delete ((*yyvaluep).vlist);       };
+/* Line 1393 of yacc.c  */
+#line 1599 "parser.cpp"
+        break;
       case 68: /* value_list_contents */
-/* Line 1381 of yacc.c  */
-#line 178 "parser.y"
-       { delete ((*yyvaluep).vlist);       };
-/* Line 1381 of yacc.c  */
-#line 1513 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 183 "parser.y"
+        { delete ((*yyvaluep).vlist);       };
+/* Line 1393 of yacc.c  */
+#line 1606 "parser.cpp"
+        break;
       case 69: /* basic_value_list */
-/* Line 1381 of yacc.c  */
-#line 178 "parser.y"
-       { delete ((*yyvaluep).vlist);       };
-/* Line 1381 of yacc.c  */
-#line 1520 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 183 "parser.y"
+        { delete ((*yyvaluep).vlist);       };
+/* Line 1393 of yacc.c  */
+#line 1613 "parser.cpp"
+        break;
       case 70: /* basic_value_list_contents */
-/* Line 1381 of yacc.c  */
-#line 178 "parser.y"
-       { delete ((*yyvaluep).vlist);       };
-/* Line 1381 of yacc.c  */
-#line 1527 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 183 "parser.y"
+        { delete ((*yyvaluep).vlist);       };
+/* Line 1393 of yacc.c  */
+#line 1620 "parser.cpp"
+        break;
       case 71: /* value_item */
-/* Line 1381 of yacc.c  */
-#line 179 "parser.y"
-       { delete ((*yyvaluep).val);       };
-/* Line 1381 of yacc.c  */
-#line 1534 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 184 "parser.y"
+        { delete ((*yyvaluep).val);       };
+/* Line 1393 of yacc.c  */
+#line 1627 "parser.cpp"
+        break;
       case 72: /* basic_value_item */
-/* Line 1381 of yacc.c  */
-#line 179 "parser.y"
-       { delete ((*yyvaluep).val);       };
-/* Line 1381 of yacc.c  */
-#line 1541 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 184 "parser.y"
+        { delete ((*yyvaluep).val);       };
+/* Line 1393 of yacc.c  */
+#line 1634 "parser.cpp"
+        break;
       case 73: /* value_item_range */
-/* Line 1381 of yacc.c  */
-#line 179 "parser.y"
-       { delete ((*yyvaluep).val);       };
-/* Line 1381 of yacc.c  */
-#line 1548 "parser.cpp"
-       break;
+/* Line 1393 of yacc.c  */
+#line 184 "parser.y"
+        { delete ((*yyvaluep).val);       };
+/* Line 1393 of yacc.c  */
+#line 1641 "parser.cpp"
+        break;
 
       default:
-       break;
+        break;
     }
 }
 
@@ -1566,6 +1659,7 @@ struct yypstate
     /* The stacks and their tools:
        `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.  */
@@ -1580,6 +1674,14 @@ struct yypstate
     YYSTYPE *yyvs;
     YYSTYPE *yyvsp;
 
+    /* The location stack.  */
+    YYLTYPE yylsa[YYINITDEPTH];
+    YYLTYPE *yyls;
+    YYLTYPE *yylsp;
+
+    /* The locations where the error started and ended.  */
+    YYLTYPE yyerror_range[3];
+
     YYSIZE_T yystacksize;
     /* Used to determine if this is the first time this instance has
        been used.  */
@@ -1633,6 +1735,10 @@ yypstate_delete (yyps)
 #define yyvsa yyps->yyvsa
 #define yyvs yyps->yyvs
 #define yyvsp yyps->yyvsp
+#define yylsa yyps->yylsa
+#define yyls yyps->yyls
+#define yylsp yyps->yylsp
+#define yyerror_range yyps->yyerror_range
 #define yystacksize yyps->yystacksize
 
 
@@ -1643,29 +1749,63 @@ yypstate_delete (yyps)
 #if (defined __STDC__ || defined __C99__FUNC__ \
      || defined __cplusplus || defined _MSC_VER)
 int
-yypush_parse (yypstate *yyps, int yypushed_char, YYSTYPE const *yypushed_val, void *scanner)
+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, scanner)
+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
+/* Default value used for initialization, for pacifying older GCCs
+   or non-GCC compilers.  */
+static YYSTYPE yyval_default;
+# define YY_INITIAL_VALUE(Value) = Value
+#endif
+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;
+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.  */
-  int yytoken;
+  int yytoken = 0;
   /* The variables used to return semantic value and location from the
      action routines.  */
   YYSTYPE yyval;
+  YYLTYPE yyloc;
 
 #if YYERROR_VERBOSE
   /* Buffer for error messages, and its allocated size.  */
@@ -1674,7 +1814,7 @@ YYSTYPE yylval;
   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
 #endif
 
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
 
   /* The number of symbols on the RHS of the reduced rule.
      Keep to zero when no symbol should be popped.  */
@@ -1686,9 +1826,9 @@ YYSTYPE yylval;
       goto yyread_pushed_token;
     }
 
-  yytoken = 0;
-  yyss = yyssa;
-  yyvs = yyvsa;
+  yyssp = yyss = yyssa;
+  yyvsp = yyvs = yyvsa;
+  yylsp = yyls = yylsa;
   yystacksize = YYINITDEPTH;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1697,13 +1837,7 @@ YYSTYPE yylval;
   yyerrstatus = 0;
   yynerrs = 0;
   yychar = YYEMPTY; /* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-  yyssp = yyss;
-  yyvsp = yyvs;
+  yylsp[0] = *yypushed_loc;
   goto yysetstate;
 
 /*------------------------------------------------------------.
@@ -1729,6 +1863,7 @@ YYSTYPE yylval;
           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
@@ -1737,8 +1872,10 @@ YYSTYPE yylval;
        yyoverflow (YY_("memory exhausted"),
                    &yyss1, yysize * sizeof (*yyssp),
                    &yyvs1, yysize * sizeof (*yyvsp),
+                   &yyls1, yysize * sizeof (*yylsp),
                    &yystacksize);
 
+       yyls = yyls1;
        yyss = yyss1;
        yyvs = yyvs1;
       }
@@ -1761,6 +1898,7 @@ YYSTYPE yylval;
          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);
@@ -1770,6 +1908,7 @@ YYSTYPE yylval;
 
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
+      yylsp = yyls + yysize - 1;
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                  (unsigned long int) yystacksize));
@@ -1815,6 +1954,8 @@ yyread_pushed_token:
       yychar = yypushed_char;
       if (yypushed_val)
         yylval = *yypushed_val;
+      if (yypushed_loc)
+        yylloc = *yypushed_loc;
     }
 
   if (yychar <= YYEOF)
@@ -1854,8 +1995,10 @@ yyread_pushed_token:
   yychar = YYEMPTY;
 
   yystate = yyn;
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
-
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+  *++yylsp = yylloc;
   goto yynewstate;
 
 
@@ -1886,63 +2029,62 @@ yyreduce:
      GCC warning that YYVAL may be used uninitialized.  */
   yyval = yyvsp[1-yylen];
 
-
+  /* Default location.  */
+  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
         case 2:
 /* Line 1787 of yacc.c  */
-#line 193 "parser.y"
+#line 199 "parser.y"
     {
                  BEGIN_ACTION;
                  set_empty((yyval.sel));
-                 END_ACTION;
+                 END_ACTION_TOPLEVEL;
              }
     break;
 
   case 3:
 /* Line 1787 of yacc.c  */
-#line 199 "parser.y"
+#line 205 "parser.y"
     {
                  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))
                      YYACCEPT;
-                 END_ACTION;
+                 END_ACTION_TOPLEVEL;
              }
     break;
 
   case 4:
 /* Line 1787 of yacc.c  */
-#line 209 "parser.y"
+#line 215 "parser.y"
     { (yyval.sel) = (yyvsp[(1) - (2)].sel); }
     break;
 
   case 5:
 /* Line 1787 of yacc.c  */
-#line 211 "parser.y"
+#line 217 "parser.y"
     {
                  BEGIN_ACTION;
-                 _gmx_selparser_error(scanner, "invalid selection '%s'",
-                                      _gmx_sel_lexer_pselstr(scanner));
                  _gmx_sel_lexer_clear_method_stack(scanner);
-                 if (_gmx_sel_is_lexer_interactive(scanner))
+                 if (_gmx_selparser_handle_error(scanner))
                  {
-                     _gmx_sel_lexer_clear_pselstr(scanner);
                      yyerrok;
                  }
                  else
                  {
                      YYABORT;
                  }
+                 _gmx_sel_lexer_clear_pselstr(scanner);
                  set_empty((yyval.sel));
-                 END_ACTION;
+                 END_ACTION_TOPLEVEL;
              }
     break;
 
   case 6:
 /* Line 1787 of yacc.c  */
-#line 232 "parser.y"
+#line 236 "parser.y"
     {
                  BEGIN_ACTION;
                  set_empty((yyval.sel));
@@ -1952,7 +2094,7 @@ yyreduce:
 
   case 7:
 /* Line 1787 of yacc.c  */
-#line 238 "parser.y"
+#line 242 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer s
@@ -1967,10 +2109,10 @@ yyreduce:
 
   case 8:
 /* Line 1787 of yacc.c  */
-#line 249 "parser.y"
+#line 253 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(1) - (1)].str));
+                 scoped_guard_sfree nameGuard((yyvsp[(1) - (1)].str));
                  SelectionTreeElementPointer s
                         = _gmx_sel_init_group_by_name((yyvsp[(1) - (1)].str), scanner);
                  SelectionTreeElementPointer p
@@ -1983,7 +2125,7 @@ yyreduce:
 
   case 9:
 /* Line 1787 of yacc.c  */
-#line 261 "parser.y"
+#line 265 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[(1) - (1)].sel)), scanner));
@@ -1993,10 +2135,10 @@ yyreduce:
 
   case 10:
 /* Line 1787 of yacc.c  */
-#line 267 "parser.y"
+#line 271 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(1) - (2)].str));
+                 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));
                  END_ACTION;
              }
@@ -2004,10 +2146,10 @@ yyreduce:
 
   case 11:
 /* Line 1787 of yacc.c  */
-#line 274 "parser.y"
+#line 278 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
+                 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));
                  END_ACTION;
              }
@@ -2015,10 +2157,10 @@ yyreduce:
 
   case 12:
 /* Line 1787 of yacc.c  */
-#line 281 "parser.y"
+#line 285 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
+                 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));
                  END_ACTION;
              }
@@ -2026,10 +2168,10 @@ yyreduce:
 
   case 13:
 /* Line 1787 of yacc.c  */
-#line 288 "parser.y"
+#line 292 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
+                 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));
                  END_ACTION;
              }
@@ -2037,13 +2179,13 @@ yyreduce:
 
   case 14:
 /* Line 1787 of yacc.c  */
-#line 297 "parser.y"
+#line 301 "parser.y"
     { (yyval.sel) = (yyvsp[(1) - (1)].sel); }
     break;
 
   case 15:
 /* Line 1787 of yacc.c  */
-#line 299 "parser.y"
+#line 303 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(1) - (1)].sel)), NULL, scanner));
@@ -2054,13 +2196,13 @@ yyreduce:
 
   case 16:
 /* Line 1787 of yacc.c  */
-#line 305 "parser.y"
+#line 309 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
     break;
 
   case 17:
 /* Line 1787 of yacc.c  */
-#line 307 "parser.y"
+#line 311 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.sel), _gmx_sel_init_modifier((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), get((yyvsp[(1) - (3)].sel)), scanner));
@@ -2071,60 +2213,60 @@ yyreduce:
 
   case 18:
 /* Line 1787 of yacc.c  */
-#line 320 "parser.y"
+#line 324 "parser.y"
     { (yyval.i) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 19:
 /* Line 1787 of yacc.c  */
-#line 321 "parser.y"
+#line 325 "parser.y"
     { (yyval.i) = -(yyvsp[(2) - (2)].i); }
     break;
 
   case 20:
 /* Line 1787 of yacc.c  */
-#line 325 "parser.y"
+#line 329 "parser.y"
     { (yyval.r) = (yyvsp[(1) - (1)].r); }
     break;
 
   case 21:
 /* Line 1787 of yacc.c  */
-#line 326 "parser.y"
+#line 330 "parser.y"
     { (yyval.r) = -(yyvsp[(2) - (2)].r); }
     break;
 
   case 22:
 /* Line 1787 of yacc.c  */
-#line 329 "parser.y"
+#line 333 "parser.y"
     { (yyval.r) = (yyvsp[(1) - (1)].i); }
     break;
 
   case 23:
 /* Line 1787 of yacc.c  */
-#line 330 "parser.y"
+#line 334 "parser.y"
     { (yyval.r) = (yyvsp[(1) - (1)].r); }
     break;
 
   case 24:
 /* Line 1787 of yacc.c  */
-#line 333 "parser.y"
+#line 337 "parser.y"
     { (yyval.str) = (yyvsp[(1) - (1)].str); }
     break;
 
   case 25:
 /* Line 1787 of yacc.c  */
-#line 334 "parser.y"
+#line 338 "parser.y"
     { (yyval.str) = (yyvsp[(1) - (1)].str); }
     break;
 
   case 26:
 /* Line 1787 of yacc.c  */
-#line 343 "parser.y"
+#line 347 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer arg(get((yyvsp[(2) - (2)].sel)));
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_BOOLEAN));
+                        new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
                  sel->u.boolt = BOOL_NOT;
                  sel->child = arg;
                  set((yyval.sel), sel);
@@ -2134,12 +2276,12 @@ yyreduce:
 
   case 27:
 /* Line 1787 of yacc.c  */
-#line 354 "parser.y"
+#line 358 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_BOOLEAN));
+                        new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
                  sel->u.boolt = BOOL_AND;
                  sel->child = arg1; sel->child->next = arg2;
                  set((yyval.sel), sel);
@@ -2149,12 +2291,12 @@ yyreduce:
 
   case 28:
 /* Line 1787 of yacc.c  */
-#line 365 "parser.y"
+#line 369 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_BOOLEAN));
+                        new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
                  sel->u.boolt = BOOL_OR;
                  sel->child = arg1; sel->child->next = arg2;
                  set((yyval.sel), sel);
@@ -2164,16 +2306,16 @@ yyreduce:
 
   case 29:
 /* Line 1787 of yacc.c  */
-#line 375 "parser.y"
+#line 379 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
     break;
 
   case 30:
 /* Line 1787 of yacc.c  */
-#line 380 "parser.y"
+#line 384 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree opGuard((yyvsp[(2) - (3)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2182,10 +2324,10 @@ yyreduce:
 
   case 31:
 /* Line 1787 of yacc.c  */
-#line 391 "parser.y"
+#line 395 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(2) - (2)].str));
+                 scoped_guard_sfree nameGuard((yyvsp[(2) - (2)].str));
                  set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[(2) - (2)].str), scanner));
                  END_ACTION;
              }
@@ -2193,7 +2335,7 @@ yyreduce:
 
   case 32:
 /* Line 1787 of yacc.c  */
-#line 398 "parser.y"
+#line 402 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[(2) - (2)].i), scanner));
@@ -2203,40 +2345,40 @@ yyreduce:
 
   case 33:
 /* Line 1787 of yacc.c  */
-#line 406 "parser.y"
+#line 410 "parser.y"
     { (yyval.str) = NULL; }
     break;
 
   case 34:
 /* Line 1787 of yacc.c  */
-#line 407 "parser.y"
+#line 411 "parser.y"
     { (yyval.str) = (yyvsp[(1) - (1)].str);   }
     break;
 
   case 35:
 /* Line 1787 of yacc.c  */
-#line 412 "parser.y"
+#line 416 "parser.y"
     { (yyval.smt) = gmx::eStringMatchType_RegularExpression; }
     break;
 
   case 36:
 /* Line 1787 of yacc.c  */
-#line 413 "parser.y"
+#line 417 "parser.y"
     { (yyval.smt) = gmx::eStringMatchType_Wildcard; }
     break;
 
   case 37:
 /* Line 1787 of yacc.c  */
-#line 414 "parser.y"
+#line 418 "parser.y"
     { (yyval.smt) = gmx::eStringMatchType_Exact; }
     break;
 
   case 38:
 /* Line 1787 of yacc.c  */
-#line 419 "parser.y"
+#line 423 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2245,10 +2387,10 @@ yyreduce:
 
   case 39:
 /* Line 1787 of yacc.c  */
-#line 427 "parser.y"
+#line 431 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2257,10 +2399,10 @@ yyreduce:
 
   case 40:
 /* Line 1787 of yacc.c  */
-#line 435 "parser.y"
+#line 439 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (4)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2269,10 +2411,10 @@ yyreduce:
 
   case 41:
 /* Line 1787 of yacc.c  */
-#line 443 "parser.y"
+#line 447 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2281,10 +2423,10 @@ yyreduce:
 
   case 42:
 /* Line 1787 of yacc.c  */
-#line 454 "parser.y"
+#line 458 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2293,11 +2435,11 @@ yyreduce:
 
   case 43:
 /* Line 1787 of yacc.c  */
-#line 469 "parser.y"
+#line 473 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_CONST));
+                        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);
@@ -2308,11 +2450,11 @@ yyreduce:
 
   case 44:
 /* Line 1787 of yacc.c  */
-#line 480 "parser.y"
+#line 484 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_CONST));
+                        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);
@@ -2323,10 +2465,10 @@ yyreduce:
 
   case 45:
 /* Line 1787 of yacc.c  */
-#line 494 "parser.y"
+#line 498 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
@@ -2335,11 +2477,11 @@ yyreduce:
 
   case 46:
 /* Line 1787 of yacc.c  */
-#line 502 "parser.y"
+#line 506 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_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));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
@@ -2347,77 +2489,89 @@ yyreduce:
 
   case 47:
 /* Line 1787 of yacc.c  */
-#line 513 "parser.y"
+#line 514 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '+', scanner));
+                 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));
+                 CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
     break;
 
   case 48:
 /* Line 1787 of yacc.c  */
-#line 519 "parser.y"
+#line 525 "parser.y"
     {
                  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[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '+', scanner));
                  END_ACTION;
              }
     break;
 
   case 49:
 /* Line 1787 of yacc.c  */
-#line 525 "parser.y"
+#line 531 "parser.y"
     {
                  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[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '-', scanner));
                  END_ACTION;
              }
     break;
 
   case 50:
 /* Line 1787 of yacc.c  */
-#line 531 "parser.y"
+#line 537 "parser.y"
     {
                  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[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '*', scanner));
                  END_ACTION;
              }
     break;
 
   case 51:
 /* Line 1787 of yacc.c  */
-#line 537 "parser.y"
+#line 543 "parser.y"
     {
                  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[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '/', scanner));
                  END_ACTION;
              }
     break;
 
   case 52:
 /* Line 1787 of yacc.c  */
-#line 543 "parser.y"
+#line 549 "parser.y"
     {
                  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) - (2)].sel)), SelectionTreeElementPointer(), '-', scanner));
                  END_ACTION;
              }
     break;
 
   case 53:
 /* Line 1787 of yacc.c  */
-#line 548 "parser.y"
-    { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
+#line 555 "parser.y"
+    {
+                 BEGIN_ACTION;
+                 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '^', scanner));
+                 END_ACTION;
+             }
     break;
 
   case 54:
 /* Line 1787 of yacc.c  */
-#line 556 "parser.y"
+#line 560 "parser.y"
+    { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
+    break;
+
+  case 55:
+/* Line 1787 of yacc.c  */
+#line 568 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_CONST));
+                        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);
@@ -2426,37 +2580,37 @@ yyreduce:
              }
     break;
 
-  case 55:
+  case 56:
 /* Line 1787 of yacc.c  */
-#line 567 "parser.y"
+#line 579 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
     break;
 
-  case 56:
+  case 57:
 /* Line 1787 of yacc.c  */
-#line 582 "parser.y"
+#line 594 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[(2) - (7)].r), (yyvsp[(4) - (7)].r), (yyvsp[(6) - (7)].r)));
+                 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[(2) - (7)].r), (yyvsp[(4) - (7)].r), (yyvsp[(6) - (7)].r), scanner));
                  END_ACTION;
              }
     break;
 
-  case 57:
+  case 58:
 /* Line 1787 of yacc.c  */
-#line 590 "parser.y"
+#line 602 "parser.y"
     { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
     break;
 
-  case 58:
+  case 59:
 /* Line 1787 of yacc.c  */
-#line 595 "parser.y"
+#line 607 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.sel), _gmx_sel_init_method((yyvsp[(1) - (2)].meth), get((yyvsp[(2) - (2)].plist)), NULL, scanner));
@@ -2465,63 +2619,63 @@ yyreduce:
              }
     break;
 
-  case 59:
+  case 60:
 /* Line 1787 of yacc.c  */
-#line 605 "parser.y"
+#line 617 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree keywordGuard((yyvsp[(1) - (3)].str));
+                 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));
                  CHECK_SEL((yyval.sel));
                  END_ACTION;
              }
     break;
 
-  case 60:
+  case 61:
 /* Line 1787 of yacc.c  */
-#line 619 "parser.y"
+#line 631 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel)), scanner));
                  END_ACTION;
              }
     break;
 
-  case 61:
+  case 62:
 /* Line 1787 of yacc.c  */
-#line 627 "parser.y"
+#line 639 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel)), scanner));
                  END_ACTION;
              }
     break;
 
-  case 62:
+  case 63:
 /* Line 1787 of yacc.c  */
-#line 635 "parser.y"
+#line 647 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
+                 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel)), scanner));
                  END_ACTION;
              }
     break;
 
-  case 63:
+  case 64:
 /* Line 1787 of yacc.c  */
-#line 648 "parser.y"
+#line 660 "parser.y"
     { (yyval.plist) = (yyvsp[(1) - (1)].plist); }
     break;
 
-  case 64:
+  case 65:
 /* Line 1787 of yacc.c  */
-#line 650 "parser.y"
+#line 662 "parser.y"
     { (yyval.plist) = (yyvsp[(1) - (2)].plist); }
     break;
 
-  case 65:
+  case 66:
 /* Line 1787 of yacc.c  */
-#line 655 "parser.y"
+#line 667 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.plist), SelectionParserParameter::createList());
@@ -2529,9 +2683,9 @@ yyreduce:
              }
     break;
 
-  case 66:
+  case 67:
 /* Line 1787 of yacc.c  */
-#line 661 "parser.y"
+#line 673 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionParserParameterListPointer list(get((yyvsp[(1) - (2)].plist)));
@@ -2541,32 +2695,32 @@ yyreduce:
              }
     break;
 
-  case 67:
+  case 68:
 /* Line 1787 of yacc.c  */
-#line 672 "parser.y"
+#line 684 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard((yyvsp[(1) - (2)].str));
-                 set((yyval.param), SelectionParserParameter::create((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].vlist))));
+                 scoped_guard_sfree nameGuard((yyvsp[(1) - (2)].str));
+                 set((yyval.param), SelectionParserParameter::create((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].vlist)), (yyloc)));
                  END_ACTION;
              }
     break;
 
-  case 68:
+  case 69:
 /* Line 1787 of yacc.c  */
-#line 680 "parser.y"
+#line 692 "parser.y"
     { (yyval.vlist) = (yyvsp[(1) - (1)].vlist);   }
     break;
 
-  case 69:
+  case 70:
 /* Line 1787 of yacc.c  */
-#line 681 "parser.y"
+#line 693 "parser.y"
     { (yyval.vlist) = (yyvsp[(2) - (3)].vlist);   }
     break;
 
-  case 70:
+  case 71:
 /* Line 1787 of yacc.c  */
-#line 686 "parser.y"
+#line 698 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.vlist), SelectionParserValue::createList());
@@ -2574,9 +2728,9 @@ yyreduce:
              }
     break;
 
-  case 71:
+  case 72:
 /* Line 1787 of yacc.c  */
-#line 692 "parser.y"
+#line 704 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
@@ -2586,9 +2740,9 @@ yyreduce:
              }
     break;
 
-  case 72:
+  case 73:
 /* Line 1787 of yacc.c  */
-#line 700 "parser.y"
+#line 712 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
@@ -2598,21 +2752,21 @@ yyreduce:
              }
     break;
 
-  case 73:
+  case 74:
 /* Line 1787 of yacc.c  */
-#line 710 "parser.y"
+#line 722 "parser.y"
     { (yyval.vlist) = (yyvsp[(1) - (1)].vlist); }
     break;
 
-  case 74:
+  case 75:
 /* Line 1787 of yacc.c  */
-#line 711 "parser.y"
+#line 723 "parser.y"
     { (yyval.vlist) = (yyvsp[(2) - (3)].vlist); }
     break;
 
-  case 75:
+  case 76:
 /* Line 1787 of yacc.c  */
-#line 716 "parser.y"
+#line 728 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[(1) - (1)].val))));
@@ -2620,9 +2774,9 @@ yyreduce:
              }
     break;
 
-  case 76:
+  case 77:
 /* Line 1787 of yacc.c  */
-#line 722 "parser.y"
+#line 734 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
@@ -2632,9 +2786,9 @@ yyreduce:
              }
     break;
 
-  case 77:
+  case 78:
 /* Line 1787 of yacc.c  */
-#line 730 "parser.y"
+#line 742 "parser.y"
     {
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
@@ -2644,9 +2798,9 @@ yyreduce:
              }
     break;
 
-  case 78:
+  case 79:
 /* Line 1787 of yacc.c  */
-#line 740 "parser.y"
+#line 752 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
@@ -2654,9 +2808,9 @@ yyreduce:
              }
     break;
 
-  case 79:
+  case 80:
 /* Line 1787 of yacc.c  */
-#line 746 "parser.y"
+#line 758 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
@@ -2664,9 +2818,9 @@ yyreduce:
              }
     break;
 
-  case 80:
+  case 81:
 /* Line 1787 of yacc.c  */
-#line 752 "parser.y"
+#line 764 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
@@ -2674,9 +2828,9 @@ yyreduce:
              }
     break;
 
-  case 81:
+  case 82:
 /* Line 1787 of yacc.c  */
-#line 758 "parser.y"
+#line 770 "parser.y"
     {
                  BEGIN_ACTION;
                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
@@ -2684,82 +2838,82 @@ yyreduce:
              }
     break;
 
-  case 82:
+  case 83:
 /* Line 1787 of yacc.c  */
-#line 763 "parser.y"
+#line 775 "parser.y"
     { (yyval.val) = (yyvsp[(1) - (1)].val); }
     break;
 
-  case 83:
+  case 84:
 /* Line 1787 of yacc.c  */
-#line 768 "parser.y"
+#line 780 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createInteger((yyvsp[(1) - (1)].i)));
+                 set((yyval.val), SelectionParserValue::createInteger((yyvsp[(1) - (1)].i), (yyloc)));
                  END_ACTION;
              }
     break;
 
-  case 84:
+  case 85:
 /* Line 1787 of yacc.c  */
-#line 774 "parser.y"
+#line 786 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createReal((yyvsp[(1) - (1)].r)));
+                 set((yyval.val), SelectionParserValue::createReal((yyvsp[(1) - (1)].r), (yyloc)));
                  END_ACTION;
              }
     break;
 
-  case 85:
+  case 86:
 /* Line 1787 of yacc.c  */
-#line 780 "parser.y"
+#line 792 "parser.y"
     {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree stringGuard((yyvsp[(1) - (1)].str));
-                 set((yyval.val), SelectionParserValue::createString((yyvsp[(1) - (1)].str)));
+                 scoped_guard_sfree stringGuard((yyvsp[(1) - (1)].str));
+                 set((yyval.val), SelectionParserValue::createString((yyvsp[(1) - (1)].str), (yyloc)));
                  END_ACTION;
              }
     break;
 
-  case 86:
+  case 87:
 /* Line 1787 of yacc.c  */
-#line 786 "parser.y"
+#line 798 "parser.y"
     { (yyval.val) = (yyvsp[(1) - (1)].val); }
     break;
 
-  case 87:
+  case 88:
 /* Line 1787 of yacc.c  */
-#line 791 "parser.y"
+#line 803 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].i)));
+                 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].i), (yyloc)));
                  END_ACTION;
              }
     break;
 
-  case 88:
+  case 89:
 /* Line 1787 of yacc.c  */
-#line 797 "parser.y"
+#line 809 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].r)));
+                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].r), (yyloc)));
                  END_ACTION;
              }
     break;
 
-  case 89:
+  case 90:
 /* Line 1787 of yacc.c  */
-#line 803 "parser.y"
+#line 815 "parser.y"
     {
                  BEGIN_ACTION;
-                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].r), (yyvsp[(3) - (3)].r)));
+                 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].r), (yyvsp[(3) - (3)].r), (yyloc)));
                  END_ACTION;
              }
     break;
 
 
 /* Line 1787 of yacc.c  */
-#line 2763 "parser.cpp"
+#line 2917 "parser.cpp"
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -2780,6 +2934,7 @@ yyreduce:
   YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
+  *++yylsp = yyloc;
 
   /* Now `shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
@@ -2809,7 +2964,7 @@ yyerrlab:
     {
       ++yynerrs;
 #if ! YYERROR_VERBOSE
-      yyerror (scanner, YY_("syntax error"));
+      yyerror (&yylloc, scanner, YY_("syntax error"));
 #else
 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
                                         yyssp, yytoken)
@@ -2836,7 +2991,7 @@ yyerrlab:
                 yymsgp = yymsg;
               }
           }
-        yyerror (scanner, yymsgp);
+        yyerror (&yylloc, scanner, yymsgp);
         if (yysyntax_error_status == 2)
           goto yyexhaustedlab;
       }
@@ -2844,7 +2999,7 @@ yyerrlab:
 #endif
     }
 
-
+  yyerror_range[1] = yylloc;
 
   if (yyerrstatus == 3)
     {
@@ -2860,7 +3015,7 @@ yyerrlab:
       else
        {
          yydestruct ("Error: discarding",
-                     yytoken, &yylval, scanner);
+                     yytoken, &yylval, &yylloc, scanner);
          yychar = YYEMPTY;
        }
     }
@@ -2881,6 +3036,7 @@ yyerrorlab:
   if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
 
+  yyerror_range[1] = yylsp[1-yylen];
   /* Do not reclaim the symbols of the rule which action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -2914,16 +3070,23 @@ yyerrlab1:
       if (yyssp == yyss)
        YYABORT;
 
-
+      yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
-                 yystos[yystate], yyvsp, scanner);
+                 yystos[yystate], yyvsp, yylsp, scanner);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 
+  yyerror_range[2] = yylloc;
+  /* Using YYLLOC is tempting, but would change the location of
+     the lookahead.  YYLOC is available though.  */
+  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
+  *++yylsp = yyloc;
 
   /* Shift the error token.  */
   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
@@ -2951,7 +3114,7 @@ yyabortlab:
 | yyexhaustedlab -- memory exhaustion comes here.  |
 `-------------------------------------------------*/
 yyexhaustedlab:
-  yyerror (scanner, YY_("memory exhausted"));
+  yyerror (&yylloc, scanner, YY_("memory exhausted"));
   yyresult = 2;
   /* Fall through.  */
 #endif
@@ -2963,7 +3126,7 @@ yyreturn:
          user semantic actions for why this is necessary.  */
       yytoken = YYTRANSLATE (yychar);
       yydestruct ("Cleanup: discarding lookahead",
-                  yytoken, &yylval, scanner);
+                  yytoken, &yylval, &yylloc, scanner);
     }
   /* Do not reclaim the symbols of the rule which action triggered
      this YYABORT or YYACCEPT.  */
@@ -2972,7 +3135,7 @@ yyreturn:
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-                 yystos[*yyssp], yyvsp, scanner);
+                 yystos[*yyssp], yyvsp, yylsp, scanner);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
index 5ccdff7781200a5b78195020a1e16da7edf46f52..3a70dcf359f27299ebcad975b04262bca8e98b5c 100644 (file)
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.6.2.  */
+/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
 
 /* Bison interface for Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989-1990, 2000-2013 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
@@ -30,8 +30,8 @@
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
-#ifndef _GMX_SEL_YY_PARSER_H
-# define _GMX_SEL_YY_PARSER_H
+#ifndef YY__GMX_SEL_YY_PARSER_H_INCLUDED
+# define YY__GMX_SEL_YY_PARSER_H_INCLUDED
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 1
@@ -40,7 +40,7 @@
 extern int _gmx_sel_yydebug;
 #endif
 /* "%code requires" blocks.  */
-/* Line 2049 of yacc.c  */
+/* Line 2053 of yacc.c  */
 #line 1 "parser.y"
 
 /*
@@ -78,15 +78,17 @@ extern int _gmx_sel_yydebug;
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-/* Line 2049 of yacc.c  */
-#line 73 "parser.y"
+/* Line 2053 of yacc.c  */
+#line 76 "parser.y"
 
 #include "parsetree.h"
 #include "selelem.h"
 
+#define YYLTYPE ::gmx::SelectionLocation
 
-/* Line 2049 of yacc.c  */
-#line 90 "parser.h"
+
+/* Line 2053 of yacc.c  */
+#line 92 "parser.h"
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
@@ -132,8 +134,8 @@ extern int _gmx_sel_yydebug;
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
 {
-/* Line 2049 of yacc.c  */
-#line 78 "parser.y"
+/* Line 2053 of yacc.c  */
+#line 83 "parser.y"
 
     int                         i;
     real                        r;
@@ -149,14 +151,27 @@ typedef union YYSTYPE
     gmx::SelectionParserParameterListPointer    *plist;
 
 
-/* Line 2049 of yacc.c  */
-#line 154 "parser.h"
+/* Line 2053 of yacc.c  */
+#line 156 "parser.h"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef 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
@@ -166,7 +181,7 @@ 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, void *scanner);
+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
@@ -182,4 +197,4 @@ void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
 void _gmx_sel_yypstate_delete ();
 #endif
 
-#endif /* !_GMX_SEL_YY_PARSER_H  */
+#endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED  */
index 940535e2715ed78b1005f5092cda486bb137a0cc..de16101d2ba39ccbf28d0b1fb6db1ace6bf69c18 100644 (file)
@@ -1,6 +1,15 @@
---- parser.cpp 2014-08-11 22:24:31.000000000 +0200
-+++ parser.cpp 2014-08-11 22:24:40.000000000 +0200
-@@ -963,7 +963,7 @@
+--- parser.cpp 2014-11-03 06:56:28.000000000 +0200
++++ parser.cpp 2014-11-03 06:57:35.000000000 +0200
+@@ -470,7 +470,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)))
+@@ -1076,7 +1076,7 @@
      void *scanner;
  #endif
  {
index 682a1fddab20a13a2cfd18aea7d206e53e275270..c7f676ccaf9893ebaeee3bb13ceab7a03bca8976 100644 (file)
@@ -2,7 +2,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,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.
@@ -40,7 +40,7 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-%{
+%code top {
 /*! \internal \file parser.cpp
  * \brief Generated (from parser.y by Bison) parser for the selection language.
  *
  *
  * \ingroup module_selection
  */
-#include "gromacs/utility/scoped_ptr_sfree.h"
+#include "gmxpre.h"
+}
+%{
+#include "gromacs/utility/scoped_cptr.h"
 
 #include "parser_internal.h"
 
-using gmx::scoped_ptr_sfree;
+using gmx::scoped_guard_sfree;
 using gmx::SelectionParserValue;
 using gmx::SelectionParserValueList;
 using gmx::SelectionParserValueListPointer;
@@ -73,6 +76,8 @@ using gmx::SelectionTreeElementPointer;
 %code requires{
 #include "parsetree.h"
 #include "selelem.h"
+
+#define YYLTYPE ::gmx::SelectionLocation
 }
 
 %union{
@@ -182,6 +187,7 @@ using gmx::SelectionTreeElementPointer;
 %debug
 %pure-parser
 %define api.push-pull push
+%locations
 
 %name-prefix="_gmx_sel_yy"
 %parse-param { void *scanner }
@@ -193,7 +199,7 @@ commands:    /* empty */
              {
                  BEGIN_ACTION;
                  set_empty($$);
-                 END_ACTION;
+                 END_ACTION_TOPLEVEL;
              }
            | commands command
              {
@@ -201,7 +207,7 @@ commands:    /* empty */
                  set($$, _gmx_sel_append_selection(get($2), get($1), scanner));
                  if (_gmx_sel_parser_should_finish(scanner))
                      YYACCEPT;
-                 END_ACTION;
+                 END_ACTION_TOPLEVEL;
              }
 ;
 
@@ -210,20 +216,18 @@ command:     cmd_plain CMD_SEP  { $$ = $1; }
            | error CMD_SEP
              {
                  BEGIN_ACTION;
-                 _gmx_selparser_error(scanner, "invalid selection '%s'",
-                                      _gmx_sel_lexer_pselstr(scanner));
                  _gmx_sel_lexer_clear_method_stack(scanner);
-                 if (_gmx_sel_is_lexer_interactive(scanner))
+                 if (_gmx_selparser_handle_error(scanner))
                  {
-                     _gmx_sel_lexer_clear_pselstr(scanner);
                      yyerrok;
                  }
                  else
                  {
                      YYABORT;
                  }
+                 _gmx_sel_lexer_clear_pselstr(scanner);
                  set_empty($$);
-                 END_ACTION;
+                 END_ACTION_TOPLEVEL;
              }
 ;
 
@@ -248,7 +252,7 @@ cmd_plain:   /* empty */
            | string
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($1);
+                 scoped_guard_sfree nameGuard($1);
                  SelectionTreeElementPointer s
                         = _gmx_sel_init_group_by_name($1, scanner);
                  SelectionTreeElementPointer p
@@ -263,31 +267,31 @@ cmd_plain:   /* empty */
                  set($$, _gmx_sel_init_selection(NULL, get($1), scanner));
                  END_ACTION;
              }
-           | string selection
+           | STR selection
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($1);
+                 scoped_guard_sfree nameGuard($1);
                  set($$, _gmx_sel_init_selection($1, get($2), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' sel_expr
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($1);
+                 scoped_guard_sfree nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' num_expr
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($1);
+                 scoped_guard_sfree nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
            | IDENTIFIER '=' pos_expr
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($1);
+                 scoped_guard_sfree nameGuard($1);
                  set($$, _gmx_sel_assign_variable($1, get($3), scanner));
                  END_ACTION;
              }
@@ -344,7 +348,7 @@ sel_expr:    NOT sel_expr
                  BEGIN_ACTION;
                  SelectionTreeElementPointer arg(get($2));
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_BOOLEAN));
+                        new SelectionTreeElement(SEL_BOOLEAN, @$));
                  sel->u.boolt = BOOL_NOT;
                  sel->child = arg;
                  set($$, sel);
@@ -355,7 +359,7 @@ sel_expr:    NOT sel_expr
                  BEGIN_ACTION;
                  SelectionTreeElementPointer arg1(get($1)), arg2(get($3));
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_BOOLEAN));
+                        new SelectionTreeElement(SEL_BOOLEAN, @$));
                  sel->u.boolt = BOOL_AND;
                  sel->child = arg1; sel->child->next = arg2;
                  set($$, sel);
@@ -366,7 +370,7 @@ sel_expr:    NOT sel_expr
                  BEGIN_ACTION;
                  SelectionTreeElementPointer arg1(get($1)), arg2(get($3));
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_BOOLEAN));
+                        new SelectionTreeElement(SEL_BOOLEAN, @$));
                  sel->u.boolt = BOOL_OR;
                  sel->child = arg1; sel->child->next = arg2;
                  set($$, sel);
@@ -379,7 +383,7 @@ sel_expr:    NOT sel_expr
 sel_expr:    num_expr CMP_OP num_expr
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree opGuard($2);
+                 scoped_guard_sfree opGuard($2);
                  set($$, _gmx_sel_init_comparison(get($1), get($3), $2, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -390,7 +394,7 @@ sel_expr:    num_expr CMP_OP num_expr
 sel_expr:    GROUP string
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($2);
+                 scoped_guard_sfree nameGuard($2);
                  set($$, _gmx_sel_init_group_by_name($2, scanner));
                  END_ACTION;
              }
@@ -418,7 +422,7 @@ str_match_type:
 sel_expr:    pos_mod KEYWORD_GROUP
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -426,7 +430,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_STR basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_strmatch($2, gmx::eStringMatchType_Auto, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -434,7 +438,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_STR str_match_type basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_keyword_strmatch($2, $3, get($4), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -442,7 +446,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
            | pos_mod KEYWORD_NUMERIC basic_value_list
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -453,7 +457,7 @@ sel_expr:    pos_mod KEYWORD_GROUP
 sel_expr:    pos_mod METHOD_GROUP method_params
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_method($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -469,7 +473,7 @@ num_expr:    TOK_INT
              {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_CONST));
+                        new SelectionTreeElement(SEL_CONST, @$));
                  _gmx_selelem_set_vtype(sel, INT_VALUE);
                  _gmx_selvalue_reserve(&sel->v, 1);
                  sel->v.u.i[0] = $1;
@@ -480,7 +484,7 @@ num_expr:    TOK_INT
              {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_CONST));
+                        new SelectionTreeElement(SEL_CONST, @$));
                  _gmx_selelem_set_vtype(sel, REAL_VALUE);
                  _gmx_selvalue_reserve(&sel->v, 1);
                  sel->v.u.r[0] = $1;
@@ -493,15 +497,23 @@ num_expr:    TOK_INT
 num_expr:    pos_mod KEYWORD_NUMERIC    %prec NUM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
              }
+           | pos_mod KEYWORD_NUMERIC OF pos_expr
+             {
+                 BEGIN_ACTION;
+                 scoped_guard_sfree posmodGuard($1);
+                 set($$, _gmx_sel_init_keyword_of($2, get($4), $1, scanner));
+                 CHECK_SEL($$);
+                 END_ACTION;
+             }
            | pos_mod METHOD_NUMERIC method_params
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_method($2, get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -556,7 +568,7 @@ str_expr:    string
              {
                  BEGIN_ACTION;
                  SelectionTreeElementPointer sel(
-                        new SelectionTreeElement(SEL_CONST));
+                        new SelectionTreeElement(SEL_CONST, @$));
                  _gmx_selelem_set_vtype(sel, STR_VALUE);
                  _gmx_selvalue_reserve(&sel->v, 1);
                  sel->v.u.s[0] = $1;
@@ -566,7 +578,7 @@ str_expr:    string
            | pos_mod KEYWORD_STR
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree posmodGuard($1);
+                 scoped_guard_sfree posmodGuard($1);
                  set($$, _gmx_sel_init_keyword($2, SelectionParserValueListPointer(), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -581,7 +593,7 @@ str_expr:    string
 pos_expr:    '[' number ',' number ',' number ']'
              {
                  BEGIN_ACTION;
-                 set($$, _gmx_sel_init_const_position($2, $4, $6));
+                 set($$, _gmx_sel_init_const_position($2, $4, $6, scanner));
                  END_ACTION;
              }
 ;
@@ -604,7 +616,7 @@ pos_expr:    METHOD_POS method_params
 pos_expr:    KEYWORD_POS OF sel_expr    %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree keywordGuard($1);
+                 scoped_guard_sfree keywordGuard($1);
                  set($$, _gmx_sel_init_position(get($3), $1, scanner));
                  CHECK_SEL($$);
                  END_ACTION;
@@ -618,7 +630,7 @@ pos_expr:    KEYWORD_POS OF sel_expr    %prec PARAM_REDUCT
 sel_expr:    VARIABLE_GROUP
              {
                  BEGIN_ACTION;
-                 set($$, _gmx_sel_init_variable_ref(get($1)));
+                 set($$, _gmx_sel_init_variable_ref(get($1), scanner));
                  END_ACTION;
              }
 ;
@@ -626,7 +638,7 @@ sel_expr:    VARIABLE_GROUP
 num_expr:    VARIABLE_NUMERIC
              {
                  BEGIN_ACTION;
-                 set($$, _gmx_sel_init_variable_ref(get($1)));
+                 set($$, _gmx_sel_init_variable_ref(get($1), scanner));
                  END_ACTION;
              }
 ;
@@ -634,7 +646,7 @@ num_expr:    VARIABLE_NUMERIC
 pos_expr:    VARIABLE_POS
              {
                  BEGIN_ACTION;
-                 set($$, _gmx_sel_init_variable_ref(get($1)));
+                 set($$, _gmx_sel_init_variable_ref(get($1), scanner));
                  END_ACTION;
              }
 ;
@@ -671,8 +683,8 @@ method_param:
              PARAM value_list
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree nameGuard($1);
-                 set($$, SelectionParserParameter::create($1, get($2)));
+                 scoped_guard_sfree nameGuard($1);
+                 set($$, SelectionParserParameter::create($1, get($2), @$));
                  END_ACTION;
              }
 ;
@@ -767,20 +779,20 @@ basic_value_item:
              integer_number      %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 set($$, SelectionParserValue::createInteger($1));
+                 set($$, SelectionParserValue::createInteger($1, @$));
                  END_ACTION;
              }
            | real_number         %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 set($$, SelectionParserValue::createReal($1));
+                 set($$, SelectionParserValue::createReal($1, @$));
                  END_ACTION;
              }
            | string              %prec PARAM_REDUCT
              {
                  BEGIN_ACTION;
-                 scoped_ptr_sfree stringGuard($1);
-                 set($$, SelectionParserValue::createString($1));
+                 scoped_guard_sfree stringGuard($1);
+                 set($$, SelectionParserValue::createString($1, @$));
                  END_ACTION;
              }
            | value_item_range    { $$ = $1; }
@@ -790,19 +802,19 @@ value_item_range:
              integer_number TO integer_number
              {
                  BEGIN_ACTION;
-                 set($$, SelectionParserValue::createIntegerRange($1, $3));
+                 set($$, SelectionParserValue::createIntegerRange($1, $3, @$));
                  END_ACTION;
              }
            | integer_number TO real_number
              {
                  BEGIN_ACTION;
-                 set($$, SelectionParserValue::createRealRange($1, $3));
+                 set($$, SelectionParserValue::createRealRange($1, $3, @$));
                  END_ACTION;
              }
            | real_number TO number
              {
                  BEGIN_ACTION;
-                 set($$, SelectionParserValue::createRealRange($1, $3));
+                 set($$, SelectionParserValue::createRealRange($1, $3, @$));
                  END_ACTION;
              }
 ;
index a9482fa856b07d40abf2b3fdb8e5a9d8873d069d..f00413346f22174394ca83a97e28b0645ac3aa38 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_SELECTION_PARSER_INTERNAL_H
 #define GMX_SELECTION_PARSER_INTERNAL_H
 
+#include "config.h"
+
 #include <exception>
 
+#include <boost/exception_ptr.hpp>
 #include <boost/scoped_ptr.hpp>
 
+#include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/stringutil.h"
 
 #include "parsetree.h"
-#include "selelem.h"
-
 #include "scanner.h"
+#include "selelem.h"
 
 //! Error handler needed by Bison.
 static void
-yyerror(yyscan_t scanner, char const *s)
+yyerror(YYLTYPE *location, yyscan_t scanner, char const *s)
 {
-    _gmx_selparser_error(scanner, "%s", s);
+    try
+    {
+        std::string            context(_gmx_sel_lexer_get_text(scanner, *location));
+        gmx::InvalidInputError ex(s);
+        // TODO: Examine how to show better context information.
+        if (!context.empty())
+        {
+            context = gmx::formatString("Near '%s'", context.c_str());
+            ex.prependContext(context);
+        }
+        _gmx_sel_lexer_set_exception(scanner, boost::copy_exception(ex));
+    }
+    catch (const std::exception &)
+    {
+        _gmx_sel_lexer_set_exception(scanner, boost::current_exception());
+    }
 }
 
+//! Logic for computing the location of the output of Bison reduction.
+#define YYLLOC_DEFAULT(Current, Rhs, N)                          \
+    do {                                                         \
+        if (N != 0)                                              \
+        {                                                        \
+            (Current).startIndex = YYRHSLOC(Rhs, 1).startIndex;  \
+            (Current).endIndex   = YYRHSLOC(Rhs, N).endIndex;    \
+        }                                                        \
+        else                                                     \
+        {                                                        \
+            (Current).startIndex = (Current).endIndex =          \
+                    YYRHSLOC(Rhs, 0).endIndex;                   \
+        }                                                        \
+        _gmx_sel_lexer_set_current_location(scanner, (Current)); \
+    } while (0)
+
+/*! \brief
+ * Custom macro to influence Bison behavior.
+ *
+ * This macro added to parser.cpp through our patch to force Bison to
+ * use C-style logic for stack reallocation even though we have provided
+ * YYLTYPE and are compiling the code in C++ (our YYLTYPE can safely be copied
+ * this way).
+ * An alternative would be to provide the whole reallocation logic through an
+ * undocumented yyoverflow() macro, but that is probably also more trouble than
+ * it is worth.
+ */
+#define GMX_YYFORCE_C_STACK_EXTENSION 1
+
 /*! \name Exception handling macros for actions
  *
  * These macros should be used at the beginning and end of each semantic action
@@ -80,14 +128,26 @@ yyerror(yyscan_t scanner, char const *s)
 #define BEGIN_ACTION \
     try {
 //! Finishes an action that may throw exceptions.
-#define END_ACTION \
-    } \
-    catch (const std::exception &ex) \
-    { \
-        if (_gmx_selparser_handle_exception(scanner, ex)) { \
-            YYERROR; } \
-        else{ \
-            YYABORT; } \
+#define END_ACTION                                              \
+    }                                                           \
+    catch (std::exception &ex)                                  \
+    {                                                           \
+        if (_gmx_selparser_handle_exception(scanner, &ex))      \
+        {                                                       \
+            YYERROR;                                            \
+        }                                                       \
+        else                                                    \
+        {                                                       \
+            YYABORT;                                            \
+        }                                                       \
+    }
+//! Finishes an action that may throw exceptions and does not support resuming.
+#define END_ACTION_TOPLEVEL                                     \
+    }                                                           \
+    catch (const std::exception &)                              \
+    {                                                           \
+        _gmx_sel_lexer_set_exception(scanner, boost::current_exception()); \
+        YYABORT;                                                \
     }
 //!\}
 
index 753da3b07d1040986e8fbb2539c9f1617f6e1aa6..d3d9096f18211cda5374801599cbd1adb69b096d 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,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.
  * Each element has exactly two children (one for unary negation elements),
  * which are in the order given in the input.
  */
-#include <stdio.h>
+#include "gmxpre.h"
+
+#include "parsetree.h"
+
 #include <stdarg.h>
+#include <stdio.h>
 
 #include <boost/exception_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "gromacs/fileio/futil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/selection.h"
-#include "gromacs/selection/selmethod.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
-#include "gromacs/utility/messagestringcollector.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "keywords.h"
-#include "parsetree.h"
+#include "poscalc.h"
+#include "scanner.h"
 #include "selectioncollection-impl.h"
 #include "selelem.h"
+#include "selmethod.h"
 #include "symrec.h"
 
-#include "scanner.h"
-
+using gmx::SelectionLocation;
 using gmx::SelectionParserValue;
 using gmx::SelectionParserValueList;
 using gmx::SelectionParserValueListPointer;
@@ -253,36 +255,75 @@ using gmx::SelectionParserValue;
 using gmx::SelectionTreeElement;
 using gmx::SelectionTreeElementPointer;
 
-void
-_gmx_selparser_error(yyscan_t scanner, const char *fmt, ...)
+namespace
+{
+
+/*! \brief
+ * Formats context string for errors.
+ *
+ * The returned string is used as the context for errors reported during
+ * parsing.
+ */
+std::string
+formatCurrentErrorContext(yyscan_t scanner)
+{
+    return gmx::formatString(
+            "While parsing '%s'",
+            _gmx_sel_lexer_get_current_text(scanner).c_str());
+}
+
+} // namespace
+
+bool
+_gmx_selparser_handle_exception(yyscan_t scanner, std::exception *ex)
 {
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    // FIXME: Use an arbitrary length buffer.
-    char    buf[1024];
-    va_list ap;
-    va_start(ap, fmt);
-    vsnprintf(buf, 1024, fmt, ap);
-    va_end(ap);
-    errors->append(buf);
+    try
+    {
+        bool                   canContinue = false;
+        gmx::GromacsException *gromacsException
+            = dynamic_cast<gmx::GromacsException *>(ex);
+        if (gromacsException != NULL)
+        {
+            gromacsException->prependContext(formatCurrentErrorContext(scanner));
+            canContinue = (dynamic_cast<gmx::UserInputError *>(ex) != NULL);
+        }
+        _gmx_sel_lexer_set_exception(scanner, boost::current_exception());
+        return canContinue;
+    }
+    catch (const std::exception &)
+    {
+        _gmx_sel_lexer_set_exception(scanner, boost::current_exception());
+        return false;
+    }
 }
 
 bool
-_gmx_selparser_handle_exception(yyscan_t scanner, const std::exception &ex)
+_gmx_selparser_handle_error(yyscan_t scanner)
 {
-    if (dynamic_cast<const gmx::UserInputError *>(&ex) != NULL)
+    std::string context(gmx::formatString("Invalid selection '%s'",
+                                          _gmx_sel_lexer_pselstr(scanner)));
+    // The only way to prepend context to the exception is to rethrow it.
+    try
+    {
+        _gmx_sel_lexer_rethrow_exception_if_occurred(scanner);
+    }
+    catch (gmx::UserInputError &ex)
     {
-        // TODO: Consider whether also the non-interactive parser should
-        // postpone the exception such that the whole selection can be added as
-        // context.
+        ex.prependContext(context);
         if (_gmx_sel_is_lexer_interactive(scanner))
         {
-            // TODO: Handle exceptions that printing the message may produce.
             gmx::formatExceptionMessageToFile(stderr, ex);
             return true;
         }
+        throw;
     }
-    _gmx_sel_lexer_set_exception(scanner, boost::current_exception());
-    return false;
+    catch (gmx::GromacsException &ex)
+    {
+        ex.prependContext(context);
+        throw;
+    }
+    GMX_RELEASE_ASSERT(false, "All parsing errors should result in a captured exception");
+    return false; // Some compilers will not believe that the above never returns.
 }
 
 namespace gmx
@@ -292,15 +333,16 @@ namespace gmx
  * SelectionParserValue
  */
 
-SelectionParserValue::SelectionParserValue(e_selvalue_t type)
-    : type(type)
+SelectionParserValue::SelectionParserValue(
+        e_selvalue_t type, const SelectionLocation &location)
+    : type(type), location_(location)
 {
     memset(&u, 0, sizeof(u));
 }
 
 SelectionParserValue::SelectionParserValue(
         const SelectionTreeElementPointer &expr)
-    : type(expr->v.type), expr(expr)
+    : type(expr->v.type), expr(expr), location_(expr->location())
 {
     memset(&u, 0, sizeof(u));
 }
@@ -310,9 +352,10 @@ SelectionParserValue::SelectionParserValue(
  */
 
 SelectionParserParameter::SelectionParserParameter(
-        const char                     *name,
-        SelectionParserValueListPointer values)
-    : name_(name != NULL ? name : ""),
+        const char                      *name,
+        SelectionParserValueListPointer  values,
+        const SelectionLocation         &location)
+    : name_(name != NULL ? name : ""), location_(location),
       values_(values ? move(values)
               : SelectionParserValueListPointer(new SelectionParserValueList))
 {
@@ -534,13 +577,11 @@ _gmx_selelem_set_method(const gmx::SelectionTreeElementPointer &sel,
  * \param[in,out] pcc    Position calculation collection to use.
  * \param[in,out] sel    Selection element to initialize.
  * \param[in]     rpost  Reference position type to use (NULL = default).
- * \param[in]     scanner Scanner data structure.
- * \returns       0 on success, a non-zero error code on error.
  */
 static void
 set_refpos_type(gmx::PositionCalculationCollection *pcc,
-                const SelectionTreeElementPointer &sel,
-                const char *rpost, yyscan_t scanner)
+                const SelectionTreeElementPointer  &sel,
+                const char                         *rpost)
 {
     if (!rpost)
     {
@@ -555,18 +596,21 @@ set_refpos_type(gmx::PositionCalculationCollection *pcc,
     }
     else
     {
-        // TODO: Should this be treated as a real error?
-        _gmx_selparser_error(scanner, "modifier '%s' is not applicable for '%s'",
-                             rpost, sel->u.expr.method->name);
+        std::string message
+            = gmx::formatString("Position modifiers ('%s') is not applicable for '%s'",
+                                rpost, sel->u.expr.method->name);
+        GMX_THROW(gmx::InvalidInputError(message));
     }
 }
 
 gmx::SelectionTreeElementPointer
 _gmx_sel_init_arithmetic(const gmx::SelectionTreeElementPointer &left,
                          const gmx::SelectionTreeElementPointer &right,
-                         char op, yyscan_t /* scanner */)
+                         char op, yyscan_t scanner)
 {
-    SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_ARITHMETIC));
+    SelectionTreeElementPointer sel(
+            new SelectionTreeElement(
+                    SEL_ARITHMETIC, _gmx_sel_lexer_get_current_location(scanner)));
     sel->v.type        = REAL_VALUE;
     switch (op)
     {
@@ -580,7 +624,7 @@ _gmx_sel_init_arithmetic(const gmx::SelectionTreeElementPointer &left,
     buf[0] = op;
     buf[1] = 0;
     sel->setName(buf);
-    sel->u.arith.opstr = strdup(buf);
+    sel->u.arith.opstr = gmx_strdup(buf);
     sel->child         = left;
     sel->child->next   = right;
     return sel;
@@ -601,10 +645,9 @@ _gmx_sel_init_comparison(const gmx::SelectionTreeElementPointer &left,
                          const gmx::SelectionTreeElementPointer &right,
                          const char *cmpop, yyscan_t scanner)
 {
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    gmx::MessageStringContext    context(errors, "In comparison initialization");
-
-    SelectionTreeElementPointer  sel(new SelectionTreeElement(SEL_EXPRESSION));
+    SelectionTreeElementPointer  sel(
+            new SelectionTreeElement(
+                    SEL_EXPRESSION, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_method(sel, &sm_compare, scanner);
 
     SelectionParserParameterList params;
@@ -616,14 +659,14 @@ _gmx_sel_init_comparison(const gmx::SelectionTreeElementPointer &left,
     name  = right->v.type == INT_VALUE ? "int2" : "real2";
     params.push_back(SelectionParserParameter::createFromExpression(name, right));
     // Create the parameter for the operator.
+    // TODO: Consider whether a proper location is needed.
+    SelectionLocation location(SelectionLocation::createEmpty());
     params.push_back(
             SelectionParserParameter::create(
-                    "op", SelectionParserValue::createString(cmpop)));
-    if (!_gmx_sel_parse_params(params, sel->u.expr.method->nparams,
-                               sel->u.expr.method->param, sel, scanner))
-    {
-        return SelectionTreeElementPointer();
-    }
+                    "op", SelectionParserValue::createString(cmpop, location),
+                    location));
+    _gmx_sel_parse_params(params, sel->u.expr.method->nparams,
+                          sel->u.expr.method->param, sel, scanner);
 
     return sel;
 }
@@ -650,11 +693,6 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
 {
     gmx_ana_selcollection_t     *sc = _gmx_sel_lexer_selcollection(scanner);
 
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    char  buf[128];
-    sprintf(buf, "In keyword '%s'", method->name);
-    gmx::MessageStringContext  context(errors, buf);
-
     if (method->nparams > 0)
     {
         // TODO: Would assert be better?
@@ -662,7 +700,10 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
                           "Keyword initialization called with non-keyword method"));
     }
 
-    SelectionTreeElementPointer root(new SelectionTreeElement(SEL_EXPRESSION));
+    const SelectionLocation    &location = _gmx_sel_lexer_get_current_location(scanner);
+    // TODO: If there are arguments, the location would be better as just the
+    // location of the keyword itself.
+    SelectionTreeElementPointer root(new SelectionTreeElement(SEL_EXPRESSION, location));
     SelectionTreeElementPointer child = root;
     _gmx_selelem_set_method(child, method, scanner);
 
@@ -680,7 +721,7 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
                                   "Unknown type for keyword selection"));
         }
         /* Initialize the selection element */
-        root.reset(new SelectionTreeElement(SEL_EXPRESSION));
+        root.reset(new SelectionTreeElement(SEL_EXPRESSION, location));
         _gmx_selelem_set_method(root, kwmethod, scanner);
         if (method->type == STR_VALUE)
         {
@@ -689,14 +730,12 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
         SelectionParserParameterList params;
         params.push_back(
                 SelectionParserParameter::createFromExpression(NULL, child));
-        params.push_back(SelectionParserParameter::create(NULL, move(args)));
-        if (!_gmx_sel_parse_params(params, root->u.expr.method->nparams,
-                                   root->u.expr.method->param, root, scanner))
-        {
-            return SelectionTreeElementPointer();
-        }
+        params.push_back(
+                SelectionParserParameter::create(NULL, move(args), location));
+        _gmx_sel_parse_params(params, root->u.expr.method->nparams,
+                              root->u.expr.method->param, root, scanner);
     }
-    set_refpos_type(&sc->pcc, child, rpost, scanner);
+    set_refpos_type(&sc->pcc, child, rpost);
 
     return root;
 }
@@ -744,6 +783,26 @@ _gmx_sel_init_keyword_strmatch(gmx_ana_selmethod_t *method,
     return init_keyword_internal(method, matchType, move(args), rpost, scanner);
 }
 
+/*!
+ * \param[in]  method Method to use for initialization.
+ * \param[in]  group  Selection in which the keyword should be evaluated.
+ * \param[in]  rpost  Reference position type to use (NULL = default).
+ * \param[in]  scanner Scanner data structure.
+ * \returns    The created selection element.
+ *
+ * This function handles the creation of a gmx::SelectionTreeElement object for
+ * expressions like "z of ...".
+ */
+SelectionTreeElementPointer
+_gmx_sel_init_keyword_of(gmx_ana_selmethod_t                    *method,
+                         const gmx::SelectionTreeElementPointer &group,
+                         const char *rpost, yyscan_t scanner)
+{
+    // TODO Provide an error if rpost is provided.
+    GMX_UNUSED_VALUE(rpost);
+    return _gmx_sel_init_keyword_evaluator(method, group, scanner);
+}
+
 /*!
  * \param[in]  method Method to use for initialization.
  * \param[in]  params Pointer to the first parameter.
@@ -765,29 +824,18 @@ _gmx_sel_init_method(gmx_ana_selmethod_t                      *method,
                      const char *rpost, yyscan_t scanner)
 {
     gmx_ana_selcollection_t     *sc = _gmx_sel_lexer_selcollection(scanner);
-    int                          rc;
-
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    char  buf[128];
-    sprintf(buf, "In keyword '%s'", method->name);
-    gmx::MessageStringContext  context(errors, buf);
 
     _gmx_sel_finish_method(scanner);
     /* The "same" keyword needs some custom massaging of the parameters. */
-    rc = _gmx_selelem_custom_init_same(&method, params, scanner);
-    if (rc != 0)
-    {
-        return SelectionTreeElementPointer();
-    }
-    SelectionTreeElementPointer root(new SelectionTreeElement(SEL_EXPRESSION));
+    _gmx_selelem_custom_init_same(&method, params, scanner);
+    SelectionTreeElementPointer root(
+            new SelectionTreeElement(
+                    SEL_EXPRESSION, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_method(root, method, scanner);
     /* Process the parameters */
-    if (!_gmx_sel_parse_params(*params, root->u.expr.method->nparams,
-                               root->u.expr.method->param, root, scanner))
-    {
-        return SelectionTreeElementPointer();
-    }
-    set_refpos_type(&sc->pcc, root, rpost, scanner);
+    _gmx_sel_parse_params(*params, root->u.expr.method->nparams,
+                          root->u.expr.method->param, root, scanner);
+    set_refpos_type(&sc->pcc, root, rpost);
 
     return root;
 }
@@ -808,13 +856,10 @@ _gmx_sel_init_modifier(gmx_ana_selmethod_t                      *method,
                        const gmx::SelectionTreeElementPointer   &sel,
                        yyscan_t                                  scanner)
 {
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    char  buf[128];
-    sprintf(buf, "In keyword '%s'", method->name);
-    gmx::MessageStringContext  context(errors, buf);
-
     _gmx_sel_finish_method(scanner);
-    SelectionTreeElementPointer modifier(new SelectionTreeElement(SEL_MODIFIER));
+    SelectionTreeElementPointer modifier(
+            new SelectionTreeElement(
+                    SEL_MODIFIER, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_method(modifier, method, scanner);
     SelectionTreeElementPointer root;
     if (method->type == NO_VALUE)
@@ -834,11 +879,8 @@ _gmx_sel_init_modifier(gmx_ana_selmethod_t                      *method,
         root = modifier;
     }
     /* Process the parameters */
-    if (!_gmx_sel_parse_params(*params, modifier->u.expr.method->nparams,
-                               modifier->u.expr.method->param, modifier, scanner))
-    {
-        return SelectionTreeElementPointer();
-    }
+    _gmx_sel_parse_params(*params, modifier->u.expr.method->nparams,
+                          modifier->u.expr.method->param, modifier, scanner);
 
     return root;
 }
@@ -856,37 +898,34 @@ SelectionTreeElementPointer
 _gmx_sel_init_position(const gmx::SelectionTreeElementPointer &expr,
                        const char *type, yyscan_t scanner)
 {
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    char  buf[128];
-    sprintf(buf, "In position evaluation");
-    gmx::MessageStringContext   context(errors, buf);
-
-    SelectionTreeElementPointer root(new SelectionTreeElement(SEL_EXPRESSION));
+    SelectionTreeElementPointer  root(
+            new SelectionTreeElement(
+                    SEL_EXPRESSION, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_method(root, &sm_keyword_pos, scanner);
     _gmx_selelem_set_kwpos_type(root.get(), type);
     /* Create the parameters for the parameter parser. */
     SelectionParserParameterList params;
     params.push_back(SelectionParserParameter::createFromExpression(NULL, expr));
     /* Parse the parameters. */
-    if (!_gmx_sel_parse_params(params, root->u.expr.method->nparams,
-                               root->u.expr.method->param, root, scanner))
-    {
-        return SelectionTreeElementPointer();
-    }
+    _gmx_sel_parse_params(params, root->u.expr.method->nparams,
+                          root->u.expr.method->param, root, scanner);
 
     return root;
 }
 
 /*!
- * \param[in] x,y,z  Coordinates for the position.
+ * \param[in] x,y,z   Coordinates for the position.
+ * \param[in] scanner Scanner data structure.
  * \returns   The creates selection element.
  */
 SelectionTreeElementPointer
-_gmx_sel_init_const_position(real x, real y, real z)
+_gmx_sel_init_const_position(real x, real y, real z, yyscan_t scanner)
 {
     rvec                        pos;
 
-    SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_CONST));
+    SelectionTreeElementPointer sel(
+            new SelectionTreeElement(
+                    SEL_CONST, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_vtype(sel, POS_VALUE);
     _gmx_selvalue_reserve(&sel->v, 1);
     pos[XX] = x;
@@ -908,16 +947,19 @@ SelectionTreeElementPointer
 _gmx_sel_init_group_by_name(const char *name, yyscan_t scanner)
 {
 
-    SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_GROUPREF));
+    SelectionTreeElementPointer sel(
+            new SelectionTreeElement(
+                    SEL_GROUPREF, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_vtype(sel, GROUP_VALUE);
     sel->setName(gmx::formatString("group \"%s\"", name));
-    sel->u.gref.name = strdup(name);
+    sel->u.gref.name = gmx_strdup(name);
     sel->u.gref.id   = -1;
 
     if (_gmx_sel_lexer_has_groups_set(scanner))
     {
-        gmx_ana_indexgrps_t *grps = _gmx_sel_lexer_indexgrps(scanner);
-        sel->resolveIndexGroupReference(grps);
+        gmx_ana_indexgrps_t     *grps = _gmx_sel_lexer_indexgrps(scanner);
+        gmx_ana_selcollection_t *sc   = _gmx_sel_lexer_selcollection(scanner);
+        sel->resolveIndexGroupReference(grps, sc->gall.isize);
     }
 
     return sel;
@@ -931,7 +973,9 @@ _gmx_sel_init_group_by_name(const char *name, yyscan_t scanner)
 SelectionTreeElementPointer
 _gmx_sel_init_group_by_id(int id, yyscan_t scanner)
 {
-    SelectionTreeElementPointer sel(new SelectionTreeElement(SEL_GROUPREF));
+    SelectionTreeElementPointer sel(
+            new SelectionTreeElement(
+                    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;
@@ -939,22 +983,25 @@ _gmx_sel_init_group_by_id(int id, yyscan_t scanner)
 
     if (_gmx_sel_lexer_has_groups_set(scanner))
     {
-        gmx_ana_indexgrps_t *grps = _gmx_sel_lexer_indexgrps(scanner);
-        sel->resolveIndexGroupReference(grps);
+        gmx_ana_indexgrps_t     *grps = _gmx_sel_lexer_indexgrps(scanner);
+        gmx_ana_selcollection_t *sc   = _gmx_sel_lexer_selcollection(scanner);
+        sel->resolveIndexGroupReference(grps, sc->gall.isize);
     }
 
     return sel;
 }
 
 /*!
- * \param[in,out] sel  Value of the variable.
+ * \param[in,out] sel      Value of the variable.
+ * \param         scanner  Scanner data structure.
  * \returns       The created selection element that references \p sel.
  *
  * The reference count of \p sel is updated, but no other modifications are
  * made.
  */
 SelectionTreeElementPointer
-_gmx_sel_init_variable_ref(const gmx::SelectionTreeElementPointer &sel)
+_gmx_sel_init_variable_ref(const gmx::SelectionTreeElementPointer &sel,
+                           yyscan_t                                scanner)
 {
     SelectionTreeElementPointer ref;
 
@@ -964,7 +1011,8 @@ _gmx_sel_init_variable_ref(const gmx::SelectionTreeElementPointer &sel)
     }
     else
     {
-        ref.reset(new SelectionTreeElement(SEL_SUBEXPRREF));
+        ref.reset(new SelectionTreeElement(
+                          SEL_SUBEXPRREF, _gmx_sel_lexer_get_current_location(scanner)));
         _gmx_selelem_set_vtype(ref, sel->v.type);
         ref->setName(sel->name());
         ref->child = sel;
@@ -994,7 +1042,9 @@ _gmx_sel_init_selection(const char                             *name,
                           "Each selection must evaluate to a position"));
     }
 
-    SelectionTreeElementPointer root(new SelectionTreeElement(SEL_ROOT));
+    SelectionTreeElementPointer root(
+            new SelectionTreeElement(
+                    SEL_ROOT, _gmx_sel_lexer_get_current_location(scanner)));
     root->child = sel;
     if (name)
     {
@@ -1056,11 +1106,12 @@ _gmx_sel_assign_variable(const char                             *name,
     }
     else
     {
+        SelectionLocation location(_gmx_sel_lexer_get_current_location(scanner));
         /* Create the root element */
-        root.reset(new SelectionTreeElement(SEL_ROOT));
+        root.reset(new SelectionTreeElement(SEL_ROOT, location));
         root->setName(name);
         /* Create the subexpression element */
-        root->child.reset(new SelectionTreeElement(SEL_SUBEXPR));
+        root->child.reset(new SelectionTreeElement(SEL_SUBEXPR, location));
         root->child->setName(name);
         _gmx_selelem_set_vtype(root->child, expr->v.type);
         root->child->child  = expr;
@@ -1076,7 +1127,7 @@ _gmx_sel_assign_variable(const char                             *name,
         sc->symtab->addVariable(name, root->child);
     }
     srenew(sc->varstrs, sc->nvars + 1);
-    sc->varstrs[sc->nvars] = strdup(pselstr);
+    sc->varstrs[sc->nvars] = gmx_strdup(pselstr);
     ++sc->nvars;
     if (_gmx_sel_is_lexer_interactive(scanner))
     {
index d594f3240d61bb0ac4966fe9a867e953c76e6bb5..3e0d5f49e4ceb3aa9e7ebe8f6b292d30bbbd0290 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,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.
 #include <list>
 #include <string>
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/vec.h"
-
+#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/uniqueptr.h"
 
 #include "selelem.h"
@@ -139,25 +139,29 @@ class SelectionParserValue
         /*! \brief
          * Allocates and initializes a constant integer value.
          *
-         * \param[in] value  Integer value to assign to the value.
+         * \param[in] value    Integer value to assign to the value.
+         * \param[in] location Location of the value.
          * \returns   The newly created value.
          */
-        static SelectionParserValue createInteger(int value)
+        static SelectionParserValue
+        createInteger(int value, const SelectionLocation &location)
         {
-            SelectionParserValue result(INT_VALUE);
+            SelectionParserValue result(INT_VALUE, location);
             result.u.i.i1 = result.u.i.i2 = value;
             return result;
         }
         /*! \brief
          * Allocates and initializes a constant integer range value.
          *
-         * \param[in] from  Beginning of the range to assign to the value.
-         * \param[in] to    End of the range to assign to the value.
+         * \param[in] from     Beginning of the range to assign to the value.
+         * \param[in] to       End of the range to assign to the value.
+         * \param[in] location Location of the value.
          * \returns   The newly created value.
          */
-        static SelectionParserValue createIntegerRange(int from, int to)
+        static SelectionParserValue
+        createIntegerRange(int from, int to, const SelectionLocation &location)
         {
-            SelectionParserValue result(INT_VALUE);
+            SelectionParserValue result(INT_VALUE, location);
             result.u.i.i1 = from;
             result.u.i.i2 = to;
             return result;
@@ -165,25 +169,29 @@ class SelectionParserValue
         /*! \brief
          * Allocates and initializes a constant floating-point value.
          *
-         * \param[in] value  Floating-point value to assign to the value.
+         * \param[in] value    Floating-point value to assign to the value.
+         * \param[in] location Location of the value.
          * \returns   The newly created value.
          */
-        static SelectionParserValue createReal(real value)
+        static SelectionParserValue
+        createReal(real value, const SelectionLocation &location)
         {
-            SelectionParserValue result(REAL_VALUE);
+            SelectionParserValue result(REAL_VALUE, location);
             result.u.r.r1 = result.u.r.r2 = value;
             return result;
         }
         /*! \brief
          * Allocates and initializes a constant floating-point range value.
          *
-         * \param[in] from  Beginning of the range to assign to the value.
-         * \param[in] to    End of the range to assign to the value.
+         * \param[in] from     Beginning of the range to assign to the value.
+         * \param[in] to       End of the range to assign to the value.
+         * \param[in] location Location of the value.
          * \returns   The newly created value.
          */
-        static SelectionParserValue createRealRange(real from, real to)
+        static SelectionParserValue
+        createRealRange(real from, real to, const SelectionLocation &location)
         {
-            SelectionParserValue result(REAL_VALUE);
+            SelectionParserValue result(REAL_VALUE, location);
             result.u.r.r1 = from;
             result.u.r.r2 = to;
             return result;
@@ -191,28 +199,34 @@ class SelectionParserValue
         /*! \brief
          * Allocates and initializes a constant string value.
          *
-         * \param[in] value  String to assign to the value.
+         * \param[in] value    String to assign to the value.
+         * \param[in] location Location of the value.
          * \returns   The newly created value.
          */
-        static SelectionParserValue createString(const char *value)
+        static SelectionParserValue
+        createString(const char *value, const SelectionLocation &location)
         {
-            SelectionParserValue result(STR_VALUE);
+            SelectionParserValue result(STR_VALUE, location);
             result.str = value;
             return result;
         }
         /*! \brief
          * Allocates and initializes a constant position value.
          *
-         * \param[in] value  Position vector to assign to the value.
+         * \param[in] value    Position vector to assign to the value.
+         * \param[in] location Location of the value.
          * \returns   The newly created value.
          */
-        static SelectionParserValue createPosition(rvec value)
+        static SelectionParserValue
+        createPosition(rvec value, const SelectionLocation &location)
         {
-            SelectionParserValue result(POS_VALUE);
+            SelectionParserValue result(POS_VALUE, location);
             copy_rvec(value, result.u.x);
             return result;
         }
 
+        //! Returns the location of this value in the parsed selection text.
+        const SelectionLocation &location() const { return location_; }
         //! Returns true if the value comes from expression evaluation.
         bool hasExpressionValue() const { return static_cast<bool>(expr); }
 
@@ -255,15 +269,19 @@ class SelectionParserValue
         /*! \brief
          * Initializes a new value.
          *
-         * \param[in] type  Type for the new value.
+         * \param[in] type     Type for the new value.
+         * \param[in] location Location for the value.
          */
-        explicit SelectionParserValue(e_selvalue_t type);
+        SelectionParserValue(e_selvalue_t type, const SelectionLocation &location);
         /*! \brief
          * Initializes a new expression value.
          *
          * \param[in] expr  Expression for the value.
          */
         explicit SelectionParserValue(const gmx::SelectionTreeElementPointer &expr);
+
+        //! Location of the value in the parsed text.
+        SelectionLocation       location_;
 };
 
 class SelectionParserParameter;
@@ -292,27 +310,31 @@ class SelectionParserParameter
         /*! \brief
          * Allocates and initializes a parsed method parameter.
          *
-         * \param[in] name    Name for the new parameter (can be NULL).
-         * \param[in] values  List of values for the parameter.
+         * \param[in] name     Name for the new parameter (can be NULL).
+         * \param[in] values   List of values for the parameter.
+         * \param[in] location Location of the parameter.
          * \returns   Pointer to the newly allocated parameter.
          * \throws    std::bad_alloc if out of memory.
          */
         static SelectionParserParameter
-        create(const char *name, SelectionParserValueListPointer values)
+        create(const char *name, SelectionParserValueListPointer values,
+               const SelectionLocation &location)
         {
-            return SelectionParserParameter(name, move(values));
+            return SelectionParserParameter(name, move(values), location);
         }
-        //! \copydoc create(const char *, SelectionParserValueListPointer)
+        //! \copydoc create(const char *, SelectionParserValueListPointer, const SelectionLocation &)
         static SelectionParserParameter
-        create(const std::string &name, SelectionParserValueListPointer values)
+        create(const std::string &name, SelectionParserValueListPointer values,
+               const SelectionLocation &location)
         {
-            return SelectionParserParameter(name.c_str(), move(values));
+            return SelectionParserParameter(name.c_str(), move(values), location);
         }
         /*! \brief
          * Allocates and initializes a parsed method parameter.
          *
-         * \param[in] name    Name for the new parameter (can be NULL).
-         * \param[in] value   Value for the parameter.
+         * \param[in] name     Name for the new parameter (can be NULL).
+         * \param[in] value    Value for the parameter.
+         * \param[in] location Location of the parameter.
          * \returns   Pointer to the newly allocated parameter.
          * \throws    std::bad_alloc if out of memory.
          *
@@ -321,9 +343,10 @@ class SelectionParserParameter
          * is necessary.
          */
         static SelectionParserParameter
-        create(const char *name, const SelectionParserValue &value)
+        create(const char *name, const SelectionParserValue &value,
+               const SelectionLocation &location)
         {
-            return create(name, SelectionParserValue::createList(value));
+            return create(name, SelectionParserValue::createList(value), location);
         }
         /*! \brief
          * Allocates and initializes a parsed method parameter.
@@ -341,45 +364,93 @@ class SelectionParserParameter
         createFromExpression(const char                        *name,
                              const SelectionTreeElementPointer &expr)
         {
-            return create(name, SelectionParserValue::createExpr(expr));
+            return create(name, SelectionParserValue::createExpr(expr),
+                          expr->location());
         }
         //! \copydoc createFromExpression(const char *, const SelectionTreeElementPointer &)
         static SelectionParserParameter
         createFromExpression(const std::string                 &name,
                              const SelectionTreeElementPointer &expr)
         {
-            return create(name.c_str(), SelectionParserValue::createExpr(expr));
+            return create(name.c_str(), SelectionParserValue::createExpr(expr),
+                          expr->location());
         }
 
+        //! Returns the name of the parameter (may be empty).
+        const std::string &name() const { return name_; }
+        //! Returns the location of this parameter in the parsed selection text.
+        const SelectionLocation        &location() const { return location_; }
+        //! Returns the values for the parameter.
+        const SelectionParserValueList &values() const { return *values_; }
+
+    private:
         /*! \brief
          * Initializes a parsed method parameter.
          *
-         * \param[in] name    Name for the new parameter (can be NULL).
-         * \param[in] values  List of values for the parameter.
+         * \param[in] name     Name for the new parameter (can be NULL).
+         * \param[in] values   List of values for the parameter.
+         * \param[in] location Location of the parameter.
          * \throws    std::bad_alloc if out of memory.
          */
-        SelectionParserParameter(const char                     *name,
-                                 SelectionParserValueListPointer values);
-
-        //! Returns the name of the parameter (may be empty).
-        const std::string &name() const { return name_; }
-        //! Returns the values for the parameter.
-        const SelectionParserValueList &values() const { return *values_; }
+        SelectionParserParameter(const char                      *name,
+                                 SelectionParserValueListPointer  values,
+                                 const SelectionLocation         &location);
 
         //! Name of the parameter.
         std::string                     name_;
+        //! Location of the parameter in the parsed text.
+        SelectionLocation               location_;
+
+        // TODO: Make private, there is only one direct user.
+    public:
         //! Values for this parameter.
         SelectionParserValueListPointer values_;
 };
 
 } // namespace gmx
 
-/** Error reporting function for the selection parser. */
-void
-_gmx_selparser_error(void *scanner, const char *fmt, ...);
-/** Handle exceptions caught within the Bison code. */
+/*! \brief
+ * Handles exceptions caught within the Bison code.
+ *
+ * \retval `true`  if the parser should attempt error recovery.
+ * \retval `false` if the parser should immediately abort.
+ *
+ * This function is called whenever an exception is caught within Bison
+ * actions.  Since exceptions cannot propagate through Bison code, the
+ * exception is saved (potentially with some extra context information) so that
+ * the caller of the parser can rethrow the exception.
+ *
+ * If it is possible to recover from the exception, then the function returns
+ * `true`, and Bison enters error recovery state.  At the end of the recovery,
+ * _gmx_selparser_handle_error() is called.
+ * If this function returns false, then Bison immediately aborts the parsing
+ * so that the caller can rethrow the exception.
+ */
 bool
-_gmx_selparser_handle_exception(void *scanner, const std::exception &ex);
+_gmx_selparser_handle_exception(void *scanner, std::exception *ex);
+/*! \brief
+ * Handles errors in the selection parser.
+ *
+ * \returns `true` if parsing can continue with the next selection.
+ * \throws  std::bad_alloc if out of memory during the error processing.
+ * \throws  unspecified    Can throw the stored exception if recovery from that
+ *     exception is not possible.
+ *
+ * This function is called during error recovery, after Bison has discarded all
+ * the symbols for the erroneous selection.
+ * At this point, the full selection that caused the error is known, and can be
+ * added to the error context.
+ *
+ * For an interactive parser, this function returns `true` to let the parsing
+ * continue with the next selection, or to let the user enter the next
+ * selection, if it was possible to recover from the exception.
+ * For other cases, this will either rethrow the original exception with added
+ * context, or return `false` after adding the context to the error reporter.
+ * Any exceptions thrown from this method are again caught by Bison and result
+ * in termination of the parsing; the caller can then rethrow them.
+ */
+bool
+_gmx_selparser_handle_error(void *scanner);
 
 /** Propagates the flags for selection elements. */
 void
@@ -431,6 +502,11 @@ _gmx_sel_init_keyword_strmatch(struct gmx_ana_selmethod_t *method,
                                gmx::SelectionStringMatchType matchType,
                                gmx::SelectionParserValueListPointer args,
                                const char *rpost, void *scanner);
+/** Creates a gmx::SelectionTreeElement for "keyword of" expression. */
+gmx::SelectionTreeElementPointer
+_gmx_sel_init_keyword_of(struct gmx_ana_selmethod_t *method,
+                         const gmx::SelectionTreeElementPointer &group,
+                         const char *rpost, void *scanner);
 /** Creates a gmx::SelectionTreeElement for a method expression from the parsed data. */
 gmx::SelectionTreeElementPointer
 _gmx_sel_init_method(struct gmx_ana_selmethod_t *method,
@@ -449,7 +525,7 @@ _gmx_sel_init_position(const gmx::SelectionTreeElementPointer &expr,
 
 /** Creates a gmx::SelectionTreeElement for a constant position. */
 gmx::SelectionTreeElementPointer
-_gmx_sel_init_const_position(real x, real y, real z);
+_gmx_sel_init_const_position(real x, real y, real z, void *scanner);
 /** Creates a gmx::SelectionTreeElement for a index group expression using group name. */
 gmx::SelectionTreeElementPointer
 _gmx_sel_init_group_by_name(const char *name, void *scanner);
@@ -458,7 +534,8 @@ gmx::SelectionTreeElementPointer
 _gmx_sel_init_group_by_id(int id, void *scanner);
 /** Creates a gmx::SelectionTreeElement for a variable reference */
 gmx::SelectionTreeElementPointer
-_gmx_sel_init_variable_ref(const gmx::SelectionTreeElementPointer &sel);
+_gmx_sel_init_variable_ref(const gmx::SelectionTreeElementPointer &sel,
+                           void                                   *scanner);
 
 /** Creates a root gmx::SelectionTreeElement for a selection. */
 gmx::SelectionTreeElementPointer
@@ -481,7 +558,7 @@ _gmx_sel_parser_should_finish(void *scanner);
 
 /* In params.c */
 /** Initializes an array of parameters based on input from the selection parser. */
-bool
+void
 _gmx_sel_parse_params(const gmx::SelectionParserParameterList &params,
                       int nparam, struct gmx_ana_selparam_t *param,
                       const gmx::SelectionTreeElementPointer &root,
index 1f1757237605121e7c9819415a433fc178f5d83c..616ca1a0584abc48182b27ca8a33c44b54a3660e 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "poscalc.h"
+
 #include <string.h>
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
+#include <algorithm>
 
-#include "gromacs/selection/centerofmass.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/position.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "centerofmass.h"
+
 namespace gmx
 {
 
@@ -188,11 +192,11 @@ struct gmx_ana_poscalc_t
      * already been calculated in \p sbase.
      * The structure pointed by \p sbase is always a static calculation.
      */
-    struct gmx_ana_poscalc_t                 *sbase;
+    gmx_ana_poscalc_t                        *sbase;
     /** Next structure in the linked list of calculations. */
-    struct gmx_ana_poscalc_t                 *next;
+    gmx_ana_poscalc_t                        *next;
     /** Previous structure in the linked list of calculations. */
-    struct gmx_ana_poscalc_t                 *prev;
+    gmx_ana_poscalc_t                        *prev;
     /** Number of references to this structure. */
     int                                       refcount;
     /** Collection this calculation belongs to. */
@@ -559,6 +563,25 @@ PositionCalculationCollection::createCalculationFromEnum(const char *post, int f
     return impl_->createCalculation(type, cflags);
 }
 
+int PositionCalculationCollection::getHighestRequiredAtomIndex() const
+{
+    int                result = 0;
+    gmx_ana_poscalc_t *pc     = impl_->first_;
+    while (pc)
+    {
+        // Calculations with a base just copy positions from the base, so
+        // those do not need to be considered in the check.
+        if (!pc->sbase)
+        {
+            gmx_ana_index_t g;
+            gmx_ana_index_set(&g, pc->b.nra, pc->b.a, 0);
+            result = std::max(result, gmx_ana_index_get_max_index(&g));
+        }
+        pc = pc->next;
+    }
+    return result;
+}
+
 void PositionCalculationCollection::initEvaluation()
 {
     if (impl_->bInit_)
@@ -1043,7 +1066,7 @@ gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p)
     {
         gmx_ana_indexmap_set_static(&p->m, &pc->b);
     }
-    gmx_ana_pos_reserve(p, p->m.mapb.nr, 0);
+    gmx_ana_pos_reserve(p, p->m.mapb.nr, -1);
     if (pc->flags & POS_VELOCITIES)
     {
         gmx_ana_pos_reserve_velocities(p);
index 9ddc0fd46c327c4180daa3e9cc066a1bcc79db60..b922424490b4dc7e4664af1c895c315b70ed3a62 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,9 +52,9 @@
 #ifndef GMX_SELECTION_POSCALC_H
 #define GMX_SELECTION_POSCALC_H
 
-#include "../legacyheaders/typedefs.h"
+#include <cstdio>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 /*! \name Flags for position calculation.
  * \anchor poscalc_flags
@@ -127,10 +127,13 @@ typedef enum
 } e_poscalc_t;
 
 /** Data structure for position calculation. */
-typedef struct gmx_ana_poscalc_t gmx_ana_poscalc_t;
+struct gmx_ana_poscalc_t;
 
 struct gmx_ana_index_t;
 struct gmx_ana_pos_t;
+struct t_pbc;
+struct t_topology;
+struct t_trxframe;
 
 namespace gmx
 {
@@ -276,6 +279,13 @@ class PositionCalculationCollection
          */
         gmx_ana_poscalc_t *createCalculationFromEnum(const char *post, int flags);
 
+        /*! \brief
+         * Computes the highest atom index required to evaluate this collection.
+         *
+         * Does not throw.
+         */
+        int getHighestRequiredAtomIndex() const;
+
         /*! \brief
          * Initializes evaluation for a position calculation collection.
          *
@@ -323,10 +333,10 @@ void
 gmx_ana_poscalc_set_flags(gmx_ana_poscalc_t *pc, int flags);
 /** Sets the maximum possible input index group for position calculation. */
 void
-gmx_ana_poscalc_set_maxindex(gmx_ana_poscalc_t *pc, struct gmx_ana_index_t *g);
+gmx_ana_poscalc_set_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g);
 /** Initializes positions for position calculation output. */
 void
-gmx_ana_poscalc_init_pos(gmx_ana_poscalc_t *pc, struct gmx_ana_pos_t *p);
+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);
@@ -337,7 +347,7 @@ gmx_ana_poscalc_requires_top(gmx_ana_poscalc_t *pc);
 /** Updates a single COM/COG structure for a frame. */
 void
 gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc,
-                       struct gmx_ana_pos_t *p, struct gmx_ana_index_t *g,
+                       gmx_ana_pos_t *p, gmx_ana_index_t *g,
                        t_trxframe *fr, t_pbc *pbc);
 
 #endif
index fe89b9ff6a99c253ee686b372b184fa8bbe2e67f..1315d94aaea8450357fb3bf72a78707990e0b814 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/selection/position.h"
+#include "gmxpre.h"
 
-#include <string.h>
+#include "position.h"
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/vec.h"
+#include <string.h>
 
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
@@ -99,7 +99,7 @@ gmx_ana_pos_reserve(gmx_ana_pos_t *pos, int n, int isize)
             srenew(pos->f, n);
         }
     }
-    if (isize > 0)
+    if (isize >= 0)
     {
         gmx_ana_indexmap_reserve(&pos->m, n, isize);
     }
@@ -200,7 +200,7 @@ gmx_ana_pos_copy(gmx_ana_pos_t *dest, gmx_ana_pos_t *src, bool bFirst)
 {
     if (bFirst)
     {
-        gmx_ana_pos_reserve(dest, src->count(), 0);
+        gmx_ana_pos_reserve(dest, src->count(), -1);
         if (src->v)
         {
             gmx_ana_pos_reserve_velocities(dest);
@@ -247,7 +247,8 @@ gmx_ana_pos_empty_init(gmx_ana_pos_t *pos)
     pos->m.mapb.nra = 0;
     pos->m.b.nr     = 0;
     pos->m.b.nra    = 0;
-    /* This should not really be necessary, but do it for safety... */
+    /* Initializing these should not really be necessary, but do it for
+     * safety... */
     pos->m.mapb.index[0] = 0;
     pos->m.b.index[0]    = 0;
     /* This function should only be used to construct all the possible
index eb2fffc0721159ac14e5e91f67151b794408d98b..e8e662d1ec1d8e33c8bc37abbb537d5a6979a398 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -41,9 +41,8 @@
 #ifndef GMX_SELECTION_POSITION_H
 #define GMX_SELECTION_POSITION_H
 
-#include "../legacyheaders/types/simple.h"
-
-#include "indexutil.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/selection/indexutil.h"
 
 /*! \brief
  * Stores a set of positions together with their origins.
index 66324c737c256dfad07c27999f908ec04fa2ac8b..56e2a77930fad170538b0f1d2ff2896347303a2d 100755 (executable)
@@ -31,5 +31,13 @@ fi
 
 # We apply some trivial patches to the output to avoid warnings for PGI
 # (and maybe other) compilers
-[[ $FORCE || parser.y  -nt parser.cpp ]]  && $BISON -t -o parser.cpp --defines=parser.h parser.y && patch -p0 < parser.patch && rm -f parser.cpp.orig
-[[ $FORCE || scanner.l -nt scanner.cpp ]] && $FLEX -o scanner.cpp scanner.l && patch -p0 < scanner.patch && rm -f scanner.cpp.orig
+[[ $FORCE || parser.y  -nt parser.cpp ]]  && \
+    echo Generating parser.cpp and parser.h... && \
+    $BISON -t -o parser.cpp --defines=parser.h parser.y && \
+    patch -p0 < parser.patch && \
+    rm -f parser.cpp.orig
+[[ $FORCE || scanner.l -nt scanner.cpp ]] && \
+    echo Generating scanner.cpp and scanner_flex.h... && \
+    $FLEX -o scanner.cpp scanner.l && \
+    patch -p0 < scanner.patch && \
+    rm -f scanner.cpp.orig
index ae8dfac457299a14ab0ce4430c0f3766757eba35..f4c9354ffe0cfdee7d03896951faa3647c450b53 100644 (file)
@@ -1,13 +1,17 @@
 #line 2 "scanner.cpp"
 #line 50 "scanner.l"
+#if !_gmx_sel_yyIN_HEADER
+#include "gmxpre.h"
+#endif
+
 // Required before flex definitions, since it includes <stdint.h>.
 // Otherwise, compilers not strictly C99 get macro redefinition errors,
 // since flex defines INT32_MAX etc. in such cases.
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 
 
 
-#line 11 "scanner.cpp"
+#line 15 "scanner.cpp"
 
 #define  YY_INT_ALIGNED short int
 
@@ -537,7 +541,7 @@ static yyconst flex_int16_t yy_chk[151] =
  * \ingroup module_selection
  */
 
-#line 56 "scanner.l"
+#line 60 "scanner.l"
 #include "gromacs/utility/cstringutil.h"
 
 #include "parser.h"
@@ -546,7 +550,7 @@ static yyconst flex_int16_t yy_chk[151] =
 
 // This macro makes the actions a bit shorter, since nearly every action needs
 // this call.
-#define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state)
+#define ADD_TOKEN _gmx_sel_lexer_add_token(yylloc, yytext, yyleng, state)
 
 // Set YY_BREAK to an empty value to avoid warnings (for the PGI compiler)
 // when we have return statements followed by break. Instead, we add breaks
@@ -556,7 +560,7 @@ static yyconst flex_int16_t yy_chk[151] =
 
 
 
-#line 560 "scanner.cpp"
+#line 564 "scanner.cpp"
 
 #define INITIAL 0
 #define matchof 1
@@ -784,14 +788,14 @@ YY_DECL
        register int yy_act;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
-#line 94 "scanner.l"
+#line 98 "scanner.l"
 
 
 
     gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(yyscanner);
     int              retval;
     /* Return a token if one is pending */
-    retval = _gmx_sel_lexer_process_pending(yylval, state);
+    retval = _gmx_sel_lexer_process_pending(yylval, yylloc, state);
     if (retval != 0)
     {
         return retval;
@@ -818,7 +822,7 @@ YY_DECL
     }
 
 
-#line 822 "scanner.cpp"
+#line 826 "scanner.cpp"
 
        if ( !yyg->yy_init )
                {
@@ -899,34 +903,34 @@ do_action:        /* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 127 "scanner.l"
+#line 131 "scanner.l"
 break;
        YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 128 "scanner.l"
+#line 132 "scanner.l"
 { yylval->i   = strtol(yytext, NULL, 10);    ADD_TOKEN; return TOK_INT; }
        YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 129 "scanner.l"
+#line 133 "scanner.l"
 { yylval->r   = strtod(yytext, NULL);        ADD_TOKEN; return TOK_REAL; }
        YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 130 "scanner.l"
+#line 134 "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 132 "scanner.l"
-{ _gmx_sel_lexer_add_token(" ", 1, state); break; }
+#line 136 "scanner.l"
+{ _gmx_sel_lexer_add_token(yylloc, " ", 1, state); break; }
        YY_BREAK
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 133 "scanner.l"
+#line 137 "scanner.l"
 {
                     if (yytext[0] == ';' || state->bInteractive)
                     {
@@ -936,100 +940,100 @@ YY_RULE_SETUP
                     }
                     else
                     {
-                        _gmx_sel_lexer_add_token(" ", 1, state);
+                        _gmx_sel_lexer_add_token(yylloc, " ", 1, state);
                     }
                     break;
                 }
        YY_BREAK
 case YY_STATE_EOF(cmdstart):
-#line 147 "scanner.l"
+#line 151 "scanner.l"
 { state->bCmdStart = true; yyterminate(); }
        YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(matchof):
 case YY_STATE_EOF(matchbool):
-#line 148 "scanner.l"
+#line 152 "scanner.l"
 { state->bCmdStart = true; return CMD_SEP; }
        YY_BREAK
 
 case 7:
 YY_RULE_SETUP
-#line 151 "scanner.l"
+#line 155 "scanner.l"
 { ADD_TOKEN; yylval->i = 1; return TOK_INT; }
        YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 152 "scanner.l"
+#line 156 "scanner.l"
 { ADD_TOKEN; yylval->i = 0; return TOK_INT; }
        YY_BREAK
 
 case 9:
 YY_RULE_SETUP
-#line 154 "scanner.l"
+#line 158 "scanner.l"
 { ADD_TOKEN; return GROUP; }
        YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 155 "scanner.l"
+#line 159 "scanner.l"
 { ADD_TOKEN; return TO; }
        YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 156 "scanner.l"
+#line 160 "scanner.l"
 { ADD_TOKEN; BEGIN(0); return OF; }
        YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 157 "scanner.l"
+#line 161 "scanner.l"
 { ADD_TOKEN; return AND; }
        YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 158 "scanner.l"
+#line 162 "scanner.l"
 { ADD_TOKEN; return OR; }
        YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 159 "scanner.l"
+#line 163 "scanner.l"
 { ADD_TOKEN; return XOR; }
        YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 160 "scanner.l"
+#line 164 "scanner.l"
 { ADD_TOKEN; return NOT; }
        YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 161 "scanner.l"
+#line 165 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
        YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 163 "scanner.l"
-{ return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
+#line 167 "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 165 "scanner.l"
-{ _gmx_sel_lexer_add_token(" ", 1, state); break; }
+#line 169 "scanner.l"
+{ _gmx_sel_lexer_add_token(yylloc, " ", 1, state); break; }
        YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 166 "scanner.l"
+#line 170 "scanner.l"
 { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 167 "scanner.l"
+#line 171 "scanner.l"
 { ADD_TOKEN; return yytext[0]; }
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 168 "scanner.l"
+#line 172 "scanner.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
        YY_BREAK
-#line 1033 "scanner.cpp"
+#line 1037 "scanner.cpp"
 
        case YY_END_OF_BUFFER:
                {
@@ -2180,4 +2184,4 @@ void _gmx_sel_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 168 "scanner.l"
+#line 172 "scanner.l"
index 14f941a36da068a72099eb55fd8d3bfa6fffc33b..ad7fcf56ce3e33a90ec1e620803edb1bdc5bd388 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
 #ifndef SELECTION_SCANNER_H
 #define SELECTION_SCANNER_H
 
+#include <string>
+
 #include <boost/exception_ptr.hpp>
 
 #include "parser.h"
 
-namespace gmx
-{
-class MessageStringCollector;
-}
-
 struct gmx_ana_indexgrps_t;
 struct gmx_ana_selcollection_t;
 
@@ -70,10 +67,6 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
 /** Frees memory allocated for the selection scanner. */
 void
 _gmx_sel_free_lexer(yyscan_t scanner);
-/** Sets the error reporter object for the selection scanner. */
-void
-_gmx_sel_set_lexer_error_reporter(yyscan_t                     scanner,
-                                  gmx::MessageStringCollector *errors);
 /** Stores an exception that is caught during parsing. */
 void
 _gmx_sel_lexer_set_exception(yyscan_t                    scanner,
@@ -90,9 +83,6 @@ _gmx_sel_is_lexer_interactive(yyscan_t scanner);
 /** Returns the selection collection for the scanner. */
 struct gmx_ana_selcollection_t *
 _gmx_sel_lexer_selcollection(yyscan_t scanner);
-/** Returns the error reporter for the scanner. */
-gmx::MessageStringCollector *
-_gmx_sel_lexer_error_reporter(yyscan_t scanner);
 /** Returns true if the external index groups for the scanner are set. */
 bool
 _gmx_sel_lexer_has_groups_set(yyscan_t scanner);
@@ -106,6 +96,37 @@ _gmx_sel_lexer_exp_selcount(yyscan_t scanner);
 /** Returns a pretty string of the current selection.  */
 const char *
 _gmx_sel_lexer_pselstr(yyscan_t scanner);
+/*! \brief
+ * Sets the current parser context location.
+ *
+ * This location is set while Bison reductions are being processed, and
+ * identifies the location of the current rule/reduction.
+ */
+void
+_gmx_sel_lexer_set_current_location(yyscan_t                      scanner,
+                                    const gmx::SelectionLocation &location);
+/*! \brief
+ * Returns the current parser context location.
+ *
+ * This returns the location last set with
+ * _gmx_sel_lexer_set_current_location().
+ */
+const gmx::SelectionLocation &
+_gmx_sel_lexer_get_current_location(yyscan_t scanner);
+/*! \brief
+ * Returns the selection text for the current parser context.
+ *
+ * This returns the selection text that corresponds to the position set last
+ * with _gmx_sel_lexer_set_current_location().
+ */
+std::string
+_gmx_sel_lexer_get_current_text(yyscan_t scanner);
+/*! \brief
+ * Returns the selection text at the given location.
+ */
+std::string
+_gmx_sel_lexer_get_text(yyscan_t                      scanner,
+                        const gmx::SelectionLocation &location);
 /** Clears the current selection string.  */
 void
 _gmx_sel_lexer_clear_pselstr(yyscan_t scanner);
@@ -123,7 +144,7 @@ void
 _gmx_sel_set_lex_input_str(yyscan_t scanner, const char *str);
 
 /** The scanning function generated by Flex. */
-#define YY_DECL int _gmx_sel_yylex(YYSTYPE *yylval, yyscan_t yyscanner)
+#define YY_DECL int _gmx_sel_yylex(YYSTYPE *yylval, YYLTYPE *yylloc, yyscan_t yyscanner)
 YY_DECL;
 
 #endif
index 2ba3ccd0f386715f8145f1303ed018ea4cbfeb38..f9a117d96ceeac982e363660fae51310437753c4 100644 (file)
  * \ingroup module_selection
  */
 %top{
+#if !_gmx_sel_yyIN_HEADER
+#include "gmxpre.h"
+#endif
+
 // Required before flex definitions, since it includes <stdint.h>.
 // Otherwise, compilers not strictly C99 get macro redefinition errors,
 // since flex defines INT32_MAX etc. in such cases.
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 }
 %{
 #include "gromacs/utility/cstringutil.h"
@@ -61,7 +65,7 @@
 
 // This macro makes the actions a bit shorter, since nearly every action needs
 // this call.
-#define ADD_TOKEN _gmx_sel_lexer_add_token(yytext, yyleng, state)
+#define ADD_TOKEN _gmx_sel_lexer_add_token(yylloc, yytext, yyleng, state)
 
 // Set YY_BREAK to an empty value to avoid warnings (for the PGI compiler)
 // when we have return statements followed by break. Instead, we add breaks
@@ -97,7 +101,7 @@ COMMENT    (#.*)
     gmx_sel_lexer_t *state = yyget_extra(yyscanner);
     int              retval;
     /* Return a token if one is pending */
-    retval = _gmx_sel_lexer_process_pending(yylval, state);
+    retval = _gmx_sel_lexer_process_pending(yylval, yylloc, state);
     if (retval != 0)
     {
         return retval;
@@ -129,7 +133,7 @@ COMMENT    (#.*)
 {REAL}          { yylval->r   = strtod(yytext, NULL);        ADD_TOKEN; return TOK_REAL; }
 {STRING}        { yylval->str = gmx_strndup(yytext+1, yyleng-2); ADD_TOKEN; return STR;  }
 
-\\\n            { _gmx_sel_lexer_add_token(" ", 1, state); break; }
+\\\n            { _gmx_sel_lexer_add_token(yylloc, " ", 1, state); break; }
 ";"|\n          {
                     if (yytext[0] == ';' || state->bInteractive)
                     {
@@ -139,7 +143,7 @@ COMMENT    (#.*)
                     }
                     else
                     {
-                        _gmx_sel_lexer_add_token(" ", 1, state);
+                        _gmx_sel_lexer_add_token(yylloc, " ", 1, state);
                     }
                     break;
                 }
@@ -160,8 +164,8 @@ xor             { ADD_TOKEN; return XOR; }
 not|"!"         { ADD_TOKEN; return NOT; }
 {CMPOP}         { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return CMP_OP; }
 
-{IDENTIFIER}    { return _gmx_sel_lexer_process_identifier(yylval, yytext, yyleng, state); }
+{IDENTIFIER}    { return _gmx_sel_lexer_process_identifier(yylval, yylloc, yytext, yyleng, state); }
 
-[[:space:]]+    { _gmx_sel_lexer_add_token(" ", 1, state); break; }
+[[:space:]]+    { _gmx_sel_lexer_add_token(yylloc, " ", 1, state); break; }
 [_[:alnum:]]+   { yylval->str = gmx_strndup(yytext, yyleng); ADD_TOKEN; return STR; }
 .               { ADD_TOKEN; return yytext[0]; }
index 6dc819f879bc9f58114c477b2e45efce27e74db7..939c685567c404238f2a9f59518b0480120976b1 100644 (file)
@@ -4,14 +4,18 @@
 
 #line 6 "scanner_flex.h"
 #line 50 "scanner.l"
+#if !_gmx_sel_yyIN_HEADER
+#include "gmxpre.h"
+#endif
+
 // Required before flex definitions, since it includes <stdint.h>.
 // Otherwise, compilers not strictly C99 get macro redefinition errors,
 // since flex defines INT32_MAX etc. in such cases.
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 
 
 
-#line 15 "scanner_flex.h"
+#line 19 "scanner_flex.h"
 
 #define  YY_INT_ALIGNED short int
 
@@ -340,8 +344,8 @@ extern int _gmx_sel_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 168 "scanner.l"
+#line 172 "scanner.l"
 
-#line 346 "scanner_flex.h"
+#line 350 "scanner_flex.h"
 #undef _gmx_sel_yyIN_HEADER
 #endif /* _gmx_sel_yyHEADER_H */
index fc5ce923133c7a0f64684a86b6eb098ed41dcb4d..fc20e46890510bb666bcaa2f5790bbfd04846861 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
  * \ingroup module_selection
  * \endcond
  */
+#include "gmxpre.h"
+
+#include "scanner_internal.h"
+
 #include <stdlib.h>
 #include <string.h>
 
 #include <string>
 
-#include "gromacs/legacyheaders/typedefs.h"
-
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/messagestringcollector.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "parser.h"
 #include "parsetree.h"
+#include "scanner.h"
 #include "selectioncollection-impl.h"
 #include "selelem.h"
 #include "selmethod.h"
 #include "symrec.h"
 
-#include "parser.h"
-#include "scanner.h"
-#include "scanner_internal.h"
-
 /*! \brief
  * Step in which the allocated memory for pretty-printed input is incremented.
  */
@@ -104,7 +103,7 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
     }
     else
     {
-        yylval->str = param->name ? strdup(param->name) : NULL;
+        yylval->str = param->name ? gmx_strdup(param->name) : NULL;
     }
     return PARAM;
 }
@@ -113,24 +112,30 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
  * Processes a selection method token.
  */
 static int
-init_method_token(YYSTYPE *yylval, gmx_ana_selmethod_t *method, bool bPosMod,
-                  gmx_sel_lexer_t *state)
+init_method_token(YYSTYPE *yylval, YYLTYPE *yylloc,
+                  const gmx::SelectionParserSymbol *symbol,
+                  bool bPosMod, gmx_sel_lexer_t *state)
 {
+    gmx_ana_selmethod_t *method = symbol->methodValue();
     /* If the previous token was not KEYWORD_POS, return EMPTY_POSMOD
      * before the actual method to work around a limitation in Bison. */
     if (!bPosMod && method->type != POS_VALUE)
     {
-        state->nextmethod = method;
+        state->nextMethodSymbol = symbol;
+        _gmx_sel_lexer_add_token(yylloc, NULL, 0, state);
         return EMPTY_POSMOD;
     }
+    _gmx_sel_lexer_add_token(yylloc, symbol->name().c_str(), -1, state);
     yylval->meth = method;
     if (!(method->flags & SMETH_MODIFIER) && method->nparams == 0)
     {
         /* Keyword */
         switch (method->type)
         {
-            case INT_VALUE:   return KEYWORD_NUMERIC;
-            case REAL_VALUE:  return KEYWORD_NUMERIC;
+            case INT_VALUE:
+            case REAL_VALUE:
+                state->bMatchOf = true;
+                return KEYWORD_NUMERIC;
             case STR_VALUE:   return KEYWORD_STR;
             case GROUP_VALUE: return KEYWORD_GROUP;
             default:
@@ -182,7 +187,8 @@ init_method_token(YYSTYPE *yylval, gmx_ana_selmethod_t *method, bool bPosMod,
 }
 
 int
-_gmx_sel_lexer_process_pending(YYSTYPE *yylval, gmx_sel_lexer_t *state)
+_gmx_sel_lexer_process_pending(YYSTYPE *yylval, YYLTYPE *yylloc,
+                               gmx_sel_lexer_t *state)
 {
     if (state->nextparam)
     {
@@ -192,29 +198,30 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, gmx_sel_lexer_t *state)
         if (state->neom > 0)
         {
             --state->neom;
+            _gmx_sel_lexer_add_token(yylloc, NULL, 0, state);
             return END_OF_METHOD;
         }
         state->nextparam = NULL;
         state->bBoolNo   = false;
-        _gmx_sel_lexer_add_token(param->name, -1, state);
+        _gmx_sel_lexer_add_token(yylloc, param->name, -1, state);
         return init_param_token(yylval, param, bBoolNo);
     }
     if (state->prev_pos_kw > 0)
     {
         --state->prev_pos_kw;
     }
-    if (state->nextmethod)
+    if (state->nextMethodSymbol)
     {
-        gmx_ana_selmethod_t *method = state->nextmethod;
-
-        state->nextmethod = NULL;
-        return init_method_token(yylval, method, true, state);
+        const gmx::SelectionParserSymbol *symbol = state->nextMethodSymbol;
+        state->nextMethodSymbol = NULL;
+        return init_method_token(yylval, yylloc, symbol, true, state);
     }
     return 0;
 }
 
 int
-_gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
+_gmx_sel_lexer_process_identifier(YYSTYPE *yylval, YYLTYPE *yylloc,
+                                  char *yytext, size_t yyleng,
                                   gmx_sel_lexer_t *state)
 {
     /* Check if the identifier matches with a parameter name */
@@ -267,7 +274,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
                 state->bBoolNo   = bBoolNo;
                 return END_OF_METHOD;
             }
-            _gmx_sel_lexer_add_token(param->name, -1, state);
+            _gmx_sel_lexer_add_token(yylloc, param->name, -1, state);
             return init_param_token(yylval, param, bBoolNo);
         }
     }
@@ -279,11 +286,16 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
     if (!symbol)
     {
         yylval->str = gmx_strndup(yytext, yyleng);
-        _gmx_sel_lexer_add_token(yytext, yyleng, state);
+        _gmx_sel_lexer_add_token(yylloc, yytext, yyleng, state);
         return IDENTIFIER;
     }
-    _gmx_sel_lexer_add_token(symbol->name().c_str(), -1, state);
     gmx::SelectionParserSymbol::SymbolType symtype = symbol->type();
+    /* For method symbols, we need some extra processing. */
+    if (symtype == gmx::SelectionParserSymbol::MethodSymbol)
+    {
+        return init_method_token(yylval, yylloc, symbol, state->prev_pos_kw > 0, state);
+    }
+    _gmx_sel_lexer_add_token(yylloc, symbol->name().c_str(), -1, state);
     /* Reserved symbols should have been caught earlier */
     if (symtype == gmx::SelectionParserSymbol::ReservedSymbol)
     {
@@ -326,18 +338,12 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
         }
         /* This position should not be reached. */
     }
-    /* For method symbols, return the correct type */
-    if (symtype == gmx::SelectionParserSymbol::MethodSymbol)
-    {
-        gmx_ana_selmethod_t *method = symbol->methodValue();
-        return init_method_token(yylval, method, state->prev_pos_kw > 0, state);
-    }
     /* For position symbols, we need to return KEYWORD_POS, but we also need
      * some additional handling. */
     if (symtype == gmx::SelectionParserSymbol::PositionSymbol)
     {
         state->bMatchOf    = true;
-        yylval->str        = strdup(symbol->name().c_str());
+        yylval->str        = gmx_strdup(symbol->name().c_str());
         state->prev_pos_kw = 2;
         return KEYWORD_POS;
     }
@@ -346,8 +352,10 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, char *yytext, size_t yyleng,
 }
 
 void
-_gmx_sel_lexer_add_token(const char *str, int len, gmx_sel_lexer_t *state)
+_gmx_sel_lexer_add_token(YYLTYPE *yylloc, const char *str, int len,
+                         gmx_sel_lexer_t *state)
 {
+    yylloc->startIndex = yylloc->endIndex = state->pslen;
     /* Do nothing if the string is empty, or if it is a space and there is
      * no other text yet, or if there already is a space. */
     if (!str || len == 0 || strlen(str) == 0
@@ -371,6 +379,7 @@ _gmx_sel_lexer_add_token(const char *str, int len, gmx_sel_lexer_t *state)
     strncpy(state->pselstr + state->pslen, str, len);
     state->pslen                += len;
     state->pselstr[state->pslen] = 0;
+    yylloc->endIndex             = state->pslen;
 }
 
 void
@@ -388,7 +397,6 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
     gmx_sel_lexer_t *state = new gmx_sel_lexer_t;
 
     state->sc        = sc;
-    state->errors    = NULL;
     state->bGroups   = bGroups;
     state->grps      = grps;
     state->nexpsel   = (maxnr > 0 ? static_cast<int>(sc->sel.size()) + maxnr : -1);
@@ -396,22 +404,24 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
     state->bInteractive = bInteractive;
 
     snew(state->pselstr, STRSTORE_ALLOCSTEP);
-    state->pselstr[0]   = 0;
-    state->pslen        = 0;
-    state->nalloc_psel  = STRSTORE_ALLOCSTEP;
+    state->pselstr[0]                 = 0;
+    state->pslen                      = 0;
+    state->nalloc_psel                = STRSTORE_ALLOCSTEP;
+    state->currentLocation.startIndex = 0;
+    state->currentLocation.endIndex   = 0;
 
     snew(state->mstack, 20);
-    state->mstack_alloc = 20;
-    state->msp          = -1;
-    state->neom         = 0;
-    state->nextparam    = NULL;
-    state->nextmethod   = NULL;
-    state->prev_pos_kw  = 0;
-    state->bBoolNo      = false;
-    state->bMatchOf     = false;
-    state->bMatchBool   = false;
-    state->bCmdStart    = true;
-    state->bBuffer      = false;
+    state->mstack_alloc     = 20;
+    state->msp              = -1;
+    state->neom             = 0;
+    state->nextparam        = NULL;
+    state->nextMethodSymbol = NULL;
+    state->prev_pos_kw      = 0;
+    state->bBoolNo          = false;
+    state->bMatchOf         = false;
+    state->bMatchBool       = false;
+    state->bCmdStart        = true;
+    state->bBuffer          = false;
 
     _gmx_sel_yyset_extra(state, *scannerp);
 }
@@ -431,14 +441,6 @@ _gmx_sel_free_lexer(yyscan_t scanner)
     _gmx_sel_yylex_destroy(scanner);
 }
 
-void
-_gmx_sel_set_lexer_error_reporter(yyscan_t                     scanner,
-                                  gmx::MessageStringCollector *errors)
-{
-    gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
-    state->errors = errors;
-}
-
 void
 _gmx_sel_lexer_set_exception(yyscan_t                    scanner,
                              const boost::exception_ptr &ex)
@@ -473,14 +475,6 @@ _gmx_sel_lexer_selcollection(yyscan_t scanner)
     return state->sc;
 }
 
-gmx::MessageStringCollector *
-_gmx_sel_lexer_error_reporter(yyscan_t scanner)
-{
-    gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
-    GMX_RELEASE_ASSERT(state->errors != NULL, "Error reporter not set");
-    return state->errors;
-}
-
 bool
 _gmx_sel_lexer_has_groups_set(yyscan_t scanner)
 {
@@ -509,6 +503,42 @@ _gmx_sel_lexer_pselstr(yyscan_t scanner)
     return state->pselstr;
 }
 
+void
+_gmx_sel_lexer_set_current_location(yyscan_t                      scanner,
+                                    const gmx::SelectionLocation &location)
+{
+    gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
+    state->currentLocation = location;
+}
+
+const gmx::SelectionLocation &
+_gmx_sel_lexer_get_current_location(yyscan_t scanner)
+{
+    gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
+    return state->currentLocation;
+}
+
+std::string
+_gmx_sel_lexer_get_current_text(yyscan_t scanner)
+{
+    gmx_sel_lexer_t *state = _gmx_sel_yyget_extra(scanner);
+    return _gmx_sel_lexer_get_text(scanner, state->currentLocation);
+}
+
+std::string
+_gmx_sel_lexer_get_text(yyscan_t                      scanner,
+                        const gmx::SelectionLocation &location)
+{
+    gmx_sel_lexer_t *state      = _gmx_sel_yyget_extra(scanner);
+    const int        startIndex = location.startIndex;
+    const int        endIndex   = location.endIndex;
+    if (startIndex >= endIndex)
+    {
+        return std::string();
+    }
+    return std::string(&state->pselstr[startIndex], endIndex - startIndex);
+}
+
 void
 _gmx_sel_lexer_clear_pselstr(yyscan_t scanner)
 {
index 1c02c499ec24670d0a48206575aa1fe0f72f187d..5bd8eb0e433718259cf383c4135cef7a1894af1b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
@@ -47,7 +47,7 @@
 
 namespace gmx
 {
-class MessageStringCollector;
+class SelectionParserSymbol;
 }
 
 /* These need to be defined before including scanner_flex.h, because it
@@ -72,8 +72,6 @@ typedef struct gmx_sel_lexer_t
 {
     //! Selection collection to put parsed selections in.
     struct gmx_ana_selcollection_t  *sc;
-    //! Error reporter object.
-    gmx::MessageStringCollector     *errors;
     //! Stores an exception that occurred during parsing.
     boost::exception_ptr             exception;
     //! Whether external index groups have been set.
@@ -92,6 +90,13 @@ typedef struct gmx_sel_lexer_t
     int                              pslen;
     //! Number of bytes allocated for \a pselstr.
     int                              nalloc_psel;
+    /*! \brief
+     * Position of the result of the current Bison action.
+     *
+     * This identifies the part of \a pselstr that corresponds to the
+     * subselection that is currently being reduced by Bison.
+     */
+    gmx::SelectionLocation           currentLocation;
 
     //! Stack of methods in which parameters should be looked up.
     struct gmx_ana_selmethod_t     **mstack;
@@ -111,9 +116,9 @@ typedef struct gmx_sel_lexer_t
      *
      * Only used when \p nextparam is NULL.
      */
-    struct gmx_ana_selmethod_t      *nextmethod;
+    const gmx::SelectionParserSymbol *nextMethodSymbol;
     //! Used to track whether the previous token was a position modifier.
-    int                              prev_pos_kw;
+    int                               prev_pos_kw;
 
     //! Whether the 'of' keyword is acceptable as the next token.
     bool                             bMatchOf;
@@ -133,13 +138,13 @@ typedef struct gmx_sel_lexer_t
  * we cannot have them here as parameter names... */
 /** Internal function for cases where several tokens need to be returned. */
 int
-_gmx_sel_lexer_process_pending(YYSTYPE *, gmx_sel_lexer_t *state);
+_gmx_sel_lexer_process_pending(YYSTYPE *, YYLTYPE *, gmx_sel_lexer_t *state);
 /** Internal function that processes identifier tokens. */
 int
-    _gmx_sel_lexer_process_identifier(YYSTYPE *, char *, size_t,
+    _gmx_sel_lexer_process_identifier(YYSTYPE *, YYLTYPE *, char *, size_t,
                                       gmx_sel_lexer_t *state);
 /** Internal function to add a token to the pretty-printed selection text. */
 void
-_gmx_sel_lexer_add_token(const char *str, int len, gmx_sel_lexer_t *state);
+_gmx_sel_lexer_add_token(YYLTYPE *, const char *str, int len, gmx_sel_lexer_t *state);
 
 #endif
index 786fb9912a469b2c16b772edfef5324b93ab1367..7b77d5c5ac4845a31d286e680517d69395f48180 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include "selection.h"
 
-#include "nbsearch.h"
-#include "position.h"
+#include <string>
+
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/stringutil.h"
+
 #include "selelem.h"
 #include "selvalue.h"
 
@@ -78,6 +87,10 @@ SelectionData::SelectionData(SelectionTreeElement *elem,
         while (child->type == SEL_MODIFIER)
         {
             child = child->child;
+            if (!child)
+            {
+                break;
+            }
             if (child->type == SEL_SUBEXPRREF)
             {
                 child = child->child;
@@ -91,13 +104,16 @@ SelectionData::SelectionData(SelectionTreeElement *elem,
                 }
             }
         }
-        /* For variable references, we should skip the
-         * SEL_SUBEXPRREF and SEL_SUBEXPR elements. */
-        if (child->type == SEL_SUBEXPRREF)
+        if (child)
         {
-            child = child->child->child;
+            /* For variable references, we should skip the
+             * SEL_SUBEXPRREF and SEL_SUBEXPR elements. */
+            if (child->type == SEL_SUBEXPRREF)
+            {
+                child = child->child->child;
+            }
+            bDynamic_ = (child->child->flags & SEL_DYNAMIC);
         }
-        bDynamic_ = (child->child->flags & SEL_DYNAMIC);
     }
     initCoveredFraction(CFRAC_NONE);
 }
@@ -245,8 +261,41 @@ SelectionData::restoreOriginalPositions(const t_topology *top)
 
 Selection::operator AnalysisNeighborhoodPositions() const
 {
-    return AnalysisNeighborhoodPositions(data().rawPositions_.x,
-                                         data().rawPositions_.count());
+    AnalysisNeighborhoodPositions pos(data().rawPositions_.x,
+                                      data().rawPositions_.count());
+    if (hasOnlyAtoms())
+    {
+        pos.exclusionIds(atomIndices());
+    }
+    return pos;
+}
+
+
+void
+Selection::setOriginalId(int i, int id)
+{
+    data().rawPositions_.m.mapid[i] = id;
+    data().rawPositions_.m.orgid[i] = id;
+}
+
+
+int
+Selection::initOriginalIdsToGroup(t_topology *top, e_index_t type)
+{
+    try
+    {
+        return gmx_ana_indexmap_init_orgid_group(&data().rawPositions_.m, top, type);
+    }
+    catch (const InconsistentInputError &)
+    {
+        GMX_ASSERT(type == INDEX_RES || type == INDEX_MOL,
+                   "Expected that only grouping by residue/molecule would fail");
+        std::string message =
+            formatString("Cannot group selection '%s' into %s, because some "
+                         "positions have atoms from more than one such group.",
+                         name(), type == INDEX_MOL ? "molecules" : "residues");
+        GMX_THROW(InconsistentInputError(message));
+    }
 }
 
 
@@ -345,9 +394,15 @@ Selection::printDebugInfo(FILE *fp, int nmaxind) const
 
 SelectionPosition::operator AnalysisNeighborhoodPositions() const
 {
-    return AnalysisNeighborhoodPositions(sel_->rawPositions_.x,
-                                         sel_->rawPositions_.count())
-               .selectSingleFromArray(i_);
+    AnalysisNeighborhoodPositions pos(sel_->rawPositions_.x,
+                                      sel_->rawPositions_.count());
+    if (sel_->hasOnlyAtoms())
+    {
+        // TODO: Move atomIndices() such that it can be reused here as well.
+        pos.exclusionIds(constArrayRefFromArray<int>(sel_->rawPositions_.m.mapb.a,
+                                                     sel_->rawPositions_.m.mapb.nra));
+    }
+    return pos.selectSingleFromArray(i_);
 }
 
 } // namespace gmx
index 2f36c1ecf216453bbe9b575356eab376569c6fb3..d64fb2584b40c1f64639392ec5beb69a2cd7793e 100644 (file)
 #include <string>
 #include <vector>
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selectionenums.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/gmxassert.h"
 
-#include "../utility/arrayref.h"
-#include "../utility/common.h"
-#include "../utility/gmxassert.h"
-
-#include "position.h"
-#include "indexutil.h"
-#include "selectionenums.h"
+struct t_topology;
 
 namespace gmx
 {
@@ -105,6 +103,8 @@ class SelectionData
         bool isDynamic() const { return bDynamic_; }
         //! Returns the type of positions in the selection.
         e_index_t type() const { return rawPositions_.m.type; }
+        //! Returns true if the selection only contains positions with a single atom each.
+        bool hasOnlyAtoms() const { return type() == INDEX_ATOM; }
 
         //! Number of positions in the selection.
         int posCount() const { return rawPositions_.count(); }
@@ -324,6 +324,8 @@ class Selection
         bool isDynamic() const { return data().isDynamic(); }
         //! Returns the type of positions in the selection.
         e_index_t type() const { return data().type(); }
+        //! Returns true if the selection only contains positions with a single atom each.
+        bool hasOnlyAtoms() const { return data().hasOnlyAtoms(); }
 
         //! Total number of atoms in the selection.
         int atomCount() const
@@ -490,7 +492,43 @@ class Selection
          *
          * \see SelectionPosition::mappedId()
          */
-        void setOriginalId(int i, int id) { data().rawPositions_.m.orgid[i] = id; }
+        void setOriginalId(int i, int id);
+        /*! \brief
+         * Inits the IDs for use with SelectionPosition::mappedId() for
+         * grouping.
+         *
+         * \param[in] top   Topology information
+         *     (can be NULL if not required for \p type).
+         * \param[in] type  Type of groups to generate.
+         * \returns   Number of groups that were present in the selection.
+         * \throws    InconsistentInputError if the selection positions cannot
+         *     be assigned to groups of the given type.
+         *
+         * If `type == INDEX_ATOM`, the IDs are initialized to 0, 1, 2, ...,
+         * and the return value is the number of positions.
+         * If `type == INDEX_ALL`, all the IDs are initialized to 0, and the
+         * return value is one.
+         * If `type == INDEX_RES` or `type == INDEX_MOL`, the first position
+         * will get ID 0, and all following positions that belong to the same
+         * residue/molecule will get the same ID.  The first position that
+         * belongs to a different residue/molecule will get ID 1, and so on.
+         * If some position contains atoms from multiple residues/molecules,
+         * i.e., the mapping is ambiguous, an exception is thrown.
+         * The return value is the number of residues/molecules that are
+         * present in the selection positions.
+         *
+         * This method is useful if the calling code needs to group the
+         * selection, e.g., for computing aggregate properties for each residue
+         * or molecule.  It can then use this method to initialize the
+         * appropriate grouping, use the return value to allocate a
+         * sufficiently sized buffer to store the aggregated values, and then
+         * use SelectionPosition::mappedId() to identify the location where to
+         * aggregate to.
+         *
+         * \see setOriginalId()
+         * \see SelectionPosition::mappedId()
+         */
+        int initOriginalIdsToGroup(t_topology *top, e_index_t type);
 
         /*! \brief
          * Prints out one-line description of the selection.
@@ -705,10 +743,10 @@ class SelectionPosition
          * Selection::setOriginalId() has not been called, the default values
          * are dependent on type():
          *  - ::INDEX_ATOM: atom indices
-         *  - ::INDEX_RES:  residue numbers
-         *  - ::INDEX_MOL:  molecule numbers
+         *  - ::INDEX_RES:  residue indices
+         *  - ::INDEX_MOL:  molecule indices
          *  .
-         * All the default values are zero-based
+         * All the default values are zero-based.
          */
         int mappedId() const
         {
index d44f2124fe843e25de6bd62cd522c60633f3f8a9..abc938683067dc98fc8485b784db340a83292066 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <boost/scoped_ptr.hpp>
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/onlinehelp/helptopicinterface.h"
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/selection.h" // For gmx::SelectionList
+#include "gromacs/selection/selectioncollection.h"
+#include "gromacs/utility/uniqueptr.h"
 
-#include "../onlinehelp/helptopicinterface.h"
-#include "../utility/uniqueptr.h"
-#include "indexutil.h"
 #include "poscalc.h"
-#include "selection.h" // For gmx::SelectionList
-#include "selectioncollection.h"
 #include "selelem.h"
 
+struct gmx_sel_mempool_t;
+struct t_pbc;
+struct t_topology;
+struct t_trxframe;
+
 namespace gmx
 {
 
@@ -99,9 +103,9 @@ struct gmx_ana_selcollection_t
     /** Topology for the collection. */
     t_topology                                        *top;
     /** Index group that contains all the atoms. */
-    struct gmx_ana_index_t                             gall;
+    gmx_ana_index_t                                    gall;
     /** Memory pool used for selection evaluation. */
-    struct gmx_sel_mempool_t                          *mempool;
+    gmx_sel_mempool_t                                 *mempool;
     //! Parser symbol table.
     boost::scoped_ptr<gmx::SelectionParserSymbolTable> symtab;
     //! Root of help topic tree (NULL is no help yet requested).
@@ -157,6 +161,8 @@ class SelectionCollection::Impl
         std::string             rpost_;
         //! Default output position type for selections.
         std::string             spost_;
+        //! Largest atom index needed by the selections for evaluation.
+        int                     maxAtomIndex_;
         /*! \brief
          * Debugging level for the collection.
          *
index 6237fe0a05a5abb01c1d6c3b5783dfc7b69cd65c..e18078814b489a5bfdfc32878001dd145bad0b7a 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,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.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include "selectioncollection.h"
 
 #include <cctype>
 
 #include <boost/shared_ptr.hpp>
 
+#include "gromacs/fileio/trx.h"
 #include "gromacs/legacyheaders/oenv.h"
-#include "gromacs/legacyheaders/xvgr.h"
-
 #include "gromacs/onlinehelp/helpmanager.h"
 #include "gromacs/onlinehelp/helpwritercontext.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/selection/selection.h"
+#include "gromacs/selection/selhelp.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/messagestringcollector.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "parser.h"
 #include "poscalc.h"
 #include "scanner.h"
-#include "selection.h"
 #include "selectioncollection-impl.h"
 #include "selelem.h"
-#include "selhelp.h"
 #include "selmethod.h"
 #include "symrec.h"
 
@@ -84,7 +84,7 @@ namespace gmx
  */
 
 SelectionCollection::Impl::Impl()
-    : debugLevel_(0), bExternalGroupsSet_(false), grps_(NULL)
+    : maxAtomIndex_(0), debugLevel_(0), bExternalGroupsSet_(false), grps_(NULL)
 {
     sc_.nvars     = 0;
     sc_.varstrs   = NULL;
@@ -189,7 +189,8 @@ int runParserLoop(yyscan_t scanner, _gmx_sel_yypstate *parserState,
     do
     {
         YYSTYPE value;
-        int     token = _gmx_sel_yylex(&value, scanner);
+        YYLTYPE location;
+        int     token = _gmx_sel_yylex(&value, &location, scanner);
         if (bInteractive)
         {
             if (token == 0)
@@ -205,7 +206,7 @@ int runParserLoop(yyscan_t scanner, _gmx_sel_yypstate *parserState,
             }
             prevToken = token;
         }
-        status = _gmx_sel_yypush_parse(parserState, token, &value, scanner);
+        status = _gmx_sel_yypush_parse(parserState, token, &value, &location, scanner);
     }
     while (status == YYPUSH_MORE);
     _gmx_sel_lexer_rethrow_exception_if_occurred(scanner);
@@ -336,11 +337,7 @@ SelectionList runParser(yyscan_t scanner, bool bStdIn, int maxnr,
     gmx_ana_selcollection_t *sc   = _gmx_sel_lexer_selcollection(scanner);
     gmx_ana_indexgrps_t     *grps = _gmx_sel_lexer_indexgrps(scanner);
 
-    MessageStringCollector   errors;
-    _gmx_sel_set_lexer_error_reporter(scanner, &errors);
-
-    size_t oldCount = sc->sel.size();
-    bool   bOk      = false;
+    size_t                   oldCount = sc->sel.size();
     {
         boost::shared_ptr<_gmx_sel_yypstate> parserState(
                 _gmx_sel_yypstate_new(), &_gmx_sel_yypstate_delete);
@@ -380,37 +377,33 @@ SelectionList runParser(yyscan_t scanner, bool bStdIn, int maxnr,
                     // error/warning if some input was ignored.
                     goto early_termination;
                 }
-                if (!errors.isEmpty() && bInteractive)
-                {
-                    fprintf(stderr, "%s", errors.toString().c_str());
-                    errors.clear();
-                }
             }
-            status = _gmx_sel_yypush_parse(parserState.get(), 0, NULL,
-                                           scanner);
+            {
+                YYLTYPE location;
+                status = _gmx_sel_yypush_parse(parserState.get(), 0, NULL,
+                                               &location, scanner);
+            }
+            // TODO: Remove added selections from the collection if parsing failed?
             _gmx_sel_lexer_rethrow_exception_if_occurred(scanner);
 early_termination:
-            bOk = (status == 0);
+            GMX_RELEASE_ASSERT(status == 0,
+                               "Parser errors should have resulted in an exception");
         }
         else
         {
             int status = runParserLoop(scanner, parserState.get(), false);
-            bOk = (status == 0);
+            GMX_RELEASE_ASSERT(status == 0,
+                               "Parser errors should have resulted in an exception");
         }
     }
     scannerGuard.reset();
     int nr = sc->sel.size() - oldCount;
     if (maxnr > 0 && nr != maxnr)
     {
-        bOk = false;
-        errors.append("Too few selections provided");
-    }
-
-    // TODO: Remove added selections from the collection if parsing failed?
-    if (!bOk || !errors.isEmpty())
-    {
-        GMX_ASSERT(!bOk && !errors.isEmpty(), "Inconsistent error reporting");
-        GMX_THROW(InvalidInputError(errors.toString()));
+        std::string message
+            = formatString("Too few selections provided; got %d, expected %d",
+                           nr, maxnr);
+        GMX_THROW(InvalidInputError(message));
     }
 
     SelectionList                     result;
@@ -423,6 +416,44 @@ early_termination:
     return result;
 }
 
+/*! \brief
+ * Checks that index groups have valid atom indices.
+ *
+ * \param[in]    root    Root of selection tree to process.
+ * \param[in]    natoms  Maximum number of atoms that the selections are set
+ *     to evaluate.
+ * \param        errors  Object for reporting any error messages.
+ * \throws std::bad_alloc if out of memory.
+ *
+ * Recursively checks the selection tree for index groups.
+ * Each found group is checked that it only contains atom indices that match
+ * the topology/maximum number of atoms set for the selection collection.
+ * Any issues are reported to \p errors.
+ */
+void checkExternalGroups(const SelectionTreeElementPointer &root,
+                         int                                natoms,
+                         ExceptionInitializer              *errors)
+{
+    if (root->type == SEL_CONST && root->v.type == GROUP_VALUE)
+    {
+        try
+        {
+            root->checkIndexGroup(natoms);
+        }
+        catch (const UserInputError &)
+        {
+            errors->addCurrentExceptionAsNested();
+        }
+    }
+
+    SelectionTreeElementPointer child = root->child;
+    while (child)
+    {
+        checkExternalGroups(child, natoms, errors);
+        child = child->next;
+    }
+}
+
 }   // namespace
 
 
@@ -435,7 +466,7 @@ void SelectionCollection::Impl::resolveExternalGroups(
     {
         try
         {
-            root->resolveIndexGroupReference(grps_);
+            root->resolveIndexGroupReference(grps_, sc_.gall.isize);
         }
         catch (const UserInputError &)
         {
@@ -552,6 +583,20 @@ SelectionCollection::setTopology(t_topology *top, int natoms)
     {
         natoms = top->atoms.nr;
     }
+    if (impl_->bExternalGroupsSet_)
+    {
+        ExceptionInitializer        errors("Invalid index group references encountered");
+        SelectionTreeElementPointer root = impl_->sc_.root;
+        while (root)
+        {
+            checkExternalGroups(root, natoms, &errors);
+            root = root->next;
+        }
+        if (errors.hasNestedExceptions())
+        {
+            GMX_THROW(InconsistentInputError(errors));
+        }
+    }
     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);
@@ -722,7 +767,7 @@ SelectionCollection::compile()
         const internal::SelectionData &sel = **iter;
         if (sel.hasFlag(efSelection_OnlyAtoms))
         {
-            if (sel.type() != INDEX_ATOM)
+            if (!sel.hasOnlyAtoms())
             {
                 std::string message = formatString(
                             "Selection '%s' does not evaluate to individual atoms. "
@@ -748,6 +793,14 @@ SelectionCollection::compile()
 void
 SelectionCollection::evaluate(t_trxframe *fr, t_pbc *pbc)
 {
+    if (fr->natoms <= impl_->maxAtomIndex_)
+    {
+        std::string message = formatString(
+                    "Trajectory has less atoms (%d) than what is required for "
+                    "evaluating the provided selections (atoms up to index %d "
+                    "are required).", fr->natoms, impl_->maxAtomIndex_ + 1);
+        GMX_THROW(InconsistentInputError(message));
+    }
     impl_->sc_.pcc.initFrame();
 
     SelectionEvaluator evaluator;
@@ -800,11 +853,4 @@ SelectionCollection::printXvgrInfo(FILE *out, output_env_t oenv) const
     }
 }
 
-// static
-HelpTopicPointer
-SelectionCollection::createDefaultHelpTopic()
-{
-    return createSelectionHelpTopic();
-}
-
 } // namespace gmx
index cf79b660bd60cffe3dd87f6d2b16c2dc9ecc6ad2..8ec7ed1f230554acb65ed5cbbbbb094be6af8a80 100644 (file)
 #ifndef GMX_SELECTION_SELECTIONCOLLECTION_H
 #define GMX_SELECTION_SELECTIONCOLLECTION_H
 
+#include <cstdio>
+
 #include <string>
 #include <vector>
 
-#include "../legacyheaders/typedefs.h"
-
-#include "../onlinehelp/helptopicinterface.h"
-#include "../utility/common.h"
-#include "selection.h" // For gmx::SelectionList
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/selection/selection.h" // For gmx::SelectionList
+#include "gromacs/utility/classhelpers.h"
 
 struct gmx_ana_indexgrps_t;
+struct t_pbc;
+struct t_topology;
+struct t_trxframe;
 
 namespace gmx
 {
@@ -107,14 +110,6 @@ class SelectionEvaluator;
 class SelectionCollection
 {
     public:
-        /*! \brief
-         * Creates a help tree for selections.
-         *
-         * \throws   std::bad_alloc if out of memory.
-         * \returns  Root topic of the created selection tree.
-         */
-        static HelpTopicPointer createDefaultHelpTopic();
-
         /*! \brief
          * Creates an empty selection collection.
          *
index d401ac56c175fc604040697d1b206e01d787ce6f..2523ea8876d6e0479984ef1251be6663d54eae38 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 #ifndef GMX_SELECTION_SELECTIONENUMS_H
 #define GMX_SELECTION_SELECTIONENUMS_H
 
-#include "../utility/flags.h"
+#include "gromacs/utility/flags.h"
 
 /*! \brief
  * Defines the type of covered fraction.
index c0a70dad005beb6cc5ba8231b76b61d5f05bc1d7..369d6256dbb50bf3c15f2a17fe1676467fc081a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,7 +43,7 @@
 #ifndef GMX_SELECTION_SELECTIONFILEOPTION_H
 #define GMX_SELECTION_SELECTIONFILEOPTION_H
 
-#include "../options/abstractoption.h"
+#include "gromacs/options/abstractoption.h"
 
 namespace gmx
 {
@@ -76,7 +76,8 @@ class SelectionFileOption : public AbstractOption
         explicit SelectionFileOption(const char *name);
 
     private:
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 };
 
 /*! \libinternal \brief
@@ -94,13 +95,6 @@ class SelectionFileOptionInfo : public OptionInfo
          * Does not throw.
          */
         explicit SelectionFileOptionInfo(SelectionFileOptionStorage *option);
-
-        //! \copydoc SelectionOptionInfo::setManager()
-        void setManager(SelectionOptionManager *manager);
-
-    private:
-        SelectionFileOptionStorage &option();
-        const SelectionFileOptionStorage &option() const;
 };
 
 } // namespace gmx
index a19321962fe2d2314b490cec50c456b721da8f16..9d877945982e7116c878598a8f8e12467059afaf 100644 (file)
@@ -42,8 +42,8 @@
 #ifndef GMX_SELECTION_SELECTIONFILEOPTIONSTORAGE_H
 #define GMX_SELECTION_SELECTIONFILEOPTIONSTORAGE_H
 
-#include "../options/abstractoptionstorage.h"
-#include "selectionfileoption.h"
+#include "gromacs/options/abstractoptionstorage.h"
+#include "gromacs/selection/selectionfileoption.h"
 
 namespace gmx
 {
@@ -63,29 +63,25 @@ class SelectionFileOptionStorage : public AbstractOptionStorage
          * Initializes the storage from option settings.
          *
          * \param[in] settings   Storage settings.
+         * \param     manager    Manager for this object.
          */
-        SelectionFileOptionStorage(const SelectionFileOption &settings);
+        SelectionFileOptionStorage(const SelectionFileOption &settings,
+                                   SelectionOptionManager    *manager);
 
         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 ""; }
 
-        //! \copydoc SelectionFileOptionInfo::setManager()
-        void setManager(SelectionOptionManager *manager)
-        {
-            manager_ = manager;
-        }
-
     private:
         virtual void clearSet();
         virtual void convertValue(const std::string &value);
         virtual void processSet();
         virtual void processAll() {}
 
-        SelectionFileOptionInfo info_;
-        SelectionOptionManager *manager_;
-        bool                    bValueParsed_;
+        SelectionFileOptionInfo  info_;
+        SelectionOptionManager  &manager_;
+        bool                     bValueParsed_;
 };
 
 } // namespace gmx
index 41da1f5de019f73d4364cc9fe94ca04b2ddbc66f..019f8965b5e27b05807f99a00ba447d3030a149c 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include "selectionoption.h"
-#include "selectionfileoption.h"
-#include "selectionoptionstorage.h"
-#include "selectionfileoptionstorage.h"
 
 #include <string>
 
+#include "gromacs/options/optionmanagercontainer.h"
 #include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectionfileoption.h"
 #include "gromacs/selection/selectionoptionmanager.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/messagestringcollector.h"
 
+#include "selectionfileoptionstorage.h"
+#include "selectionoptionstorage.h"
+
 namespace gmx
 {
 
@@ -59,26 +63,18 @@ namespace gmx
  * SelectionOptionStorage
  */
 
-SelectionOptionStorage::SelectionOptionStorage(const SelectionOption &settings)
+SelectionOptionStorage::SelectionOptionStorage(const SelectionOption  &settings,
+                                               SelectionOptionManager *manager)
     : MyBase(settings, OptionFlags() | efOption_NoDefaultValue
              | efOption_DontCheckMinimumCount),
-      info_(this), manager_(NULL), defaultText_(settings.defaultText_),
+      info_(this), manager_(*manager), defaultText_(settings.defaultText_),
       selectionFlags_(settings.selectionFlags_)
 {
+    GMX_RELEASE_ASSERT(manager != NULL,
+                       "SelectionOptionManager must be added before SelectionOption");
     GMX_RELEASE_ASSERT(!hasFlag(efOption_MultipleTimes),
                        "allowMultiple() is not supported for selection options");
-}
-
-
-void SelectionOptionStorage::setManager(SelectionOptionManager *manager)
-{
-    GMX_RELEASE_ASSERT(manager_ == NULL || manager_ == manager,
-                       "Manager cannot be changed once set");
-    if (manager_ == NULL)
-    {
-        manager->registerOption(this);
-        manager_ = manager;
-    }
+    manager_.registerOption(this);
 }
 
 
@@ -124,18 +120,14 @@ void SelectionOptionStorage::addSelections(
 
 void SelectionOptionStorage::convertValue(const std::string &value)
 {
-    GMX_RELEASE_ASSERT(manager_ != NULL, "Manager is not set");
-
-    manager_->convertOptionValue(this, value, false);
+    manager_.convertOptionValue(this, value, false);
 }
 
 void SelectionOptionStorage::processSetValues(ValueList *values)
 {
-    GMX_RELEASE_ASSERT(manager_ != NULL, "Manager is not set");
-
     if (values->size() == 0)
     {
-        manager_->requestOptionDelayedParsing(this);
+        manager_.requestOptionDelayedParsing(this);
     }
     else if (values->size() < static_cast<size_t>(minValueCount()))
     {
@@ -145,14 +137,13 @@ void SelectionOptionStorage::processSetValues(ValueList *values)
 
 void SelectionOptionStorage::processAll()
 {
-    GMX_RELEASE_ASSERT(manager_ != NULL, "Manager is not set");
     if (!isSet() && !defaultText_.empty())
     {
-        manager_->convertOptionValue(this, defaultText_, true);
+        manager_.convertOptionValue(this, defaultText_, true);
     }
     if (isRequired() && !isSet())
     {
-        manager_->requestOptionDelayedParsing(this);
+        manager_.requestOptionDelayedParsing(this);
         markAsSet();
     }
 }
@@ -160,6 +151,7 @@ void SelectionOptionStorage::processAll()
 void SelectionOptionStorage::setAllowedValueCount(int count)
 {
     // TODO: It should be possible to have strong exception safety here.
+    // TODO: Use ExceptionInitializer here.
     MessageStringCollector errors;
     errors.startContext("In option '" + name() + "'");
     if (count >= 0)
@@ -227,11 +219,6 @@ const SelectionOptionStorage &SelectionOptionInfo::option() const
     return static_cast<const SelectionOptionStorage &>(OptionInfo::option());
 }
 
-void SelectionOptionInfo::setManager(SelectionOptionManager *manager)
-{
-    option().setManager(manager);
-}
-
 void SelectionOptionInfo::setValueCount(int count)
 {
     option().setAllowedValueCount(count);
@@ -267,9 +254,11 @@ void SelectionOptionInfo::setDynamicMask(bool bEnabled)
  * SelectionOption
  */
 
-AbstractOptionStoragePointer SelectionOption::createStorage() const
+AbstractOptionStorage *
+SelectionOption::createStorage(const OptionManagerContainer &managers) const
 {
-    return AbstractOptionStoragePointer(new SelectionOptionStorage(*this));
+    return new SelectionOptionStorage(
+            *this, managers.get<SelectionOptionManager>());
 }
 
 
@@ -277,11 +266,14 @@ AbstractOptionStoragePointer SelectionOption::createStorage() const
  * SelectionFileOptionStorage
  */
 
-SelectionFileOptionStorage::SelectionFileOptionStorage(const SelectionFileOption &settings)
+SelectionFileOptionStorage::SelectionFileOptionStorage(
+        const SelectionFileOption &settings, SelectionOptionManager *manager)
     : AbstractOptionStorage(settings, OptionFlags() | efOption_MultipleTimes
                             | efOption_DontCheckMinimumCount),
-      info_(this), manager_(NULL), bValueParsed_(false)
+      info_(this), manager_(*manager), bValueParsed_(false)
 {
+    GMX_RELEASE_ASSERT(manager != NULL,
+                       "SelectionOptionManager must be added before SelectionFileOption");
 }
 
 void SelectionFileOptionStorage::clearSet()
@@ -291,15 +283,13 @@ void SelectionFileOptionStorage::clearSet()
 
 void SelectionFileOptionStorage::convertValue(const std::string &value)
 {
-    GMX_RELEASE_ASSERT(manager_ != NULL, "Manager is not set");
-
     if (bValueParsed_)
     {
         GMX_THROW(InvalidInputError("More than one file name provided"));
     }
     bValueParsed_ = true;
     // TODO: Should we throw an InvalidInputError if the file does not exist?
-    manager_->parseRequestedFromFile(value);
+    manager_.parseRequestedFromFile(value);
 }
 
 void SelectionFileOptionStorage::processSet()
@@ -320,21 +310,6 @@ SelectionFileOptionInfo::SelectionFileOptionInfo(SelectionFileOptionStorage *opt
 {
 }
 
-SelectionFileOptionStorage &SelectionFileOptionInfo::option()
-{
-    return static_cast<SelectionFileOptionStorage &>(OptionInfo::option());
-}
-
-const SelectionFileOptionStorage &SelectionFileOptionInfo::option() const
-{
-    return static_cast<const SelectionFileOptionStorage &>(OptionInfo::option());
-}
-
-void SelectionFileOptionInfo::setManager(SelectionOptionManager *manager)
-{
-    option().setManager(manager);
-}
-
 
 /********************************************************************
  * SelectionFileOption
@@ -346,9 +321,11 @@ SelectionFileOption::SelectionFileOption(const char *name)
     setDescription("Provide selections from files");
 }
 
-AbstractOptionStoragePointer SelectionFileOption::createStorage() const
+AbstractOptionStorage *
+SelectionFileOption::createStorage(const OptionManagerContainer &managers) const
 {
-    return AbstractOptionStoragePointer(new SelectionFileOptionStorage(*this));
+    return new SelectionFileOptionStorage(
+            *this, managers.get<SelectionOptionManager>());
 }
 
 } // namespace gmx
index cba014a055ab048070dfc87dd061f6edcf477e69..0af37dddc73c36cb077d3446a9cbdc692321170a 100644 (file)
 #ifndef GMX_SELECTION_SELECTIONOPTION_H
 #define GMX_SELECTION_SELECTIONOPTION_H
 
-#include "../options/abstractoption.h"
-
-#include "selection.h"
-#include "selectionenums.h"
+#include "gromacs/options/abstractoption.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectionenums.h"
 
 namespace gmx
 {
@@ -60,6 +59,10 @@ class SelectionOptionStorage;
  *
  * Public methods in this class do not throw.
  *
+ * To use options of this type, SelectionOptionManager must first be added to
+ * the Options collection.  For trajectory analysis tools, the framework takes
+ * care of this.
+ *
  * \todo
  * Support for specifying that an option accepts, e.g., two to four selections.
  * Currently, only a fixed count or any number of selections is possible.
@@ -145,7 +148,8 @@ class SelectionOption : public OptionTemplate<Selection, SelectionOption>
         using MyBase::defaultValue;
         using MyBase::defaultValueIfSet;
 
-        virtual AbstractOptionStoragePointer createStorage() const;
+        virtual AbstractOptionStorage *createStorage(
+            const OptionManagerContainer &managers) const;
 
         const char             *defaultText_;
         SelectionFlags          selectionFlags_;
@@ -211,22 +215,6 @@ class SelectionOptionInfo : public OptionInfo
          */
         explicit SelectionOptionInfo(SelectionOptionStorage *option);
 
-        /*! \brief
-         * Set manager for handling interaction with other options and the
-         * selection collection.
-         *
-         * \param   manager  Selection manager to set.
-         *
-         * This must be called before the values are added.
-         *
-         * Typically it is called through setManagerForSelectionOptions(),
-         * which recursively sets the manager for all selection options in
-         * an Options object.
-         *
-         * Does not throw.
-         */
-        void setManager(SelectionOptionManager *manager);
-
         /*! \brief
          * Sets the number of selections allowed for the option.
          *
index 3600bd29233994a659941d064dcb21cd43be3b4b..ee1e486d0ca9a386830d49d836c820095b220e6b 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include "selectionoptionmanager.h"
 
 #include <cstdio>
 
-#include "gromacs/options/optionsvisitor.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectioncollection.h"
-#include "gromacs/selection/selectionoption.h"
 #include "gromacs/selection/selectionfileoption.h"
+#include "gromacs/selection/selectionoption.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/stringutil.h"
 
@@ -331,60 +332,4 @@ SelectionOptionManager::parseRequestedFromString(const std::string &str)
     impl_->placeSelectionsInRequests(selections);
 }
 
-/********************************************************************
- * Global functions
- */
-
-namespace
-{
-
-/*! \internal \brief
- * Visitor that sets the manager for each selection option.
- *
- * \ingroup module_selection
- */
-class SelectionOptionManagerSetter : public OptionsModifyingVisitor
-{
-    public:
-        //! Construct a visitor that sets given manager.
-        explicit SelectionOptionManagerSetter(SelectionOptionManager *manager)
-            : manager_(manager)
-        {
-        }
-
-        void visitSubSection(Options *section)
-        {
-            OptionsModifyingIterator iterator(section);
-            iterator.acceptSubSections(this);
-            iterator.acceptOptions(this);
-        }
-
-        void visitOption(OptionInfo *option)
-        {
-            SelectionOptionInfo *selOption
-                = option->toType<SelectionOptionInfo>();
-            if (selOption != NULL)
-            {
-                selOption->setManager(manager_);
-            }
-            SelectionFileOptionInfo *selFileOption
-                = option->toType<SelectionFileOptionInfo>();
-            if (selFileOption != NULL)
-            {
-                selFileOption->setManager(manager_);
-            }
-        }
-
-    private:
-        SelectionOptionManager *manager_;
-};
-
-}   // namespace
-
-void setManagerForSelectionOptions(Options                *options,
-                                   SelectionOptionManager *manager)
-{
-    SelectionOptionManagerSetter(manager).visitSubSection(options);
-}
-
 } // namespace gmx
index 8545661bbf2d2115cc71ee4aa5617c5327e8cf61..7ddb8660872e80449c94a09eabb90f6633a8ff01 100644 (file)
@@ -45,7 +45,8 @@
 
 #include <string>
 
-#include "../utility/common.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -62,6 +63,8 @@ class SelectionOptionStorage;
  * require actions outside options parsing.
  * It also implements the coupling between SelectionOption and
  * SelectionFileOption.
+ * It needs to be added using Options::addManager() before SelectionOption or
+ * SelectionFileOption options can be added to an Options collection.
  *
  * The main features of this class are:
  *  - convertOptionValue(), which is used to convert string values into
@@ -73,12 +76,10 @@ class SelectionOptionStorage;
  *    parseRequestedFromStdin(), parseRequestedFromFile() or
  *    parseRequstedFromString().
  *
- * \see setManagerForSelectionOptions()
- *
  * \inpublicapi
  * \ingroup module_selection
  */
-class SelectionOptionManager
+class SelectionOptionManager : public OptionManagerInterface
 {
     public:
         /*! \brief
@@ -87,7 +88,7 @@ class SelectionOptionManager
          * \throws  std::bad_alloc if out of memory.
          */
         explicit SelectionOptionManager(SelectionCollection *selections);
-        ~SelectionOptionManager();
+        virtual ~SelectionOptionManager();
 
         /*! \brief
          * Adds a selection option to be managed.
@@ -209,20 +210,6 @@ class SelectionOptionManager
         friend class SelectionOptionStorage;
 };
 
-/*! \brief
- * Set manager for all selection options.
- *
- * Recursively sets the manager to \p manager for all selection options in
- * \p options.
- * Must be called before value assignment starts for \p options.
- *
- * Does not throw.
- *
- * \inpublicapi
- */
-void setManagerForSelectionOptions(Options                *options,
-                                   SelectionOptionManager *manager);
-
 } // namespace gmx
 
 #endif
index 00e3622ba82717d2811090dc789c7e9703308524..41ef1488dbf40c4b692b401fd18bab23f0e0b306 100644 (file)
 
 #include <string>
 
-#include "../options/optionstoragetemplate.h"
-#include "selection.h"
-#include "selectionenums.h"
-#include "selectionoption.h"
+#include "gromacs/options/optionstoragetemplate.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectionenums.h"
+#include "gromacs/selection/selectionoption.h"
 
 namespace gmx
 {
@@ -69,16 +69,15 @@ class SelectionOptionStorage : public OptionStorageTemplate<Selection>
          * Initializes the storage from option settings.
          *
          * \param[in] settings   Storage settings.
+         * \param     manager    Manager for this object.
          */
-        SelectionOptionStorage(const SelectionOption &settings);
+        SelectionOptionStorage(const SelectionOption  &settings,
+                               SelectionOptionManager *manager);
 
         virtual OptionInfo &optionInfo() { return info_; }
         virtual std::string typeString() const { return "selection"; }
         virtual std::string formatSingleValue(const Selection &value) const;
 
-        //! \copydoc SelectionOptionInfo::setManager()
-        void setManager(SelectionOptionManager *manager);
-
         /*! \brief
          * Adds selections to the storage.
          *
@@ -127,7 +126,7 @@ class SelectionOptionStorage : public OptionStorageTemplate<Selection>
         virtual void processAll();
 
         SelectionOptionInfo     info_;
-        SelectionOptionManager *manager_;
+        SelectionOptionManager &manager_;
         std::string             defaultText_;
         SelectionFlags          selectionFlags_;
 };
index c667739d5ec409017bb6299600c1a374351e0185..8cca62b067b9f7143ff6a216e04f7ccda8a4e80b 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "selelem.h"
+
 #include <cstring>
 
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
@@ -52,7 +54,7 @@
 
 #include "keywords.h"
 #include "mempool.h"
-#include "selelem.h"
+#include "poscalc.h"
 #include "selmethod.h"
 
 /*!
@@ -130,7 +132,9 @@ _gmx_selelem_boolean_type_str(const gmx::SelectionTreeElement &sel)
 namespace gmx
 {
 
-SelectionTreeElement::SelectionTreeElement(e_selelem_t type)
+SelectionTreeElement::SelectionTreeElement(e_selelem_t              type,
+                                           const SelectionLocation &location)
+    : location_(location)
 {
     this->type       = type;
     this->flags      = (type != SEL_ROOT) ? SEL_ALLOCVAL : 0;
@@ -193,21 +197,13 @@ void SelectionTreeElement::freeValues()
                 break;
         }
     }
-    if (v.nalloc > 0)
+    _gmx_selvalue_free(&v);
+    if (type == SEL_SUBEXPRREF && u.param != NULL)
     {
-        if (v.type == POS_VALUE)
-        {
-            delete [] v.u.p;
-        }
-        else
-        {
-            sfree(v.u.ptr);
-        }
-    }
-    _gmx_selvalue_setstore(&v, NULL);
-    if (type == SEL_SUBEXPRREF && u.param)
-    {
-        u.param->val.u.ptr = NULL;
+        // TODO: This is now called from two different locations.
+        // It is likely that one of them is unnecessary, but that requires
+        // extra analysis to clarify.
+        _gmx_selelem_free_param(u.param);
     }
 }
 
@@ -375,7 +371,8 @@ void SelectionTreeElement::checkUnsortedAtoms(
     }
 }
 
-void SelectionTreeElement::resolveIndexGroupReference(gmx_ana_indexgrps_t *grps)
+void SelectionTreeElement::resolveIndexGroupReference(
+        gmx_ana_indexgrps_t *grps, int natoms)
 {
     GMX_RELEASE_ASSERT(type == SEL_GROUPREF,
                        "Should only be called for index group reference elements");
@@ -420,6 +417,26 @@ void SelectionTreeElement::resolveIndexGroupReference(gmx_ana_indexgrps_t *grps)
     gmx_ana_index_set(&u.cgrp, foundGroup.isize, foundGroup.index,
                       foundGroup.nalloc_index);
     setName(foundName);
+
+    if (natoms > 0)
+    {
+        checkIndexGroup(natoms);
+    }
+}
+
+void SelectionTreeElement::checkIndexGroup(int natoms)
+{
+    GMX_RELEASE_ASSERT(type == SEL_CONST && v.type == GROUP_VALUE,
+                       "Should only be called for index group elements");
+    if (!gmx_ana_index_check_range(&u.cgrp, natoms))
+    {
+        std::string message = formatString(
+                    "Group '%s' cannot be used in selections, because it "
+                    "contains negative atom indices and/or references atoms "
+                    "not present (largest allowed atom index is %d).",
+                    name().c_str(), natoms);
+        GMX_THROW(InconsistentInputError(message));
+    }
 }
 
 } // namespace gmx
@@ -449,10 +466,22 @@ _gmx_selelem_set_vtype(const gmx::SelectionTreeElementPointer &sel,
     }
 }
 
-/*!
- * \param[in] method Method to free.
- * \param[in] mdata  Method data to free.
- */
+void
+_gmx_selelem_free_param(gmx_ana_selparam_t *param)
+{
+    if (param->val.u.ptr != NULL)
+    {
+        if (param->val.type == GROUP_VALUE)
+        {
+            for (int i = 0; i < param->val.nr; ++i)
+            {
+                gmx_ana_index_deinit(&param->val.u.g[i]);
+            }
+        }
+        _gmx_selvalue_free(&param->val);
+    }
+}
+
 void
 _gmx_selelem_free_method(gmx_ana_selmethod_t *method, void *mdata)
 {
@@ -470,37 +499,11 @@ _gmx_selelem_free_method(gmx_ana_selmethod_t *method, void *mdata)
      * access them. */
     if (method)
     {
-        int  i, j;
-
         /* Free the memory allocated for the parameters that are not managed
          * by the selection method itself. */
-        for (i = 0; i < method->nparams; ++i)
+        for (int i = 0; i < method->nparams; ++i)
         {
-            gmx_ana_selparam_t *param = &method->param[i];
-
-            if (param->val.u.ptr)
-            {
-                if (param->val.type == GROUP_VALUE)
-                {
-                    for (j = 0; j < param->val.nr; ++j)
-                    {
-                        gmx_ana_index_deinit(&param->val.u.g[j]);
-                    }
-                }
-                else if (param->val.type == POS_VALUE)
-                {
-                    if (param->val.nalloc > 0)
-                    {
-                        delete[] param->val.u.p;
-                        _gmx_selvalue_setstore(&param->val, NULL);
-                    }
-                }
-
-                if (param->val.nalloc > 0)
-                {
-                    sfree(param->val.u.ptr);
-                }
-            }
+            _gmx_selelem_free_param(&method->param[i]);
         }
         sfree(method->param);
         sfree(method);
@@ -609,7 +612,7 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
         fprintf(fp, " eval=");
         _gmx_sel_print_evalfunc_name(fp, sel.evaluate);
     }
-    if (!(sel.flags & SEL_ALLOCVAL))
+    if (sel.v.nalloc < 0)
     {
         fprintf(fp, " (ext)");
     }
@@ -651,6 +654,23 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
             fprintf(fp, "\n");
         }
     }
+    else if (sel.type == SEL_SUBEXPRREF && sel.u.param != NULL)
+    {
+        fprintf(fp, "%*c param", level*2+1, ' ');
+        if (sel.u.param->name != NULL)
+        {
+            fprintf(fp, " \"%s\"", sel.u.param->name);
+        }
+        if (sel.u.param->val.nalloc < 0)
+        {
+            fprintf(fp, " (ext)");
+        }
+        else
+        {
+            fprintf(fp, " nalloc: %d", sel.u.param->val.nalloc);
+        }
+        fprintf(fp, "\n");
+    }
 
     if (sel.cdata)
     {
index bcb67c768ac030533c09e6aa1c6dac53e92d52ee..c8ba2c0db9dad3d5e2151124fa0702a3715c7d10 100644 (file)
 
 #include <boost/shared_ptr.hpp>
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/real.h"
 
-#include "indexutil.h"
 #include "selvalue.h"
 
 struct gmx_ana_poscalc_t;
@@ -239,12 +239,40 @@ namespace gmx
 
 class ExceptionInitializer;
 
+//! \cond internal
 /*! \brief
  * Function pointer for evaluating a gmx::SelectionTreeElement.
  */
 typedef void (*sel_evalfunc)(struct gmx_sel_evaluate_t         *data,
                              const SelectionTreeElementPointer &sel,
                              gmx_ana_index_t                   *g);
+//! \endcond
+
+/*! \internal
+ * \brief
+ * Stores the location of a selection element in the selection text.
+ *
+ * The location is stored as a range in the pretty-printed selection text
+ * (where whitespace has been sanitized), and can be used to extract that text
+ * for error messages and other diagnostic purposes.
+ * During parsing, the extraction is done with _gmx_sel_lexer_get_text().
+ *
+ * This needs to be a plain C struct for Bison to properly deal with it.
+ */
+struct SelectionLocation
+{
+    //! Returns an empty location.
+    static SelectionLocation createEmpty()
+    {
+        SelectionLocation empty = {0, 0};
+        return empty;
+    }
+
+    //! Start index of the string where this element has been parsed from.
+    int  startIndex;
+    //! End index of the string where this element has been parsed from.
+    int  endIndex;
+};
 
 /*! \internal \brief
  * Represents an element of a selection expression.
@@ -255,7 +283,8 @@ class SelectionTreeElement
         /*! \brief
          * Allocates memory and performs common initialization.
          *
-         * \param[in] type Type of selection element to create.
+         * \param[in] type     Type of selection element to create.
+         * \param[in] location Location of the element.
          *
          * \a type is set to \p type,
          * \a v::type is set to \ref GROUP_VALUE for boolean and comparison
@@ -264,7 +293,7 @@ class SelectionTreeElement
          * is also set for \ref SEL_BOOLEAN elements).
          * All the pointers are set to NULL.
          */
-        explicit SelectionTreeElement(e_selelem_t type);
+        SelectionTreeElement(e_selelem_t type, const SelectionLocation &location);
         ~SelectionTreeElement();
 
         //! Frees the memory allocated for the \a v union.
@@ -303,6 +332,9 @@ class SelectionTreeElement
 
         //! Returns the name of the element.
         const std::string &name() const { return name_; }
+        //! Returns the location of the element.
+        const SelectionLocation &location() const { return location_; }
+
         /*! \brief
          * Sets the name of the element.
          *
@@ -339,14 +371,24 @@ class SelectionTreeElement
         void checkUnsortedAtoms(bool                  bUnsortedAllowed,
                                 ExceptionInitializer *errors) const;
         /*! \brief
-         * Resolved an unresolved reference to an index group.
+         * Resolves an unresolved reference to an index group.
          *
-         * \param[in] grps  Index groups to use to resolve the reference.
+         * \param[in] grps   Index groups to use to resolve the reference.
+         * \param[in] natoms Maximum number of atoms the selections can evaluate to
+         *     (zero if the topology/atom count is not set yet).
          * \throws    std::bad_alloc if out of memory.
          * \throws    InconsistentInputError if the reference cannot be
          *     resolved.
          */
-        void resolveIndexGroupReference(gmx_ana_indexgrps_t *grps);
+        void resolveIndexGroupReference(gmx_ana_indexgrps_t *grps, int natoms);
+        /*! \brief
+         * Checks that an index group has valid atom indices.
+         *
+         * \param[in] natoms Maximum number of atoms the selections can evaluate to.
+         * \throws    std::bad_alloc if out of memory.
+         * \throws    InconsistentInputError if there are invalid atom indices.
+         */
+        void checkIndexGroup(int natoms);
 
         //! Type of the element.
         e_selelem_t                         type;
@@ -431,9 +473,16 @@ class SelectionTreeElement
         /*! \brief
          * Name of the element.
          *
-         * This field is only used for informative purposes.
+         * This field is only used for diagnostic purposes.
          */
         std::string                         name_;
+        /*! \brief
+         * Location of the element in the selection text.
+         *
+         * This field is only used for diagnostic purposes (including error
+         * messages).
+         */
+        SelectionLocation                   location_;
 
         GMX_DISALLOW_COPY_AND_ASSIGN(SelectionTreeElement);
 };
@@ -455,7 +504,19 @@ void
 _gmx_selelem_set_vtype(const gmx::SelectionTreeElementPointer &sel,
                        e_selvalue_t                            vtype);
 
-/** Frees the memory allocated for a selection method. */
+/*! \brief
+ * Frees the memory allocated for a selection method parameter.
+ *
+ * \param[in] param Parameter to free.
+ */
+void
+_gmx_selelem_free_param(struct gmx_ana_selparam_t *param);
+/*! \brief
+ * Frees the memory allocated for a selection method.
+ *
+ * \param[in] method Method to free.
+ * \param[in] mdata  Method data to free.
+ */
 void
 _gmx_selelem_free_method(struct gmx_ana_selmethod_t *method, void *mdata);
 
index e3dd3eeb771d28bd5ea79d5f49a96d54d0733e31..ae95feb913d150054787f4b775f13fde250f3186 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "selhelp.h"
+
 #include <string>
-#include <vector>
 #include <utility>
+#include <vector>
 
 #include <boost/scoped_ptr.hpp>
 
@@ -51,7 +55,6 @@
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "selhelp.h"
 #include "selmethod.h"
 #include "symrec.h"
 
@@ -71,7 +74,12 @@ const char        CommonHelpText::title[] =
 const char *const CommonHelpText::text[] = {
     "Selections are used to select atoms/molecules/residues for analysis.",
     "In contrast to traditional index files, selections can be dynamic, i.e.,",
-    "select different atoms for different trajectory frames.[PAR]",
+    "select different atoms for different trajectory frames. The GROMACS",
+    "manual contains a short introductory section to selections in the",
+    "Analysis chapter, including suggestions on how to get familiar with",
+    "selections if you are new to the concept. The subtopics listed below",
+    "provide more details on the technical and syntactic aspects of",
+    "selections.[PAR]",
 
     "Each analysis tool requires a different number of selections and the",
     "selections are interpreted differently. The general idea is still the",
@@ -79,16 +87,7 @@ const char *const CommonHelpText::text[] = {
     "can be an atom position or center-of-mass or center-of-geometry of",
     "a set of atoms. The tool then uses these positions for its analysis to",
     "allow very flexible processing. Some analysis tools may have limitations",
-    "on the types of selections allowed.[PAR]",
-
-    "To get started with selections, run, e.g., [TT][PROGRAM] select[tt]",
-    "without specifying selections on the command-line and use the interactive",
-    "prompt to try out different selections.",
-    "This tool provides output options that allow one to see what is actually",
-    "selected by the given selections, and the interactive prompt reports",
-    "syntax errors immediately, allowing one to try again.",
-    "The subtopics listed below give more details on different aspects of",
-    "selections.",
+    "on the types of selections allowed."
 };
 
 struct ArithmeticHelpText
@@ -395,7 +394,10 @@ const char *const SyntaxHelpText::text[] = {
     "evaluation order.[BR]",
     "3. [TT]ATOM_EXPR[tt] expressions can be converted into [TT]POS_EXPR[tt]",
     "expressions in various ways, see the \"positions\" subtopic for more",
-    "details.[PAR]",
+    "details.[BR]",
+    "4. [TT]POS_EXPR[tt] can be converted into [TT]NUM_EXPR[tt] using syntax",
+    "like \"x of POS_EXPR\". Currently, this is only supported for single",
+    "positions like in expression \"x of cog of ATOM_EXPR\".[PAR]",
 
     "Some keywords select atoms based on string values such as the atom name.",
     "For these keywords, it is possible to use wildcards ([TT]name \"C*\"[tt])",
@@ -615,7 +617,7 @@ void KeywordsHelpTopic::printKeywordList(const HelpWriterContext &context,
 
 }   // namespace
 
-/*! \cond internal */
+//! \cond libapi */
 HelpTopicPointer createSelectionHelpTopic()
 {
     CompositeHelpTopicPointer root(new CompositeHelpTopic<CommonHelpText>);
index 42598d7a3b7f54dcc4c8242f916e29cad5ce7a97..b29251d31aaf2f2cd1438117570388b8110dfc22 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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
  * Functions for initializing online help for selections.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
  * \ingroup module_selection
  */
 #ifndef GMX_SELECTION_SELHELP_H
 #define GMX_SELECTION_SELHELP_H
 
-#include "../onlinehelp/helptopicinterface.h"
+#include "gromacs/onlinehelp/helptopicinterface.h"
 
 namespace gmx
 {
 
-/*! \cond internal */
-/*! \internal \brief
+//! \cond libapi
+/*! \libinternal \brief
  * Creates a help tree for selections.
  *
  * \throws   std::bad_alloc if out of memory.
index fc74d4a556813d96f7c6170089872343cd04c700..6524f2fec92f83ed86e2b1fb37d06e5cd7a79f86 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "selmethod.h"
+
 #include <ctype.h>
 #include <stdarg.h>
 
 #include "gromacs/legacyheaders/macros.h"
-
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
 
index c803945ab881b31bcbb42bf6d212e42d5b1aabc0..8df079d3f142572a99b1afaf514bb7c6c39cfda4 100644 (file)
 #ifndef GMX_SELECTION_SELMETHOD_H
 #define GMX_SELECTION_SELMETHOD_H
 
-#include "../legacyheaders/typedefs.h"
-
-#include "indexutil.h"
 #include "selparam.h"
 #include "selvalue.h"
 
@@ -308,8 +305,12 @@ class PositionCalculationCollection;
 class SelectionParserSymbolTable;
 } // namespace gmx
 
+struct gmx_ana_index_t;
 struct gmx_ana_pos_t;
 struct gmx_ana_selcollection_t;
+struct t_pbc;
+struct t_topology;
+struct t_trxframe;
 
 /*! \name Selection method flags
  * \anchor selmethod_flags
@@ -555,6 +556,11 @@ typedef void  (*sel_framefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * For \ref STR_VALUE methods, the pointers stored in \p out->s are discarded
  * without freeing; it is the responsibility of this function to provide
  * pointers that can be discarded without memory leaks.
+ *
+ * If the method accesses \p fr outside the index group specified in \p g or
+ * what it receives from its parameters, it must check that \p fr actually
+ * 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,
                                 gmx_ana_index_t *g, gmx_ana_selvalue_t *out,
@@ -572,21 +578,26 @@ typedef void  (*sel_updatefunc)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * \param      data Internal data structure from sel_datafunc().
  * \returns    0 on success, a non-zero error code on error.
  *
- * This function should evaluate the method for each position in \p g,
+ * This function should evaluate the method for each position in \p pos,
  * and write the output values to \p out. The pointer in the union \p out->u
  * that corresponds to the type of the method should be used.
  * Enough memory has been allocated to store the output values.
  * The number of values in \p out should also be updated if necessary.
- * However, \ref POS_VALUE or \ref GROUP_VALUE methods should not touch
- * \p out->nr (it should be 1 anyways).
+ * \ref POS_VALUE or \ref GROUP_VALUE methods should not touch
+ * \p out->nr (it should be 1 anyways).  For other types of methods, the number
+ * of output values should equal the number of positions in \p pos.
  *
  * For \ref STR_VALUE methods, the pointers stored in \p out->s are discarded
  * without freeing; it is the responsibility of this function to provide
  * pointers that can be discarded without memory leaks.
+ *
+ * If the method accesses \p fr outside the atoms referenced in \p pos or
+ * what it receives from its parameters, it must check that \p fr actually
+ * 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,
-                                    struct gmx_ana_pos_t *pos,
-                                    gmx_ana_selvalue_t *out,
+                                    gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out,
                                     void *data);
 
 /*! \internal
@@ -596,7 +607,7 @@ typedef void  (*sel_updatefunc_pos)(t_topology *top, t_trxframe *fr, t_pbc *pbc,
  * If some information is not available, the corresponding field can be set to
  * 0/NULL.
  */
-typedef struct gmx_ana_selmethod_help_t
+struct gmx_ana_selmethod_help_t
 {
     /*! \brief
      * One-line description of the syntax of the method.
@@ -617,7 +628,7 @@ typedef struct gmx_ana_selmethod_help_t
      * to NULL.
      */
     const char        **help;
-} gmx_ana_selmethod_help_t;
+};
 
 /*! \internal
  * \brief
@@ -632,7 +643,7 @@ typedef struct gmx_ana_selmethod_help_t
  * More details on implementing new selection methods can be found on a
  * separate page: \ref page_module_selection_custom.
  */
-typedef struct gmx_ana_selmethod_t
+struct gmx_ana_selmethod_t
 {
     /** Name of the method. */
     const char         *name;
@@ -669,7 +680,7 @@ typedef struct gmx_ana_selmethod_t
 
     /** Help data for the method. */
     gmx_ana_selmethod_help_t help;
-} gmx_ana_selmethod_t;
+};
 
 /** Registers a selection method. */
 int
index 9f471ccf5ea4c3ec9e018df9dca833b006a42dd2..bedfaadff149383a59ebaa2244d09845a953d1ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,7 +48,8 @@
 #ifndef GMX_SELECTION_SELPARAM_H
 #define GMX_SELECTION_SELPARAM_H
 
-#include "indexutil.h"
+#include "gromacs/selection/indexutil.h"
+
 #include "selvalue.h"
 
 /*! \name Parameter flags
index 18a51f0a2601bc87256a454ab87ffc6642aa5df5..80e1cfea57b57615367f5e93d218ee69c2ed5594 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "selvalue.h"
+
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selvalue.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
-/*!
- * \param[out] val  Output structure
- *
- * The type of \p val is not touched.
- * Any contents of \p val are discarded without freeing.
- */
 void
 _gmx_selvalue_clear(gmx_ana_selvalue_t *val)
 {
@@ -59,28 +56,33 @@ _gmx_selvalue_clear(gmx_ana_selvalue_t *val)
     val->nalloc = 0;
 }
 
-/*!
- * \param[in,out] val  Value structure to allocate.
- * \param[in]     n    Maximum number of values needed.
- * \returns       Zero on success.
- *
- * Reserves memory for the values within \p val to store at least \p n values,
- * of the type specified in the \p val structure.
- *
- * If the type is \ref POS_VALUE or \ref GROUP_VALUE, memory is reserved for
- * the data structures, but no memory is reserved inside these newly allocated
- * data structures.
- * Similarly, for \ref STR_VALUE values, the pointers are set to NULL.
- * For other values, the memory is uninitialized.
- */
-int
+void
+_gmx_selvalue_free(gmx_ana_selvalue_t *val)
+{
+    if (val->nalloc > 0)
+    {
+        if (val->type == POS_VALUE)
+        {
+            delete[] val->u.p;
+        }
+        else
+        {
+            sfree(val->u.ptr);
+        }
+    }
+    // TODO: It causes a memory leak somewhere if val->nr is assigned zero here...
+    val->u.ptr  = NULL;
+    val->nalloc = 0;
+}
+
+void
 _gmx_selvalue_reserve(gmx_ana_selvalue_t *val, int n)
 {
     int  i;
 
     if (val->nalloc == -1)
     {
-        return 0;
+        return;
     }
 
     if (!val->u.ptr || val->nalloc < n)
@@ -112,34 +114,31 @@ _gmx_selvalue_reserve(gmx_ana_selvalue_t *val, int n)
         }
         val->nalloc = n;
     }
-    return 0;
 }
 
-/*!
- * \param[in,out] val    Value structure to allocate.
- * \param[in]     ptr    Pointer where the values should be stored.
- * \returns       Zero on success.
- *
- * Automatic memory management is disabled for \p ptr, unless \p ptr is NULL.
- */
-int
+void
+_gmx_selvalue_getstore_and_release(gmx_ana_selvalue_t *val, void **ptr, int *nalloc)
+{
+    *ptr        = val->u.ptr;
+    *nalloc     = val->nalloc;
+    val->u.ptr  = NULL;
+    val->nalloc = 0;
+}
+
+void
 _gmx_selvalue_setstore(gmx_ana_selvalue_t *val, void *ptr)
 {
+    GMX_ASSERT(val->nalloc <= 0,
+               "Memory leak from discarding an existing value");
     val->u.ptr  = ptr;
     val->nalloc = (ptr ? -1 : 0);
-    return 0;
 }
 
-/*!
- * \param[in,out] val    Value structure to allocate.
- * \param[in]     ptr    Pointer where the values should be stored.
- * \param[in]     nalloc Number of values allocated for \p ptr.
- * \returns       Zero on success.
- */
-int
+void
 _gmx_selvalue_setstore_alloc(gmx_ana_selvalue_t *val, void *ptr, int nalloc)
 {
+    GMX_ASSERT(val->nalloc <= 0 || (ptr == val->u.ptr && nalloc == val->nalloc),
+               "Memory leak from discarding an existing value");
     val->u.ptr  = ptr;
     val->nalloc = nalloc;
-    return 0;
 }
index aad846f9c50f3d1a7a579a8286aa09c9c9380fc1..d4a1e13318cc6a59d39572877e20239b4c94b74a 100644 (file)
@@ -45,7 +45,7 @@
 #ifndef GMX_SELECTION_SELVALUE_H
 #define GMX_SELECTION_SELVALUE_H
 
-#include "../legacyheaders/types/simple.h"
+#include "gromacs/utility/real.h"
 
 /** Defines the value type of a different selection objects. */
 typedef enum
@@ -105,17 +105,79 @@ typedef struct gmx_ana_selvalue_t
     int                         nalloc;
 } gmx_ana_selvalue_t;
 
-/** Initializes an empty selection value structure. */
+/*! \brief
+ * Initializes an empty selection value structure.
+ *
+ * \param[out] val  Output structure
+ *
+ * The type of \p val is not touched.
+ * Any contents of \p val are discarded without freeing.
+ */
 void
 _gmx_selvalue_clear(gmx_ana_selvalue_t *val);
-/** Reserve memory for storing selection values. */
-int
+/*! \brief
+ * Frees memory allocated for a selection value structure.
+ *
+ * \param[in,out] val  Values to free.
+ *
+ * The type of \p val is not touched.
+ * If memory is not allocated, the value pointers are simply cleared without
+ * freeing.
+ */
+void
+_gmx_selvalue_free(gmx_ana_selvalue_t *val);
+/*! \brief
+ * Reserve memory for storing selection values.
+ *
+ * \param[in,out] val  Value structure to allocate.
+ * \param[in]     n    Maximum number of values needed.
+ *
+ * Reserves memory for the values within \p val to store at least \p n values,
+ * of the type specified in the \p val structure.
+ *
+ * If the type is \ref POS_VALUE or \ref GROUP_VALUE, memory is reserved for
+ * the data structures, but no memory is reserved inside these newly allocated
+ * data structures.
+ * Similarly, for \ref STR_VALUE values, the pointers are set to NULL.
+ * For other values, the memory is uninitialized.
+ */
+void
 _gmx_selvalue_reserve(gmx_ana_selvalue_t *val, int n);
-/** Sets the memory for storing selection values. */
-int
+/*! \brief
+ * Gets and releases the memory pointer for storing selection values.
+ *
+ * \param[in,out] val    Value structure to release.
+ * \param[out]    ptr    Pointer where the values are stored.
+ * \param[out]    nalloc Pointer where the values are stored.
+ *
+ * Returns the pointer where values of \p val were stored in \p ptr and
+ * \p nalloc, and clears the memory in \p val.
+ */
+void
+_gmx_selvalue_getstore_and_release(gmx_ana_selvalue_t *val, void **ptr, int *nalloc);
+/*! \brief
+ * Sets the memory for storing selection values.
+ *
+ * \param[in,out] val    Value structure to set storage for.
+ * \param[in]     ptr    Pointer where the values should be stored.
+ *
+ * Automatic memory management is disabled for \p ptr.
+ * Asserts if \p val had a previous storage that it owned, as that would result
+ * in a memory leak.
+ */
+void
 _gmx_selvalue_setstore(gmx_ana_selvalue_t *val, void *ptr);
-/** Sets the memory for storing selection values and marks it for automatic freeing. */
-int
+/*! \brief
+ * Sets the memory for storing selection values and marks it for automatic freeing.
+ *
+ * \param[in,out] val    Value structure to set storage for.
+ * \param[in]     ptr    Pointer where the values should be stored.
+ * \param[in]     nalloc Number of values allocated for \p ptr.
+ *
+ * Asserts if \p val had a previous storage that it owned, as that would result
+ * in a memory leak.
+ */
+void
 _gmx_selvalue_setstore_alloc(gmx_ana_selvalue_t *val, void *ptr, int nalloc);
 
 #endif
index 605bf1cf2df658761e09b9b70fe608319a885dc6..be899fd7e7f37ed4514c8dad1d5ac11d649b4b24 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include <cmath>
 
 #include "gromacs/legacyheaders/macros.h"
-
 #include "gromacs/math/utilities.h"
-#include "gromacs/selection/selmethod.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "selmethod.h"
+
 /** Defines the comparison operator for comparison expressions. */
 typedef enum
 {
index e7a6c689c56ba852c5f7b0d6048aee13b1c1d0c6..449dd9bcd12e9bcda548cbfd409962da3b819381 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/nbsearch.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 
+#include "selmethod.h"
+
 /*! \internal
  * \brief
  * Data structure for distance-based selection method.
@@ -230,7 +231,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)
 {
-    t_methoddata_distance *d = (t_methoddata_distance *)data;
+    t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
 
     if ((param[0].flags & SPAR_SET) && d->cutoff <= 0)
     {
@@ -254,7 +255,7 @@ free_data_common(void *data)
 static void
 init_frame_common(t_topology * /* top */, t_trxframe * /* fr */, t_pbc *pbc, void *data)
 {
-    t_methoddata_distance *d = (t_methoddata_distance *)data;
+    t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
 
     d->nbsearch.reset();
     gmx::AnalysisNeighborhoodPositions pos(d->p.x, d->p.count());
@@ -272,16 +273,12 @@ static void
 evaluate_distance(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
                   gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data)
 {
-    t_methoddata_distance *d = (t_methoddata_distance *)data;
+    t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
 
-    out->nr = pos->m.mapb.nra;
-    for (int b = 0; b < pos->count(); ++b)
+    out->nr = pos->count();
+    for (int i = 0; i < pos->count(); ++i)
     {
-        real dist = d->nbsearch.minimumDistance(pos->x[b]);
-        for (int i = pos->m.mapb.index[b]; i < pos->m.mapb.index[b+1]; ++i)
-        {
-            out->u.r[i] = dist;
-        }
+        out->u.r[i] = d->nbsearch.minimumDistance(pos->x[i]);
     }
 }
 
@@ -296,7 +293,7 @@ static void
 evaluate_within(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
                 gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void *data)
 {
-    t_methoddata_distance *d = (t_methoddata_distance *)data;
+    t_methoddata_distance *d = static_cast<t_methoddata_distance *>(data);
 
     out->u.g->isize = 0;
     for (int b = 0; b < pos->count(); ++b)
index f9b8e736f739ee9a516a8074eec8043237229cfe..9c163e097f2db673c3f30e10791c1e66af9a0ae1 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include <algorithm>
+#include "gmxpre.h"
 
 #include <math.h>
 
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/physics.h"
-#include "gromacs/legacyheaders/vec.h"
+#include <algorithm>
 
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/selection/position.h"
 #include "gromacs/selection/selection.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "selelem.h"
+#include "selmethod.h"
 
 using std::min;
 using std::max;
index ecf721beac1f5356e079117ac5e84e9cbcf7e80b..ef063d7463681891e9892dbfc61a107c60b9e68e 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,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.
@@ -40,6 +40,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include <cctype>
 #include <cstring>
 
 #include <boost/shared_ptr.hpp>
 
 #include "gromacs/legacyheaders/macros.h"
-
-#include "gromacs/selection/selmethod.h"
+#include "gromacs/selection/position.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxregex.h"
-#include "gromacs/utility/messagestringcollector.h"
-#include "gromacs/utility/stringutil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 #include "keywords.h"
 #include "parsetree.h"
 #include "scanner.h"
 #include "selelem.h"
+#include "selmethod.h"
 
 /*! \brief
  * Allocates data for integer keyword evaluation.
@@ -216,9 +218,10 @@ class StringKeywordMatchItem
             {
                 if (!gmx::Regex::isSupported())
                 {
-                    GMX_THROW(gmx::InvalidInputError(gmx::formatString(
-                                                             "No regular expression support, "
-                                                             "cannot match \"%s\"", str)));
+                    std::string message
+                        = gmx::formatString("No regular expression support, "
+                                            "cannot match \"%s\"", str);
+                    GMX_THROW(gmx::InvalidInputError(message));
                 }
                 regex_.reset(new gmx::Regex(str));
             }
@@ -362,27 +365,67 @@ 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);
-/** Evaluates keywords in an arbitrary group. */
+/*! \brief
+ * Evaluates keywords in an arbitrary group.
+ *
+ * See sel_updatefunc() for description of the parameters.
+ * \p data should point to a \c t_methoddata_kweval.
+ *
+ * Calls the evaluation function of the wrapped keyword with the given
+ * parameters, with the exception of using \c t_methoddata_kweval::g for the
+ * evaluation group.
+ */
 static void
-evaluate_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data);
+evaluate_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t *g,
+                gmx_ana_selvalue_t *out, void *data);
+/*! \brief
+ * Evaluates keywords in an arbitrary set of positions.
+ *
+ * See sel_updatefunc() for description of the parameters.
+ * \p data should point to a \c t_methoddata_kweval.
+ *
+ * Calls the evaluation function of the wrapped keyword with the given
+ * parameters, with the exception of using \c t_methoddata_kweval::p for the
+ * evaluation positions.
+ */
+static void
+evaluate_kweval_pos(t_topology *top, t_trxframe *fr, t_pbc *pbc, gmx_ana_index_t *g,
+                    gmx_ana_selvalue_t *out, void *data);
 
 /*! \internal \brief
  * Data structure for keyword evaluation in arbitrary groups.
  */
-typedef struct
+struct t_methoddata_kweval
 {
-    /** Wrapped keyword method for evaluating the values. */
+    //! Initialize new keyword evaluator for the given keyword.
+    t_methoddata_kweval(gmx_ana_selmethod_t *method, void *data)
+        : kwmethod(method), kwmdata(data)
+    {
+        gmx_ana_index_clear(&g);
+    }
+    ~t_methoddata_kweval()
+    {
+        _gmx_selelem_free_method(kwmethod, kwmdata);
+    }
+
+    //! Wrapped keyword method for evaluating the values.
     gmx_ana_selmethod_t  *kwmethod;
-    /** Method data for \p kwmethod. */
+    //! Method data for \p kwmethod.
     void                 *kwmdata;
-    /** Group in which \p kwmethod should be evaluated. */
+    //! Group in which \p kwmethod should be evaluated.
     gmx_ana_index_t       g;
-} t_methoddata_kweval;
+    //! Positions for which \p kwmethod should be evaluated.
+    gmx_ana_pos_t         p;
+};
 
 /** Parameters for keyword evaluation in an arbitrary group. */
-static gmx_ana_selparam_t smparams_kweval[] = {
+static gmx_ana_selparam_t smparams_kweval_group[] = {
     {NULL,   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
 };
+/** Parameters for keyword evaluation from positions. */
+static gmx_ana_selparam_t smparams_kweval_pos[] = {
+    {NULL,   {POS_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+};
 
 
 /********************************************************************
@@ -634,7 +677,7 @@ 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)
 {
-    t_methoddata_kweval *d = (t_methoddata_kweval *)data;
+    t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
     d->kwmethod->init(top, 0, NULL, d->kwmdata);
 }
@@ -642,7 +685,7 @@ init_kweval(t_topology *top, int /* npar */, gmx_ana_selparam_t * /* param */, v
 static void
 init_output_kweval(t_topology * /* top */, gmx_ana_selvalue_t *out, void *data)
 {
-    t_methoddata_kweval *d = (t_methoddata_kweval *)data;
+    t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
     out->nr = d->g.isize;
     _gmx_selvalue_reserve(out, out->nr);
@@ -656,10 +699,9 @@ init_output_kweval(t_topology * /* top */, gmx_ana_selvalue_t *out, void *data)
 static void
 free_data_kweval(void *data)
 {
-    t_methoddata_kweval *d = (t_methoddata_kweval *)data;
+    t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
-    _gmx_selelem_free_method(d->kwmethod, d->kwmdata);
-    sfree(d);
+    delete d;
 }
 
 /*!
@@ -675,69 +717,67 @@ free_data_kweval(void *data)
 static void
 init_frame_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc, void *data)
 {
-    t_methoddata_kweval *d = (t_methoddata_kweval *)data;
+    t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
     d->kwmethod->init_frame(top, fr, pbc, d->kwmdata);
 }
 
-/*!
- * See sel_updatefunc() for description of the parameters.
- * \p data should point to a \c t_methoddata_kweval.
- *
- * Calls the evaluation function of the wrapped keyword with the given
- * parameters, with the exception of using \c t_methoddata_kweval::g for the
- * evaluation group.
- */
 static void
 evaluate_kweval(t_topology *top, t_trxframe *fr, t_pbc *pbc,
                 gmx_ana_index_t * /* g */, gmx_ana_selvalue_t *out, void *data)
 {
-    t_methoddata_kweval *d = (t_methoddata_kweval *)data;
+    t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
     d->kwmethod->update(top, fr, pbc, &d->g, out, d->kwmdata);
 }
 
-/*!
+static void
+evaluate_kweval_pos(t_topology *top, t_trxframe *fr, t_pbc *pbc,
+                    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);
+}
+
+/*! \brief
+ * Initializes a selection element for evaluating a keyword in a given group.
+ *
  * \param[in]   method  Keyword selection method to evaluate.
- * \param[in]   params  Parameter that gives the group to evaluate \p method in.
+ * \param[in]   params  Parameters to pass to initialization (the child group).
  * \param[in]   scanner Scanner data structure.
- * \returns     Pointer to the created selection element (NULL on error).
- *
- * Creates a \ref SEL_EXPRESSION selection element that evaluates the keyword
- * method given by \p method in the group given by \p param.
+ * \returns     Pointer to the created selection element.
  *
- * The name of \p param should be empty.
+ * Implements _gmx_sel_init_keyword_evaluator() for \ref GROUP_VALUE input
+ * selections.
  */
-gmx::SelectionTreeElementPointer
-_gmx_sel_init_keyword_evaluator(gmx_ana_selmethod_t                     *method,
-                                const gmx::SelectionParserParameterList &params,
-                                void                                    *scanner)
+static gmx::SelectionTreeElementPointer
+init_evaluator_group(gmx_ana_selmethod_t                     *method,
+                     const gmx::SelectionParserParameterList &params,
+                     void                                    *scanner)
 {
-    gmx::MessageStringCollector *errors = _gmx_sel_lexer_error_reporter(scanner);
-    char  buf[1024];
-    sprintf(buf, "In evaluation of '%s'", method->name);
-    gmx::MessageStringContext   context(errors, buf);
-
     if ((method->flags & (SMETH_SINGLEVAL | SMETH_VARNUMVAL))
         || method->outinit || method->pupdate)
     {
-        GMX_THROW(gmx::InternalError(
-                          "Unsupported keyword method for arbitrary group evaluation"));
+        std::string message
+            = gmx::formatString("Keyword '%s' cannot be evaluated in this context",
+                                method->name);
+        GMX_THROW(gmx::InvalidInputError(message));
     }
 
+    // TODO: For same ... as ..., some other location could be more intuitive.
     gmx::SelectionTreeElementPointer sel(
-            new gmx::SelectionTreeElement(SEL_EXPRESSION));
+            new gmx::SelectionTreeElement(
+                    SEL_EXPRESSION, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_method(sel, method, scanner);
 
-    t_methoddata_kweval  *data;
-    snew(data, 1);
-    data->kwmethod = sel->u.expr.method;
-    data->kwmdata  = sel->u.expr.mdata;
-    gmx_ana_index_clear(&data->g);
+    t_methoddata_kweval *data
+        = new t_methoddata_kweval(sel->u.expr.method, sel->u.expr.mdata);
 
     snew(sel->u.expr.method, 1);
-    memcpy(sel->u.expr.method, data->kwmethod, sizeof(gmx_ana_selmethod_t));
-    sel->u.expr.method->flags       |= SMETH_VARNUMVAL;
+    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;
@@ -746,17 +786,97 @@ _gmx_sel_init_keyword_evaluator(gmx_ana_selmethod_t                     *method,
     sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : NULL;
     sel->u.expr.method->update       = &evaluate_kweval;
     sel->u.expr.method->pupdate      = NULL;
-    sel->u.expr.method->nparams      = asize(smparams_kweval);
-    sel->u.expr.method->param        = smparams_kweval;
+    sel->u.expr.method->nparams      = asize(smparams_kweval_group);
+    sel->u.expr.method->param        = smparams_kweval_group;
     _gmx_selelem_init_method_params(sel, scanner);
     sel->u.expr.mdata = data;
 
     sel->u.expr.method->param[0].val.u.g = &data->g;
 
-    if (!_gmx_sel_parse_params(params, sel->u.expr.method->nparams,
-                               sel->u.expr.method->param, sel, scanner))
+    _gmx_sel_parse_params(params, sel->u.expr.method->nparams,
+                          sel->u.expr.method->param, sel, scanner);
+    return sel;
+}
+
+/*! \brief
+ * Initializes a selection element for evaluating a keyword in given positions.
+ *
+ * \param[in]   method  Keyword selection method to evaluate.
+ * \param[in]   params  Parameters to pass to initialization (the child positions).
+ * \param[in]   scanner Scanner data structure.
+ * \returns     Pointer to the created selection element.
+ *
+ * Implements _gmx_sel_init_keyword_evaluator() for \ref POS_VALUE input
+ * selections.
+ */
+static gmx::SelectionTreeElementPointer
+init_evaluator_pos(gmx_ana_selmethod_t                     *method,
+                   const gmx::SelectionParserParameterList &params,
+                   void                                    *scanner)
+{
+    if ((method->flags & (SMETH_SINGLEVAL | SMETH_VARNUMVAL))
+        || method->outinit || method->pupdate == NULL)
     {
-        return gmx::SelectionTreeElementPointer();
+        std::string message
+            = gmx::formatString("Keyword '%s' cannot be evaluated in this context",
+                                method->name);
+        GMX_THROW(gmx::InvalidInputError(message));
     }
+
+    gmx::SelectionTreeElementPointer sel(
+            new gmx::SelectionTreeElement(
+                    SEL_EXPRESSION, _gmx_sel_lexer_get_current_location(scanner)));
+    _gmx_selelem_set_method(sel, method, scanner);
+
+    t_methoddata_kweval *data
+        = new t_methoddata_kweval(sel->u.expr.method, sel->u.expr.mdata);
+
+    snew(sel->u.expr.method, 1);
+    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->free         = &free_data_kweval;
+    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : NULL;
+    sel->u.expr.method->update       = &evaluate_kweval_pos;
+    sel->u.expr.method->pupdate      = NULL;
+    sel->u.expr.method->nparams      = asize(smparams_kweval_pos);
+    sel->u.expr.method->param        = smparams_kweval_pos;
+    _gmx_selelem_init_method_params(sel, scanner);
+    sel->u.expr.mdata = data;
+
+    sel->u.expr.method->param[0].val.u.p = &data->p;
+
+    _gmx_sel_parse_params(params, sel->u.expr.method->nparams,
+                          sel->u.expr.method->param, sel, scanner);
     return sel;
 }
+
+gmx::SelectionTreeElementPointer
+_gmx_sel_init_keyword_evaluator(gmx_ana_selmethod_t                    *method,
+                                const gmx::SelectionTreeElementPointer &child,
+                                void                                   *scanner)
+{
+    gmx::SelectionParserParameterList    params;
+    params.push_back(
+            gmx::SelectionParserParameter::createFromExpression(NULL, child));
+    if (child->v.type == GROUP_VALUE)
+    {
+        return init_evaluator_group(method, params, scanner);
+    }
+    else if (child->v.type == POS_VALUE)
+    {
+        return init_evaluator_pos(method, params, scanner);
+    }
+    else
+    {
+        std::string text(_gmx_sel_lexer_get_text(scanner, child->location()));
+        std::string message
+            = gmx::formatString("Expression '%s' cannot be used to evaluate keywords",
+                                text.c_str());
+        GMX_THROW(gmx::InvalidInputError(message));
+    }
+}
index 258dc85d1f3cc14e608e8493e80f8ede49744286..47b91ee886be084e8e94b546b1ea37866cba7049 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/vec.h"
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
+#include "selmethod.h"
+
 /*! \internal \brief
  * Data structure for the merging selection modifiers.
  */
index b9a194d0f33720908a6a4d89217dce21f121e58c..eb7467149f342cc362c350aaa7f4dbb50ba39e23 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/vec.h"
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "selmethod.h"
+
 /*! \internal \brief
  * Data structure for the \p permute selection modifier.
  */
@@ -236,7 +238,7 @@ free_data_permute(void *data)
 
 static void
 evaluate_permute(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc */,
-                 gmx_ana_pos_t *p, gmx_ana_selvalue_t *out, void *data)
+                 gmx_ana_pos_t * /*p*/, gmx_ana_selvalue_t *out, void *data)
 {
     t_methoddata_permute *d = (t_methoddata_permute *)data;
     int                   i, j, b;
@@ -259,7 +261,7 @@ evaluate_permute(t_topology * /* top */, t_trxframe * /* fr */, t_pbc * /* pbc *
                 /* De-permute the reference ID */
                 refid = refid - (refid % d->n) + d->perm[refid % d->n];
             }
-            gmx_ana_pos_append(out->u.p, p, b, refid);
+            gmx_ana_pos_append(out->u.p, &d->p, b, refid);
         }
     }
     gmx_ana_pos_append_finish(out->u.p);
index 31f3c0a8b2dd9c6f84182d5255be263680eecf43..3a92f82d69edb8972e5f757fc4a59920de4de58b 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/legacyheaders/macros.h"
+#include "gmxpre.h"
 
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "keywords.h"
+#include "poscalc.h"
 #include "selelem.h"
+#include "selmethod.h"
 
 /*! \internal \brief
  * Data structure for position keyword evaluation.
index 71192b842d9c01eece0ef71422dcae99891840aa..f97978f9885294cf6dc02e8e401e285a4f16520e 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include <stdlib.h>
 
 #include "gromacs/legacyheaders/macros.h"
-
-#include "gromacs/selection/selmethod.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "keywords.h"
 #include "parsetree.h"
 #include "selelem.h"
+#include "selmethod.h"
 
 /*! \internal
  * \brief
@@ -230,12 +231,11 @@ init_data_same(int /* npar */, gmx_ana_selparam_t *param)
  * \param[in,out] method  The method to initialize.
  * \param[in,out] params  Pointer to the first parameter.
  * \param[in]     scanner Scanner data structure.
- * \returns       0 on success, a non-zero error code on error.
  *
- * If \p *method is not a \c same method, this function returns zero
+ * If \p *method is not a \c same method, this function returns
  * immediately.
  */
-int
+void
 _gmx_selelem_custom_init_same(gmx_ana_selmethod_t                           **method,
                               const gmx::SelectionParserParameterListPointer &params,
                               void                                           *scanner)
@@ -244,15 +244,14 @@ _gmx_selelem_custom_init_same(gmx_ana_selmethod_t                           **me
     /* Do nothing if this is not a same method. */
     if (!*method || (*method)->name != sm_same.name || params->empty())
     {
-        return 0;
+        return;
     }
 
     const gmx::SelectionParserValueList &kwvalues = params->front().values();
     if (kwvalues.size() != 1 || !kwvalues.front().hasExpressionValue()
         || kwvalues.front().expr->type != SEL_EXPRESSION)
     {
-        _gmx_selparser_error(scanner, "'same' should be followed by a single keyword");
-        return -1;
+        GMX_THROW(gmx::InvalidInputError("'same' should be followed by a single keyword"));
     }
     gmx_ana_selmethod_t *kwmethod = kwvalues.front().expr->u.expr.method;
     if (kwmethod->type == STR_VALUE)
@@ -264,27 +263,22 @@ _gmx_selelem_custom_init_same(gmx_ana_selmethod_t                           **me
     gmx::SelectionParserParameterList::iterator asparam = ++params->begin();
     if (asparam != params->end() && asparam->name() == sm_same.param[1].name)
     {
-        gmx::SelectionParserParameterList    kwparams;
-        gmx::SelectionParserValueListPointer values(
-                new gmx::SelectionParserValueList(asparam->values()));
-        kwparams.push_back(
-                gmx::SelectionParserParameter::create(NULL, move(values)));
-
+        const gmx::SelectionParserValueList &asvalues = asparam->values();
+        if (asvalues.size() != 1 || !asvalues.front().hasExpressionValue())
+        {
+            // TODO: Think about providing more informative context.
+            GMX_THROW(gmx::InvalidInputError("'same ... as' should be followed by a single expression"));
+        }
+        const gmx::SelectionTreeElementPointer &child = asvalues.front().expr;
         /* Create a second keyword evaluation element for the keyword given as
          * the first parameter, evaluating the keyword in the group given by the
          * second parameter. */
         gmx::SelectionTreeElementPointer kwelem
-            = _gmx_sel_init_keyword_evaluator(kwmethod, kwparams, scanner);
-        // FIXME: Use exceptions.
-        if (!kwelem)
-        {
-            return -1;
-        }
+            = _gmx_sel_init_keyword_evaluator(kwmethod, child, scanner);
         /* Replace the second parameter with one with a value from \p kwelem. */
         std::string pname = asparam->name();
         *asparam = gmx::SelectionParserParameter::createFromExpression(pname, kwelem);
     }
-    return 0;
 }
 
 static void
index cc61a684b73230694c26eac984dca209774de0b2..b257effe742642093f1848f136bcbfaca37fbbf3 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include <cctype>
 
 #include "gromacs/legacyheaders/macros.h"
-
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selmethod.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 
+#include "selmethod.h"
+
 /** Evaluates the \p all selection keyword. */
 static void
 evaluate_all(t_topology *top, t_trxframe *fr, t_pbc *pbc,
@@ -841,8 +844,7 @@ evaluate_betafactor(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
  * Internal utility function for position keyword evaluation.
  *
  * \param[out] out  Output array.
- * \param[in]  pos  Position data to use instead of atomic coordinates
- *   (can be NULL).
+ * \param[in]  pos  Position data to use instead of atomic coordinates.
  * \param[in]  d    Coordinate index to evaluate (\p XX, \p YY or \p ZZ).
  *
  * This function is used internally by evaluate_x(), evaluate_y() and
@@ -851,13 +853,9 @@ evaluate_betafactor(t_topology *top, t_trxframe * /* fr */, t_pbc * /* pbc */,
 static void
 evaluate_coord(real out[], gmx_ana_pos_t *pos, int d)
 {
-    for (int b = 0; b < pos->count(); ++b)
+    for (int i = 0; i < pos->count(); ++i)
     {
-        const real v = pos->x[b][d];
-        for (int i = pos->m.mapb.index[b]; i < pos->m.mapb.index[b+1]; ++i)
-        {
-            out[i] = v;
-        }
+        out[i] = pos->x[i][d];
     }
     // TODO: Make this more efficient by directly extracting the coordinates
     // from the frame coordinates for atomic positions instead of going through
@@ -868,13 +866,13 @@ evaluate_coord(real out[], gmx_ana_pos_t *pos, int d)
  * See sel_updatefunc_pos() for description of the parameters.
  * \p data is not used.
  *
- * Returns the \p x coordinate for each atom in \p out->u.r.
+ * 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*/,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void * /*data*/)
 {
-    out->nr = pos->m.mapb.nra;
+    out->nr = pos->count();
     evaluate_coord(out->u.r, pos, XX);
 }
 
@@ -882,13 +880,13 @@ evaluate_x(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
  * See sel_updatefunc() for description of the parameters.
  * \p data is not used.
  *
- * Returns the \p y coordinate for each atom in \p out->u.r.
+ * 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*/,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void * /*data*/)
 {
-    out->nr = pos->m.mapb.nra;
+    out->nr = pos->count();
     evaluate_coord(out->u.r, pos, YY);
 }
 
@@ -896,12 +894,12 @@ evaluate_y(t_topology * /*top*/, t_trxframe * /*fr*/, t_pbc * /*pbc*/,
  * See sel_updatefunc() for description of the parameters.
  * \p data is not used.
  *
- * Returns the \p z coordinate for each atom in \p out->u.r.
+ * 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*/,
            gmx_ana_pos_t *pos, gmx_ana_selvalue_t *out, void * /*data*/)
 {
-    out->nr = pos->m.mapb.nra;
+    out->nr = pos->count();
     evaluate_coord(out->u.r, pos, ZZ);
 }
index 38808d97715b5fe479172e669f85f1a05c1bfb78..cd648f60efc0261e932ed93050c6a9b20a44774d 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "symrec.h"
+
 #include <map>
 #include <string>
 #include <utility>
 
 #include "gromacs/legacyheaders/macros.h"
-
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
@@ -52,7 +55,6 @@
 
 #include "poscalc.h"
 #include "selelem.h"
-#include "symrec.h"
 
 namespace gmx
 {
index 984c272042445c1f915e923b48780474cd103ecc..d544bddad48ecdb13f223389aec2384a42539696 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,7 +47,7 @@
 #include <iterator>
 #include <string>
 
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 #include "selelem.h"
 
index 8dd46bfcbf782571fff69ac929fa557be3f428a5..3c8989be9911de188f575c3f14830c5df15994bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include <gtest/gtest.h>
-
-#include "gromacs/legacyheaders/typedefs.h"
+#include "gmxpre.h"
 
 #include "gromacs/selection/indexutil.h"
 
+#include <gtest/gtest.h>
+
+#include "gromacs/topology/block.h"
+
 #include "testutils/refdata.h"
 
 #include "toputils.h"
@@ -350,6 +352,7 @@ class IndexMapTest : public ::testing::Test
         void testInit(int atomCount, const int atoms[], e_index_t type);
         void testUpdate(int atomCount, const int atoms[], bool bMaskOnly,
                         const char *name);
+        void testOrgIdGroup(e_index_t type, const char *name);
         template <int count>
         void testInit(const int (&atoms)[count], e_index_t type)
         {
@@ -415,6 +418,20 @@ void IndexMapTest::testUpdate(int atomCount, const int atoms[], bool bMaskOnly,
     }
 }
 
+void IndexMapTest::testOrgIdGroup(e_index_t type, const char *name)
+{
+    gmx::test::TestReferenceChecker compound(
+            checker_.checkCompound("OrgIdGroups", name));
+    const int count
+        = gmx_ana_indexmap_init_orgid_group(&map_, topManager_.topology(), type);
+    compound.checkInteger(count, "GroupCount");
+    compound.checkSequenceArray(map_.mapb.nr, map_.orgid, "OrgId");
+    for (int i = 0; i < map_.mapb.nr; ++i)
+    {
+        EXPECT_EQ(map_.orgid[i], map_.mapid[i]);
+    }
+}
+
 void IndexMapTest::checkMapping(int atomCount, const int atoms[],
                                 const char *name)
 {
@@ -446,6 +463,48 @@ TEST_F(IndexMapTest, InitializesAtomBlock)
     testInit(maxGroup, INDEX_ATOM);
 }
 
+TEST_F(IndexMapTest, InitializesOrgIdGroupAtom)
+{
+    const int maxGroup[] = { 2, 5, 7 };
+    testInit(maxGroup, INDEX_ATOM);
+    testOrgIdGroup(INDEX_ATOM, "Atoms");
+}
+
+TEST_F(IndexMapTest, InitializesOrgIdGroupSingle)
+{
+    const int maxGroup[] = { 3, 4, 7, 8, 13 };
+    topManager_.initAtoms(18);
+    topManager_.initUniformResidues(3);
+    testInit(maxGroup, INDEX_RES);
+    testOrgIdGroup(INDEX_ATOM, "Single");
+}
+
+TEST_F(IndexMapTest, InitializesOrgIdGroupResidue)
+{
+    const int maxGroup[] = { 3, 4, 7, 8, 13 };
+    topManager_.initAtoms(18);
+    topManager_.initUniformResidues(3);
+    testInit(maxGroup, INDEX_ATOM);
+    testOrgIdGroup(INDEX_RES, "Residues");
+}
+
+TEST_F(IndexMapTest, InitializesOrgIdGroupMolecule)
+{
+    const int maxGroup[] = { 1, 2, 3, 4, 7, 8, 13 };
+    topManager_.initAtoms(18);
+    topManager_.initUniformResidues(3);
+    topManager_.initUniformMolecules(6);
+    testInit(maxGroup, INDEX_RES);
+    testOrgIdGroup(INDEX_MOL, "Molecules");
+}
+
+TEST_F(IndexMapTest, InitializesOrgIdGroupAll)
+{
+    const int maxGroup[] = { 3, 4, 7, 8, 13 };
+    testInit(maxGroup, INDEX_ATOM);
+    testOrgIdGroup(INDEX_ALL, "All");
+}
+
 TEST_F(IndexMapTest, InitializesMoleculeBlock)
 {
     const int maxGroup[] = { 3, 4, 7, 8, 13 };
index 177913fad1212ed2c34808fe16dd744b31b516ef..471dae9ab8a3c758ad16f70b1cdd22f8ba3da15b 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
+
+#include "gromacs/selection/nbsearch.h"
 
 #include <cmath>
 
+#include <algorithm>
 #include <limits>
-#include <set>
+#include <numeric>
 #include <vector>
 
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
+#include <gtest/gtest.h>
 
-#include "gromacs/selection/nbsearch.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/random/random.h"
+#include "gromacs/topology/block.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
 
 #include "testutils/testasserts.h"
 
@@ -71,6 +76,30 @@ namespace
 class NeighborhoodSearchTestData
 {
     public:
+        struct RefPair
+        {
+            RefPair(int refIndex, real distance)
+                : refIndex(refIndex), distance(distance), bFound(false),
+                  bExcluded(false), bIndexed(true)
+            {
+            }
+
+            bool operator<(const RefPair &other) const
+            {
+                return refIndex < other.refIndex;
+            }
+
+            int                 refIndex;
+            real                distance;
+            // The variables below are state variables that are only used
+            // during the actual testing after creating a copy of the reference
+            // pair list, not as part of the reference data.
+            // Simpler to have just a single structure for both purposes.
+            bool                bFound;
+            bool                bExcluded;
+            bool                bIndexed;
+        };
+
         struct TestPosition
         {
             explicit TestPosition(const rvec x)
@@ -79,11 +108,12 @@ class NeighborhoodSearchTestData
                 copy_rvec(x, this->x);
             }
 
-            rvec                x;
-            real                refMinDist;
-            int                 refNearestPoint;
-            std::set<int>       refPairs;
+            rvec                 x;
+            real                 refMinDist;
+            int                  refNearestPoint;
+            std::vector<RefPair> refPairs;
         };
+
         typedef std::vector<TestPosition> TestPositionList;
 
         NeighborhoodSearchTestData(int seed, real cutoff);
@@ -91,20 +121,19 @@ class NeighborhoodSearchTestData
 
         gmx::AnalysisNeighborhoodPositions refPositions() const
         {
-            return gmx::AnalysisNeighborhoodPositions(refPos_, refPosCount_);
+            return gmx::AnalysisNeighborhoodPositions(refPos_);
         }
         gmx::AnalysisNeighborhoodPositions testPositions() const
         {
-            if (testPos_ == NULL)
+            if (testPos_.empty())
             {
-                snew(testPos_, testPositions_.size());
+                testPos_.reserve(testPositions_.size());
                 for (size_t i = 0; i < testPositions_.size(); ++i)
                 {
-                    copy_rvec(testPositions_[i].x, testPos_[i]);
+                    testPos_.push_back(testPositions_[i].x);
                 }
             }
-            return gmx::AnalysisNeighborhoodPositions(testPos_,
-                                                      testPositions_.size());
+            return gmx::AnalysisNeighborhoodPositions(testPos_);
         }
         gmx::AnalysisNeighborhoodPositions testPosition(int index) const
         {
@@ -113,29 +142,54 @@ class NeighborhoodSearchTestData
 
         void addTestPosition(const rvec x)
         {
-            GMX_RELEASE_ASSERT(testPos_ == NULL,
+            GMX_RELEASE_ASSERT(testPos_.empty(),
                                "Cannot add positions after testPositions() call");
             testPositions_.push_back(TestPosition(x));
         }
-        void generateRandomPosition(rvec x);
+        gmx::RVec generateRandomPosition();
+        std::vector<int> generateIndex(int count) const;
         void generateRandomRefPositions(int count);
         void generateRandomTestPositions(int count);
-        void computeReferences(t_pbc *pbc);
+        void computeReferences(t_pbc *pbc)
+        {
+            computeReferencesInternal(pbc, false);
+        }
+        void computeReferencesXY(t_pbc *pbc)
+        {
+            computeReferencesInternal(pbc, true);
+        }
+
+        bool containsPair(int testIndex, const RefPair &pair) const
+        {
+            const std::vector<RefPair>          &refPairs = testPositions_[testIndex].refPairs;
+            std::vector<RefPair>::const_iterator foundRefPair
+                = std::lower_bound(refPairs.begin(), refPairs.end(), pair);
+            if (foundRefPair == refPairs.end() || foundRefPair->refIndex != pair.refIndex)
+            {
+                return false;
+            }
+            return true;
+        }
 
         gmx_rng_t                        rng_;
         real                             cutoff_;
         matrix                           box_;
         t_pbc                            pbc_;
         int                              refPosCount_;
-        rvec                            *refPos_;
+        std::vector<gmx::RVec>           refPos_;
         TestPositionList                 testPositions_;
 
     private:
-        mutable rvec                    *testPos_;
+        void computeReferencesInternal(t_pbc *pbc, bool bXY);
+
+        mutable std::vector<gmx::RVec>   testPos_;
 };
 
+//! Shorthand for a collection of reference pairs.
+typedef std::vector<NeighborhoodSearchTestData::RefPair> RefPairList;
+
 NeighborhoodSearchTestData::NeighborhoodSearchTestData(int seed, real cutoff)
-    : rng_(NULL), cutoff_(cutoff), refPosCount_(0), refPos_(NULL), testPos_(NULL)
+    : rng_(NULL), cutoff_(cutoff), refPosCount_(0)
 {
     // TODO: Handle errors.
     rng_ = gmx_rng_init(seed);
@@ -149,13 +203,11 @@ NeighborhoodSearchTestData::~NeighborhoodSearchTestData()
     {
         gmx_rng_destroy(rng_);
     }
-    sfree(refPos_);
-    sfree(testPos_);
 }
 
-void NeighborhoodSearchTestData::generateRandomPosition(rvec x)
+gmx::RVec NeighborhoodSearchTestData::generateRandomPosition()
 {
-    rvec fx;
+    rvec fx, x;
     fx[XX] = gmx_rng_uniform_real(rng_);
     fx[YY] = gmx_rng_uniform_real(rng_);
     fx[ZZ] = gmx_rng_uniform_real(rng_);
@@ -164,15 +216,29 @@ void NeighborhoodSearchTestData::generateRandomPosition(rvec x)
     x[XX] += 0.2 * gmx_rng_uniform_real(rng_) - 0.1;
     x[YY] += 0.2 * gmx_rng_uniform_real(rng_) - 0.1;
     x[ZZ] += 0.2 * gmx_rng_uniform_real(rng_) - 0.1;
+    return x;
+}
+
+std::vector<int> NeighborhoodSearchTestData::generateIndex(int count) const
+{
+    std::vector<int> result;
+    for (int i = 0; i < count; ++i)
+    {
+        if (gmx_rng_uniform_real(rng_) > 0.5)
+        {
+            result.push_back(i);
+        }
+    }
+    return result;
 }
 
 void NeighborhoodSearchTestData::generateRandomRefPositions(int count)
 {
     refPosCount_ = count;
-    snew(refPos_, refPosCount_);
-    for (int i = 0; i < refPosCount_; ++i)
+    refPos_.reserve(count);
+    for (int i = 0; i < count; ++i)
     {
-        generateRandomPosition(refPos_[i]);
+        refPos_.push_back(generateRandomPosition());
     }
 }
 
@@ -181,13 +247,11 @@ void NeighborhoodSearchTestData::generateRandomTestPositions(int count)
     testPositions_.reserve(count);
     for (int i = 0; i < count; ++i)
     {
-        rvec x;
-        generateRandomPosition(x);
-        addTestPosition(x);
+        addTestPosition(generateRandomPosition());
     }
 }
 
-void NeighborhoodSearchTestData::computeReferences(t_pbc *pbc)
+void NeighborhoodSearchTestData::computeReferencesInternal(t_pbc *pbc, bool bXY)
 {
     real cutoff = cutoff_;
     if (cutoff <= 0)
@@ -211,7 +275,11 @@ void NeighborhoodSearchTestData::computeReferences(t_pbc *pbc)
             {
                 rvec_sub(i->x, refPos_[j], dx);
             }
-            const real dist = norm(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) : sqrt(sqr(dx[XX]) + sqr(dx[YY]));
             if (dist < i->refMinDist)
             {
                 i->refMinDist      = dist;
@@ -219,12 +287,114 @@ void NeighborhoodSearchTestData::computeReferences(t_pbc *pbc)
             }
             if (dist <= cutoff)
             {
-                i->refPairs.insert(j);
+                RefPair pair(j, dist);
+                GMX_RELEASE_ASSERT(i->refPairs.empty() || i->refPairs.back() < pair,
+                                   "Reference pairs should be generated in sorted order");
+                i->refPairs.push_back(pair);
             }
         }
     }
 }
 
+/********************************************************************
+ * ExclusionsHelper
+ */
+
+class ExclusionsHelper
+{
+    public:
+        static void markExcludedPairs(RefPairList *refPairs, int testIndex,
+                                      const t_blocka *excls);
+
+        ExclusionsHelper(int refPosCount, int testPosCount);
+
+        void generateExclusions();
+
+        const t_blocka *exclusions() const { return &excls_; }
+
+        gmx::ConstArrayRef<int> refPosIds() const
+        {
+            return gmx::constArrayRefFromVector<int>(exclusionIds_.begin(),
+                                                     exclusionIds_.begin() + refPosCount_);
+        }
+        gmx::ConstArrayRef<int> testPosIds() const
+        {
+            return gmx::constArrayRefFromVector<int>(exclusionIds_.begin(),
+                                                     exclusionIds_.begin() + testPosCount_);
+        }
+
+    private:
+        int              refPosCount_;
+        int              testPosCount_;
+        std::vector<int> exclusionIds_;
+        std::vector<int> exclsIndex_;
+        std::vector<int> exclsAtoms_;
+        t_blocka         excls_;
+};
+
+// static
+void ExclusionsHelper::markExcludedPairs(RefPairList *refPairs, int testIndex,
+                                         const t_blocka *excls)
+{
+    int count = 0;
+    for (int i = excls->index[testIndex]; i < excls->index[testIndex + 1]; ++i)
+    {
+        const int                           excludedIndex = excls->a[i];
+        NeighborhoodSearchTestData::RefPair searchPair(excludedIndex, 0.0);
+        RefPairList::iterator               excludedRefPair
+            = std::lower_bound(refPairs->begin(), refPairs->end(), searchPair);
+        if (excludedRefPair != refPairs->end()
+            && excludedRefPair->refIndex == excludedIndex)
+        {
+            excludedRefPair->bFound    = true;
+            excludedRefPair->bExcluded = true;
+            ++count;
+        }
+    }
+}
+
+ExclusionsHelper::ExclusionsHelper(int refPosCount, int testPosCount)
+    : refPosCount_(refPosCount), testPosCount_(testPosCount)
+{
+    // Generate an array of 0, 1, 2, ...
+    // TODO: Make the tests work also with non-trivial exclusion IDs,
+    // and test that.
+    exclusionIds_.resize(std::max(refPosCount, testPosCount), 1);
+    exclusionIds_[0] = 0;
+    std::partial_sum(exclusionIds_.begin(), exclusionIds_.end(),
+                     exclusionIds_.begin());
+
+    excls_.nr           = 0;
+    excls_.index        = NULL;
+    excls_.nra          = 0;
+    excls_.a            = NULL;
+    excls_.nalloc_index = 0;
+    excls_.nalloc_a     = 0;
+}
+
+void ExclusionsHelper::generateExclusions()
+{
+    // TODO: Consider a better set of test data, where the density of the
+    // particles would be higher, or where the exclusions would not be random,
+    // to make a higher percentage of the exclusions to actually be within the
+    // cutoff.
+    exclsIndex_.reserve(testPosCount_ + 1);
+    exclsAtoms_.reserve(testPosCount_ * 20);
+    exclsIndex_.push_back(0);
+    for (int i = 0; i < testPosCount_; ++i)
+    {
+        for (int j = 0; j < 20; ++j)
+        {
+            exclsAtoms_.push_back(i + j*3);
+        }
+        exclsIndex_.push_back(exclsAtoms_.size());
+    }
+    excls_.nr    = exclsIndex_.size();
+    excls_.index = &exclsIndex_[0];
+    excls_.nra   = exclsAtoms_.size();
+    excls_.a     = &exclsAtoms_[0];
+}
+
 /********************************************************************
  * NeighborhoodSearchTest
  */
@@ -240,6 +410,14 @@ class NeighborhoodSearchTest : public ::testing::Test
                               const NeighborhoodSearchTestData &data);
         void testPairSearch(gmx::AnalysisNeighborhoodSearch  *search,
                             const NeighborhoodSearchTestData &data);
+        void testPairSearchIndexed(gmx::AnalysisNeighborhood        *nb,
+                                   const NeighborhoodSearchTestData &data);
+        void testPairSearchFull(gmx::AnalysisNeighborhoodSearch          *search,
+                                const NeighborhoodSearchTestData         &data,
+                                const gmx::AnalysisNeighborhoodPositions &pos,
+                                const t_blocka                           *excls,
+                                const gmx::ConstArrayRef<int>            &refIndices,
+                                const gmx::ConstArrayRef<int>            &testIndices);
 
         gmx::AnalysisNeighborhood        nb_;
 };
@@ -282,6 +460,8 @@ void NeighborhoodSearchTest::testNearestPoint(
         {
             EXPECT_EQ(i->refNearestPoint, pair.refIndex());
             EXPECT_EQ(0, pair.testIndex());
+            EXPECT_REAL_EQ_TOL(i->refMinDist, sqrt(pair.distance2()),
+                               gmx::test::ulpTolerance(64));
         }
         else
         {
@@ -290,31 +470,202 @@ void NeighborhoodSearchTest::testNearestPoint(
     }
 }
 
+//! Helper function for formatting test failure messages.
+std::string formatVector(const rvec x)
+{
+    return gmx::formatString("[%.3f, %.3f, %.3f]", x[XX], x[YY], x[ZZ]);
+}
+
+/*! \brief
+ * Helper function to check that all expected pairs were found.
+ */
+void checkAllPairsFound(const RefPairList &refPairs,
+                        const std::vector<gmx::RVec> &refPos,
+                        int testPosIndex, const rvec testPos)
+{
+    // This could be elegantly expressed with Google Mock matchers, but that
+    // has a significant effect on the runtime of the tests...
+    int                         count = 0;
+    RefPairList::const_iterator first;
+    for (RefPairList::const_iterator i = refPairs.begin(); i != refPairs.end(); ++i)
+    {
+        if (!i->bFound)
+        {
+            ++count;
+            first = i;
+        }
+    }
+    if (count > 0)
+    {
+        ADD_FAILURE()
+        << "Some pairs (" << count << "/" << refPairs.size() << ") "
+        << "within the cutoff were not found. First pair:\n"
+        << " Ref: " << first->refIndex << " at "
+        << formatVector(refPos[first->refIndex]) << "\n"
+        << "Test: " << testPosIndex << " at " << formatVector(testPos) << "\n"
+        << "Dist: " << first->distance;
+    }
+}
+
 void NeighborhoodSearchTest::testPairSearch(
         gmx::AnalysisNeighborhoodSearch  *search,
         const NeighborhoodSearchTestData &data)
 {
-    NeighborhoodSearchTestData::TestPositionList::const_iterator i;
-    for (i = data.testPositions_.begin(); i != data.testPositions_.end(); ++i)
+    testPairSearchFull(search, data, data.testPositions(), NULL,
+                       gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
+}
+
+void NeighborhoodSearchTest::testPairSearchIndexed(
+        gmx::AnalysisNeighborhood        *nb,
+        const NeighborhoodSearchTestData &data)
+{
+    std::vector<int>                refIndices(data.generateIndex(data.refPos_.size()));
+    std::vector<int>                testIndices(data.generateIndex(data.testPositions_.size()));
+    gmx::AnalysisNeighborhoodSearch search =
+        nb->initSearch(&data.pbc_,
+                       data.refPositions().indexed(refIndices));
+    testPairSearchFull(&search, data, data.testPositions(), NULL,
+                       refIndices, testIndices);
+}
+
+void NeighborhoodSearchTest::testPairSearchFull(
+        gmx::AnalysisNeighborhoodSearch          *search,
+        const NeighborhoodSearchTestData         &data,
+        const gmx::AnalysisNeighborhoodPositions &pos,
+        const t_blocka                           *excls,
+        const gmx::ConstArrayRef<int>            &refIndices,
+        const gmx::ConstArrayRef<int>            &testIndices)
+{
+    // 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())
     {
-        std::set<int> checkSet                         = i->refPairs;
-        gmx::AnalysisNeighborhoodPairSearch pairSearch =
-            search->startPairSearch(i->x);
-        gmx::AnalysisNeighborhoodPair       pair;
-        while (pairSearch.findNextPair(&pair))
+        for (size_t i = 0; i < data.testPositions_.size(); ++i)
         {
-            EXPECT_EQ(0, pair.testIndex());
-            if (checkSet.erase(pair.refIndex()) == 0)
+            remainingTestPositions.insert(i);
+        }
+    }
+    else
+    {
+        remainingTestPositions.insert(testIndices.begin(), testIndices.end());
+        posCopy.indexed(testIndices);
+    }
+    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))
+    {
+        const int testIndex =
+            (testIndices.empty() ? pair.testIndex() : testIndices[pair.testIndex()]);
+        const int refIndex =
+            (refIndices.empty() ? pair.refIndex() : refIndices[pair.refIndex()]);
+        if (testIndex != prevTestPos)
+        {
+            if (prevTestPos != -1)
+            {
+                checkAllPairsFound(refPairs, data.refPos_, prevTestPos,
+                                   data.testPositions_[prevTestPos].x);
+            }
+            if (remainingTestPositions.count(testIndex) == 0)
             {
-                // TODO: Check whether the same pair was returned more than
-                // once and give a better error message if so.
                 ADD_FAILURE()
-                << "Expected: Position " << pair.refIndex()
-                << " is within cutoff.\n"
-                << "  Actual: It is not.";
+                << "Pairs for test position " << testIndex
+                << " are returned more than once.";
+            }
+            remainingTestPositions.erase(testIndex);
+            refPairs = data.testPositions_[testIndex].refPairs;
+            if (excls != NULL)
+            {
+                ExclusionsHelper::markExcludedPairs(&refPairs, testIndex, excls);
             }
+            if (!refIndices.empty())
+            {
+                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(refIndices[i], 0.0);
+                    refPair = std::lower_bound(refPairs.begin(), refPairs.end(), searchPair);
+                    if (refPair != refPairs.end() && refPair->refIndex == refIndices[i])
+                    {
+                        refPair->bIndexed = true;
+                    }
+                }
+                for (refPair = refPairs.begin(); refPair != refPairs.end(); ++refPair)
+                {
+                    if (!refPair->bIndexed)
+                    {
+                        refPair->bFound = true;
+                    }
+                }
+            }
+            prevTestPos = testIndex;
+        }
+
+        NeighborhoodSearchTestData::RefPair searchPair(refIndex,
+                                                       sqrt(pair.distance2()));
+        RefPairList::iterator               foundRefPair
+            = std::lower_bound(refPairs.begin(), refPairs.end(), searchPair);
+        if (foundRefPair == refPairs.end() || foundRefPair->refIndex != refIndex)
+        {
+            ADD_FAILURE()
+            << "Expected: Pair (ref: " << refIndex << ", test: " << testIndex
+            << ") is not within the cutoff.\n"
+            << "  Actual: It is returned.";
+        }
+        else if (foundRefPair->bExcluded)
+        {
+            ADD_FAILURE()
+            << "Expected: Pair (ref: " << refIndex << ", test: " << testIndex
+            << ") is excluded from the search.\n"
+            << "  Actual: It is returned.";
+        }
+        else if (!foundRefPair->bIndexed)
+        {
+            ADD_FAILURE()
+            << "Expected: Pair (ref: " << refIndex << ", test: " << testIndex
+            << ") is not part of the indexed set.\n"
+            << "  Actual: It is returned.";
+        }
+        else if (foundRefPair->bFound)
+        {
+            ADD_FAILURE()
+            << "Expected: Pair (ref: " << refIndex << ", test: " << testIndex
+            << ") is returned only once.\n"
+            << "  Actual: It is returned multiple times.";
+            return;
+        }
+        else
+        {
+            foundRefPair->bFound = true;
+            EXPECT_REAL_EQ_TOL(foundRefPair->distance, searchPair.distance,
+                               gmx::test::ulpTolerance(64))
+            << "Distance computed by the neighborhood search does not match.";
+        }
+    }
+    checkAllPairsFound(refPairs, data.refPos_, prevTestPos,
+                       data.testPositions_[prevTestPos].x);
+    for (std::set<int>::const_iterator i = remainingTestPositions.begin();
+         i != remainingTestPositions.end(); ++i)
+    {
+        if (!data.testPositions_[*i].refPairs.empty())
+        {
+            ADD_FAILURE()
+            << "Expected: Pairs would be returned for test position " << *i << ".\n"
+            << "  Actual: None were returned.";
+            break;
         }
-        EXPECT_TRUE(checkSet.empty()) << "Some positions were not returned by the pair search.";
     }
 }
 
@@ -346,6 +697,26 @@ class TrivialTestData
         NeighborhoodSearchTestData data_;
 };
 
+class TrivialNoPBCTestData
+{
+    public:
+        static const NeighborhoodSearchTestData &get()
+        {
+            static TrivialNoPBCTestData singleton;
+            return singleton.data_;
+        }
+
+        TrivialNoPBCTestData() : data_(12345, 1.0)
+        {
+            data_.generateRandomRefPositions(10);
+            data_.generateRandomTestPositions(5);
+            data_.computeReferences(NULL);
+        }
+
+    private:
+        NeighborhoodSearchTestData data_;
+};
+
 class RandomBoxFullPBCData
 {
     public:
@@ -372,6 +743,32 @@ class RandomBoxFullPBCData
         NeighborhoodSearchTestData data_;
 };
 
+class RandomBoxXYFullPBCData
+{
+    public:
+        static const NeighborhoodSearchTestData &get()
+        {
+            static RandomBoxXYFullPBCData singleton;
+            return singleton.data_;
+        }
+
+        RandomBoxXYFullPBCData() : data_(54321, 1.0)
+        {
+            data_.box_[XX][XX] = 10.0;
+            data_.box_[YY][YY] = 5.0;
+            data_.box_[ZZ][ZZ] = 7.0;
+            // TODO: Consider whether manually picking some positions would give better
+            // test coverage.
+            data_.generateRandomRefPositions(1000);
+            data_.generateRandomTestPositions(100);
+            set_pbc(&data_.pbc_, epbcXYZ, data_.box_);
+            data_.computeReferencesXY(&data_.pbc_);
+        }
+
+    private:
+        NeighborhoodSearchTestData data_;
+};
+
 class RandomTriclinicFullPBCData
 {
     public:
@@ -427,6 +824,32 @@ class RandomBox2DPBCData
         NeighborhoodSearchTestData data_;
 };
 
+class RandomBoxNoPBCData
+{
+    public:
+        static const NeighborhoodSearchTestData &get()
+        {
+            static RandomBoxNoPBCData singleton;
+            return singleton.data_;
+        }
+
+        RandomBoxNoPBCData() : data_(12345, 1.0)
+        {
+            data_.box_[XX][XX] = 10.0;
+            data_.box_[YY][YY] = 5.0;
+            data_.box_[ZZ][ZZ] = 7.0;
+            // TODO: Consider whether manually picking some positions would give better
+            // test coverage.
+            data_.generateRandomRefPositions(1000);
+            data_.generateRandomTestPositions(100);
+            set_pbc(&data_.pbc_, epbcNONE, data_.box_);
+            data_.computeReferences(NULL);
+        }
+
+    private:
+        NeighborhoodSearchTestData data_;
+};
+
 /********************************************************************
  * Actual tests
  */
@@ -445,6 +868,26 @@ TEST_F(NeighborhoodSearchTest, SimpleSearch)
     testMinimumDistance(&search, data);
     testNearestPoint(&search, data);
     testPairSearch(&search, data);
+
+    search.reset();
+    testPairSearchIndexed(&nb_, data);
+}
+
+TEST_F(NeighborhoodSearchTest, SimpleSearchXY)
+{
+    const NeighborhoodSearchTestData &data = RandomBoxXYFullPBCData::get();
+
+    nb_.setCutoff(data.cutoff_);
+    nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Simple);
+    nb_.setXYMode(true);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_, data.refPositions());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
+
+    testIsWithin(&search, data);
+    testMinimumDistance(&search, data);
+    testNearestPoint(&search, data);
+    testPairSearch(&search, data);
 }
 
 TEST_F(NeighborhoodSearchTest, GridSearchBox)
@@ -461,6 +904,9 @@ TEST_F(NeighborhoodSearchTest, GridSearchBox)
     testMinimumDistance(&search, data);
     testNearestPoint(&search, data);
     testPairSearch(&search, data);
+
+    search.reset();
+    testPairSearchIndexed(&nb_, data);
 }
 
 TEST_F(NeighborhoodSearchTest, GridSearchTriclinic)
@@ -484,8 +930,37 @@ TEST_F(NeighborhoodSearchTest, GridSearch2DPBC)
     nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Grid);
     gmx::AnalysisNeighborhoodSearch search =
         nb_.initSearch(&data.pbc_, data.refPositions());
-    // Currently, grid searching not supported with 2D PBC.
-    //ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Grid, search.mode());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Grid, search.mode());
+
+    testIsWithin(&search, data);
+    testMinimumDistance(&search, data);
+    testNearestPoint(&search, data);
+    testPairSearch(&search, data);
+}
+
+TEST_F(NeighborhoodSearchTest, GridSearchNoPBC)
+{
+    const NeighborhoodSearchTestData &data = RandomBoxNoPBCData::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());
+
+    testPairSearch(&search, data);
+}
+
+TEST_F(NeighborhoodSearchTest, GridSearchXYBox)
+{
+    const NeighborhoodSearchTestData &data = RandomBoxXYFullPBCData::get();
+
+    nb_.setCutoff(data.cutoff_);
+    nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Grid);
+    nb_.setXYMode(true);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_, data.refPositions());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Grid, search.mode());
 
     testIsWithin(&search, data);
     testMinimumDistance(&search, data);
@@ -511,13 +986,51 @@ TEST_F(NeighborhoodSearchTest, HandlesConcurrentSearches)
     testPairSearch(&search2, data);
 
     gmx::AnalysisNeighborhoodPair pair;
-    pairSearch1.findNextPair(&pair);
+    ASSERT_TRUE(pairSearch1.findNextPair(&pair))
+    << "Test data did not contain any pairs for position 0 (problem in the test).";
     EXPECT_EQ(0, pair.testIndex());
-    EXPECT_TRUE(data.testPositions_[0].refPairs.count(pair.refIndex()) == 1);
+    {
+        NeighborhoodSearchTestData::RefPair searchPair(pair.refIndex(), sqrt(pair.distance2()));
+        EXPECT_TRUE(data.containsPair(0, searchPair));
+    }
 
-    pairSearch2.findNextPair(&pair);
+    ASSERT_TRUE(pairSearch2.findNextPair(&pair))
+    << "Test data did not contain any pairs for position 1 (problem in the test).";
     EXPECT_EQ(1, pair.testIndex());
-    EXPECT_TRUE(data.testPositions_[1].refPairs.count(pair.refIndex()) == 1);
+    {
+        NeighborhoodSearchTestData::RefPair searchPair(pair.refIndex(), sqrt(pair.distance2()));
+        EXPECT_TRUE(data.containsPair(1, searchPair));
+    }
+}
+
+TEST_F(NeighborhoodSearchTest, HandlesNoPBC)
+{
+    const NeighborhoodSearchTestData &data = TrivialNoPBCTestData::get();
+
+    nb_.setCutoff(data.cutoff_);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_, data.refPositions());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
+
+    testIsWithin(&search, data);
+    testMinimumDistance(&search, data);
+    testNearestPoint(&search, data);
+    testPairSearch(&search, data);
+}
+
+TEST_F(NeighborhoodSearchTest, HandlesNullPBC)
+{
+    const NeighborhoodSearchTestData &data = TrivialNoPBCTestData::get();
+
+    nb_.setCutoff(data.cutoff_);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(NULL, data.refPositions());
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
+
+    testIsWithin(&search, data);
+    testMinimumDistance(&search, data);
+    testNearestPoint(&search, data);
+    testPairSearch(&search, data);
 }
 
 TEST_F(NeighborhoodSearchTest, HandlesSkippingPairs)
@@ -542,10 +1055,51 @@ TEST_F(NeighborhoodSearchTest, HandlesSkippingPairs)
             ++currentIndex;
         }
         EXPECT_EQ(currentIndex, pair.testIndex());
-        EXPECT_TRUE(data.testPositions_[currentIndex].refPairs.count(pair.refIndex()) == 1);
+        NeighborhoodSearchTestData::RefPair searchPair(pair.refIndex(), sqrt(pair.distance2()));
+        EXPECT_TRUE(data.containsPair(currentIndex, searchPair));
         pairSearch.skipRemainingPairsForTestPosition();
         ++currentIndex;
     }
 }
 
+TEST_F(NeighborhoodSearchTest, SimpleSearchExclusions)
+{
+    const NeighborhoodSearchTestData &data = RandomBoxFullPBCData::get();
+
+    ExclusionsHelper                  helper(data.refPosCount_, data.testPositions_.size());
+    helper.generateExclusions();
+
+    nb_.setCutoff(data.cutoff_);
+    nb_.setTopologyExclusions(helper.exclusions());
+    nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Simple);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_,
+                       data.refPositions().exclusionIds(helper.refPosIds()));
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
+
+    testPairSearchFull(&search, data,
+                       data.testPositions().exclusionIds(helper.testPosIds()),
+                       helper.exclusions(), gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
+}
+
+TEST_F(NeighborhoodSearchTest, GridSearchExclusions)
+{
+    const NeighborhoodSearchTestData &data = RandomBoxFullPBCData::get();
+
+    ExclusionsHelper                  helper(data.refPosCount_, data.testPositions_.size());
+    helper.generateExclusions();
+
+    nb_.setCutoff(data.cutoff_);
+    nb_.setTopologyExclusions(helper.exclusions());
+    nb_.setMode(gmx::AnalysisNeighborhood::eSearchMode_Grid);
+    gmx::AnalysisNeighborhoodSearch search =
+        nb_.initSearch(&data.pbc_,
+                       data.refPositions().exclusionIds(helper.refPosIds()));
+    ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Grid, search.mode());
+
+    testPairSearchFull(&search, data,
+                       data.testPositions().exclusionIds(helper.testPosIds()),
+                       helper.exclusions(), gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
+}
+
 } // namespace
index ba2b25d52f41f3a40b27e17e10a944cd82cfafbb..1608a5b11b599847c823f1db12454413dfca30ca 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
+
+#include "gromacs/selection/poscalc.h"
 
 #include <vector>
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/vec.h"
+#include <gtest/gtest.h>
 
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/poscalc.h"
 #include "gromacs/selection/position.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/uniqueptr.h"
 
diff --git a/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupAll.xml b/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupAll.xml
new file mode 100644 (file)
index 0000000..eba5382
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <IndexMapping Name="Initialized">
+    <Sequence Name="Input">
+      <Int Name="Length">5</Int>
+      <Int>3</Int>
+      <Int>4</Int>
+      <Int>7</Int>
+      <Int>8</Int>
+      <Int>13</Int>
+    </Sequence>
+    <Int Name="Count">5</Int>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>3</Int>
+      </Sequence>
+      <Int Name="RefId">0</Int>
+      <Int Name="MapId">3</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>4</Int>
+      </Sequence>
+      <Int Name="RefId">1</Int>
+      <Int Name="MapId">4</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>7</Int>
+      </Sequence>
+      <Int Name="RefId">2</Int>
+      <Int Name="MapId">7</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>8</Int>
+      </Sequence>
+      <Int Name="RefId">3</Int>
+      <Int Name="MapId">8</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>13</Int>
+      </Sequence>
+      <Int Name="RefId">4</Int>
+      <Int Name="MapId">13</Int>
+    </Block>
+  </IndexMapping>
+  <OrgIdGroups Name="All">
+    <Int Name="GroupCount">1</Int>
+    <Sequence Name="OrgId">
+      <Int Name="Length">5</Int>
+      <Int>0</Int>
+      <Int>0</Int>
+      <Int>0</Int>
+      <Int>0</Int>
+      <Int>0</Int>
+    </Sequence>
+  </OrgIdGroups>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupAtom.xml b/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupAtom.xml
new file mode 100644 (file)
index 0000000..0e1c543
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <IndexMapping Name="Initialized">
+    <Sequence Name="Input">
+      <Int Name="Length">3</Int>
+      <Int>2</Int>
+      <Int>5</Int>
+      <Int>7</Int>
+    </Sequence>
+    <Int Name="Count">3</Int>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>2</Int>
+      </Sequence>
+      <Int Name="RefId">0</Int>
+      <Int Name="MapId">2</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>5</Int>
+      </Sequence>
+      <Int Name="RefId">1</Int>
+      <Int Name="MapId">5</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>7</Int>
+      </Sequence>
+      <Int Name="RefId">2</Int>
+      <Int Name="MapId">7</Int>
+    </Block>
+  </IndexMapping>
+  <OrgIdGroups Name="Atoms">
+    <Int Name="GroupCount">3</Int>
+    <Sequence Name="OrgId">
+      <Int Name="Length">3</Int>
+      <Int>0</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+    </Sequence>
+  </OrgIdGroups>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupMolecule.xml b/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupMolecule.xml
new file mode 100644 (file)
index 0000000..e211843
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <IndexMapping Name="Initialized">
+    <Sequence Name="Input">
+      <Int Name="Length">7</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+      <Int>3</Int>
+      <Int>4</Int>
+      <Int>7</Int>
+      <Int>8</Int>
+      <Int>13</Int>
+    </Sequence>
+    <Int Name="Count">4</Int>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">2</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+      </Sequence>
+      <Int Name="RefId">0</Int>
+      <Int Name="MapId">0</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+      </Sequence>
+      <Int Name="RefId">1</Int>
+      <Int Name="MapId">1</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">2</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+      </Sequence>
+      <Int Name="RefId">2</Int>
+      <Int Name="MapId">2</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>13</Int>
+      </Sequence>
+      <Int Name="RefId">3</Int>
+      <Int Name="MapId">4</Int>
+    </Block>
+  </IndexMapping>
+  <OrgIdGroups Name="Molecules">
+    <Int Name="GroupCount">3</Int>
+    <Sequence Name="OrgId">
+      <Int Name="Length">4</Int>
+      <Int>0</Int>
+      <Int>0</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+    </Sequence>
+  </OrgIdGroups>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupResidue.xml b/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupResidue.xml
new file mode 100644 (file)
index 0000000..99e092e
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <IndexMapping Name="Initialized">
+    <Sequence Name="Input">
+      <Int Name="Length">5</Int>
+      <Int>3</Int>
+      <Int>4</Int>
+      <Int>7</Int>
+      <Int>8</Int>
+      <Int>13</Int>
+    </Sequence>
+    <Int Name="Count">5</Int>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>3</Int>
+      </Sequence>
+      <Int Name="RefId">0</Int>
+      <Int Name="MapId">3</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>4</Int>
+      </Sequence>
+      <Int Name="RefId">1</Int>
+      <Int Name="MapId">4</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>7</Int>
+      </Sequence>
+      <Int Name="RefId">2</Int>
+      <Int Name="MapId">7</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>8</Int>
+      </Sequence>
+      <Int Name="RefId">3</Int>
+      <Int Name="MapId">8</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>13</Int>
+      </Sequence>
+      <Int Name="RefId">4</Int>
+      <Int Name="MapId">13</Int>
+    </Block>
+  </IndexMapping>
+  <OrgIdGroups Name="Residues">
+    <Int Name="GroupCount">3</Int>
+    <Sequence Name="OrgId">
+      <Int Name="Length">5</Int>
+      <Int>0</Int>
+      <Int>0</Int>
+      <Int>1</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+    </Sequence>
+  </OrgIdGroups>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupSingle.xml b/src/gromacs/selection/tests/refdata/IndexMapTest_InitializesOrgIdGroupSingle.xml
new file mode 100644 (file)
index 0000000..9d3ae3c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <IndexMapping Name="Initialized">
+    <Sequence Name="Input">
+      <Int Name="Length">5</Int>
+      <Int>3</Int>
+      <Int>4</Int>
+      <Int>7</Int>
+      <Int>8</Int>
+      <Int>13</Int>
+    </Sequence>
+    <Int Name="Count">3</Int>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+      </Sequence>
+      <Int Name="RefId">0</Int>
+      <Int Name="MapId">1</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">2</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+      </Sequence>
+      <Int Name="RefId">1</Int>
+      <Int Name="MapId">2</Int>
+    </Block>
+    <Block>
+      <Sequence Name="Atoms">
+        <Int Name="Length">1</Int>
+        <Int>13</Int>
+      </Sequence>
+      <Int Name="RefId">2</Int>
+      <Int Name="MapId">4</Int>
+    </Block>
+  </IndexMapping>
+  <OrgIdGroups Name="Single">
+    <Int Name="GroupCount">3</Int>
+    <Sequence Name="OrgId">
+      <Int Name="Length">3</Int>
+      <Int>0</Int>
+      <Int>1</Int>
+      <Int>2</Int>
+    </Sequence>
+  </OrgIdGroups>
+</ReferenceData>
index e0e5a09a4269d598b055ef049a34cbe1227e91dc..386a27253fdeab3ee549a577d2232cceea75f205 100644 (file)
       <Sequence Name="Atoms">
         <Int Name="Length">0</Int>
       </Sequence>
+      <Sequence Name="Positions">
+        <Int Name="Length">1</Int>
+        <Position>
+          <Int Name="RefId">0</Int>
+          <Int Name="MappedId">0</Int>
+        </Position>
+      </Sequence>
     </Selection>
   </CompiledSelections>
   <EvaluatedSelections Name="Frame1">
@@ -28,6 +35,8 @@
             <Real Name="Y">-2</Real>
             <Real Name="Z">3.5</Real>
           </Vector>
+          <Int Name="RefId">0</Int>
+          <Int Name="MappedId">0</Int>
         </Position>
       </Sequence>
     </Selection>
diff --git a/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesConstantPositionsWithModifiers.xml b/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesConstantPositionsWithModifiers.xml
new file mode 100644 (file)
index 0000000..24f59c6
--- /dev/null
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <ParsedSelections Name="Parsed">
+    <ParsedSelection Name="Selection1">
+      <String Name="Input">[0, 0, 0] plus [0, 1, 0]</String>
+      <String Name="Text">[0, 0, 0] plus [0, 1, 0]</String>
+      <Bool Name="Dynamic">false</Bool>
+    </ParsedSelection>
+  </ParsedSelections>
+  <CompiledSelections Name="Compiled">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">0</Int>
+      </Sequence>
+      <Sequence Name="Positions">
+        <Int Name="Length">2</Int>
+        <Position>
+          <Int Name="RefId">0</Int>
+          <Int Name="MappedId">0</Int>
+        </Position>
+        <Position>
+          <Int Name="RefId">1</Int>
+          <Int Name="MappedId">0</Int>
+        </Position>
+      </Sequence>
+    </Selection>
+  </CompiledSelections>
+  <EvaluatedSelections Name="Frame1">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">0</Int>
+      </Sequence>
+      <Sequence Name="Positions">
+        <Int Name="Length">2</Int>
+        <Position>
+          <Vector Name="Coordinates">
+            <Real Name="X">0</Real>
+            <Real Name="Y">0</Real>
+            <Real Name="Z">0</Real>
+          </Vector>
+          <Int Name="RefId">0</Int>
+          <Int Name="MappedId">0</Int>
+        </Position>
+        <Position>
+          <Vector Name="Coordinates">
+            <Real Name="X">0</Real>
+            <Real Name="Y">1</Real>
+            <Real Name="Z">0</Real>
+          </Vector>
+          <Int Name="RefId">1</Int>
+          <Int Name="MappedId">0</Int>
+        </Position>
+      </Sequence>
+    </Selection>
+  </EvaluatedSelections>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositions.xml b/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositions.xml
new file mode 100644 (file)
index 0000000..e728c55
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <ParsedSelections Name="Parsed">
+    <ParsedSelection Name="Selection1">
+      <String Name="Input">x &lt; y of cog of resnr 2</String>
+      <String Name="Text">x &lt; y of cog of resnr 2</String>
+      <Bool Name="Dynamic">true</Bool>
+    </ParsedSelection>
+  </ParsedSelections>
+  <CompiledSelections Name="Compiled">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">15</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+        <Int>9</Int>
+        <Int>10</Int>
+        <Int>11</Int>
+        <Int>12</Int>
+        <Int>13</Int>
+        <Int>14</Int>
+      </Sequence>
+    </Selection>
+  </CompiledSelections>
+  <EvaluatedSelections Name="Frame1">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">8</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+      </Sequence>
+    </Selection>
+  </EvaluatedSelections>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositionsInArithmetic.xml b/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositionsInArithmetic.xml
new file mode 100644 (file)
index 0000000..c012728
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <ParsedSelections Name="Parsed">
+    <ParsedSelection Name="Selection1">
+      <String Name="Input">x - y of cog of resnr 2 &lt; 0</String>
+      <String Name="Text">x - y of cog of resnr 2 &lt; 0</String>
+      <Bool Name="Dynamic">true</Bool>
+    </ParsedSelection>
+  </ParsedSelections>
+  <CompiledSelections Name="Compiled">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">15</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+        <Int>9</Int>
+        <Int>10</Int>
+        <Int>11</Int>
+        <Int>12</Int>
+        <Int>13</Int>
+        <Int>14</Int>
+      </Sequence>
+    </Selection>
+  </CompiledSelections>
+  <EvaluatedSelections Name="Frame1">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">8</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+      </Sequence>
+    </Selection>
+  </EvaluatedSelections>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesPositionModifiersForKeywords.xml b/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesPositionModifiersForKeywords.xml
new file mode 100644 (file)
index 0000000..d1c8f85
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <ParsedSelections Name="Parsed">
+    <ParsedSelection Name="Selection1">
+      <String Name="Input">res_cog x &gt; 2</String>
+      <String Name="Text">res_cog x &gt; 2</String>
+      <Bool Name="Dynamic">true</Bool>
+    </ParsedSelection>
+    <ParsedSelection Name="Selection2">
+      <String Name="Input">name CB and res_cog y &gt; 2.5</String>
+      <String Name="Text">name CB and res_cog y &gt; 2.5</String>
+      <Bool Name="Dynamic">true</Bool>
+    </ParsedSelection>
+  </ParsedSelections>
+  <CompiledSelections Name="Compiled">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">15</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+        <Int>9</Int>
+        <Int>10</Int>
+        <Int>11</Int>
+        <Int>12</Int>
+        <Int>13</Int>
+        <Int>14</Int>
+      </Sequence>
+    </Selection>
+    <Selection Name="Selection2">
+      <Sequence Name="Atoms">
+        <Int Name="Length">5</Int>
+        <Int>0</Int>
+        <Int>3</Int>
+        <Int>6</Int>
+        <Int>9</Int>
+        <Int>12</Int>
+      </Sequence>
+    </Selection>
+  </CompiledSelections>
+  <EvaluatedSelections Name="Frame1">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">9</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+        <Int>9</Int>
+        <Int>10</Int>
+        <Int>11</Int>
+        <Int>12</Int>
+        <Int>13</Int>
+        <Int>14</Int>
+      </Sequence>
+    </Selection>
+    <Selection Name="Selection2">
+      <Sequence Name="Atoms">
+        <Int Name="Length">2</Int>
+        <Int>6</Int>
+        <Int>9</Int>
+      </Sequence>
+    </Selection>
+  </EvaluatedSelections>
+</ReferenceData>
diff --git a/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesPositionModifiersForMethods.xml b/src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesPositionModifiersForMethods.xml
new file mode 100644 (file)
index 0000000..3624ef2
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <ParsedSelections Name="Parsed">
+    <ParsedSelection Name="Selection1">
+      <String Name="Input">res_cog distance from cog of resnr 1 &lt; 2</String>
+      <String Name="Text">res_cog distance from cog of resnr 1 &lt; 2</String>
+      <Bool Name="Dynamic">true</Bool>
+    </ParsedSelection>
+    <ParsedSelection Name="Selection2">
+      <String Name="Input">res_cog within 2 of cog of resnr 1</String>
+      <String Name="Text">res_cog within 2 of cog of resnr 1</String>
+      <Bool Name="Dynamic">true</Bool>
+    </ParsedSelection>
+  </ParsedSelections>
+  <CompiledSelections Name="Compiled">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">15</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+        <Int>9</Int>
+        <Int>10</Int>
+        <Int>11</Int>
+        <Int>12</Int>
+        <Int>13</Int>
+        <Int>14</Int>
+      </Sequence>
+    </Selection>
+    <Selection Name="Selection2">
+      <Sequence Name="Atoms">
+        <Int Name="Length">15</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+        <Int>9</Int>
+        <Int>10</Int>
+        <Int>11</Int>
+        <Int>12</Int>
+        <Int>13</Int>
+        <Int>14</Int>
+      </Sequence>
+    </Selection>
+  </CompiledSelections>
+  <EvaluatedSelections Name="Frame1">
+    <Selection Name="Selection1">
+      <Sequence Name="Atoms">
+        <Int Name="Length">9</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+      </Sequence>
+    </Selection>
+    <Selection Name="Selection2">
+      <Sequence Name="Atoms">
+        <Int Name="Length">9</Int>
+        <Int>0</Int>
+        <Int>1</Int>
+        <Int>2</Int>
+        <Int>3</Int>
+        <Int>4</Int>
+        <Int>5</Int>
+        <Int>6</Int>
+        <Int>7</Int>
+        <Int>8</Int>
+      </Sequence>
+    </Selection>
+  </EvaluatedSelections>
+</ReferenceData>
index 5c4cb5fedf1c08fb920c6c8626a0bb2df8a65e93..d26d2e2b18ff1d13c151e92af80d45a3e50887e4 100644 (file)
     </table>
 </xsl:template>
 
+<xsl:template match="OrgIdGroups">
+    <h2>Groups: <xsl:value-of select="@Name"/></h2>
+    <table>
+        <tr>
+            <td>Group count:</td>
+            <td><xsl:value-of select="Int[@Name='GroupCount']"/></td>
+        </tr>
+        <tr>
+            <td>OrgId</td>
+            <td>
+                <xsl:call-template name="SequenceAsCSV">
+                    <xsl:with-param name="root" select="Sequence[@Name='OrgId']"/>
+                </xsl:call-template>
+            </td>
+        </tr>
+    </table>
+</xsl:template>
+
 <!-- Position calculation reference data -->
 
 <xsl:template match="InitializedPositions">
index d299a2b56c2e110b334c0c66bf0069be7a0b111e..f17c17d2b3143ebe4b6bb9af1a9741ff65d454bc 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "gromacs/selection/selectioncollection.h"
+
 #include <gtest/gtest.h>
 
+#include "gromacs/fileio/trx.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/selection/indexutil.h"
-#include "gromacs/selection/selectioncollection.h"
 #include "gromacs/selection/selection.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/flags.h"
@@ -518,6 +523,27 @@ TEST_F(SelectionCollectionTest, HandlesUnsortedGroupReferenceDelayed)
     // EXPECT_THROW_GMX(sc_.compile(), gmx::APIError);
 }
 
+TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroup)
+{
+    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
+    ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
+    EXPECT_THROW_GMX(sc_.parseFromString("group \"GrpB\""), gmx::InconsistentInputError);
+}
+
+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);
+}
+
+TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed2)
+{
+    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
+    ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
+    EXPECT_THROW_GMX(loadIndexGroups("simple.ndx"), gmx::InconsistentInputError);
+}
+
 TEST_F(SelectionCollectionTest, RecoversFromMissingMoleculeInfo)
 {
     ASSERT_NO_THROW_GMX(sc_.parseFromString("molindex 1 to 5"));
@@ -561,7 +587,35 @@ TEST_F(SelectionCollectionTest, RecoversFromInvalidPermutation3)
     EXPECT_THROW_GMX(sc_.evaluate(frame_, NULL), gmx::InconsistentInputError);
 }
 
-// TODO: Tests for evaluation errors
+TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets)
+{
+    ASSERT_NO_THROW_GMX(sc_.parseFromString("atomnr 3 to 10"));
+    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_NO_THROW_GMX(sc_.compile());
+    frame_->natoms = 8;
+    EXPECT_THROW_GMX(sc_.evaluate(frame_, NULL), gmx::InconsistentInputError);
+}
+
+TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets2)
+{
+    // Evaluating the positions will require atoms 1-9.
+    ASSERT_NO_THROW_GMX(sc_.parseFromString("whole_res_com of atomnr 2 5 7"));
+    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_NO_THROW_GMX(sc_.compile());
+    frame_->natoms = 8;
+    EXPECT_THROW_GMX(sc_.evaluate(frame_, NULL), gmx::InconsistentInputError);
+}
+
+TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets3)
+{
+    ASSERT_NO_THROW_GMX(sc_.parseFromString("mindistance from atomnr 1 to 5 < 2"));
+    ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
+    ASSERT_NO_THROW_GMX(sc_.compile());
+    frame_->natoms = 10;
+    EXPECT_THROW_GMX(sc_.evaluate(frame_, NULL), gmx::InconsistentInputError);
+}
+
+// TODO: Tests for more evaluation errors
 
 
 /********************************************************************
@@ -974,12 +1028,25 @@ TEST_F(SelectionCollectionDataTest, HandlesUnsortedIndexGroupsInSelectionsDelaye
     ASSERT_NO_FATAL_FAILURE(runCompiler());
 }
 
+
 TEST_F(SelectionCollectionDataTest, HandlesConstantPositions)
 {
     static const char * const selections[] = {
         "[1, -2, 3.5]"
     };
-    setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates);
+    setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates
+             | efTestPositionMapping);
+    runTest("simple.gro", selections);
+}
+
+
+TEST_F(SelectionCollectionDataTest, HandlesConstantPositionsWithModifiers)
+{
+    static const char * const selections[] = {
+        "[0, 0, 0] plus [0, 1, 0]"
+    };
+    setFlags(TestFlags() | efTestEvaluation | efTestPositionCoordinates
+             | efTestPositionMapping);
     runTest("simple.gro", selections);
 }
 
@@ -1061,6 +1128,47 @@ TEST_F(SelectionCollectionDataTest, HandlesEmptySelectionWithUnevaluatedExpressi
 }
 
 
+TEST_F(SelectionCollectionDataTest, HandlesPositionModifiersForKeywords)
+{
+    static const char * const selections[] = {
+        "res_cog x > 2",
+        "name CB and res_cog y > 2.5"
+    };
+    setFlags(TestFlags() | efTestEvaluation);
+    runTest("simple.gro", selections);
+}
+
+
+TEST_F(SelectionCollectionDataTest, HandlesPositionModifiersForMethods)
+{
+    static const char * const selections[] = {
+        "res_cog distance from cog of resnr 1 < 2",
+        "res_cog within 2 of cog of resnr 1"
+    };
+    setFlags(TestFlags() | efTestEvaluation);
+    runTest("simple.gro", selections);
+}
+
+
+TEST_F(SelectionCollectionDataTest, HandlesKeywordOfPositions)
+{
+    static const char * const selections[] = {
+        "x < y of cog of resnr 2"
+    };
+    setFlags(TestFlags() | efTestEvaluation);
+    runTest("simple.gro", selections);
+}
+
+TEST_F(SelectionCollectionDataTest, HandlesKeywordOfPositionsInArithmetic)
+{
+    static const char * const selections[] = {
+        "x - y of cog of resnr 2 < 0"
+    };
+    setFlags(TestFlags() | efTestEvaluation);
+    runTest("simple.gro", selections);
+}
+
+
 TEST_F(SelectionCollectionDataTest, HandlesNumericComparisons)
 {
     static const char * const selections[] = {
index 4c464006905a2313c77200627d1b16c8e18b189c..8f3397cf430bc0a8c24c4747eda61281009b75fc 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
+#include "gromacs/selection/selectionoption.h"
+
 #include <gtest/gtest.h>
 
 #include "gromacs/options/options.h"
@@ -46,7 +50,6 @@
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectioncollection.h"
 #include "gromacs/selection/selectionfileoption.h"
-#include "gromacs/selection/selectionoption.h"
 #include "gromacs/selection/selectionoptionmanager.h"
 #include "gromacs/utility/exceptions.h"
 
@@ -69,7 +72,6 @@ class SelectionOptionTestBase : public ::testing::Test
     public:
         SelectionOptionTestBase();
 
-        void setManager();
         void loadTopology(const char *filename);
 
         gmx::SelectionCollection    sc_;
@@ -83,15 +85,11 @@ class SelectionOptionTestBase : public ::testing::Test
 SelectionOptionTestBase::SelectionOptionTestBase()
     : manager_(&sc_), options_(NULL, NULL)
 {
+    options_.addManager(&manager_);
     sc_.setReferencePosType("atom");
     sc_.setOutputPosType("atom");
 }
 
-void SelectionOptionTestBase::setManager()
-{
-    setManagerForSelectionOptions(&options_, &manager_);
-}
-
 void SelectionOptionTestBase::loadTopology(const char *filename)
 {
     topManager_.loadTopology(filename);
@@ -112,7 +110,6 @@ TEST_F(SelectionOptionTest, ParsesSimpleSelection)
     gmx::Selection sel;
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(SelectionOption("sel").store(&sel)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -132,7 +129,6 @@ TEST_F(SelectionOptionTest, HandlesDynamicSelectionWhenStaticRequired)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(&sel).onlyStatic()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -150,7 +146,6 @@ TEST_F(SelectionOptionTest, HandlesNonAtomicSelectionWhenAtomsRequired)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(&sel).onlyAtoms()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -171,7 +166,6 @@ TEST_F(SelectionOptionTest, ChecksEmptySelections)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(&sel)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -191,7 +185,6 @@ TEST_F(SelectionOptionTest, ChecksEmptyDelayedSelections)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(&sel)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -210,7 +203,6 @@ TEST_F(SelectionOptionTest, HandlesTooManySelections)
     gmx::Selection sel;
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(SelectionOption("sel").store(&sel)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -229,7 +221,6 @@ TEST_F(SelectionOptionTest, HandlesTooFewSelections)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(sel).valueCount(2)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -247,7 +238,6 @@ TEST_F(SelectionOptionTest, HandlesDefaultSelectionText)
     using gmx::SelectionOption;
     options_.addOption(SelectionOption("sel").store(&sel)
                            .defaultSelectionText("all"));
-    setManager();
 
     EXPECT_NO_THROW_GMX(options_.finish());
 
@@ -266,7 +256,6 @@ TEST_F(SelectionOptionTest, HandlesAdjuster)
     using gmx::SelectionOption;
     gmx::SelectionOptionInfo *info = options_.addOption(
                 SelectionOption("sel").storeVector(&sel).multiValue());
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -286,7 +275,6 @@ TEST_F(SelectionOptionTest, HandlesDynamicWhenStaticRequiredWithAdjuster)
     using gmx::SelectionOption;
     gmx::SelectionOptionInfo *info = options_.addOption(
                 SelectionOption("sel").store(&sel));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -305,7 +293,6 @@ TEST_F(SelectionOptionTest, HandlesTooManySelectionsWithAdjuster)
     using gmx::SelectionOption;
     gmx::SelectionOptionInfo *info = options_.addOption(
                 SelectionOption("sel").storeVector(&sel).multiValue());
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -325,7 +312,6 @@ TEST_F(SelectionOptionTest, HandlesTooFewSelectionsWithAdjuster)
     using gmx::SelectionOption;
     gmx::SelectionOptionInfo *info = options_.addOption(
                 SelectionOption("sel").storeVector(&sel).multiValue());
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -344,7 +330,6 @@ TEST_F(SelectionOptionTest, HandlesDelayedRequiredSelection)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(&sel).required()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -362,7 +347,6 @@ TEST_F(SelectionOptionTest, HandlesTooFewDelayedRequiredSelections)
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").store(sel).required()
                                     .valueCount(2)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -377,7 +361,6 @@ TEST_F(SelectionOptionTest, HandlesDelayedOptionalSelection)
     gmx::Selection sel;
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(SelectionOption("sel").store(&sel)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -396,7 +379,6 @@ TEST_F(SelectionOptionTest, HandlesDelayedSelectionWithAdjuster)
     using gmx::SelectionOption;
     gmx::SelectionOptionInfo *info = options_.addOption(
                 SelectionOption("sel").storeVector(&sel).valueCount(3));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -435,7 +417,6 @@ TEST_F(SelectionFileOptionTest, HandlesSingleSelectionOptionFromFile)
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("reqsel").storeVector(&reqsel)
                                     .multiValue().required()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -464,7 +445,6 @@ TEST_F(SelectionFileOptionTest, HandlesTwoSeparateSelectionOptions)
                                 SelectionOption("sel1").storeVector(&sel1).multiValue()));
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel2").storeVector(&sel2).multiValue()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     std::string          value(TestFileManager::getInputFilePath("selfile.dat"));
@@ -501,7 +481,6 @@ TEST_F(SelectionFileOptionTest, HandlesTwoSelectionOptionsFromSingleFile)
                                 SelectionOption("sel1").storeVector(&sel1)));
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel2").storeVector(&sel2)));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     std::string          value(TestFileManager::getInputFilePath("selfile.dat"));
@@ -535,7 +514,6 @@ TEST_F(SelectionFileOptionTest, HandlesRequiredOptionFromFile)
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("optsel").storeVector(&optsel)
                                     .multiValue()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -569,7 +547,6 @@ TEST_F(SelectionFileOptionTest, HandlesRequiredOptionFromFileWithOtherOptionSet)
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel2").storeVector(&sel2)
                                     .multiValue().required()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -600,7 +577,6 @@ TEST_F(SelectionFileOptionTest, HandlesTwoRequiredOptionsFromSingleFile)
                                 SelectionOption("sel1").storeVector(&sel1).required()));
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel2").storeVector(&sel2).required()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     std::string          value(TestFileManager::getInputFilePath("selfile.dat"));
@@ -625,7 +601,6 @@ TEST_F(SelectionFileOptionTest, GivesErrorWithNoFile)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").storeVector(&sel).multiValue()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -644,7 +619,6 @@ TEST_F(SelectionFileOptionTest, GivesErrorWithNonExistentFile)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").storeVector(&sel).multiValue()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
@@ -667,7 +641,6 @@ TEST_F(SelectionFileOptionTest, GivesErrorWithMultipleFiles)
     using gmx::SelectionOption;
     ASSERT_NO_THROW_GMX(options_.addOption(
                                 SelectionOption("sel").storeVector(&sel).multiValue()));
-    setManager();
 
     gmx::OptionsAssigner assigner(&options_);
     EXPECT_NO_THROW_GMX(assigner.start());
index 1e55142ee2bb5b49d6395e0646cbcc9f4a6b81cc..eff1e0c3560af5c52fd69eac7fbb3c92742a0655 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
+#include "gmxpre.h"
+
 #include "toputils.h"
 
 #include <cstring>
 
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/vec.h"
-
 #include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -172,7 +175,7 @@ void TopologyManager::initAtomTypes(int count, const char *const types[])
     atomtypes_.reserve(count);
     for (int i = 0; i < count; ++i)
     {
-        atomtypes_.push_back(strdup(types[i]));
+        atomtypes_.push_back(gmx_strdup(types[i]));
     }
     snew(top_->atoms.atomtype, top_->atoms.nr);
     for (int i = 0, j = 0; i < top_->atoms.nr; ++i, ++j)
index 94ab8c3139b3497f23a6fba70105a4ce5a103b1e..c5dec1c429f6da0a36d654c2a9abb94dc7af0155 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,7 +44,8 @@
 
 #include <vector>
 
-#include "gromacs/legacyheaders/typedefs.h"
+struct t_topology;
+struct t_trxframe;
 
 namespace gmx
 {
diff --git a/src/gromacs/simd/impl_arm_neon/impl_arm_neon.h b/src/gromacs/simd/impl_arm_neon/impl_arm_neon.h
new file mode 100644 (file)
index 0000000..59d99d6
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+#ifndef GMX_SIMD_IMPL_ARM_NEON_H
+#define GMX_SIMD_IMPL_ARM_NEON_H
+
+#include <math.h>
+
+#include <arm_neon.h>
+
+/* ARM 32-bit NEON SIMD instruction wrappers
+ *
+ * Please see documentation in gromacs/simd/simd.h for defines.
+ */
+
+/* Capability definitions for ARM 32-bit NEON */
+#define GMX_SIMD_HAVE_FLOAT
+#undef  GMX_SIMD_HAVE_DOUBLE
+#define GMX_SIMD_HAVE_HARDWARE
+#define GMX_SIMD_HAVE_LOADU
+#define GMX_SIMD_HAVE_STOREU
+#define GMX_SIMD_HAVE_LOGICAL
+#define GMX_SIMD_HAVE_FMA
+#undef  GMX_SIMD_HAVE_FRACTION
+#define GMX_SIMD_HAVE_FINT32
+#define GMX_SIMD_HAVE_FINT32_EXTRACT
+#define GMX_SIMD_HAVE_FINT32_LOGICAL
+#define GMX_SIMD_HAVE_FINT32_ARITHMETICS
+#undef  GMX_SIMD_HAVE_DINT32
+#undef  GMX_SIMD_HAVE_DINT32_EXTRACT
+#undef  GMX_SIMD_HAVE_DINT32_LOGICAL
+#undef  GMX_SIMD_HAVE_DINT32_ARITHMETICS
+#define GMX_SIMD4_HAVE_FLOAT
+#undef  GMX_SIMD4_HAVE_DOUBLE
+
+/* Implementation details */
+#define GMX_SIMD_FLOAT_WIDTH         4
+#undef  GMX_SIMD_DOUBLE_WIDTH
+#define GMX_SIMD_FINT32_WIDTH        4
+#undef  GMX_SIMD_DINT32_WIDTH
+#define GMX_SIMD_RSQRT_BITS          8
+#define GMX_SIMD_RCP_BITS            8
+
+/****************************************************
+ *      SINGLE PRECISION SIMD IMPLEMENTATION        *
+ ****************************************************/
+#define gmx_simd_float_t           float32x4_t
+#define gmx_simd_load_f            vld1q_f32
+#define gmx_simd_load1_f           vld1q_dup_f32
+#define gmx_simd_set1_f            vdupq_n_f32
+#define gmx_simd_store_f           vst1q_f32
+#define gmx_simd_loadu_f           vld1q_f32
+#define gmx_simd_storeu_f          vst1q_f32
+#define gmx_simd_setzero_f()       vdupq_n_f32(0.0f)
+#define gmx_simd_add_f             vaddq_f32
+#define gmx_simd_sub_f             vsubq_f32
+#define gmx_simd_mul_f             vmulq_f32
+#ifdef __ARM_FEATURE_FMA
+#    define gmx_simd_fmadd_f(a, b, c)  vfmaq_f32(c, b, a)
+#    define gmx_simd_fmsub_f(a, b, c)  vnegq_f32(vfmsq_f32(c, b, a))
+#    define gmx_simd_fnmadd_f(a, b, c) vfmaq_f32(c, b, a)
+#    define gmx_simd_fnmsub_f(a, b, c) vnegq_f32(vfmaq_f32(c, b, a))
+#else
+#    define gmx_simd_fmadd_f(a, b, c)  vmlaq_f32(c, b, a)
+#    define gmx_simd_fmsub_f(a, b, c)  vnegq_f32(vmlsq_f32(c, b, a))
+#    define gmx_simd_fnmadd_f(a, b, c) vmlsq_f32(c, b, a)
+#    define gmx_simd_fnmsub_f(a, b, c) vnegq_f32(vmlaq_f32(c, b, a))
+#endif
+#define gmx_simd_and_f(a, b)        vreinterpretq_f32_s32(vandq_s32(vreinterpretq_s32_f32(a), vreinterpretq_s32_f32(b)))
+#define gmx_simd_andnot_f(a, b)     vreinterpretq_f32_s32(vbicq_s32(vreinterpretq_s32_f32(b), vreinterpretq_s32_f32(a)))
+#define gmx_simd_or_f(a, b)         vreinterpretq_f32_s32(vorrq_s32(vreinterpretq_s32_f32(a), vreinterpretq_s32_f32(b)))
+#define gmx_simd_xor_f(a, b)        vreinterpretq_f32_s32(veorq_s32(vreinterpretq_s32_f32(a), vreinterpretq_s32_f32(b)))
+#define gmx_simd_rsqrt_f            vrsqrteq_f32
+#define gmx_simd_rsqrt_iter_f(lu, x) vmulq_f32(lu, vrsqrtsq_f32(vmulq_f32(lu, lu), x))
+#define gmx_simd_rcp_f              vrecpeq_f32
+#define gmx_simd_rcp_iter_f(lu, x)   vmulq_f32(lu, vrecpsq_f32(lu, x))
+#define gmx_simd_fabs_f(x)         vabsq_f32(x)
+#define gmx_simd_fneg_f(x)         vnegq_f32(x)
+#define gmx_simd_max_f             vmaxq_f32
+#define gmx_simd_min_f             vminq_f32
+#define gmx_simd_round_f(x)        gmx_simd_cvt_i2f(gmx_simd_cvt_f2i(x))
+#define gmx_simd_trunc_f(x)        gmx_simd_cvt_i2f(gmx_simd_cvtt_f2i(x))
+#define gmx_simd_fraction_f(x)     vsubq_f32(x, gmx_simd_trunc_f(x))
+#define gmx_simd_get_exponent_f    gmx_simd_get_exponent_f_arm_neon
+#define gmx_simd_get_mantissa_f    gmx_simd_get_mantissa_f_arm_neon
+#define gmx_simd_set_exponent_f    gmx_simd_set_exponent_f_arm_neon
+/* integer datatype corresponding to float: gmx_simd_fint32_t */
+#define gmx_simd_fint32_t         int32x4_t
+#define gmx_simd_load_fi(m)        vld1q_s32(m)
+#define gmx_simd_set1_fi           vdupq_n_s32
+#define gmx_simd_store_fi(m, x)    vst1q_s32(m, x)
+#define gmx_simd_loadu_fi(m)       vld1q_s32(m)
+#define gmx_simd_storeu_fi(m, x)   vst1q_s32(m, x)
+#define gmx_simd_setzero_fi()      vdupq_n_s32(0)
+#define gmx_simd_cvtt_f2i          vcvtq_s32_f32
+#define gmx_simd_cvt_f2i(x)        vcvtq_s32_f32(gmx_simd_add_f(gmx_simd_or_f(gmx_simd_and_f(vdupq_n_f32(-0.0f), x), vdupq_n_f32(0.5f)), x))
+#define gmx_simd_cvt_i2f           vcvtq_f32_s32
+#define gmx_simd_extract_fi(x, i)  vgetq_lane_s32(x, i)
+/* Integer logical ops on gmx_simd_fint32_t */
+#define gmx_simd_slli_fi           vshlq_n_s32
+#define gmx_simd_srli_fi           vshrq_n_s32
+#define gmx_simd_and_fi            vandq_s32
+#define gmx_simd_andnot_fi(a, b)   vbicq_s32(b, a)
+#define gmx_simd_or_fi             vorrq_s32
+#define gmx_simd_xor_fi            veorq_s32
+/* Integer arithmetic ops on gmx_simd_fint32_t */
+#define gmx_simd_add_fi            vaddq_s32
+#define gmx_simd_sub_fi            vsubq_s32
+#define gmx_simd_mul_fi            vmulq_s32
+/* Boolean & comparison operations on gmx_simd_float_t */
+#define gmx_simd_fbool_t           uint32x4_t
+#define gmx_simd_cmpeq_f           vceqq_f32
+#define gmx_simd_cmplt_f           vcltq_f32
+#define gmx_simd_cmple_f           vcleq_f32
+#define gmx_simd_and_fb            vandq_u32
+#define gmx_simd_or_fb             vorrq_u32
+#define gmx_simd_anytrue_fb        gmx_simd_anytrue_fb_arm_neon
+#define gmx_simd_blendzero_f(a, sel)     vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(a), sel))
+#define gmx_simd_blendnotzero_f(a, sel)  vreinterpretq_f32_u32(vbicq_u32(vreinterpretq_u32_f32(a), sel))
+#define gmx_simd_blendv_f(a, b, sel)     vbslq_f32(sel, b, a)
+#define gmx_simd_reduce_f(a)       gmx_simd_reduce_f_arm_neon(a)
+/* Boolean & comparison operations on gmx_simd_fint32_t */
+#define gmx_simd_fibool_t          uint32x4_t
+#define gmx_simd_cmpeq_fi          vceqq_s32
+#define gmx_simd_cmplt_fi          vcltq_s32
+#define gmx_simd_and_fib           vandq_u32
+#define gmx_simd_or_fib            vorrq_u32
+#define gmx_simd_anytrue_fib       gmx_simd_anytrue_fb
+#define gmx_simd_blendzero_fi(a, sel)     vandq_s32(a, vreinterpretq_s32_u32(sel))
+#define gmx_simd_blendnotzero_fi(a, sel)  vbicq_s32(a, vreinterpretq_s32_u32(sel))
+#define gmx_simd_blendv_fi(a, b, sel)     vbslq_s32(sel, b, a)
+/* Conversions between different booleans */
+#define gmx_simd_cvt_fb2fib(x)     (x)
+#define gmx_simd_cvt_fib2fb(x)     (x)
+
+/****************************************************
+ *     NO DOUBLE PRECISION SIMD AVAILABLE           *
+ ****************************************************/
+
+
+/****************************************************
+ * SINGLE PRECISION IMPLEMENTATION HELPER FUNCTIONS *
+ ****************************************************/
+static gmx_inline gmx_simd_float_t
+gmx_simd_get_exponent_f_arm_neon(gmx_simd_float_t x)
+{
+    const float32x4_t expmask    = vreinterpretq_f32_s32( vdupq_n_s32(0x7F800000) );
+    int32x4_t         iexp;
+
+    iexp = vreinterpretq_s32_f32(gmx_simd_and_f(x, expmask));
+    iexp = vsubq_s32(vshrq_n_s32(iexp, 23), vdupq_n_s32(127));
+    return vcvtq_f32_s32(iexp);
+}
+
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_get_mantissa_f_arm_neon(gmx_simd_float_t x)
+{
+    const float32x4_t mantmask   = vreinterpretq_f32_s32( vdupq_n_s32(0x007FFFFF) );
+    const float32x4_t one        = vdupq_n_f32(1.0f);
+
+    /* Get mantissa */
+    x = gmx_simd_and_f(mantmask, x);
+    /* Reset zero (but correctly biased) exponent */
+    return gmx_simd_or_f(x, one);
+}
+
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_set_exponent_f_arm_neon(gmx_simd_float_t x)
+{
+    int32x4_t  iexp = gmx_simd_cvt_f2i(x);
+
+    iexp = vshlq_n_s32(vaddq_s32(iexp, vdupq_n_s32(127)), 23);
+    return vreinterpretq_f32_s32(iexp);
+}
+
+static gmx_inline float
+gmx_simd_reduce_f_arm_neon(gmx_simd_float_t a)
+{
+    float32x4_t b = vextq_f32(a, a, 2);
+
+    a = vaddq_f32(a, b);
+    b = vextq_f32(a, a, 1);
+    a = vaddq_f32(a, b);
+    return vgetq_lane_f32(a, 0);
+}
+
+static gmx_inline int
+gmx_simd_anytrue_fb_arm_neon(gmx_simd_fbool_t a)
+{
+    uint32x4_t b = vextq_u32(a, a, 2);
+
+    a = gmx_simd_or_fb(a, b);
+    b = vextq_u32(a, a, 1);
+    a = gmx_simd_or_fb(a, b);
+    return (vgetq_lane_u32(a, 0) != 0);
+}
+
+
+/* ARM 32-bit Neon is already 4-wide in single, so just reuse float type for SIMD4 */
+#define gmx_simd4_float_t                gmx_simd_float_t
+#define gmx_simd4_load_f                 gmx_simd_load_f
+#define gmx_simd4_load1_f                gmx_simd_load1_f
+#define gmx_simd4_set1_f                 gmx_simd_set1_f
+#define gmx_simd4_store_f                gmx_simd_store_f
+#define gmx_simd4_loadu_f                gmx_simd_loadu_f
+#define gmx_simd4_storeu_f               gmx_simd_storeu_f
+#define gmx_simd4_setzero_f              gmx_simd_setzero_f
+#define gmx_simd4_add_f                  gmx_simd_add_f
+#define gmx_simd4_sub_f                  gmx_simd_sub_f
+#define gmx_simd4_mul_f                  gmx_simd_mul_f
+#define gmx_simd4_fmadd_f                gmx_simd_fmadd_f
+#define gmx_simd4_fmsub_f                gmx_simd_fmsub_f
+#define gmx_simd4_fnmadd_f               gmx_simd_fnmadd_f
+#define gmx_simd4_fnmsub_f               gmx_simd_fnmsub_f
+#define gmx_simd4_and_f                  gmx_simd_and_f
+#define gmx_simd4_andnot_f               gmx_simd_andnot_f
+#define gmx_simd4_or_f                   gmx_simd_or_f
+#define gmx_simd4_xor_f                  gmx_simd_xor_f
+#define gmx_simd4_rsqrt_f                gmx_simd_rsqrt_f
+#define gmx_simd4_fabs_f                 gmx_simd_fabs_f
+#define gmx_simd4_fneg_f                 gmx_simd_fneg_f
+#define gmx_simd4_max_f                  gmx_simd_max_f
+#define gmx_simd4_min_f                  gmx_simd_min_f
+#define gmx_simd4_round_f                gmx_simd_round_f
+#define gmx_simd4_trunc_f                gmx_simd_trunc_f
+#define gmx_simd4_dotproduct3_f          gmx_simd4_dotproduct3_f_arm_neon
+#define gmx_simd4_fbool_t                gmx_simd_fbool_t
+#define gmx_simd4_cmpeq_f                gmx_simd_cmpeq_f
+#define gmx_simd4_cmplt_f                gmx_simd_cmplt_f
+#define gmx_simd4_cmple_f                gmx_simd_cmple_f
+#define gmx_simd4_and_fb                 gmx_simd_and_fb
+#define gmx_simd4_or_fb                  gmx_simd_or_fb
+#define gmx_simd4_anytrue_fb             gmx_simd_anytrue_fb
+#define gmx_simd4_blendzero_f            gmx_simd_blendzero_f
+#define gmx_simd4_blendnotzero_f         gmx_simd_blendnotzero_f
+#define gmx_simd4_blendv_f               gmx_simd_blendv_f
+#define gmx_simd4_reduce_f               gmx_simd_reduce_f
+
+/* SIMD4 Dotproduct helper function */
+static gmx_inline float
+gmx_simd4_dotproduct3_f_arm_neon(gmx_simd_float_t a, gmx_simd_float_t b)
+{
+    gmx_simd_float_t  c;
+    c = gmx_simd_mul_f(a, b);
+    /* set 4th element to 0, then add all of them */
+    c = vsetq_lane_f32(0.0f, c, 3);
+    return gmx_simd_reduce_f_arm_neon(c);
+}
+
+#endif /* GMX_SIMD_IMPL_ARM_NEON_H */
diff --git a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd.h b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd.h
new file mode 100644 (file)
index 0000000..609354a
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+#ifndef GMX_SIMD_IMPL_ARM_NEON_ASIMD_H
+#define GMX_SIMD_IMPL_ARM_NEON_ASIMD_H
+
+#include <math.h>
+
+#include <arm_neon.h>
+
+/* ARM (AArch64) NEON Advanced SIMD instruction wrappers
+ *
+ * Please see documentation in gromacs/simd/simd.h for defines.
+ */
+
+/* Inherit single-precision and integer part from 32-bit arm */
+#include "gromacs/simd/impl_arm_neon/impl_arm_neon.h"
+
+/* Override some capability definitions from ARM 32-bit NEON - we now have double */
+#define GMX_SIMD_HAVE_DOUBLE
+#define GMX_SIMD_HAVE_DINT32
+#define GMX_SIMD_HAVE_DINT32_EXTRACT
+#define GMX_SIMD_HAVE_DINT32_LOGICAL
+#define GMX_SIMD_HAVE_DINT32_ARITHMETICS
+
+/* Implementation details */
+#define GMX_SIMD_DOUBLE_WIDTH        2
+#define GMX_SIMD_DINT32_WIDTH        2
+
+/* NEON ASIMD always has FMA support, so make sure we use that for single too. */
+#undef  gmx_simd_fmadd_f
+#define gmx_simd_fmadd_f(a, b, c)  vfmaq_f32(c, b, a)
+#undef  gmx_simd_fmsub_f
+#define gmx_simd_fmsub_f(a, b, c)  vnegq_f32(vfmsq_f32(c, b, a))
+#undef  gmx_simd_fnmadd_f
+#define gmx_simd_fnmadd_f(a, b, c) vfmsq_f32(c, b, a)
+#undef  gmx_simd_fnmsub_f
+#define gmx_simd_fnmsub_f(a, b, c) vnegq_f32(vfmaq_f32(c, b, a))
+
+/* The rounding instructions were actually added already in ARMv8, but most
+ * compilers did not add intrinsics for them. Make sure we use them for single
+ * precision too when enabling NEON Advanced SIMD.
+ */
+#undef  gmx_simd_round_f
+#define gmx_simd_round_f(x)        vrndnq_f32(x)
+#undef  gmx_simd_trunc_f
+#define gmx_simd_trunc_f(x)        vrndq_f32(x)
+
+/* NEON Advanced SIMD has a real rounding conversion instruction */
+#undef  gmx_simd_cvt_f2i
+#define gmx_simd_cvt_f2i(x)        vcvtnq_s32_f32(x)
+
+/* Since we redefine rounding/conversion-with-rounding, make
+ * sure we use the new operations by redefining the routine
+ * to set the exponent too.
+ */
+#undef  gmx_simd_set_exponent_f
+#define gmx_simd_set_exponent_f    gmx_simd_set_exponent_f_arm_neon_asimd
+
+/* We can do more efficient reduce with vector pairwise arithmetic */
+#undef  gmx_simd_reduce_f
+#define gmx_simd_reduce_f(a)       gmx_simd_reduce_f_arm_neon_asimd(a)
+
+/* Pick the largest unsigned integer as a shortcut for any-true */
+#undef  gmx_simd_anytrue_fb
+#define gmx_simd_anytrue_fb(x)     (vmaxvq_u32(x) != 0)
+#undef  gmx_simd_anytrue_fib
+#define gmx_simd_anytrue_fib(x)    (vmaxvq_u32(x) != 0)
+
+/* gcc-4.8 is missing the proper vreinterpretq casts
+ * for 64-bit operands. However, since these datatypes
+ * are opaque to the compiler we can safely cast one
+ * to the other without any conversion happening.
+ */
+
+/****************************************************
+ *      DOUBLE PRECISION SIMD IMPLEMENTATION        *
+ ****************************************************/
+#define gmx_simd_double_t          float64x2_t
+#define gmx_simd_load_d            vld1q_f64
+#define gmx_simd_load1_d           vld1q_dup_f64
+#define gmx_simd_set1_d            vdupq_n_f64
+#define gmx_simd_store_d           vst1q_f64
+#define gmx_simd_loadu_d           vld1q_f64
+#define gmx_simd_storeu_d          vst1q_f64
+#define gmx_simd_setzero_d()       vdupq_n_f64(0.0)
+#define gmx_simd_add_d             vaddq_f64
+#define gmx_simd_sub_d             vsubq_f64
+#define gmx_simd_mul_d             vmulq_f64
+#define gmx_simd_fmadd_d(a, b, c)  vfmaq_f64(c, b, a)
+#define gmx_simd_fmsub_d(a, b, c)  vnegq_f64(vfmsq_f64(c, b, a))
+#define gmx_simd_fnmadd_d(a, b, c) vfmsq_f64(c, b, a)
+#define gmx_simd_fnmsub_d(a, b, c) vnegq_f64(vfmaq_f64(c, b, a))
+#define gmx_simd_and_d(a, b)        (float64x2_t)(vandq_s64((int64x2_t)(a), (int64x2_t)(b)))
+#define gmx_simd_andnot_d(a, b)     (float64x2_t)(vbicq_s64((int64x2_t)(b), (int64x2_t)(a)))
+#define gmx_simd_or_d(a, b)         (float64x2_t)(vorrq_s64((int64x2_t)(a), (int64x2_t)(b)))
+#define gmx_simd_xor_d(a, b)        (float64x2_t)(veorq_s64((int64x2_t)(a), (int64x2_t)(b)))
+#define gmx_simd_rsqrt_d            vrsqrteq_f64
+#define gmx_simd_rsqrt_iter_d(lu, x) vmulq_f64(lu, vrsqrtsq_f64(vmulq_f64(lu, lu), x))
+#define gmx_simd_rcp_d              vrecpeq_f64
+#define gmx_simd_rcp_iter_d(lu, x)   vmulq_f64(lu, vrecpsq_f64(lu, x))
+#define gmx_simd_fabs_d(x)         vabsq_f64(x)
+#define gmx_simd_fneg_d(x)         vnegq_f64(x)
+#define gmx_simd_max_d             vmaxq_f64
+#define gmx_simd_min_d             vminq_f64
+#define gmx_simd_round_d(x)        vrndnq_f64(x)
+#define gmx_simd_trunc_d(x)        vrndq_f64(x)
+#define gmx_simd_fraction_d(x)     vsubq_f64(x, gmx_simd_trunc_d(x))
+#define gmx_simd_get_exponent_d    gmx_simd_get_exponent_d_arm_neon_asimd
+#define gmx_simd_get_mantissa_d    gmx_simd_get_mantissa_d_arm_neon_asimd
+#define gmx_simd_set_exponent_d    gmx_simd_set_exponent_d_arm_neon_asimd
+/* integer datatype corresponding to double: gmx_simd_dint32_t */
+#define gmx_simd_dint32_t          int32x2_t
+#define gmx_simd_load_di(m)        vld1_s32(m)
+#define gmx_simd_set1_di           vdup_n_s32
+#define gmx_simd_store_di(m, x)    vst1_s32(m, x)
+#define gmx_simd_loadu_di(m)       vld1_s32(m)
+#define gmx_simd_storeu_di(m, x)   vst1_s32(m, x)
+#define gmx_simd_setzero_di()      vdup_n_s32(0)
+#define gmx_simd_cvtt_d2i(x)       vmovn_s64(vcvtq_s64_f64(x))
+#define gmx_simd_cvt_d2i(x)        vmovn_s64(vcvtnq_s64_f64(x))
+#define gmx_simd_cvt_i2d(x)        vcvtq_f64_s64(vmovl_s32(x))
+#define gmx_simd_extract_di(x, i)  vget_lane_s32(x, i)
+/* Integer logical ops on gmx_simd_dint32_t */
+#define gmx_simd_slli_di           vshl_n_s32
+#define gmx_simd_srli_di           vshr_n_s32
+#define gmx_simd_and_di            vand_s32
+#define gmx_simd_andnot_di(a, b)    vbic_s32(b, a)
+#define gmx_simd_or_di             vorr_s32
+#define gmx_simd_xor_di            veor_s32
+/* Integer arithmetic ops on gmx_simd_dint32_t */
+#define gmx_simd_add_di            vadd_s32
+#define gmx_simd_sub_di            vsub_s32
+#define gmx_simd_mul_di            vmul_s32
+/* Boolean & comparison operations on gmx_simd_double_t */
+#define gmx_simd_dbool_t           uint64x2_t
+#define gmx_simd_cmpeq_d           vceqq_f64
+#define gmx_simd_cmplt_d           vcltq_f64
+#define gmx_simd_cmple_d           vcleq_f64
+#define gmx_simd_and_db            vandq_u64
+#define gmx_simd_or_db             vorrq_u64
+#define gmx_simd_anytrue_db(x)     (vmaxvq_u32((uint32x4_t)(x)) != 0)
+#define gmx_simd_blendzero_d(a, sel)     (float64x2_t)(vandq_u64((uint64x2_t)(a), sel))
+#define gmx_simd_blendnotzero_d(a, sel)  (float64x2_t)(vbicq_u64((uint64x2_t)(a), sel))
+#define gmx_simd_blendv_d(a, b, sel)     vbslq_f64(sel, b, a)
+#define gmx_simd_reduce_d(a)       gmx_simd_reduce_d_arm_neon_asimd(a)
+/* Boolean & comparison operations on gmx_simd_dint32_t */
+#define gmx_simd_dibool_t          uint32x2_t
+#define gmx_simd_cmpeq_di          vceq_s32
+#define gmx_simd_cmplt_di          vclt_s32
+#define gmx_simd_and_dib           vand_u32
+#define gmx_simd_or_dib            vorr_u32
+#define gmx_simd_anytrue_dib(x)    (vmaxv_u32(x) != 0)
+#define gmx_simd_blendzero_di(a, sel)      vand_s32(a, vreinterpret_s32_u32(sel))
+#define gmx_simd_blendnotzero_di(a, sel)  vbic_s32(a, vreinterpret_s32_u32(sel))
+#define gmx_simd_blendv_di(a, b, sel)     vbsl_s32(sel, b, a)
+/* Conversions between different booleans */
+#define gmx_simd_cvt_db2dib(x)     vqmovn_u64(x)
+#define gmx_simd_cvt_dib2db(x)     vorrq_u64(vmovl_u32(x), vshlq_n_u64(vmovl_u32(x), 32))
+
+/* Float/double conversion */
+#define gmx_simd_cvt_f2dd(f, d0, d1)  { *d0 = vcvt_f64_f32(vget_low_f32(f)); *d1 = vcvt_high_f64_f32(f); }
+#define gmx_simd_cvt_dd2f(d0, d1)     vcvt_high_f32_f64(vcvt_f32_f64(d0), d1)
+
+/****************************************************
+ * SINGLE PRECISION IMPLEMENTATION HELPER FUNCTIONS *
+ ****************************************************/
+static gmx_inline gmx_simd_float_t
+gmx_simd_set_exponent_f_arm_neon_asimd(gmx_simd_float_t x)
+{
+    int32x4_t  iexp = vcvtnq_s32_f32(x);
+
+    iexp = vshlq_n_s32(vaddq_s32(iexp, vdupq_n_s32(127)), 23);
+    return vreinterpretq_f32_s32(iexp);
+}
+
+static gmx_inline float
+gmx_simd_reduce_f_arm_neon_asimd(gmx_simd_float_t a)
+{
+    a = vpaddq_f32(a, a);
+    a = vpaddq_f32(a, a);
+    return vgetq_lane_f32(a, 0);
+}
+
+
+/****************************************************
+ * DOUBLE PRECISION IMPLEMENTATION HELPER FUNCTIONS *
+ ****************************************************/
+static gmx_inline gmx_simd_double_t
+gmx_simd_get_exponent_d_arm_neon_asimd(gmx_simd_double_t x)
+{
+    const float64x2_t expmask    = (float64x2_t)( vdupq_n_s64(0x7FF0000000000000LL) );
+    int64x2_t         iexp;
+
+    iexp = (int64x2_t)(gmx_simd_and_d(x, expmask));
+    iexp = vsubq_s64(vshrq_n_s64(iexp, 52), vdupq_n_s64(1023));
+    return vcvtq_f64_s64(iexp);
+}
+
+
+static gmx_inline gmx_simd_double_t
+gmx_simd_get_mantissa_d_arm_neon_asimd(gmx_simd_double_t x)
+{
+    const float64x2_t mantmask   = (float64x2_t)( vdupq_n_s64(0x000FFFFFFFFFFFFFLL) );
+    const float64x2_t one        = vdupq_n_f64(1.0);
+
+    /* Get mantissa */
+    x = gmx_simd_and_d(mantmask, x);
+    /* Reset zero (but correctly biased) exponent */
+    return gmx_simd_or_d(x, one);
+}
+
+
+static gmx_inline gmx_simd_double_t
+gmx_simd_set_exponent_d_arm_neon_asimd(gmx_simd_double_t x)
+{
+    int64x2_t  iexp = vcvtnq_s64_f64(x);
+
+    iexp = vshlq_n_s64(vaddq_s64(iexp, vdupq_n_s64(1023)), 52);
+    return (float64x2_t)(iexp);
+}
+
+static gmx_inline double
+gmx_simd_reduce_d_arm_neon_asimd(gmx_simd_double_t a)
+{
+    a = vpaddq_f64(a, a);
+    return vgetq_lane_f64(a, 0);
+}
+
+#endif /* GMX_SIMD_IMPL_ARM_NEON_ASIMD_H */
index 63bce3c895f676d31b270d7ff96d2de699911ee7..ebbf77aec775e79d548a95f2313bd88c1351da83 100644 (file)
@@ -41,6 +41,8 @@
 #include <qpxmath.h>
 #endif
 
+#include "config.h"
+
 /* IBM QPX SIMD instruction wrappers
  *
  * Please see documentation in gromacs/simd/simd.h for the available
diff --git a/src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx.h b/src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx.h
new file mode 100644 (file)
index 0000000..810a134
--- /dev/null
@@ -0,0 +1,360 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+#ifndef GMX_SIMD_IMPLEMENTATION_IBM_VMX_H
+#define GMX_SIMD_IMPLEMENTATION_IBM_VMX_H
+
+#include <math.h>
+
+#include <altivec.h>
+
+/* Make sure we do not screw up c++ - undefine vector/bool, and rely on __vector and __bool */
+#undef vector
+#undef bool
+
+/* IBM VMX SIMD instruction wrappers. Power6 and later.
+ *
+ * Please see documentation in gromacs/simd/simd.h for the available
+ * defines.
+ */
+/* Capability definitions for IBM VMX */
+#define GMX_SIMD_HAVE_FLOAT
+#undef  GMX_SIMD_HAVE_DOUBLE
+#define GMX_SIMD_HAVE_HARDWARE
+#undef  GMX_SIMD_HAVE_LOADU
+#undef  GMX_SIMD_HAVE_STOREU
+#define GMX_SIMD_HAVE_LOGICAL
+/* VMX only provides fmadd/fnmadd (our definitions), but not fmsub/fnmsub.
+ * However, fnmadd is what we need for 1/sqrt(x).
+ */
+#define GMX_SIMD_HAVE_FMA
+#undef  GMX_SIMD_HAVE_FRACTION
+#define GMX_SIMD_HAVE_FINT32
+#undef  GMX_SIMD_HAVE_FINT32_EXTRACT
+#define GMX_SIMD_HAVE_FINT32_LOGICAL
+#define GMX_SIMD_HAVE_FINT32_ARITHMETICS
+#undef  GMX_SIMD_HAVE_DINT32
+#undef  GMX_SIMD_HAVE_DINT32_EXTRACT
+#undef  GMX_SIMD_HAVE_DINT32_LOGICAL
+#undef  GMX_SIMD_HAVE_DINT32_ARITHMETICS
+#define GMX_SIMD4_HAVE_FLOAT
+#undef  GMX_SIMD4_HAVE_DOUBLE
+
+/* Implementation details */
+#define GMX_SIMD_FLOAT_WIDTH         4
+#undef  GMX_SIMD_DOUBLE_WIDTH
+#define GMX_SIMD_FINT32_WIDTH        4
+#undef  GMX_SIMD_DINT32_WIDTH
+#define GMX_SIMD_RSQRT_BITS         14
+#define GMX_SIMD_RCP_BITS           14
+
+/****************************************************
+ *      SINGLE PRECISION SIMD IMPLEMENTATION        *
+ ****************************************************/
+#define gmx_simd_float_t           __vector float
+#define gmx_simd_load_f(m)         vec_ld(0, (const __vector float *)m)
+#define gmx_simd_load1_f(m)        gmx_simd_load1_f_ibm_vmx(m)
+#define gmx_simd_set1_f(x)         gmx_simd_set1_f_ibm_vmx(x)
+#define gmx_simd_store_f(m, x)     vec_st(x, 0, (__vector float *)m)
+#undef  gmx_simd_loadu_f
+#undef  gmx_simd_storeu_f
+#define gmx_simd_setzero_f()       ((__vector float)vec_splat_u32(0))
+#define gmx_simd_add_f(a, b)       vec_add(a, b)
+#define gmx_simd_sub_f(a, b)       vec_sub(a, b)
+#define gmx_simd_mul_f(a, b)       vec_mul(a, b)
+#define gmx_simd_fmadd_f(a, b, c)  vec_madd(a, b, c)
+#define gmx_simd_fmsub_f(a, b, c)  vec_sub(vec_mul(a, b), c)
+/* IBM uses an alternative FMA definition, so -a*b+c=-(a*b-c) is "nmsub" */
+#define gmx_simd_fnmadd_f(a, b, c) vec_nmsub(a, b, c)
+/* IBM uses an alternative FMA definition, so -a*b-c=-(a*b+c) is "nmadd" */
+#define gmx_simd_fnmsub_f(a, b, c) vec_sub(gmx_simd_setzero_f(), vec_madd(a, b, c))
+#define gmx_simd_and_f(a, b)       vec_and(a, b)
+#define gmx_simd_andnot_f(a, b)    vec_andc(b, a)
+#define gmx_simd_or_f(a, b)        vec_or(a, b)
+#define gmx_simd_xor_f(a, b)       vec_xor(a, b)
+#define gmx_simd_rsqrt_f(a)        vec_rsqrte(a)
+#define gmx_simd_rcp_f(a)          vec_re(a)
+#define gmx_simd_fabs_f(a)         vec_abs(a)
+#define gmx_simd_fneg_f(a)         vec_xor(a, (__vector float)vec_sl(vec_splat_u32(-1), vec_splat_u32(-1)))
+#define gmx_simd_max_f(a, b)       vec_max(a, b)
+#define gmx_simd_min_f(a, b)       vec_min(a, b)
+#define gmx_simd_round_f(a)        vec_round(a)
+#define gmx_simd_trunc_f(a)        vec_trunc(a)
+#define gmx_simd_fraction_f(x)     vec_sub(x, vec_trunc(x))
+#define gmx_simd_get_exponent_f(a) gmx_simd_get_exponent_f_ibm_vmx(a)
+#define gmx_simd_get_mantissa_f(a) gmx_simd_get_mantissa_f_ibm_vmx(a)
+#define gmx_simd_set_exponent_f(a) gmx_simd_set_exponent_f_ibm_vmx(a)
+/* integer datatype corresponding to float: gmx_simd_fint32_t */
+#define gmx_simd_fint32_t          __vector int
+#define gmx_simd_load_fi(m)        vec_ld(0, (const __vector int *)m)
+#define gmx_simd_set1_fi(i)        gmx_simd_set1_fi_ibm_vmx((int)i)
+#define gmx_simd_store_fi(m, x)    vec_st(x, 0, (__vector int *)m)
+#undef  gmx_simd_loadu_fi
+#undef  gmx_simd_storeu_fi
+#define gmx_simd_setzero_fi()      vec_splat_s32(0)
+#define gmx_simd_cvt_f2i(a)        vec_cts(vec_round(a), 0)
+#define gmx_simd_cvtt_f2i(a)       vec_cts(a, 0)
+#define gmx_simd_cvt_i2f(a)        vec_ctf(a, 0)
+#undef  gmx_simd_extract_fi
+/* Integer logical ops on gmx_simd_fint32_t */
+/* The shift constant magic requires an explanation:
+ * VMX only allows literals up to 15 to be created directly with vec_splat_u32,
+ * and we need to be able to shift up to 31 bits. The code on the right hand
+ * side splits the constant in three parts with values in the range 0..15.
+ * Since the argument has to be a constant (but our and VMX requirement), these
+ * constants will be evaluated at compile-time, and if one or two parts evaluate
+ * to zero they will be removed with -O2 or higher optimization (checked).
+ */
+#define gmx_simd_slli_fi(a, i)      vec_sl(a, vec_add(vec_add(vec_splat_u32( (((i&0xF)+(i/16))&0xF)+i/31 ), vec_splat_u32( (i/16)*15 )), vec_splat_u32( (i/31)*15 )))
+#define gmx_simd_srli_fi(a, i)      vec_sr(a, vec_add(vec_add(vec_splat_u32( (((i&0xF)+(i/16))&0xF)+i/31 ), vec_splat_u32( (i/16)*15 )), vec_splat_u32( (i/31)*15 )))
+#define gmx_simd_and_fi(a, b)       vec_and(a, b)
+#define gmx_simd_andnot_fi(a, b)   vec_andc(b, a)
+#define gmx_simd_or_fi(a, b)        vec_or(a, b)
+#define gmx_simd_xor_fi(a, b)       vec_xor(a, b)
+/* Integer arithmetic ops on gmx_simd_fint32_t */
+#define gmx_simd_add_fi(a, b)       vec_add(a, b)
+#define gmx_simd_sub_fi(a, b)       vec_sub(a, b)
+#define gmx_simd_mul_fi(a, b)       vec_mule((__vector short)a, (__vector short)b)
+/* Boolean & comparison operations on gmx_simd_float_t */
+#define gmx_simd_fbool_t           __vector __bool int
+#define gmx_simd_cmpeq_f(a, b)     vec_cmpeq(a, b)
+#define gmx_simd_cmplt_f(a, b)     vec_cmplt(a, b)
+#define gmx_simd_cmple_f(a, b)     vec_cmple(a, b)
+#define gmx_simd_and_fb(a, b)      vec_and(a, b)
+#define gmx_simd_or_fb(a, b)       vec_or(a, b)
+#define gmx_simd_anytrue_fb(a)     vec_any_ne(a, (__vector __bool int)vec_splat_u32(0))
+#define gmx_simd_blendzero_f(a, sel)    vec_and(a, (__vector float)sel)
+#define gmx_simd_blendnotzero_f(a, sel) vec_andc(a, (__vector float)sel)
+#define gmx_simd_blendv_f(a, b, sel)    vec_sel(a, b, sel)
+#define gmx_simd_reduce_f(a)       gmx_simd_reduce_f_ibm_vmx(a)
+/* Boolean & comparison operations on gmx_simd_fint32_t */
+#define gmx_simd_fibool_t          __vector __bool int
+#define gmx_simd_cmpeq_fi(a, b)     vec_cmpeq(a, b)
+#define gmx_simd_cmplt_fi(a, b)     vec_cmplt(a, b)
+#define gmx_simd_and_fib(a, b)      vec_and(a, b)
+#define gmx_simd_or_fib(a, b)       vec_or(a, b)
+#define gmx_simd_anytrue_fib(a)          vec_any_ne(a, (__vector __bool int)vec_splat_u32(0))
+#define gmx_simd_blendzero_fi(a, sel)    vec_and(a, (__vector int)sel)
+#define gmx_simd_blendnotzero_fi(a, sel) vec_andc(a, (__vector int)sel)
+#define gmx_simd_blendv_fi(a, b, sel)    vec_sel(a, b, sel)
+/* Conversions between different booleans */
+#define gmx_simd_cvt_fb2fib(x)     (x)
+#define gmx_simd_cvt_fib2fb(x)     (x)
+
+/* Double is not available with VMX SIMD */
+
+/****************************************************
+ * IMPLEMENTATION HELPER FUNCTIONS                  *
+ ****************************************************/
+static gmx_inline gmx_simd_float_t
+gmx_simd_set1_f_ibm_vmx(const float x)
+{
+    /* In the old days when PPC was all big endian we could
+     * use the vec_lvsl() instruction to permute bytes based on
+     * a load adress. However, at least with gcc-4.8.2 the bytes
+     * end up reversed on Power8 running little endian (Linux).
+     * Since this is not a critical instruction we work around
+     * it by first putting the data in an aligned position before
+     * loading, so we can avoid vec_lvsl() entirely. We can
+     * do this slightly faster on GCC with alignment attributes.
+     */
+    __vector float vx;
+#ifdef __GNUC__
+    float alignedx __attribute ((aligned (16)));
+    alignedx = x;
+    vx       = vec_lde(0, &alignedx);
+#else
+    struct {
+        vector float vx; float x[4];
+    } conv;
+    conv.x[0] = x;
+    vx        = vec_lde(0, conv.x);
+#endif
+    return vec_splat(vx, 0);
+}
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_load1_f_ibm_vmx(const float * m)
+{
+    return gmx_simd_set1_f_ibm_vmx(*m);
+}
+
+static gmx_inline gmx_simd_fint32_t
+gmx_simd_set1_fi_ibm_vmx(const int x)
+{
+    /* See comment in gmx_simd_set1_f_ibm_vmx why we
+     * cannot use vec_lvsl().
+     */
+    __vector int vx;
+#ifdef __GNUC__
+    int alignedx __attribute ((aligned (16)));
+    alignedx = x;
+    vx       = vec_lde(0, &alignedx);
+#else
+    struct {
+        vector int vx; int x[4];
+    } conv;
+    conv.x[0] = x;
+    vx        = vec_lde(0, conv.x);
+#endif
+    return vec_splat(vx, 0);
+}
+
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_get_exponent_f_ibm_vmx(gmx_simd_float_t x)
+{
+    /* Generate 0x7F800000 without memory operations */
+    gmx_simd_float_t     expmask = (__vector float)gmx_simd_slli_fi(vec_add(vec_splat_s32(15), vec_sl(vec_splat_s32(15), vec_splat_u32(4))), 23);
+    gmx_simd_fint32_t    i127    = vec_sub(vec_sl(vec_splat_s32(1), vec_splat_u32(7)), vec_splat_s32(1));
+    gmx_simd_fint32_t    iexp;
+
+    iexp = (__vector int)gmx_simd_and_f(x, expmask);
+    iexp = vec_sub(gmx_simd_srli_fi(iexp, 23), i127);
+    return vec_ctf(iexp, 0);
+}
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_get_mantissa_f_ibm_vmx(gmx_simd_float_t x)
+{
+    gmx_simd_float_t     expmask = (__vector float)gmx_simd_slli_fi(vec_add(vec_splat_s32(15), vec_sl(vec_splat_s32(15), vec_splat_u32(4))), 23);
+
+    /* Get mantissa. By taking the absolute value (to get rid of the sign bit) we can
+     * use the same mask as for gmx_simd_get_exponent_f() (but complement it). Since
+     * these two routines are typically called together, this will save a few operations.
+     */
+    x = gmx_simd_andnot_f(expmask, vec_abs(x));
+    /* Reset zero (but correctly biased) exponent */
+    return gmx_simd_or_f(x, vec_ctf(vec_splat_s32(1), 0));
+}
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_set_exponent_f_ibm_vmx(gmx_simd_float_t x)
+{
+    gmx_simd_fint32_t  iexp = gmx_simd_cvt_f2i(x);
+    gmx_simd_fint32_t  i127 = vec_sub(vec_sl(vec_splat_s32(1), vec_splat_u32(7)), vec_splat_s32(1));
+
+    iexp = gmx_simd_slli_fi(vec_add(iexp, i127), 23);
+    return (__vector float)iexp;
+}
+
+static gmx_inline float
+gmx_simd_reduce_f_ibm_vmx(gmx_simd_float_t x)
+{
+    float res;
+    x = vec_add(x, vec_sld(x, x, 8));
+    x = vec_add(x, vec_sld(x, x, 4));
+    vec_ste(x, 0, &res);
+    return res;
+}
+
+
+
+/* SINGLE */
+#define gmx_simd4_float_t                gmx_simd_float_t
+#define gmx_simd4_load_f                 gmx_simd_load_f
+#define gmx_simd4_load1_f                gmx_simd_load1_f
+#define gmx_simd4_set1_f                 gmx_simd_set1_f
+#define gmx_simd4_store_f                gmx_simd_store_f
+#define gmx_simd4_loadu_f                gmx_simd_loadu_f
+#define gmx_simd4_storeu_f               gmx_simd_storeu_f
+#define gmx_simd4_setzero_f              gmx_simd_setzero_f
+#define gmx_simd4_add_f                  gmx_simd_add_f
+#define gmx_simd4_sub_f                  gmx_simd_sub_f
+#define gmx_simd4_mul_f                  gmx_simd_mul_f
+#define gmx_simd4_fmadd_f                gmx_simd_fmadd_f
+#define gmx_simd4_fmsub_f                gmx_simd_fmsub_f
+#define gmx_simd4_fnmadd_f               gmx_simd_fnmadd_f
+#define gmx_simd4_fnmsub_f               gmx_simd_fnmsub_f
+#define gmx_simd4_and_f                  gmx_simd_and_f
+#define gmx_simd4_andnot_f               gmx_simd_andnot_f
+#define gmx_simd4_or_f                   gmx_simd_or_f
+#define gmx_simd4_xor_f                  gmx_simd_xor_f
+#define gmx_simd4_rsqrt_f                gmx_simd_rsqrt_f
+#define gmx_simd4_rcp_f                  gmx_simd_rcp_f
+#define gmx_simd4_fabs_f                 gmx_simd_fabs_f
+#define gmx_simd4_fneg_f                 gmx_simd_fneg_f
+#define gmx_simd4_max_f                  gmx_simd_max_f
+#define gmx_simd4_min_f                  gmx_simd_min_f
+#define gmx_simd4_round_f                gmx_simd_round_f
+#define gmx_simd4_trunc_f                gmx_simd_trunc_f
+#define gmx_simd4_fraction_f             gmx_simd_fraction_f
+#define gmx_simd4_get_exponent_f         gmx_simd_get_exponent_f
+#define gmx_simd4_get_mantissa_f         gmx_simd_get_mantissa_f
+#define gmx_simd4_set_exponent_f         gmx_simd_set_exponent_f
+#define gmx_simd4_dotproduct3_f          gmx_simd4_dotproduct3_f_ibm_vmx
+#define gmx_simd4_fint32_t               gmx_simd_fint32_t
+#define gmx_simd4_load_fi                gmx_simd_load_fi
+#define gmx_simd4_load1_fi               gmx_simd_load1_fi
+#define gmx_simd4_set1_fi                gmx_simd_set1_fi
+#define gmx_simd4_store_fi               gmx_simd_store_fi
+#define gmx_simd4_loadu_fi               gmx_simd_loadu_fi
+#define gmx_simd4_storeu_fi              gmx_simd_storeu_fi
+#define gmx_simd4_setzero_fi             gmx_simd_setzero_fi
+#define gmx_simd4_cvt_f2i                gmx_simd_cvt_f2i
+#define gmx_simd4_cvtt_f2i               gmx_simd_cvtt_f2i
+#define gmx_simd4_cvt_i2f                gmx_simd_cvt_i2f
+#define gmx_simd4_fbool_t                gmx_simd_fbool_t
+#define gmx_simd4_cmpeq_f                gmx_simd_cmpeq_f
+#define gmx_simd4_cmplt_f                gmx_simd_cmplt_f
+#define gmx_simd4_cmple_f                gmx_simd_cmple_f
+#define gmx_simd4_and_fb                 gmx_simd_and_fb
+#define gmx_simd4_or_fb                  gmx_simd_or_fb
+#define gmx_simd4_anytrue_fb             gmx_simd_anytrue_fb
+#define gmx_simd4_blendzero_f            gmx_simd_blendzero_f
+#define gmx_simd4_blendnotzero_f         gmx_simd_blendnotzero_f
+#define gmx_simd4_blendv_f               gmx_simd_blendv_f
+#define gmx_simd4_reduce_f               gmx_simd_reduce_f
+
+static gmx_inline float
+gmx_simd4_dotproduct3_f_ibm_vmx(gmx_simd4_float_t a, gmx_simd4_float_t b)
+{
+    gmx_simd4_float_t c = vec_mul(a, b);
+    /* Keep only elements 0,1,2 by shifting in zero from right */
+    c = vec_sld(c, gmx_simd_setzero_f(), 4);
+    /* calculate sum */
+    return gmx_simd_reduce_f_ibm_vmx(c);
+}
+
+/* Function to check whether SIMD operations have resulted in overflow.
+ * For now, this is unfortunately a dummy for this architecture.
+ */
+static int
+gmx_simd_check_and_reset_overflow(void)
+{
+    return 0;
+}
+
+#endif /* GMX_SIMD_IMPLEMENTATION_IBM_VMX_H */
diff --git a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx.h b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx.h
new file mode 100644 (file)
index 0000000..4430e58
--- /dev/null
@@ -0,0 +1,631 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+#ifndef GMX_SIMD_IMPLEMENTATION_IBM_VSX_H
+#define GMX_SIMD_IMPLEMENTATION_IBM_VSX_H
+
+#include <math.h>
+
+#include <altivec.h>
+
+/* IBM VSX SIMD instruction wrappers. Power7 and later.
+ *
+ * While this instruction set is similar to VMX, there are quite a few differences
+ * that make it easier to understand if we start from scratch rather than by
+ * including the VMX implementation and changing lots of things.
+ */
+
+
+/* Make sure we do not screw up c++ - undefine vector/bool, and rely on __vector,
+ * which is present both on gcc and xlc.
+ */
+#undef vector
+
+/* g++ is also unhappy with the clash of vector bool and the C++ reserved 'bool',
+ * which is solved by undefining bool and reyling on __bool. However, that does
+ * not work with xlc, which requires us to use bool. Solve the conflict by
+ * defining a new vsx_bool.
+ */
+#ifdef __GNUC__
+#    define vsx_bool __bool
+#    undef  bool
+#else
+#    define vsx_bool bool
+#endif
+
+/* Since we've had to use quite a few compiler and endian defines in this code
+ * it might not 'just work' when e.g. clang provides VSX support. If you are
+ * reading this because you saw the error below for a new compiler, try removing
+ * the checks, but then make sure you run 'make test'.
+ */
+#if !(defined __GNUC__) && !(defined __IBMC__) && !(defined __IBMCPP__)
+#    error VSX acceleration is very compiler-dependent, and only tested for gcc & xlc.
+#endif
+
+#if !(defined __BIG_ENDIAN__) && !(defined __LITTLE_ENDIAN__)
+#    error VSX platform not recognized - both gcc & xlc should define big or little endian!
+#endif
+
+/* Capability definitions for IBM VSX */
+#define GMX_SIMD_HAVE_FLOAT
+#define GMX_SIMD_HAVE_DOUBLE
+#define GMX_SIMD_HAVE_HARDWARE
+#define GMX_SIMD_HAVE_LOADU
+#define GMX_SIMD_HAVE_STOREU
+#define GMX_SIMD_HAVE_LOGICAL
+#define GMX_SIMD_HAVE_FMA
+#undef  GMX_SIMD_HAVE_FRACTION
+#define GMX_SIMD_HAVE_FINT32
+#define GMX_SIMD_HAVE_FINT32_EXTRACT
+#define GMX_SIMD_HAVE_FINT32_LOGICAL
+#define GMX_SIMD_HAVE_FINT32_ARITHMETICS
+#define GMX_SIMD_HAVE_DINT32
+#define GMX_SIMD_HAVE_DINT32_EXTRACT
+#define GMX_SIMD_HAVE_DINT32_LOGICAL
+#define GMX_SIMD_HAVE_DINT32_ARITHMETICS
+#define GMX_SIMD4_HAVE_FLOAT
+#undef  GMX_SIMD4_HAVE_DOUBLE
+
+/* 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_SIMD_RSQRT_BITS         14
+#define GMX_SIMD_RCP_BITS           14
+
+/****************************************************
+ *      SINGLE PRECISION SIMD IMPLEMENTATION        *
+ ****************************************************/
+#define gmx_simd_float_t           __vector float
+#ifdef __GNUC__
+#    define gmx_simd_load_f(m)     vec_vsx_ld(0, (const float *)m)
+#    define gmx_simd_store_f(m, x) vec_vsx_st(x, 0, (float *)m)
+#else
+/* IBM xlC */
+#    define gmx_simd_load_f(m)     vec_xlw4(0, (float *)(m))
+#    define gmx_simd_store_f(m, x) vec_xstw4(x, 0, (float *)(m))
+#endif
+#define gmx_simd_load1_f(m)        vec_splats((float)(*m))
+#define gmx_simd_set1_f(x)         vec_splats((float)(x))
+#define gmx_simd_loadu_f           gmx_simd_load_f
+#define gmx_simd_storeu_f          gmx_simd_store_f
+#define gmx_simd_setzero_f()       vec_splats(0.0f)
+#define gmx_simd_add_f(a, b)       vec_add(a, b)
+#define gmx_simd_sub_f(a, b)       vec_sub(a, b)
+#define gmx_simd_mul_f(a, b)       vec_mul(a, b)
+#define gmx_simd_fmadd_f(a, b, c)  vec_madd(a, b, c)
+#define gmx_simd_fmsub_f(a, b, c)  vec_msub(a, b, c)
+/* IBM uses an alternative FMA definition, so -a*b+c=-(a*b-c) is "nmsub" */
+#define gmx_simd_fnmadd_f(a, b, c) vec_nmsub(a, b, c)
+/* IBM uses an alternative FMA definition, so -a*b-c=-(a*b+c) is "nmadd" */
+#define gmx_simd_fnmsub_f(a, b, c) vec_nmadd(a, b, c)
+#define gmx_simd_and_f(a, b)       vec_and(a, b)
+#define gmx_simd_andnot_f(a, b)    vec_andc(b, a)
+#define gmx_simd_or_f(a, b)        vec_or(a, b)
+#define gmx_simd_xor_f(a, b)       vec_xor(a, b)
+#define gmx_simd_rsqrt_f(a)        vec_rsqrte(a)
+#define gmx_simd_rcp_f(a)          vec_re(a)
+#define gmx_simd_fabs_f(a)         vec_abs(a)
+#ifdef __GNUC__
+/* gcc up to at least version 4.9 is missing intrinsics for vec_neg(), use inline asm. */
+#    define gmx_simd_fneg_f(a)     ({ __vector float res; __asm__ ("xvnegsp %0,%1" : \
+                                                                   "=ww" ((__vector float)res) : "ww" ((__vector float)(a))); res; })
+#else
+/* IBM xlC */
+#    define gmx_simd_fneg_f(a)     vec_neg(a)
+#endif
+#define gmx_simd_max_f(a, b)       vec_max(a, b)
+#define gmx_simd_min_f(a, b)       vec_min(a, b)
+#define gmx_simd_round_f(a)        vec_round(a)
+#define gmx_simd_trunc_f(a)        vec_trunc(a)
+#define gmx_simd_fraction_f(x)     vec_sub(x, vec_trunc(x))
+#define gmx_simd_get_exponent_f(a) gmx_simd_get_exponent_f_ibm_vsx(a)
+#define gmx_simd_get_mantissa_f(a) gmx_simd_get_mantissa_f_ibm_vsx(a)
+#define gmx_simd_set_exponent_f(a) gmx_simd_set_exponent_f_ibm_vsx(a)
+/* integer datatype corresponding to float: gmx_simd_fint32_t */
+#define gmx_simd_fint32_t          __vector signed int
+#ifdef __GNUC__
+#    define gmx_simd_load_fi(m)     vec_vsx_ld(0, (const int *)m)
+#    define gmx_simd_store_fi(m, x) vec_vsx_st(x, 0, (int *)m)
+#else
+/* IBM xlC */
+#    define gmx_simd_load_fi(m)     vec_xlw4(0, (int *)m)
+#    define gmx_simd_store_fi(m, x) vec_xstw4(x, 0, (int *)m)
+#endif
+#define gmx_simd_set1_fi(i)        vec_splats((int)(i))
+#define gmx_simd_loadu_fi          gmx_simd_load_fi
+#define gmx_simd_storeu_fi         gmx_simd_store_fi
+#define gmx_simd_setzero_fi()      vec_splats((int)0)
+#define gmx_simd_cvt_f2i(a)        vec_cts(vec_round(a), 0)
+#define gmx_simd_cvtt_f2i(a)       vec_cts(a, 0)
+#define gmx_simd_cvt_i2f(a)        vec_ctf(a, 0)
+#define gmx_simd_extract_fi(a, i)   gmx_simd_extract_fi_ibm_vsx(a, i)
+/* Integer logical ops on gmx_simd_fint32_t */
+#define gmx_simd_slli_fi(a, i)      vec_sl(a, vec_splats((unsigned int)i))
+#define gmx_simd_srli_fi(a, i)      vec_sr(a, vec_splats((unsigned int)i))
+#define gmx_simd_and_fi(a, b)       vec_and(a, b)
+#define gmx_simd_andnot_fi(a, b)    vec_andc(b, a)
+#define gmx_simd_or_fi(a, b)        vec_or(a, b)
+#define gmx_simd_xor_fi(a, b)       vec_xor(a, b)
+/* Integer arithmetic ops on gmx_simd_fint32_t */
+#define gmx_simd_add_fi(a, b)       vec_add(a, b)
+#define gmx_simd_sub_fi(a, b)       vec_sub(a, b)
+#ifdef __GNUC__
+/* gcc-4.9 does not provide vec_mul() for integers */
+#    ifdef __BIG_ENDIAN__
+#        define gmx_simd_mul_fi(a, b)   vec_mulo((__vector short)a, (__vector short)b)
+#    else
+#        define gmx_simd_mul_fi(a, b)   vec_mule((__vector short)a, (__vector short)b)
+#    endif
+#else
+/* IBM xlC */
+#    define gmx_simd_mul_fi(a, b)   vec_mul(a, b)
+#endif
+/* Boolean & comparison operations on gmx_simd_float_t */
+#define gmx_simd_fbool_t           __vector vsx_bool int
+#define gmx_simd_cmpeq_f(a, b)     vec_cmpeq(a, b)
+#define gmx_simd_cmplt_f(a, b)     vec_cmplt(a, b)
+#define gmx_simd_cmple_f(a, b)     vec_cmple(a, b)
+#define gmx_simd_and_fb(a, b)      vec_and(a, b)
+#define gmx_simd_or_fb(a, b)       vec_or(a, b)
+#define gmx_simd_anytrue_fb(a)     vec_any_ne(a, (__vector vsx_bool int)vec_splats(0))
+#define gmx_simd_blendzero_f(a, sel)    vec_and(a, (__vector float)sel)
+#define gmx_simd_blendnotzero_f(a, sel) vec_andc(a, (__vector float)sel)
+#define gmx_simd_blendv_f(a, b, sel)    vec_sel(a, b, sel)
+#define gmx_simd_reduce_f(a)       gmx_simd_reduce_f_ibm_vsx(a)
+/* Boolean & comparison operations on gmx_simd_fint32_t */
+#define gmx_simd_fibool_t          __vector vsx_bool int
+#define gmx_simd_cmpeq_fi(a, b)    vec_cmpeq(a, b)
+#define gmx_simd_cmplt_fi(a, b)    vec_cmplt(a, b)
+#define gmx_simd_and_fib(a, b)     vec_and(a, b)
+#define gmx_simd_or_fib(a, b)      vec_or(a, b)
+#define gmx_simd_anytrue_fib(a)          vec_any_ne(a, (__vector vsx_bool int)vec_splats(0))
+#define gmx_simd_blendzero_fi(a, sel)    vec_and(a, (__vector signed int)sel)
+#define gmx_simd_blendnotzero_fi(a, sel) vec_andc(a, (__vector signed int)sel)
+#define gmx_simd_blendv_fi(a, b, sel)    vec_sel(a, b, sel)
+/* Conversions between different booleans */
+#define gmx_simd_cvt_fb2fib(x)     (x)
+#define gmx_simd_cvt_fib2fb(x)     (x)
+
+/****************************************************
+ *      DOUBLE PRECISION SIMD IMPLEMENTATION        *
+ ****************************************************/
+#define gmx_simd_double_t          __vector double
+#ifdef __GNUC__
+#    define gmx_simd_load_d(m)      vec_vsx_ld(0, (const __vector double *)(m))
+#    define gmx_simd_store_d(m, x)  vec_vsx_st(x, 0, (__vector double *)(m))
+#else
+/* IBM xlC */
+#    define gmx_simd_load_d(m)      vec_xld2(0, (double *)(m))
+#    define gmx_simd_store_d(m, x)  vec_xstd2(x, 0, (double *)(m))
+#endif
+#define gmx_simd_load1_d(m)        vec_splats((double)(*m))
+#define gmx_simd_set1_d(x)         vec_splats((double)(x))
+#define gmx_simd_loadu_d           gmx_simd_load_d
+#define gmx_simd_storeu_d          gmx_simd_store_d
+#define gmx_simd_setzero_d()       vec_splats(0.0)
+#define gmx_simd_add_d(a, b)       vec_add(a, b)
+#define gmx_simd_sub_d(a, b)       vec_sub(a, b)
+#define gmx_simd_mul_d(a, b)       vec_mul(a, b)
+#define gmx_simd_fmadd_d(a, b, c)  vec_madd(a, b, c)
+#define gmx_simd_fmsub_d(a, b, c)  vec_msub(a, b, c)
+/* IBM uses an alternative FMA definition, so -a*b+c=-(a*b-c) is "nmsub" */
+#define gmx_simd_fnmadd_d(a, b, c) vec_nmsub(a, b, c)
+/* IBM uses an alternative FMA definition, so -a*b-c=-(a*b+c) is "nmadd" */
+#define gmx_simd_fnmsub_d(a, b, c) vec_nmadd(a, b, c)
+#define gmx_simd_and_d(a, b)       vec_and(a, b)
+#define gmx_simd_andnot_d(a, b)    vec_andc(b, a)
+#define gmx_simd_or_d(a, b)        vec_or(a, b)
+#define gmx_simd_xor_d(a, b)       vec_xor(a, b)
+#define gmx_simd_rsqrt_d(a)        vec_rsqrte(a)
+#define gmx_simd_rcp_d(a)          vec_re(a)
+#define gmx_simd_fabs_d(a)         vec_abs(a)
+#ifdef __GNUC__
+/* gcc up to at least version 4.9 is missing intrinsics for vec_neg(), use inline asm. */
+#    define gmx_simd_fneg_d(a)     ({ __vector double res; __asm__ ("xvnegdp %0,%1" : \
+                                                                    "=ww" (res) : "ww" ((__vector double) (a))); res; })
+#else
+/* IBM xlC */
+#    define gmx_simd_fneg_d(a)     vec_neg(a)
+#endif
+#define gmx_simd_max_d(a, b)       vec_max(a, b)
+#define gmx_simd_min_d(a, b)       vec_min(a, b)
+#ifdef __GNUC__
+/* gcc up to at least version 4.9 does not support vec_round() in double precision. */
+#    define gmx_simd_round_d(a)     ({ __vector double res; __asm__ ("xvrdpi %0,%1" : \
+                                                                     "=ww" (res) : "ww" ((__vector double) (a))); res; })
+#else
+/* IBM xlC */
+#    define gmx_simd_round_d(a)        vec_round(a)
+#endif
+#define gmx_simd_trunc_d(a)        vec_trunc(a)
+#define gmx_simd_fraction_d(x)     vec_sub(x, vec_trunc(x))
+#define gmx_simd_get_exponent_d(a) gmx_simd_get_exponent_d_ibm_vsx(a)
+#define gmx_simd_get_mantissa_d(a) gmx_simd_get_mantissa_d_ibm_vsx(a)
+#define gmx_simd_set_exponent_d(a) gmx_simd_set_exponent_d_ibm_vsx(a)
+/* integer datatype corresponding to double: gmx_simd_dint32_t */
+#define gmx_simd_dint32_t          __vector signed int
+#define gmx_simd_load_di(m)        gmx_simd_load_di_ibm_vsx(m)
+#define gmx_simd_store_di(m, x)    gmx_simd_store_di_ibm_vsx(m, x)
+#define gmx_simd_set1_di(i)        vec_splats((int)(i))
+#define gmx_simd_loadu_di          gmx_simd_load_di
+#define gmx_simd_storeu_di         gmx_simd_store_di
+#define gmx_simd_setzero_di()      vec_splats((int)0)
+#ifdef __GNUC__
+/* gcc up to at least version 4.9 is missing intrinsics for double precision
+ * to integer conversion, use inline asm instead.
+ */
+#    define gmx_simd_cvtt_d2i(a)   ({ __vector signed int res; __asm__ ("xvcvdpsxws %0,%1" : \
+                                                                        "=ww" (res) : "ww" ((__vector double) (a))); res; })
+#    define gmx_simd_cvt_i2d(a)    ({ __vector double res; __asm__ ("xvcvsxwdp %0,%1" : \
+                                                                    "=ww" (res) : "ww" ((__vector signed int) (a))); res; })
+#else
+/* IBM xlC */
+#    define gmx_simd_cvtt_d2i(a)       vec_cts(a, 0)
+#    define gmx_simd_cvt_i2d(a)        vec_ctd(a, 0)
+#endif
+#define gmx_simd_cvt_d2i(a)         gmx_simd_cvtt_d2i(gmx_simd_round_d(a))
+#define gmx_simd_extract_di(a, i)   gmx_simd_extract_fi_ibm_vsx(a, (i)*2)
+/* Integer logical ops on gmx_simd_dint32_t */
+#define gmx_simd_slli_di(a, i)      vec_sl(a, vec_splats((unsigned int)i))
+#define gmx_simd_srli_di(a, i)      vec_sr(a, vec_splats((unsigned int)i))
+#define gmx_simd_and_di(a, b)       vec_and(a, b)
+#define gmx_simd_andnot_di(a, b)    vec_andc(b, a)
+#define gmx_simd_or_di(a, b)        vec_or(a, b)
+#define gmx_simd_xor_di(a, b)       vec_xor(a, b)
+/* Integer arithmetic ops on gmx_simd_dint32_t */
+#define gmx_simd_add_di(a, b)       vec_add(a, b)
+#define gmx_simd_sub_di(a, b)       vec_sub(a, b)
+#ifdef __GNUC__
+/* gcc 4.9 does not provide vec_mul() for integers */
+#    ifdef __BIG_ENDIAN__
+#        define gmx_simd_mul_di(a, b)   vec_mulo((__vector short)a, (__vector short)b)
+#    else
+#        define gmx_simd_mul_di(a, b)   vec_mule((__vector short)a, (__vector short)b)
+#    endif
+#else
+/* IBM xlC */
+#    define gmx_simd_mul_di(a, b)   vec_mul(a, b)
+#endif
+/* Boolean & comparison operations on gmx_simd_double_t */
+#define gmx_simd_dbool_t           __vector vsx_bool long long
+#define gmx_simd_cmpeq_d(a, b)     vec_cmpeq(a, b)
+#define gmx_simd_cmplt_d(a, b)     vec_cmplt(a, b)
+#define gmx_simd_cmple_d(a, b)     vec_cmple(a, b)
+#define gmx_simd_and_db(a, b)      (__vector vsx_bool long long)vec_and((__vector signed int)a, (__vector signed int)b)
+#define gmx_simd_or_db(a, b)       (__vector vsx_bool long long)vec_or((__vector signed int)a, (__vector signed int)b)
+#define gmx_simd_anytrue_db(a)     vec_any_ne((__vector vsx_bool int)a, (__vector vsx_bool int)vec_splats(0))
+#define gmx_simd_blendzero_d(a, sel)    vec_and(a, (__vector double)sel)
+#define gmx_simd_blendnotzero_d(a, sel) vec_andc(a, (__vector double)sel)
+#define gmx_simd_blendv_d(a, b, sel)    vec_sel(a, b, sel)
+#define gmx_simd_reduce_d(a)       gmx_simd_reduce_d_ibm_vsx(a)
+/* Boolean & comparison operations on gmx_simd_fint32_t */
+#define gmx_simd_dibool_t          __vector vsx_bool int
+#define gmx_simd_cmpeq_di(a, b)    vec_cmpeq(a, b)
+#define gmx_simd_cmplt_di(a, b)    vec_cmplt(a, b)
+#define gmx_simd_and_dib(a, b)     vec_and(a, b)
+#define gmx_simd_or_dib(a, b)      vec_or(a, b)
+/* Since we have applied all operations to pairs of elements we can work on all elements here */
+#define gmx_simd_anytrue_dib(a)          vec_any_ne(a, (__vector vsx_bool int)vec_splats(0))
+#define gmx_simd_blendzero_di(a, sel)    vec_and(a, (__vector signed int)sel)
+#define gmx_simd_blendnotzero_di(a, sel) vec_andc(a, (__vector signed int)sel)
+#define gmx_simd_blendv_di(a, b, sel)    vec_sel(a, b, sel)
+/* Conversions between different booleans */
+#define gmx_simd_cvt_db2dib(x)     (__vector vsx_bool int)(x)
+#define gmx_simd_cvt_dib2db(x)     (__vector vsx_bool long long)(x)
+/* Float/double conversion */
+#define gmx_simd_cvt_f2dd(f, d0, d1)  gmx_simd_cvt_f2dd_ibm_vsx(f, d0, d1)
+#define gmx_simd_cvt_dd2f(d0, d1)     gmx_simd_cvt_dd2f_ibm_vsx(d0, d1)
+
+/* Convenience defines to work around GCC/xlc compiler differences */
+
+#ifdef __GNUC__
+/* vec_xxsldwi() and vec_xxpermdi() were missing from altivec.h
+ * in gcc-4.8, but the builtins are available. This was fixed in gcc-4.9.
+ */
+#    ifndef vec_xxsldwi
+#        define vec_xxsldwi  __builtin_vsx_xxsldwi
+#    endif
+#    ifndef vec_xxpermdi
+#        define vec_xxpermdi __builtin_vsx_xxpermdi
+#    endif
+/* gcc up to at least 4.9 is missing intrinsics for
+ * double-to-float and float-to-double conversions. Use inline asm.
+ */
+#    define gmx_vsx_f2d(x) ({ __vector double res; __asm__ ("xvcvspdp %0,%1" : \
+                                                            "=ww" (res) : "ww" ((__vector float) (x))); res; })
+#    define gmx_vsx_d2f(x) ({ __vector float res; __asm__ ("xvcvdpsp %0,%1" : \
+                                                           "=ww" (res) : "ww" ((__vector double) (x))); res; })
+#else
+/* IBM xlC */
+#    define vec_xxsldwi          vec_sldw
+#    define vec_xxpermdi         vec_permi
+/* f2d and d2f are indeed identical on xlC; it is selected by the argument and result type. */
+#    define gmx_vsx_f2d(x)       vec_cvf(x)
+#    define gmx_vsx_d2f(x)       vec_cvf(x)
+#endif
+
+
+/****************************************************
+ * SINGLE PREC. IMPLEMENTATION HELPER FUNCTIONS     *
+ ****************************************************/
+static gmx_inline gmx_simd_float_t
+gmx_simd_get_exponent_f_ibm_vsx(gmx_simd_float_t x)
+{
+    /* Generate 0x7F800000 without memory operations */
+    gmx_simd_float_t     expmask = (__vector float)vec_splats(0x7F800000);
+    gmx_simd_fint32_t    i127    = vec_splats(127);
+    gmx_simd_fint32_t    iexp;
+
+    iexp = (__vector signed int)gmx_simd_and_f(x, expmask);
+    iexp = vec_sub(gmx_simd_srli_fi(iexp, 23), i127);
+    return vec_ctf(iexp, 0);
+}
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_get_mantissa_f_ibm_vsx(gmx_simd_float_t x)
+{
+    gmx_simd_float_t     expmask = (__vector float)vec_splats(0x7F800000);
+
+    x = gmx_simd_andnot_f(expmask, vec_abs(x));
+    /* Reset zero (but correctly biased) exponent */
+    return gmx_simd_or_f(x, vec_splats(1.0f));
+}
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_set_exponent_f_ibm_vsx(gmx_simd_float_t x)
+{
+    gmx_simd_fint32_t  iexp = gmx_simd_cvt_f2i(x);
+    gmx_simd_fint32_t  i127 = vec_splats(127);
+
+    iexp = gmx_simd_slli_fi(vec_add(iexp, i127), 23);
+    return (__vector float)iexp;
+}
+
+static gmx_inline float
+gmx_simd_reduce_f_ibm_vsx(gmx_simd_float_t x)
+{
+    x = vec_add(x, vec_xxsldwi(x, x, 2));
+    x = vec_add(x, vec_xxsldwi(x, x, 1));
+    return vec_extract(x, 0);
+}
+
+static gmx_inline int
+gmx_simd_extract_fi_ibm_vsx(gmx_simd_fint32_t gmx_unused x, unsigned int i)
+{
+    /* For some reason gcc-4.9 warns about x being unused, which it isn't. */
+#if (defined __GNUC__) && (defined __LITTLE_ENDIAN__)
+    /* On Power7 and earlier big-endian architecture the GNU version of vec_extract()
+     * works fine, but it appears to be buggy on Power8 running in little-endian mode.
+     * Use inline assembly instead. Since this can only happen on Power8 and later,
+     * we can use a Power8-specific direct move instruction.
+     */
+    int res;
+    __asm__ ("mfvsrwz %0,%1" : "=r" (res) : \
+             "ww" ((vec_xxsldwi((x), (x), (((2-(i))&0x3 ))))));
+    return res;
+#else
+    /* IBM xlC, and GNU when running in big-endian mode */
+    return vec_extract(x, i);
+#endif
+}
+
+/****************************************************
+ * DOUBLE PREC. IMPLEMENTATION HELPER FUNCTIONS     *
+ ****************************************************/
+static gmx_inline gmx_simd_dint32_t
+gmx_simd_load_di_ibm_vsx(const int *m)
+{
+    __vector signed int vi;
+    __vector signed int d0 = vec_splats(m[0]);
+    __vector signed int d1 = vec_splats(m[1]);
+#ifdef __LITTLE_ENDIAN__
+    vi = (__vector signed int)vec_xxpermdi((__vector double)d1, (__vector double)d0, 0x0);
+#else
+    vi = (__vector signed int)vec_xxpermdi((__vector double)d0, (__vector double)d1, 0x0);
+#endif
+    return vi;
+}
+
+static gmx_inline void
+gmx_simd_store_di_ibm_vsx(int *m, gmx_simd_dint32_t x)
+{
+    m[0] = gmx_simd_extract_di(x, 0);
+    m[1] = gmx_simd_extract_di(x, 1);
+}
+
+static gmx_inline gmx_simd_double_t
+gmx_simd_get_exponent_d_ibm_vsx(gmx_simd_double_t x)
+{
+    gmx_simd_double_t  expmask = (__vector double)vec_mergel(vec_splats((int)0x7FF00000), vec_splats((int)0));
+    gmx_simd_dint32_t  i1023   = vec_splats(1023);
+    gmx_simd_dint32_t  iexp;
+
+    iexp = (__vector signed int)gmx_simd_and_d(x, expmask);
+    /* The upper half of each double is already in positions 0/2, so we only need
+     * to shift by another 52-32=20 bits.
+     */
+    iexp = gmx_simd_srli_fi(iexp, 20);
+    iexp = vec_sub(iexp, i1023);
+    /* Now we have the correct integer in elements 0 & 2. Never mind about elements 1,3 */
+    return gmx_simd_cvt_i2d(iexp);
+}
+
+static gmx_inline gmx_simd_double_t
+gmx_simd_get_mantissa_d_ibm_vsx(gmx_simd_double_t x)
+{
+    gmx_simd_double_t  expmask = (__vector double)vec_mergel(vec_splats((int)0x7FF00000), vec_splats((int)0));
+
+    x = gmx_simd_andnot_d(expmask, vec_abs(x));
+    /* Reset zero (but correctly biased) exponent */
+    return gmx_simd_or_d(x, vec_splats(1.0));
+}
+
+static gmx_inline gmx_simd_double_t
+gmx_simd_set_exponent_d_ibm_vsx(gmx_simd_double_t x)
+{
+    gmx_simd_dint32_t  iexp  = gmx_simd_cvt_d2i(x);
+    gmx_simd_dint32_t  i1023 = vec_splats(1023);
+    gmx_simd_dint32_t  tmp;
+
+    iexp = vec_add(iexp, i1023);
+    /* exponent is now present in pairs of integers; 0011.
+     * Elements 0/2 already correspond to the upper half of each double,
+     * so we only need to shift by another 52-32=20 bits.
+     * The remaining elements 1/3 are shifted by 32 bits to make them zero.
+     */
+    iexp = vec_sl(iexp, (__vector unsigned int)vec_splats((int)20));
+    tmp  = vec_mergeh(iexp, iexp);
+    iexp = vec_mergel(tmp, iexp);
+    iexp = vec_mergel(iexp, gmx_simd_setzero_di());
+    return (__vector double)iexp;
+}
+
+static gmx_inline double
+gmx_simd_reduce_d_ibm_vsx(gmx_simd_double_t x)
+{
+    x = vec_add(x, vec_xxsldwi(x, x, 2));
+    return vec_extract(x, 0);
+}
+
+
+/****************************************************
+ * CONVERSION IMPLEMENTATION HELPER FUNCTIONS       *
+ ****************************************************/
+static gmx_inline void
+gmx_simd_cvt_f2dd_ibm_vsx(gmx_simd_float_t f0,
+                          gmx_simd_double_t * d0, gmx_simd_double_t * d1)
+{
+    __vector float fA, fB;
+    fA  = vec_mergel(f0, f0); /* 0011 */
+    fB  = vec_mergeh(f0, f0); /* 2233 */
+    *d0 = gmx_vsx_f2d(fA);    /* 01 */
+    *d1 = gmx_vsx_f2d(fB);    /* 23 */
+}
+
+
+static gmx_inline gmx_simd_float_t
+gmx_simd_cvt_dd2f_ibm_vsx(gmx_simd_double_t d0, gmx_simd_double_t d1)
+{
+    __vector float fA, fB, fC, fD, fE;
+    fA = gmx_vsx_d2f(d0);    /* 0x1x */
+    fB = gmx_vsx_d2f(d1);    /* 2x3x */
+    fC = vec_mergel(fA, fB); /* 02xx */
+    fD = vec_mergeh(fA, fB); /* 13xx */
+    fE = vec_mergel(fD, fC); /* 0123 */
+    return fE;
+}
+
+/* Single precision VSX is 4 elements wide, use for SIMD4 */
+#define gmx_simd4_float_t                gmx_simd_float_t
+#define gmx_simd4_load_f                 gmx_simd_load_f
+#define gmx_simd4_load1_f                gmx_simd_load1_f
+#define gmx_simd4_set1_f                 gmx_simd_set1_f
+#define gmx_simd4_store_f                gmx_simd_store_f
+#define gmx_simd4_loadu_f                gmx_simd_loadu_f
+#define gmx_simd4_storeu_f               gmx_simd_storeu_f
+#define gmx_simd4_setzero_f              gmx_simd_setzero_f
+#define gmx_simd4_add_f                  gmx_simd_add_f
+#define gmx_simd4_sub_f                  gmx_simd_sub_f
+#define gmx_simd4_mul_f                  gmx_simd_mul_f
+#define gmx_simd4_fmadd_f                gmx_simd_fmadd_f
+#define gmx_simd4_fmsub_f                gmx_simd_fmsub_f
+#define gmx_simd4_fnmadd_f               gmx_simd_fnmadd_f
+#define gmx_simd4_fnmsub_f               gmx_simd_fnmsub_f
+#define gmx_simd4_and_f                  gmx_simd_and_f
+#define gmx_simd4_andnot_f               gmx_simd_andnot_f
+#define gmx_simd4_or_f                   gmx_simd_or_f
+#define gmx_simd4_xor_f                  gmx_simd_xor_f
+#define gmx_simd4_rsqrt_f                gmx_simd_rsqrt_f
+#define gmx_simd4_rcp_f                  gmx_simd_rcp_f
+#define gmx_simd4_fabs_f                 gmx_simd_fabs_f
+#define gmx_simd4_fneg_f                 gmx_simd_fneg_f
+#define gmx_simd4_max_f                  gmx_simd_max_f
+#define gmx_simd4_min_f                  gmx_simd_min_f
+#define gmx_simd4_round_f                gmx_simd_round_f
+#define gmx_simd4_trunc_f                gmx_simd_trunc_f
+#define gmx_simd4_fraction_f             gmx_simd_fraction_f
+#define gmx_simd4_get_exponent_f         gmx_simd_get_exponent_f
+#define gmx_simd4_get_mantissa_f         gmx_simd_get_mantissa_f
+#define gmx_simd4_set_exponent_f         gmx_simd_set_exponent_f
+#define gmx_simd4_dotproduct3_f          gmx_simd4_dotproduct3_f_ibm_vsx
+#define gmx_simd4_fint32_t               gmx_simd_fint32_t
+#define gmx_simd4_load_fi                gmx_simd_load_fi
+#define gmx_simd4_load1_fi               gmx_simd_load1_fi
+#define gmx_simd4_set1_fi                gmx_simd_set1_fi
+#define gmx_simd4_store_fi               gmx_simd_store_fi
+#define gmx_simd4_loadu_fi               gmx_simd_loadu_fi
+#define gmx_simd4_storeu_fi              gmx_simd_storeu_fi
+#define gmx_simd4_setzero_fi             gmx_simd_setzero_fi
+#define gmx_simd4_cvt_f2i                gmx_simd_cvt_f2i
+#define gmx_simd4_cvtt_f2i               gmx_simd_cvtt_f2i
+#define gmx_simd4_cvt_i2f                gmx_simd_cvt_i2f
+#define gmx_simd4_fbool_t                gmx_simd_fbool_t
+#define gmx_simd4_cmpeq_f                gmx_simd_cmpeq_f
+#define gmx_simd4_cmplt_f                gmx_simd_cmplt_f
+#define gmx_simd4_cmple_f                gmx_simd_cmple_f
+#define gmx_simd4_and_fb                 gmx_simd_and_fb
+#define gmx_simd4_or_fb                  gmx_simd_or_fb
+#define gmx_simd4_anytrue_fb             gmx_simd_anytrue_fb
+#define gmx_simd4_blendzero_f            gmx_simd_blendzero_f
+#define gmx_simd4_blendnotzero_f         gmx_simd_blendnotzero_f
+#define gmx_simd4_blendv_f               gmx_simd_blendv_f
+#define gmx_simd4_reduce_f               gmx_simd_reduce_f
+
+static gmx_inline float
+gmx_simd4_dotproduct3_f_ibm_vsx(gmx_simd4_float_t a, gmx_simd4_float_t b)
+{
+    gmx_simd4_float_t c = gmx_simd_mul_f(a, b);
+    gmx_simd4_float_t sum;
+    sum = vec_add(c, vec_xxsldwi(c, c, 2));
+    sum = vec_add(sum, vec_xxsldwi(c, c, 1));
+    return vec_extract(sum, 0);
+}
+
+/* Function to check whether SIMD operations have resulted in overflow.
+ * For now, this is unfortunately a dummy for this architecture.
+ */
+static int
+gmx_simd_check_and_reset_overflow(void)
+{
+    return 0;
+}
+
+/* Undefine our temporary work-arounds so they are not used by mistake */
+#undef gmx_vsx_f2d
+#undef gmx_vsx_d2f
+
+#endif /* GMX_SIMD_IMPLEMENTATION_IBM_VSX_H */
index e3d49126f0ebf5132ad8744c2e2caa198f591f18..67418f98d06262d4c323be355a6456c1d31b61f1 100644 (file)
 #ifndef GMX_SIMD_IMPL_INTEL_MIC_H
 #define GMX_SIMD_IMPL_INTEL_MIC_H
 
+#include "config.h"
+
 #include <math.h>
+
 #include <immintrin.h>
 
 /* Intel Xeon Phi, or
@@ -503,12 +506,25 @@ gmx_simd_exp2_f_mic(__m512 x)
 static gmx_inline __m512 gmx_simdcall
 gmx_simd_exp_f_mic(__m512 x)
 {
-    /* only 59ulp accuracy so we need to do extra an iteration
-       Using: http://yacas.sourceforge.net/Algochapter5.html 5.4 Method 3 */
-    __m512    r = gmx_simd_exp2_f(_mm512_mul_ps(x, _mm512_set1_ps(1.44269504088896341)));
-    __mmask16 m = _mm512_cmpneq_ps_mask(r, _mm512_setzero_ps());
-    __m512    t = _mm512_mask_fnmadd_ps(_mm512_mask_log2ae23_ps(_mm512_undefined_ps(), m, r), m, _mm512_set1_ps(0.693147180559945286226764), x);
-    return _mm512_mask_fmadd_ps(r, m, t, r);
+    const gmx_simd_float_t  argscale    = gmx_simd_set1_f(1.44269504088896341f);
+    const gmx_simd_float_t  invargscale = gmx_simd_set1_f(-0.69314718055994528623f);
+    __m512                  xscaled     = _mm512_mul_ps(x, argscale);
+    __m512                  r           = gmx_simd_exp2_f_mic(xscaled);
+
+    /* gmx_simd_exp2_f_mic() provides 23 bits of accuracy, but we ruin some of that
+     * with the argument scaling due to single-precision rounding, where the
+     * rounding error is amplified exponentially. To correct this, we find the
+     * difference between the scaled argument and the true one (extended precision
+     * arithmetics does not appear to be necessary to fulfill our accuracy requirements)
+     * and then multiply by the exponent of this correction since exp(a+b)=exp(a)*exp(b).
+     * Note that this only adds two instructions (and maybe some constant loads).
+     */
+    x         = gmx_simd_fmadd_f(invargscale, xscaled, x);
+    /* x will now be a _very_ small number, so approximate exp(x)=1+x.
+     * We should thus apply the correction as r'=r*(1+x)=r+r*x
+     */
+    r         = gmx_simd_fmadd_f(r, x, r);
+    return r;
 }
 
 static gmx_inline __m512 gmx_simdcall
index 5269fa14e5e403e94814336ca80b6ffb3e9bcbfb..c4f6f776caa1aa353d1ae14dcd62b1a75be866aa 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <math.h>
 
-#include "gmx_fatal.h"
+#include "gromacs/utility/fatalerror.h"
 
 /*! \cond libapi */
 /*! \addtogroup module_simd */
index a05e12ebbb1b26a3c4ad0782f7b07a3ba5f7a569..e19320add3d7f9a00ac0618a3b1ea6cac4bdced7 100644 (file)
 #ifndef GMX_SIMD_IMPL_X86_AVX2_256_H
 #define GMX_SIMD_IMPL_X86_AVX2_256_H
 
+#include "config.h"
+
 #include <math.h>
+
 #include <immintrin.h>
 
 /* x86 256-bit AVX2 SIMD instruction wrappers
index 5b3096bee322f5fe367c39da2165a030ea6b1db7..c13e847ffa6659c6bf5dc1ea511206c6c4993062 100644 (file)
 #ifndef GMX_SIMD_IMPL_X86_AVX_128_FMA_H
 #define GMX_SIMD_IMPL_X86_AVX_128_FMA_H
 
+#include "config.h"
+
 #include <math.h>
+
 #include <immintrin.h>
 #include <x86intrin.h>
 
index cff1a7e2cbd00bb782aadfba2b862214706a98d1..493fe2a34f695667dfb51a76630573363b56fa6f 100644 (file)
@@ -36,7 +36,8 @@
 #ifndef GMX_SIMD_IMPL_X86_AVX_256_H
 #define GMX_SIMD_IMPL_X86_AVX_256_H
 
-#include <math.h>
+#include "config.h"
+
 #include <immintrin.h>
 
 /* It is cleaner to start the AVX implementation from scratch rather than
 #define gmx_simd_set_exponent_f    gmx_simd_set_exponent_f_avx_256
 /* integer datatype corresponding to float: gmx_simd_fint32_t */
 #define gmx_simd_fint32_t          __m256i
-#define gmx_simd_load_fi(m)        _mm256_castps_si256(_mm256_load_ps((const float *)m))
+#define gmx_simd_load_fi(m)        _mm256_load_si256((__m256i const*)m)
 #define gmx_simd_set1_fi           _mm256_set1_epi32
-#define gmx_simd_store_fi(m, x)     _mm256_store_ps((float *)m, _mm256_castsi256_ps(x))
-#define gmx_simd_loadu_fi(m)       _mm256_castps_si256(_mm256_loadu_ps((const float *)m))
-#define gmx_simd_storeu_fi(m, x)    _mm256_storeu_ps((float *)m, _mm256_castsi256_ps(x))
+#define gmx_simd_store_fi(m, x)    _mm256_store_si256((__m256i *)m, x)
+#define gmx_simd_loadu_fi(m)       _mm256_loadu_si256((__m256i const*)m)
+#define gmx_simd_storeu_fi(m, x)   _mm256_storeu_si256((__m256i *)m, x)
 #define gmx_simd_setzero_fi        _mm256_setzero_si256
 #define gmx_simd_cvt_f2i           _mm256_cvtps_epi32
 #define gmx_simd_cvtt_f2i          _mm256_cvttps_epi32
index 7aab27ae21c5faad2de33dde08b39594b00498e8..2d3f908f56e626e6479bd6d16f7f44a1cf1992c3 100644 (file)
 #ifndef GMX_SIMD_IMPL_X86_SSE2_H
 #define GMX_SIMD_IMPL_X86_SSE2_H
 
+#include "config.h"
+
 #include <math.h>
+
 #include <emmintrin.h>
 
 /* Set capabilities that can be inherited */
index 946ae1e866a88d35c421166d6823da576360a5cb..8b8384a835a7e42cedcfeda76abea73d1bb9ba90 100644 (file)
 #ifndef GMX_SIMD_IMPL_X86_SSE4_1_H
 #define GMX_SIMD_IMPL_X86_SSE4_1_H
 
+#include "config.h"
+
 #include <math.h>
-#include <smmintrin.h>
 
+#include <smmintrin.h>
 
 /* x86 SSE4.1 SIMD instruction wrappers
  *
index fed6d546946bda6576d1216ff83f5a521c51627b..9ee80edbd7acbfabeb82067134cd6a67a125b622 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_AVX_128_FMA_DOUBLE_H
 #define GMX_SIMD_MATH_AVX_128_FMA_DOUBLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index fc7113dd3a426f645a9f18890b2cb6d254ad10fc..014508d9773fea2cc8e195dc5c7bcb29254c33e2 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_AVX_128_FMA_SINGLE_H
 #define GMX_SIMD_MATH_AVX_128_FMA_SINGLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index 8eb7941765156707b4f48af3517ed8254609c8ba..6a1963cbaf31ecd64d68956b4bcade8ca7fd42e5 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_AVX_256_DOUBLE_H
 #define GMX_SIMD_MATH_AVX_256_DOUBLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index b23712a2595d9eff9a19c4e6da4a851ced18b939..ad72a1057955088188bbaead4c124a0994923cae 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_AVX_256_SINGLE_H
 #define GMX_SIMD_MATH_AVX_256_SINGLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index 9332dc3d3666a752f3b9a7363082b3e4c77c4532..857f4ee2ef58d6c18ade96bd500df00249542a29 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_SSE2_DOUBLE_H
 #define GMX_SIMD_MATH_SSE2_DOUBLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index 054fd2c1bc8261c1ba27258171635259183706a1..67ebf7f7cd2104fbd5e966655d69ee61b12a6f3c 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_SSE2_SINGLE_H
 #define GMX_SIMD_MATH_SSE2_SINGLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index 4d8955a51c1ca87d1603e8b84a7110eed5eedddb..e7f7a06249b02e64a35ef65988cc836a536cc9fd 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_SSE4_1_DOUBLE_H
 #define GMX_SIMD_MATH_SSE4_1_DOUBLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index 2fbdf23b3aa76f1f4b274c2e92d80cec3abee377..7c78dd57b9510d11b361b63f82d64b3a548558b0 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef GMX_SIMD_MATH_SSE4_1_SINGLE_H
 #define GMX_SIMD_MATH_SSE4_1_SINGLE_H
 
-#include "simd_math.h"
+#include "gromacs/simd/simd_math.h"
 
 /* Temporary:
  * Alias some old SSE definitions to new SIMD definitions so we don't need
index 8ef1c8cac4e563c0cef3c46fc571c1d3b20b7691..33036bfe2847d98079ee2b00902c530967db1afd 100644 (file)
  * \ingroup module_simd
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "config.h"
 
 #include <stddef.h>
-#include "gromacs/legacyheaders/types/simple.h"
+
+#include "gromacs/utility/basedefinitions.h"
 
 /* Forward declarations so memory allocation can be used in implementations */
 static gmx_inline float *  gmx_simd_align_f(float *p);
@@ -112,29 +111,37 @@ static gmx_inline double * gmx_simd4_align_d(double *p);
  * this SIMD module are static, so it will work perfectly fine to include this
  * file with different SIMD definitions for different files.
  */
-#if defined __MIC__
-#    include "gromacs/simd/impl_intel_mic/impl_intel_mic.h"
+#if defined GMX_SIMD_X86_MIC
+#    include "impl_intel_mic/impl_intel_mic.h"
 #elif defined GMX_SIMD_X86_AVX2_256
-#    include "gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256.h"
+#    include "impl_x86_avx2_256/impl_x86_avx2_256.h"
 #elif defined GMX_SIMD_X86_AVX_256
-#    include "gromacs/simd/impl_x86_avx_256/impl_x86_avx_256.h"
+#    include "impl_x86_avx_256/impl_x86_avx_256.h"
 #elif defined GMX_SIMD_X86_AVX_128_FMA
-#    include "gromacs/simd/impl_x86_avx_128_fma/impl_x86_avx_128_fma.h"
+#    include "impl_x86_avx_128_fma/impl_x86_avx_128_fma.h"
 #elif defined GMX_SIMD_X86_SSE4_1
-#    include "gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1.h"
+#    include "impl_x86_sse4_1/impl_x86_sse4_1.h"
 #elif defined GMX_SIMD_X86_SSE2
-#    include "gromacs/simd/impl_x86_sse2/impl_x86_sse2.h"
+#    include "impl_x86_sse2/impl_x86_sse2.h"
+#elif defined GMX_SIMD_ARM_NEON
+#    include "impl_arm_neon/impl_arm_neon.h"
+#elif defined GMX_SIMD_ARM_NEON_ASIMD
+#    include "impl_arm_neon_asimd/impl_arm_neon_asimd.h"
 #elif defined GMX_SIMD_IBM_QPX
-#    include "gromacs/simd/impl_ibm_qpx/impl_ibm_qpx.h"
+#    include "impl_ibm_qpx/impl_ibm_qpx.h"
+#elif defined GMX_SIMD_IBM_VMX
+#    include "impl_ibm_vmx/impl_ibm_vmx.h"
+#elif defined GMX_SIMD_IBM_VSX
+#    include "impl_ibm_vsx/impl_ibm_vsx.h"
 #elif defined GMX_SIMD_SPARC64_HPC_ACE
-#    include "gromacs/simd/impl_sparc64_hpc_ace/impl_sparc64_hpc_ace.h"
+#    include "impl_sparc64_hpc_ace/impl_sparc64_hpc_ace.h"
 #elif (defined GMX_SIMD_REFERENCE) || (defined DOXYGEN)
 /* Plain C SIMD reference implementation, also serves as documentation.
  * For now this code path will also be taken for Sparc64_HPC_ACE since we have
  * not yet added the verlet kernel extensions there. The group kernels do not
  * depend on this file, so they will still be accelerated with SIMD.
  */
-#    include "gromacs/simd/impl_reference/impl_reference.h"
+#    include "impl_reference/impl_reference.h"
 #else
 /* Turn off the GMX_SIMD flag if we do not even have reference support */
 #    undef GMX_SIMD
index 68ab6774ef0031b3f4b71ca5cceb21663245c59f..5bdc7c6d5b747ac91ea1a3c2ffa0654e8551df3c 100644 (file)
@@ -55,6 +55,8 @@
  * \ingroup module_simd
  */
 
+#include "config.h"
+
 #include <math.h>
 
 #include "gromacs/math/utilities.h"
@@ -130,6 +132,7 @@ gmx_simd_xor_sign_f(gmx_simd_float_t a, gmx_simd_float_t b)
 #endif
 }
 
+#ifndef gmx_simd_rsqrt_iter_f
 /*! \brief Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD float.
  *
  * This is a low-level routine that should only be used by SIMD math routine
@@ -148,6 +151,7 @@ gmx_simd_rsqrt_iter_f(gmx_simd_float_t lu, gmx_simd_float_t x)
     return gmx_simd_mul_f(gmx_simd_set1_f(0.5f), gmx_simd_mul_f(gmx_simd_sub_f(gmx_simd_set1_f(3.0f), gmx_simd_mul_f(gmx_simd_mul_f(lu, lu), x)), lu));
 #    endif
 }
+#endif
 
 /*! \brief Calculate 1/sqrt(x) for SIMD float.
  *
@@ -172,6 +176,46 @@ gmx_simd_invsqrt_f(gmx_simd_float_t x)
     return lu;
 }
 
+/*! \brief Calculate 1/sqrt(x) for masked entries of SIMD float.
+ *
+ * Identical to gmx_simd_invsqrt_f but avoids fp-exception for non-masked entries.
+ * The result for the non-masked entries is undefined and the user has to use blend
+ * with the same mask to obtain a defined result.
+ *
+ *  \param x Argument that must be >0 for masked entries
+ *  \param m Masked entries
+ *  \return 1/sqrt(x). Result is undefined if your argument was invalid or entry was not masked.
+ */
+#ifdef NDEBUG
+#define gmx_simd_invsqrt_maskfpe_f(x, m) gmx_simd_invsqrt_f(x)
+#else
+static gmx_inline gmx_simd_float_t
+gmx_simd_invsqrt_maskfpe_f(gmx_simd_float_t x, gmx_simd_fbool_t m)
+{
+    return gmx_simd_invsqrt_f(gmx_simd_blendv_f(gmx_simd_set1_f(1.0f), x, m));
+}
+#endif
+
+/*! \brief Calculate 1/sqrt(x) for non-masked entries of SIMD float.
+ *
+ * Identical to gmx_simd_invsqrt_f but avoids fp-exception for masked entries.
+ * The result for the non-masked entries is undefined and the user has to use blend
+ * with the same mask to obtain a defined result.
+ *
+ *  \param x Argument that must be >0 for non-masked entries
+ *  \param m Masked entries
+ *  \return 1/sqrt(x). Result is undefined if your argument was invalid or entry was masked.
+ */
+#ifdef NDEBUG
+#define gmx_simd_invsqrt_notmaskfpe_f(x, m) gmx_simd_invsqrt_f(x)
+#else
+static gmx_inline gmx_simd_float_t
+gmx_simd_invsqrt_notmaskfpe_f(gmx_simd_float_t x, gmx_simd_fbool_t m)
+{
+    return gmx_simd_invsqrt_f(gmx_simd_blendv_f(x, gmx_simd_set1_f(1.0f), m));
+}
+#endif
+
 /*! \brief Calculate 1/sqrt(x) for two SIMD floats.
  *
  * You should normally call the real-precision routine \ref gmx_simd_invsqrt_pair_r.
@@ -192,6 +236,7 @@ gmx_simd_invsqrt_pair_f(gmx_simd_float_t x0,    gmx_simd_float_t x1,
     *out1 = gmx_simd_invsqrt_f(x1);
 }
 
+#ifndef gmx_simd_rcp_iter_f
 /*! \brief Perform one Newton-Raphson iteration to improve 1/x for SIMD float.
  *
  * This is a low-level routine that should only be used by SIMD math routine
@@ -206,6 +251,7 @@ gmx_simd_rcp_iter_f(gmx_simd_float_t lu, gmx_simd_float_t x)
 {
     return gmx_simd_mul_f(lu, gmx_simd_fnmadd_f(lu, x, gmx_simd_set1_f(2.0f)));
 }
+#endif
 
 /*! \brief Calculate 1/x for SIMD float.
  *
@@ -230,6 +276,46 @@ gmx_simd_inv_f(gmx_simd_float_t x)
     return lu;
 }
 
+/*! \brief Calculate 1/x for masked entries of SIMD float.
+ *
+ * Identical to gmx_simd_inv_f but avoids fp-exception for non-masked entries.
+ * The result for the non-masked entries is undefined and the user has to use blend
+ * with the same mask to obtain a defined result.
+ *
+ *  \param x Argument that must be nonzero for masked entries
+ *  \param m Masked entries
+ *  \return 1/x. Result is undefined if your argument was invalid or entry was not masked.
+ */
+#ifdef NDEBUG
+#define gmx_simd_inv_maskfpe_f(x, m) gmx_simd_inv_f(x)
+#else
+static gmx_inline gmx_simd_float_t
+gmx_simd_inv_maskfpe_f(gmx_simd_float_t x, gmx_simd_fbool_t m)
+{
+    return gmx_simd_inv_f(gmx_simd_blendv_f(gmx_simd_set1_f(1.0f), x, m));
+}
+#endif
+
+/*! \brief Calculate 1/x for non-masked entries of SIMD float.
+ *
+ * Identical to gmx_simd_inv_f but avoids fp-exception for masked entries.
+ * The result for the non-masked entries is undefined and the user has to use blend
+ * with the same mask to obtain a defined result.
+ *
+ *  \param x Argument that must be nonzero for non-masked entries
+ *  \param m Masked entries
+ *  \return 1/x. Result is undefined if your argument was invalid or entry was masked.
+ */
+#ifdef NDEBUG
+#define gmx_simd_inv_notmaskfpe_f(x, m) gmx_simd_inv_f(x)
+#else
+static gmx_inline gmx_simd_float_t
+gmx_simd_inv_notmaskfpe_f(gmx_simd_float_t x, gmx_simd_fbool_t m)
+{
+    return gmx_simd_inv_f(gmx_simd_blendv_f(x, gmx_simd_set1_f(1.0f), m));
+}
+#endif
+
 /*! \brief Calculate sqrt(x) correctly for SIMD floats, including argument 0.0.
  *
  * You should normally call the real-precision routine \ref gmx_simd_sqrt_r.
@@ -245,7 +331,7 @@ gmx_simd_sqrt_f(gmx_simd_float_t x)
     gmx_simd_float_t  res;
 
     mask = gmx_simd_cmpeq_f(x, gmx_simd_setzero_f());
-    res  = gmx_simd_blendnotzero_f(gmx_simd_invsqrt_f(x), mask);
+    res  = gmx_simd_blendnotzero_f(gmx_simd_invsqrt_notmaskfpe_f(x, mask), mask);
     return gmx_simd_mul_f(res, x);
 }
 
@@ -354,8 +440,8 @@ gmx_simd_exp_f(gmx_simd_float_t x)
     const gmx_simd_float_t  argscale     = gmx_simd_set1_f(1.44269504088896341f);
     /* Lower bound: Disallow numbers that would lead to an IEEE fp exponent reaching +-127. */
     const gmx_simd_float_t  arglimit     = gmx_simd_set1_f(126.0f);
-    const gmx_simd_float_t  invargscale0 = gmx_simd_set1_f(0.693145751953125f);
-    const gmx_simd_float_t  invargscale1 = gmx_simd_set1_f(1.428606765330187045e-06f);
+    const gmx_simd_float_t  invargscale0 = gmx_simd_set1_f(-0.693145751953125f);
+    const gmx_simd_float_t  invargscale1 = gmx_simd_set1_f(-1.428606765330187045e-06f);
     const gmx_simd_float_t  CC4          = gmx_simd_set1_f(0.00136324646882712841033936f);
     const gmx_simd_float_t  CC3          = gmx_simd_set1_f(0.00836596917361021041870117f);
     const gmx_simd_float_t  CC2          = gmx_simd_set1_f(0.0416710823774337768554688f);
@@ -374,8 +460,8 @@ gmx_simd_exp_f(gmx_simd_float_t x)
     fexppart  = gmx_simd_blendzero_f(fexppart, valuemask);
 
     /* Extended precision arithmetics */
-    x         = gmx_simd_fnmadd_f(invargscale0, intpart, x);
-    x         = gmx_simd_fnmadd_f(invargscale1, intpart, x);
+    x         = gmx_simd_fmadd_f(invargscale0, intpart, x);
+    x         = gmx_simd_fmadd_f(invargscale1, intpart, x);
 
     p         = gmx_simd_fmadd_f(CC4, x, CC3);
     p         = gmx_simd_fmadd_f(p, x, CC2);
@@ -440,7 +526,7 @@ gmx_simd_erf_f(gmx_simd_float_t x)
     gmx_simd_float_t        pA0, pA1, pB0, pB1, pC0, pC1;
     gmx_simd_float_t        expmx2;
     gmx_simd_float_t        res_erf, res_erfc, res;
-    gmx_simd_fbool_t        mask;
+    gmx_simd_fbool_t        mask, msk_erf;
 
     /* Calculate erf() */
     x2   = gmx_simd_mul_f(x, x);
@@ -459,7 +545,8 @@ gmx_simd_erf_f(gmx_simd_float_t x)
 
     /* Calculate erfc */
     y       = gmx_simd_fabs_f(x);
-    t       = gmx_simd_inv_f(y);
+    msk_erf = gmx_simd_cmplt_f(y, gmx_simd_set1_f(0.75f));
+    t       = gmx_simd_inv_notmaskfpe_f(y, msk_erf);
     w       = gmx_simd_sub_f(t, one);
     t2      = gmx_simd_mul_f(t, t);
     w2      = gmx_simd_mul_f(w, w);
@@ -502,8 +589,7 @@ gmx_simd_erf_f(gmx_simd_float_t x)
     res_erfc = gmx_simd_blendv_f(res_erfc, gmx_simd_sub_f(two, res_erfc), mask);
 
     /* Select erf() or erfc() */
-    mask = gmx_simd_cmplt_f(y, gmx_simd_set1_f(0.75f));
-    res  = gmx_simd_blendv_f(gmx_simd_sub_f(one, res_erfc), res_erf, mask);
+    res  = gmx_simd_blendv_f(gmx_simd_sub_f(one, res_erfc), res_erf, msk_erf);
 
     return res;
 }
@@ -587,7 +673,7 @@ gmx_simd_erfc_f(gmx_simd_float_t x)
     gmx_simd_float_t        pA0, pA1, pB0, pB1, pC0, pC1;
     gmx_simd_float_t        expmx2, corr;
     gmx_simd_float_t        res_erf, res_erfc, res;
-    gmx_simd_fbool_t        mask;
+    gmx_simd_fbool_t        mask, msk_erf;
 
     /* Calculate erf() */
     x2     = gmx_simd_mul_f(x, x);
@@ -606,7 +692,8 @@ gmx_simd_erfc_f(gmx_simd_float_t x)
 
     /* Calculate erfc */
     y       = gmx_simd_fabs_f(x);
-    t       = gmx_simd_inv_f(y);
+    msk_erf = gmx_simd_cmplt_f(y, gmx_simd_set1_f(0.75f));
+    t       = gmx_simd_inv_notmaskfpe_f(y, msk_erf);
     w       = gmx_simd_sub_f(t, one);
     t2      = gmx_simd_mul_f(t, t);
     w2      = gmx_simd_mul_f(w, w);
@@ -681,8 +768,7 @@ gmx_simd_erfc_f(gmx_simd_float_t x)
     res_erfc = gmx_simd_blendv_f(res_erfc, gmx_simd_sub_f(two, res_erfc), mask);
 
     /* Select erf() or erfc() */
-    mask = gmx_simd_cmplt_f(y, gmx_simd_set1_f(0.75f));
-    res  = gmx_simd_blendv_f(res_erfc, gmx_simd_sub_f(one, res_erf), mask);
+    res  = gmx_simd_blendv_f(res_erfc, gmx_simd_sub_f(one, res_erf), msk_erf);
 
     return res;
 }
@@ -703,10 +789,10 @@ static gmx_inline void gmx_simdcall
 gmx_simd_sincos_f(gmx_simd_float_t x, gmx_simd_float_t *sinval, gmx_simd_float_t *cosval)
 {
     /* Constants to subtract Pi/4*x from y while minimizing precision loss */
-    const gmx_simd_float_t  argred0         = gmx_simd_set1_f(1.5703125);
-    const gmx_simd_float_t  argred1         = gmx_simd_set1_f(4.83751296997070312500e-04f);
-    const gmx_simd_float_t  argred2         = gmx_simd_set1_f(7.54953362047672271729e-08f);
-    const gmx_simd_float_t  argred3         = gmx_simd_set1_f(2.56334406825708960298e-12f);
+    const gmx_simd_float_t  argred0         = gmx_simd_set1_f(-1.5703125);
+    const gmx_simd_float_t  argred1         = gmx_simd_set1_f(-4.83751296997070312500e-04f);
+    const gmx_simd_float_t  argred2         = gmx_simd_set1_f(-7.54953362047672271729e-08f);
+    const gmx_simd_float_t  argred3         = gmx_simd_set1_f(-2.56334406825708960298e-12f);
     const gmx_simd_float_t  two_over_pi     = gmx_simd_set1_f(2.0f/M_PI);
     const gmx_simd_float_t  const_sin2      = gmx_simd_set1_f(-1.9515295891e-4f);
     const gmx_simd_float_t  const_sin1      = gmx_simd_set1_f( 8.3321608736e-3f);
@@ -784,10 +870,10 @@ gmx_simd_sincos_f(gmx_simd_float_t x, gmx_simd_float_t *sinval, gmx_simd_float_t
     /* where mask is FALSE, set sign. */
     csign   = gmx_simd_xor_sign_f(csign, gmx_simd_blendv_f(gmx_simd_set1_f(-1.0f), one, mask));
 #endif
-    x       = gmx_simd_fnmadd_f(y, argred0, x);
-    x       = gmx_simd_fnmadd_f(y, argred1, x);
-    x       = gmx_simd_fnmadd_f(y, argred2, x);
-    x       = gmx_simd_fnmadd_f(y, argred3, x);
+    x       = gmx_simd_fmadd_f(y, argred0, x);
+    x       = gmx_simd_fmadd_f(y, argred1, x);
+    x       = gmx_simd_fmadd_f(y, argred2, x);
+    x       = gmx_simd_fmadd_f(y, argred3, x);
     x2      = gmx_simd_mul_f(x, x);
 
     psin    = gmx_simd_fmadd_f(const_sin2, x2, const_sin1);
@@ -856,10 +942,10 @@ gmx_simd_cos_f(gmx_simd_float_t x)
 static gmx_inline gmx_simd_float_t gmx_simdcall
 gmx_simd_tan_f(gmx_simd_float_t x)
 {
-    const gmx_simd_float_t  argred0         = gmx_simd_set1_f(1.5703125);
-    const gmx_simd_float_t  argred1         = gmx_simd_set1_f(4.83751296997070312500e-04f);
-    const gmx_simd_float_t  argred2         = gmx_simd_set1_f(7.54953362047672271729e-08f);
-    const gmx_simd_float_t  argred3         = gmx_simd_set1_f(2.56334406825708960298e-12f);
+    const gmx_simd_float_t  argred0         = gmx_simd_set1_f(-1.5703125);
+    const gmx_simd_float_t  argred1         = gmx_simd_set1_f(-4.83751296997070312500e-04f);
+    const gmx_simd_float_t  argred2         = gmx_simd_set1_f(-7.54953362047672271729e-08f);
+    const gmx_simd_float_t  argred3         = gmx_simd_set1_f(-2.56334406825708960298e-12f);
     const gmx_simd_float_t  two_over_pi     = gmx_simd_set1_f(2.0f/M_PI);
     const gmx_simd_float_t  CT6             = gmx_simd_set1_f(0.009498288995810566122993911);
     const gmx_simd_float_t  CT5             = gmx_simd_set1_f(0.002895755790837379295226923);
@@ -880,10 +966,10 @@ gmx_simd_tan_f(gmx_simd_float_t x)
     y       = gmx_simd_round_f(z);
     mask    = gmx_simd_cvt_fib2fb(gmx_simd_cmpeq_fi(gmx_simd_and_fi(iy, ione), ione));
 
-    x       = gmx_simd_fnmadd_f(y, argred0, x);
-    x       = gmx_simd_fnmadd_f(y, argred1, x);
-    x       = gmx_simd_fnmadd_f(y, argred2, x);
-    x       = gmx_simd_fnmadd_f(y, argred3, x);
+    x       = gmx_simd_fmadd_f(y, argred0, x);
+    x       = gmx_simd_fmadd_f(y, argred1, x);
+    x       = gmx_simd_fmadd_f(y, argred2, x);
+    x       = gmx_simd_fmadd_f(y, argred3, x);
     x       = gmx_simd_xor_f(gmx_simd_blendzero_f(gmx_simd_set1_f(GMX_FLOAT_NEGZERO), mask), x);
 #else
     const gmx_simd_float_t  quarter         = gmx_simd_set1_f(0.25f);
@@ -902,10 +988,10 @@ gmx_simd_tan_f(gmx_simd_float_t x)
     m3      = gmx_simd_cmple_f(threequarter, q);
     m1      = gmx_simd_and_fb(m1, m2);
     mask    = gmx_simd_or_fb(m1, m3);
-    w       = gmx_simd_fnmadd_f(y, argred0, w);
-    w       = gmx_simd_fnmadd_f(y, argred1, w);
-    w       = gmx_simd_fnmadd_f(y, argred2, w);
-    w       = gmx_simd_fnmadd_f(y, argred3, w);
+    w       = gmx_simd_fmadd_f(y, argred0, w);
+    w       = gmx_simd_fmadd_f(y, argred1, w);
+    w       = gmx_simd_fmadd_f(y, argred2, w);
+    w       = gmx_simd_fmadd_f(y, argred3, w);
 
     w       = gmx_simd_blendv_f(w, gmx_simd_fneg_f(w), mask);
     x       = gmx_simd_xor_sign_f(w, x);
@@ -918,7 +1004,7 @@ gmx_simd_tan_f(gmx_simd_float_t x)
     p       = gmx_simd_fmadd_f(p, x2, CT1);
     p       = gmx_simd_fmadd_f(x2, gmx_simd_mul_f(p, x), x);
 
-    p       = gmx_simd_blendv_f( p, gmx_simd_inv_f(p), mask);
+    p       = gmx_simd_blendv_f( p, gmx_simd_inv_maskfpe_f(p, mask), mask);
     return p;
 }
 
@@ -944,13 +1030,14 @@ gmx_simd_asin_f(gmx_simd_float_t x)
     gmx_simd_float_t       xabs;
     gmx_simd_float_t       z, z1, z2, q, q1, q2;
     gmx_simd_float_t       pA, pB;
-    gmx_simd_fbool_t       mask;
+    gmx_simd_fbool_t       mask, mask2;
 
     xabs  = gmx_simd_fabs_f(x);
     mask  = gmx_simd_cmplt_f(half, xabs);
     z1    = gmx_simd_mul_f(half, gmx_simd_sub_f(one, xabs));
-    q1    = gmx_simd_mul_f(z1, gmx_simd_invsqrt_f(z1));
-    q1    = gmx_simd_blendnotzero_f(q1, gmx_simd_cmpeq_f(xabs, one));
+    mask2 = gmx_simd_cmpeq_f(xabs, one);
+    q1    = gmx_simd_mul_f(z1, gmx_simd_invsqrt_notmaskfpe_f(z1, mask2));
+    q1    = gmx_simd_blendnotzero_f(q1, mask2);
     q2    = xabs;
     z2    = gmx_simd_mul_f(q2, q2);
     z     = gmx_simd_blendv_f(z2, z1, mask);
@@ -990,15 +1077,16 @@ gmx_simd_acos_f(gmx_simd_float_t x)
     const gmx_simd_float_t halfpi    = gmx_simd_set1_f((float)M_PI/2.0f);
     gmx_simd_float_t       xabs;
     gmx_simd_float_t       z, z1, z2, z3;
-    gmx_simd_fbool_t       mask1, mask2;
+    gmx_simd_fbool_t       mask1, mask2, mask3;
 
     xabs  = gmx_simd_fabs_f(x);
     mask1 = gmx_simd_cmplt_f(half, xabs);
     mask2 = gmx_simd_cmplt_f(gmx_simd_setzero_f(), x);
 
     z     = gmx_simd_mul_f(half, gmx_simd_sub_f(one, xabs));
-    z     = gmx_simd_mul_f(z, gmx_simd_invsqrt_f(z));
-    z     = gmx_simd_blendnotzero_f(z, gmx_simd_cmpeq_f(xabs, one));
+    mask3 = gmx_simd_cmpeq_f(xabs, one);
+    z     = gmx_simd_mul_f(z, gmx_simd_invsqrt_notmaskfpe_f(z, mask3));
+    z     = gmx_simd_blendnotzero_f(z, mask3);
     z     = gmx_simd_blendv_f(x, z, mask1);
     z     = gmx_simd_asin_f(z);
 
@@ -1030,13 +1118,14 @@ gmx_simd_atan_f(gmx_simd_float_t x)
     const gmx_simd_float_t CA7       = gmx_simd_set1_f(-0.1420273631811141967773f);
     const gmx_simd_float_t CA5       = gmx_simd_set1_f(0.1999269574880599975585f);
     const gmx_simd_float_t CA3       = gmx_simd_set1_f(-0.3333310186862945556640f);
+    const gmx_simd_float_t one       = gmx_simd_set1_f(1.0f);
     gmx_simd_float_t       x2, x3, x4, pA, pB;
     gmx_simd_fbool_t       mask, mask2;
 
     mask  = gmx_simd_cmplt_f(x, gmx_simd_setzero_f());
     x     = gmx_simd_fabs_f(x);
-    mask2 = gmx_simd_cmplt_f(gmx_simd_set1_f(1.0f), x);
-    x     = gmx_simd_blendv_f(x, gmx_simd_inv_f(x), mask2);
+    mask2 = gmx_simd_cmplt_f(one, x);
+    x     = gmx_simd_blendv_f(x, gmx_simd_inv_maskfpe_f(x, mask2), mask2);
 
     x2    = gmx_simd_mul_f(x, x);
     x3    = gmx_simd_mul_f(x2, x);
@@ -1090,7 +1179,7 @@ gmx_simd_atan2_f(gmx_simd_float_t y, gmx_simd_float_t x)
     aoffset   = gmx_simd_blendv_f(aoffset, pi, mask_xlt0);
     aoffset   = gmx_simd_blendv_f(aoffset, gmx_simd_fneg_f(aoffset), mask_ylt0);
 
-    xinv      = gmx_simd_blendnotzero_f(gmx_simd_inv_f(x), mask_x0);
+    xinv      = gmx_simd_blendnotzero_f(gmx_simd_inv_notmaskfpe_f(x, mask_x0), mask_x0);
     p         = gmx_simd_mul_f(y, xinv);
     p         = gmx_simd_atan_f(p);
     p         = gmx_simd_add_f(p, aoffset);
@@ -1344,6 +1433,7 @@ gmx_simd_xor_sign_d(gmx_simd_double_t a, gmx_simd_double_t b)
 #endif
 }
 
+#ifndef gmx_simd_rsqrt_iter_d
 /*! \brief Perform one Newton-Raphson iteration to improve 1/sqrt(x) for SIMD double.
  *
  * \copydetails gmx_simd_rsqrt_iter_f
@@ -1357,7 +1447,7 @@ gmx_simd_rsqrt_iter_d(gmx_simd_double_t lu, gmx_simd_double_t x)
     return gmx_simd_mul_d(gmx_simd_set1_d(0.5), gmx_simd_mul_d(gmx_simd_sub_d(gmx_simd_set1_d(3.0), gmx_simd_mul_d(gmx_simd_mul_d(lu, lu), x)), lu));
 #endif
 }
-
+#endif
 
 /*! \brief Calculate 1/sqrt(x) for SIMD double
  *
@@ -1382,6 +1472,34 @@ gmx_simd_invsqrt_d(gmx_simd_double_t x)
     return lu;
 }
 
+/*! \brief Calculate 1/sqrt(x) for masked entries of SIMD double.
+ *
+ * \copydetails gmx_simd_invsqrt_maskfpe_f
+ */
+#ifdef NDEBUG
+#define gmx_simd_invsqrt_maskfpe_d(x, m) gmx_simd_invsqrt_d(x)
+#else
+static gmx_inline gmx_simd_double_t
+gmx_simd_invsqrt_maskfpe_d(gmx_simd_double_t x, gmx_simd_dbool_t m)
+{
+    return gmx_simd_invsqrt_d(gmx_simd_blendv_d(gmx_simd_set1_d(1.0f), x, m));
+}
+#endif
+
+/*! \brief Calculate 1/sqrt(x) for non-masked entries of SIMD double.
+ *
+ * \copydetails gmx_simd_invsqrt_notmaskfpe_f
+ */
+#ifdef NDEBUG
+#define gmx_simd_invsqrt_notmaskfpe_d(x, m) gmx_simd_invsqrt_d(x)
+#else
+static gmx_inline gmx_simd_double_t
+gmx_simd_invsqrt_notmaskfpe_d(gmx_simd_double_t x, gmx_simd_dbool_t m)
+{
+    return gmx_simd_invsqrt_d(gmx_simd_blendv_d(x, gmx_simd_set1_d(1.0f), m));
+}
+#endif
+
 /*! \brief Calculate 1/sqrt(x) for two SIMD doubles.
  *
  * \copydetails gmx_simd_invsqrt_pair_f
@@ -1422,6 +1540,7 @@ gmx_simd_invsqrt_pair_d(gmx_simd_double_t x0,    gmx_simd_double_t x1,
 #endif
 }
 
+#ifndef gmx_simd_rcp_iter_d
 /*! \brief Perform one Newton-Raphson iteration to improve 1/x for SIMD double.
  *
  * \copydetails gmx_simd_rcp_iter_f
@@ -1431,6 +1550,7 @@ gmx_simd_rcp_iter_d(gmx_simd_double_t lu, gmx_simd_double_t x)
 {
     return gmx_simd_mul_d(lu, gmx_simd_fnmadd_d(lu, x, gmx_simd_set1_d(2.0)));
 }
+#endif
 
 /*! \brief Calculate 1/x for SIMD double.
  *
@@ -1455,6 +1575,34 @@ gmx_simd_inv_d(gmx_simd_double_t x)
     return lu;
 }
 
+/*! \brief Calculate 1/x for masked entries of SIMD double.
+ *
+ * \copydetails gmx_simd_inv_maskfpe_f
+ */
+#ifdef NDEBUG
+#define gmx_simd_inv_maskfpe_d(x, m) gmx_simd_inv_d(x)
+#else
+static gmx_inline gmx_simd_double_t
+gmx_simd_inv_maskfpe_d(gmx_simd_double_t x, gmx_simd_dbool_t m)
+{
+    return gmx_simd_inv_d(gmx_simd_blendv_d(gmx_simd_set1_d(1.0f), x, m));
+}
+#endif
+
+/*! \brief Calculate 1/x for non-masked entries of SIMD double.
+ *
+ * \copydetails gmx_simd_inv_notmaskfpe_f
+ */
+#ifdef NDEBUG
+#define gmx_simd_inv_notmaskfpe_d(x, m) gmx_simd_inv_d(x)
+#else
+static gmx_inline gmx_simd_double_t
+gmx_simd_inv_notmaskfpe_d(gmx_simd_double_t x, gmx_simd_dbool_t m)
+{
+    return gmx_simd_inv_d(gmx_simd_blendv_d(x, gmx_simd_set1_d(1.0f), m));
+}
+#endif
+
 /*! \brief Calculate sqrt(x) correctly for SIMD doubles, including argument 0.0.
  *
  * \copydetails gmx_simd_sqrt_f
@@ -1466,7 +1614,7 @@ gmx_simd_sqrt_d(gmx_simd_double_t x)
     gmx_simd_double_t  res;
 
     mask = gmx_simd_cmpeq_d(x, gmx_simd_setzero_d());
-    res  = gmx_simd_blendnotzero_d(gmx_simd_invsqrt_d(x), mask);
+    res  = gmx_simd_blendnotzero_d(gmx_simd_invsqrt_notmaskfpe_d(x, mask), mask);
     return gmx_simd_mul_d(res, x);
 }
 
@@ -1570,8 +1718,8 @@ gmx_simd_exp_d(gmx_simd_double_t x)
 {
     const gmx_simd_double_t  argscale      = gmx_simd_set1_d(1.44269504088896340735992468100);
     const gmx_simd_double_t  arglimit      = gmx_simd_set1_d(1022.0);
-    const gmx_simd_double_t  invargscale0  = gmx_simd_set1_d(0.69314718055966295651160180568695068359375);
-    const gmx_simd_double_t  invargscale1  = gmx_simd_set1_d(2.8235290563031577122588448175013436025525412068e-13);
+    const gmx_simd_double_t  invargscale0  = gmx_simd_set1_d(-0.69314718055966295651160180568695068359375);
+    const gmx_simd_double_t  invargscale1  = gmx_simd_set1_d(-2.8235290563031577122588448175013436025525412068e-13);
     const gmx_simd_double_t  CE12          = gmx_simd_set1_d(2.078375306791423699350304e-09);
     const gmx_simd_double_t  CE11          = gmx_simd_set1_d(2.518173854179933105218635e-08);
     const gmx_simd_double_t  CE10          = gmx_simd_set1_d(2.755842049600488770111608e-07);
@@ -1596,8 +1744,8 @@ gmx_simd_exp_d(gmx_simd_double_t x)
     fexppart  = gmx_simd_blendzero_d(fexppart, valuemask);
 
     /* Extended precision arithmetics */
-    x         = gmx_simd_fnmadd_d(invargscale0, intpart, x);
-    x         = gmx_simd_fnmadd_d(invargscale1, intpart, x);
+    x         = gmx_simd_fmadd_d(invargscale0, intpart, x);
+    x         = gmx_simd_fmadd_d(invargscale1, intpart, x);
 
     p         = gmx_simd_fmadd_d(CE12, x, CE11);
     p         = gmx_simd_fmadd_d(p, x, CE10);
@@ -1680,10 +1828,11 @@ gmx_simd_erf_d(gmx_simd_double_t x)
     gmx_simd_double_t       PolyCP0, PolyCP1, PolyCQ0, PolyCQ1;
     gmx_simd_double_t       res_erf, res_erfcB, res_erfcC, res_erfc, res;
     gmx_simd_double_t       expmx2;
-    gmx_simd_dbool_t        mask;
+    gmx_simd_dbool_t        mask, mask_erf;
 
     /* Calculate erf() */
     xabs     = gmx_simd_fabs_d(x);
+    mask_erf = gmx_simd_cmplt_d(xabs, one);
     x2       = gmx_simd_mul_d(x, x);
     x4       = gmx_simd_mul_d(x2, x2);
 
@@ -1707,7 +1856,7 @@ gmx_simd_erf_d(gmx_simd_double_t x)
     PolyAQ1  = gmx_simd_mul_d(PolyAQ1, x2);
     PolyAQ0  = gmx_simd_add_d(PolyAQ0, PolyAQ1);
 
-    res_erf  = gmx_simd_mul_d(PolyAP0, gmx_simd_inv_d(PolyAQ0));
+    res_erf  = gmx_simd_mul_d(PolyAP0, gmx_simd_inv_maskfpe_d(PolyAQ0, mask_erf));
     res_erf  = gmx_simd_add_d(CAoffset, res_erf);
     res_erf  = gmx_simd_mul_d(x, res_erf);
 
@@ -1743,12 +1892,12 @@ gmx_simd_erf_d(gmx_simd_double_t x)
     PolyBQ1 = gmx_simd_mul_d(PolyBQ1, t);
     PolyBQ0 = gmx_simd_add_d(PolyBQ0, PolyBQ1);
 
-    res_erfcB = gmx_simd_mul_d(PolyBP0, gmx_simd_inv_d(PolyBQ0));
+    res_erfcB = gmx_simd_mul_d(PolyBP0, gmx_simd_inv_notmaskfpe_d(PolyBQ0, mask_erf));
 
     res_erfcB = gmx_simd_mul_d(res_erfcB, xabs);
 
     /* Calculate erfc() in range [4.5,inf] */
-    w       = gmx_simd_inv_d(xabs);
+    w       = gmx_simd_inv_notmaskfpe_d(xabs, mask_erf);
     w2      = gmx_simd_mul_d(w, w);
 
     PolyCP0  = gmx_simd_mul_d(CCP6, w2);
@@ -1779,7 +1928,7 @@ gmx_simd_erf_d(gmx_simd_double_t x)
 
     expmx2   = gmx_simd_exp_d( gmx_simd_fneg_d(x2) );
 
-    res_erfcC = gmx_simd_mul_d(PolyCP0, gmx_simd_inv_d(PolyCQ0));
+    res_erfcC = gmx_simd_mul_d(PolyCP0, gmx_simd_inv_notmaskfpe_d(PolyCQ0, mask_erf));
     res_erfcC = gmx_simd_add_d(res_erfcC, CCoffset);
     res_erfcC = gmx_simd_mul_d(res_erfcC, w);
 
@@ -1793,8 +1942,7 @@ gmx_simd_erf_d(gmx_simd_double_t x)
     res_erfc = gmx_simd_blendv_d(res_erfc, gmx_simd_sub_d(two, res_erfc), mask);
 
     /* Select erf() or erfc() */
-    mask = gmx_simd_cmplt_d(xabs, one);
-    res  = gmx_simd_blendv_d(gmx_simd_sub_d(one, res_erfc), res_erf, mask);
+    res  = gmx_simd_blendv_d(gmx_simd_sub_d(one, res_erfc), res_erf, mask_erf);
 
     return res;
 }
@@ -1865,10 +2013,11 @@ gmx_simd_erfc_d(gmx_simd_double_t x)
     gmx_simd_double_t       PolyCP0, PolyCP1, PolyCQ0, PolyCQ1;
     gmx_simd_double_t       res_erf, res_erfcB, res_erfcC, res_erfc, res;
     gmx_simd_double_t       expmx2;
-    gmx_simd_dbool_t        mask;
+    gmx_simd_dbool_t        mask, mask_erf;
 
     /* Calculate erf() */
     xabs     = gmx_simd_fabs_d(x);
+    mask_erf = gmx_simd_cmplt_d(xabs, one);
     x2       = gmx_simd_mul_d(x, x);
     x4       = gmx_simd_mul_d(x2, x2);
 
@@ -1892,7 +2041,7 @@ gmx_simd_erfc_d(gmx_simd_double_t x)
     PolyAQ1  = gmx_simd_mul_d(PolyAQ1, x2);
     PolyAQ0  = gmx_simd_add_d(PolyAQ0, PolyAQ1);
 
-    res_erf  = gmx_simd_mul_d(PolyAP0, gmx_simd_inv_d(PolyAQ0));
+    res_erf  = gmx_simd_mul_d(PolyAP0, gmx_simd_inv_maskfpe_d(PolyAQ0, mask_erf));
     res_erf  = gmx_simd_add_d(CAoffset, res_erf);
     res_erf  = gmx_simd_mul_d(x, res_erf);
 
@@ -1928,12 +2077,12 @@ gmx_simd_erfc_d(gmx_simd_double_t x)
     PolyBQ1 = gmx_simd_mul_d(PolyBQ1, t);
     PolyBQ0 = gmx_simd_add_d(PolyBQ0, PolyBQ1);
 
-    res_erfcB = gmx_simd_mul_d(PolyBP0, gmx_simd_inv_d(PolyBQ0));
+    res_erfcB = gmx_simd_mul_d(PolyBP0, gmx_simd_inv_notmaskfpe_d(PolyBQ0, mask_erf));
 
     res_erfcB = gmx_simd_mul_d(res_erfcB, xabs);
 
     /* Calculate erfc() in range [4.5,inf] */
-    w       = gmx_simd_inv_d(xabs);
+    w       = gmx_simd_inv_notmaskfpe_d(xabs, mask_erf);
     w2      = gmx_simd_mul_d(w, w);
 
     PolyCP0  = gmx_simd_mul_d(CCP6, w2);
@@ -1964,7 +2113,7 @@ gmx_simd_erfc_d(gmx_simd_double_t x)
 
     expmx2   = gmx_simd_exp_d( gmx_simd_fneg_d(x2) );
 
-    res_erfcC = gmx_simd_mul_d(PolyCP0, gmx_simd_inv_d(PolyCQ0));
+    res_erfcC = gmx_simd_mul_d(PolyCP0, gmx_simd_inv_notmaskfpe_d(PolyCQ0, mask_erf));
     res_erfcC = gmx_simd_add_d(res_erfcC, CCoffset);
     res_erfcC = gmx_simd_mul_d(res_erfcC, w);
 
@@ -1978,8 +2127,7 @@ gmx_simd_erfc_d(gmx_simd_double_t x)
     res_erfc = gmx_simd_blendv_d(res_erfc, gmx_simd_sub_d(two, res_erfc), mask);
 
     /* Select erf() or erfc() */
-    mask = gmx_simd_cmplt_d(xabs, one);
-    res  = gmx_simd_blendv_d(res_erfc, gmx_simd_sub_d(one, res_erf), mask);
+    res  = gmx_simd_blendv_d(res_erfc, gmx_simd_sub_d(one, res_erf), mask_erf);
 
     return res;
 }
@@ -1992,10 +2140,10 @@ static gmx_inline void gmx_simdcall
 gmx_simd_sincos_d(gmx_simd_double_t x, gmx_simd_double_t *sinval, gmx_simd_double_t *cosval)
 {
     /* Constants to subtract Pi/4*x from y while minimizing precision loss */
-    const gmx_simd_double_t  argred0         = gmx_simd_set1_d(2*0.78539816290140151978);
-    const gmx_simd_double_t  argred1         = gmx_simd_set1_d(2*4.9604678871439933374e-10);
-    const gmx_simd_double_t  argred2         = gmx_simd_set1_d(2*1.1258708853173288931e-18);
-    const gmx_simd_double_t  argred3         = gmx_simd_set1_d(2*1.7607799325916000908e-27);
+    const gmx_simd_double_t  argred0         = gmx_simd_set1_d(-2*0.78539816290140151978);
+    const gmx_simd_double_t  argred1         = gmx_simd_set1_d(-2*4.9604678871439933374e-10);
+    const gmx_simd_double_t  argred2         = gmx_simd_set1_d(-2*1.1258708853173288931e-18);
+    const gmx_simd_double_t  argred3         = gmx_simd_set1_d(-2*1.7607799325916000908e-27);
     const gmx_simd_double_t  two_over_pi     = gmx_simd_set1_d(2.0/M_PI);
     const gmx_simd_double_t  const_sin5      = gmx_simd_set1_d( 1.58938307283228937328511e-10);
     const gmx_simd_double_t  const_sin4      = gmx_simd_set1_d(-2.50506943502539773349318e-08);
@@ -2078,10 +2226,10 @@ gmx_simd_sincos_d(gmx_simd_double_t x, gmx_simd_double_t *sinval, gmx_simd_doubl
     /* where mask is FALSE, set sign. */
     csign   = gmx_simd_xor_sign_d(csign, gmx_simd_blendv_d(gmx_simd_set1_d(-1.0), one, mask));
 #endif
-    x       = gmx_simd_fnmadd_d(y, argred0, x);
-    x       = gmx_simd_fnmadd_d(y, argred1, x);
-    x       = gmx_simd_fnmadd_d(y, argred2, x);
-    x       = gmx_simd_fnmadd_d(y, argred3, x);
+    x       = gmx_simd_fmadd_d(y, argred0, x);
+    x       = gmx_simd_fmadd_d(y, argred1, x);
+    x       = gmx_simd_fmadd_d(y, argred2, x);
+    x       = gmx_simd_fmadd_d(y, argred3, x);
     x2      = gmx_simd_mul_d(x, x);
 
     psin    = gmx_simd_fmadd_d(const_sin5, x2, const_sin4);
@@ -2142,10 +2290,10 @@ gmx_simd_cos_d(gmx_simd_double_t x)
 static gmx_inline gmx_simd_double_t gmx_simdcall
 gmx_simd_tan_d(gmx_simd_double_t x)
 {
-    const gmx_simd_double_t  argred0         = gmx_simd_set1_d(2*0.78539816290140151978);
-    const gmx_simd_double_t  argred1         = gmx_simd_set1_d(2*4.9604678871439933374e-10);
-    const gmx_simd_double_t  argred2         = gmx_simd_set1_d(2*1.1258708853173288931e-18);
-    const gmx_simd_double_t  argred3         = gmx_simd_set1_d(2*1.7607799325916000908e-27);
+    const gmx_simd_double_t  argred0         = gmx_simd_set1_d(-2*0.78539816290140151978);
+    const gmx_simd_double_t  argred1         = gmx_simd_set1_d(-2*4.9604678871439933374e-10);
+    const gmx_simd_double_t  argred2         = gmx_simd_set1_d(-2*1.1258708853173288931e-18);
+    const gmx_simd_double_t  argred3         = gmx_simd_set1_d(-2*1.7607799325916000908e-27);
     const gmx_simd_double_t  two_over_pi     = gmx_simd_set1_d(2.0/M_PI);
     const gmx_simd_double_t  CT15            = gmx_simd_set1_d(1.01419718511083373224408e-05);
     const gmx_simd_double_t  CT14            = gmx_simd_set1_d(-2.59519791585924697698614e-05);
@@ -2175,10 +2323,10 @@ gmx_simd_tan_d(gmx_simd_double_t x)
     y       = gmx_simd_round_d(z);
     mask    = gmx_simd_cvt_dib2db(gmx_simd_cmpeq_di(gmx_simd_and_di(iy, ione), ione));
 
-    x       = gmx_simd_fnmadd_d(y, argred0, x);
-    x       = gmx_simd_fnmadd_d(y, argred1, x);
-    x       = gmx_simd_fnmadd_d(y, argred2, x);
-    x       = gmx_simd_fnmadd_d(y, argred3, x);
+    x       = gmx_simd_fmadd_d(y, argred0, x);
+    x       = gmx_simd_fmadd_d(y, argred1, x);
+    x       = gmx_simd_fmadd_d(y, argred2, x);
+    x       = gmx_simd_fmadd_d(y, argred3, x);
     x       = gmx_simd_xor_d(gmx_simd_blendzero_d(gmx_simd_set1_d(GMX_DOUBLE_NEGZERO), mask), x);
 #else
     const gmx_simd_double_t  quarter         = gmx_simd_set1_d(0.25);
@@ -2197,10 +2345,10 @@ gmx_simd_tan_d(gmx_simd_double_t x)
     m3      = gmx_simd_cmple_d(threequarter, q);
     m1      = gmx_simd_and_db(m1, m2);
     mask    = gmx_simd_or_db(m1, m3);
-    w       = gmx_simd_fnmadd_d(y, argred0, w);
-    w       = gmx_simd_fnmadd_d(y, argred1, w);
-    w       = gmx_simd_fnmadd_d(y, argred2, w);
-    w       = gmx_simd_fnmadd_d(y, argred3, w);
+    w       = gmx_simd_fmadd_d(y, argred0, w);
+    w       = gmx_simd_fmadd_d(y, argred1, w);
+    w       = gmx_simd_fmadd_d(y, argred2, w);
+    w       = gmx_simd_fmadd_d(y, argred3, w);
 
     w       = gmx_simd_blendv_d(w, gmx_simd_fneg_d(w), mask);
     x       = gmx_simd_xor_sign_d(w, x);
@@ -2222,7 +2370,7 @@ gmx_simd_tan_d(gmx_simd_double_t x)
     p       = gmx_simd_fmadd_d(p, x2, CT1);
     p       = gmx_simd_fmadd_d(x2, gmx_simd_mul_d(p, x), x);
 
-    p       = gmx_simd_blendv_d( p, gmx_simd_inv_d(p), mask);
+    p       = gmx_simd_blendv_d( p, gmx_simd_inv_maskfpe_d(p, mask), mask);
     return p;
 }
 
@@ -2271,7 +2419,7 @@ gmx_simd_asin_d(gmx_simd_double_t x)
     gmx_simd_double_t       RA, RB;
     gmx_simd_double_t       SA, SB;
     gmx_simd_double_t       nom, denom;
-    gmx_simd_dbool_t        mask;
+    gmx_simd_dbool_t        mask, mask2;
 
     xabs  = gmx_simd_fabs_d(x);
 
@@ -2330,7 +2478,8 @@ gmx_simd_asin_d(gmx_simd_double_t x)
     nom   = gmx_simd_blendv_d( PA, RA, mask );
     denom = gmx_simd_blendv_d( QA, SA, mask );
 
-    q     = gmx_simd_mul_d( nom, gmx_simd_inv_d(denom) );
+    mask2 = gmx_simd_cmplt_d(limit2, xabs);
+    q     = gmx_simd_mul_d( nom, gmx_simd_inv_maskfpe_d(denom, mask2) );
 
     zz    = gmx_simd_add_d(zz, zz);
     zz    = gmx_simd_sqrt_d(zz);
@@ -2345,8 +2494,7 @@ gmx_simd_asin_d(gmx_simd_double_t x)
 
     z     = gmx_simd_blendv_d( w, z, mask );
 
-    mask  = gmx_simd_cmplt_d(limit2, xabs);
-    z     = gmx_simd_blendv_d( xabs, z, mask );
+    z     = gmx_simd_blendv_d( xabs, z, mask2 );
 
     z = gmx_simd_xor_sign_d(z, x);
 
@@ -2424,8 +2572,9 @@ gmx_simd_atan_d(gmx_simd_double_t x)
     mask1  = gmx_simd_cmplt_d(limit1, xabs);
     mask2  = gmx_simd_cmplt_d(limit2, xabs);
 
-    t1     = gmx_simd_mul_d(gmx_simd_add_d(xabs, mone), gmx_simd_inv_d(gmx_simd_sub_d(xabs, mone)));
-    t2     = gmx_simd_mul_d(mone, gmx_simd_inv_d(xabs));
+    t1     = gmx_simd_mul_d(gmx_simd_add_d(xabs, mone),
+                            gmx_simd_inv_maskfpe_d(gmx_simd_sub_d(xabs, mone), mask1));
+    t2     = gmx_simd_mul_d(mone, gmx_simd_inv_maskfpe_d(xabs, mask2));
 
     y      = gmx_simd_blendzero_d(quarterpi, mask1);
     y      = gmx_simd_blendv_d(y, halfpi, mask2);
@@ -2494,7 +2643,7 @@ gmx_simd_atan2_d(gmx_simd_double_t y, gmx_simd_double_t x)
     aoffset   = gmx_simd_blendv_d(aoffset, pi, mask_xlt0);
     aoffset   = gmx_simd_blendv_d(aoffset, gmx_simd_fneg_d(aoffset), mask_ylt0);
 
-    xinv      = gmx_simd_blendnotzero_d(gmx_simd_inv_d(x), mask_x0);
+    xinv      = gmx_simd_blendnotzero_d(gmx_simd_inv_notmaskfpe_d(x, mask_x0), mask_x0);
     p         = gmx_simd_mul_d(y, xinv);
     p         = gmx_simd_atan_d(p);
     p         = gmx_simd_add_d(p, aoffset);
index c461b28952dc15ceb970cc2ed8d1bb692c5bbb18..115707363a3cdad89c9379bd84eef2fef2dd2cf9 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "base.h"
 
 #include <math.h>
 
-#include "testutils/testoptions.h"
-#include "gromacs/options/options.h"
 #include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
 
-#include "base.h"
+#include "testutils/testoptions.h"
 
 namespace gmx
 {
index f4af291973c05c94182172955a9cad461ed5373f..7101e3243a0b00f8275df31ed2f39cdfd2619d5d 100644 (file)
  * \ingroup module_simd
  */
 #include <vector>
+
 #include <gtest/gtest.h>
-#include "gromacs/simd/simd.h"
 
+#include "gromacs/simd/simd.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
@@ -93,15 +95,14 @@ class SimdBaseTest : public ::testing::Test
          * conservative so it works with (inverse) square root, division,
          * exponentials, logarithms, and error functions.
          */
-        SimdBaseTest()
-        {
+        SimdBaseTest() :
 #ifdef GMX_DOUBLE
-            ulpTol_       = 255LL; // Aim for roughly twice the precision we have in single.
+            ulpTol_(255LL), // Aim for roughly twice the precision we have in single.
 #else
-            ulpTol_       = 10LL;  // Be a bit liberal so compiler optimization doesn't bite us.
+            ulpTol_(10LL),  // Be a bit liberal so compiler optimization doesn't bite us.
 #endif
-            absTol_       = 0;
-            range_        = std::pair<real, real>(1, 10);
+            absTol_(0), range_(std::pair<real, real>(1, 10))
+        {
         }
 
         /*! \brief Adjust ulp tolerance from the default 10 (float) or 255 (double). */
index d7a38e9b510a01be958a168149fd9b29574de6c6..824a831e18f5e52344a45399a019bcae137406f3 100644 (file)
@@ -32,9 +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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 /*! \internal \file
  * \brief
@@ -55,7 +53,9 @@
  */
 
 #include <gtest/gtest.h>
+
 #include "gromacs/simd/simd.h"
+#include "gromacs/utility/real.h"
 
 namespace
 {
index e3fa9d910684c4075af86fb081d41d96599cb20f..a53c78999e5ff1fe10d85548e28fe197c493aeb5 100644 (file)
@@ -32,9 +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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "simd.h"
 
index 551546fbf69dc3e4ce778ce752a04a96a6ea19dd..26cdf9e74bc695dc0b05db3898ee3403dc75b215 100644 (file)
@@ -75,7 +75,9 @@
  * \ingroup module_simd
  */
 #include <vector>
+
 #include <gtest/gtest.h>
+
 #include "gromacs/simd/simd.h"
 
 #include "base.h"
index f8d50ae877da6699cecab53aaa9f5ab2f02a91ad..23fead9a2b9d800f36e811dee905b48ff0aac421 100644 (file)
@@ -32,9 +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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "simd4.h"
 
index 3f3df63154698ded482748208a90e904df7d3efd..83cb794a741f4b1ec7ecfe5a5233ea29c28a80c6 100644 (file)
  */
 
 #include <vector>
+
 #include <gtest/gtest.h>
+
 #include "gromacs/simd/simd.h"
-#include "gromacs/simd/tests/base.h"
+
+#include "base.h"
 
 namespace gmx
 {
index 57bfe856516bb0d03597aa4b5f8c23027f0252af..68a448e3db70155b124f39bd4a5295d6a2a1857a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+
 #include "gromacs/math/utilities.h"
 
 #include "simd4.h"
index 70784dbc78e7cc7b46527375ae33aaef6cc43484..2345c037e41c106e06c46762da3189e0faa5d060 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <vector>
+
 #include "gromacs/math/utilities.h"
+#include "gromacs/options/basicoptions.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/simd_math.h"
-#include "gromacs/options/basicoptions.h"
 
 #include "simd4.h"
 
index 7859705bb290943ef7244df12f4150d1be111603..02a29afd3d06562d343f6b22237d4c11d12835ce 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/vector_operations.h"
 
index 44bd447305e8dd947d374ce285fc272bbd1f9012..fb0a3414829ebce88cdef235857e25908f1810b3 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+
 #include "gromacs/math/utilities.h"
 
 #include "simd.h"
index 804354c08450cc760ac986b4f222c677a8afac74..9535c82a30ddc02274fd952f1a71eadc9da6d55f 100644 (file)
@@ -32,9 +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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include "simd.h"
 
index 2fab43ca7edbfc8dbd51cc3865194eb822b20da1..b1f6eca529090642ec8e6a20e27ca9ea115aa8a5 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "gromacs/simd/simd_math.h"
+
+#include "config.h"
 
 #include <vector>
+
 #include "gromacs/math/utilities.h"
-#include "gromacs/simd/simd.h"
-#include "gromacs/simd/simd_math.h"
 #include "gromacs/options/basicoptions.h"
+#include "gromacs/simd/simd.h"
 
 #include "simd.h"
 
@@ -123,7 +125,8 @@ SimdMathTest::compareSimdMathFunction(const char * refFuncExpr, const char *simd
         {
             absDiff = fabs(vref[i]-vtst[i]);
             absOk   = absOk  && ( absDiff < absTol_ );
-            signOk  = signOk && ( vref[i]*vtst[i] >= 0 );
+            signOk  = signOk && ( (vref[i] >= 0 && vtst[i] >= 0) ||
+                                  (vref[i] <= 0 && vtst[i] <= 0));
 
             if (absDiff >= absTol_)
             {
@@ -475,8 +478,15 @@ TEST_F(SimdMathTest, gmxSimdAtan2R)
 /*! \brief Evaluate reference version of PME force correction. */
 real ref_pmecorrF(real x)
 {
-    real y = sqrt(x);
-    return 2*exp(-x)/(sqrt(M_PI)*x) - gmx_erfd(y)/(x*y);
+    if (x != 0)
+    {
+        real y = sqrt(x);
+        return 2*exp(-x)/(sqrt(M_PI)*x) - gmx_erfd(y)/(x*y);
+    }
+    else
+    {
+        return -4/(3*sqrt(M_PI));
+    }
 }
 
 // The PME corrections will be added to ~1/r2, so absolute tolerance of EPS is fine.
index 60652c73dfdae107afe2266dbe462645c9148d2f..9393c24c985e794d7db1850b1fcf5553cb14e583 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
+
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/vector_operations.h"
 
index d2ccfde0e2a7ac3f29c9d3d748629dd04e17364e..30713524c7be42425d943e3808560c79de98b47e 100644 (file)
@@ -46,6 +46,8 @@
 #ifndef GMX_SIMD_VECTOR_OPERATIONS_H
 #define GMX_SIMD_VECTOR_OPERATIONS_H
 
+#include "config.h"
+
 #include "gromacs/simd/simd.h"
 
 /*! \cond libapi */
index 21fadecf2f13e076923e3d68d25f0bdca3c5b7ba..d77c231f611a09c3c6cdae657dc6f96c88d653b2 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.
  */
+#include "gmxpre.h"
+
 #include "statistics.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
 #include <math.h>
-#include "typedefs.h"
+
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
-#include "vec.h"
 
 static int gmx_dnint(double x)
 {
index 4e0faa93e05733b39512b4121d410c4d93b7dd57..23b0ce96b7825511eb0565951c8bfe7c4c221137 100644 (file)
 #ifndef GMX_STATISTICS_H
 #define GMX_STATISTICS_H
 
+#include <stdio.h>
+
+#include "gromacs/utility/real.h"
+
 /*! \libinternal \file
  *
  * \brief
@@ -50,8 +54,6 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-#include <stdio.h>
-#include "types/simple.h"
 
 //! Abstract container type
 typedef struct gmx_stats *gmx_stats_t;
index 6d31816c4cd195691dbed9ccf422a7e63fcfcf11..4b3dbf8a6658ad5778971620707ecc09b0ee70d0 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <stdio.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "vec.h"
+
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
-#include "statistics.h"
+#include "gromacs/statistics/statistics.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
 
 static void horizontal()
 {
index ce827aed4a4f321512e8ce553a23c9d1587c3cbe..909c5c3f729ed0d36cac4186521187202b30ac8a 100644 (file)
@@ -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.
 
-file(GLOB SWAP_SOURCES *.cpp *.c)
+file(GLOB SWAP_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SWAP_SOURCES} PARENT_SCOPE)
 
-gmx_install_headers(swap enums.h)
+gmx_install_headers(enums.h)
similarity index 97%
rename from src/gromacs/swap/swapcoords.c
rename to src/gromacs/swap/swapcoords.cpp
index dc87ff1d25d9567a38f2b31d5b2a4f4c9af02df5..6d1d944600274446a79f1b2130c3a924d94811a1 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,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.
  * \author Carsten Kutzner <ckutzne@gwdg.de>
  * \ingroup module_swap
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "swapcoords.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/mdlib/groupcoord.h"
-#include "mtop_util.h"
-#include "macros.h"
-#include "vec.h"
-#include "names.h"
-#include "network.h"
-#include "mdrun.h"
-#include "xvgr.h"
-#include "copyrite.h"
+
 #include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/groupcoord.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/timing/wallcycle.h"
-#include "swapcoords.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/smalloc.h"
 
-static char *SwS      = {"SWAP:"};                                           /**< For output that comes from the swap module */
-static char *SwSEmpty = {"     "};                                           /**< Placeholder for multi-line output */
-static char* IonString[eIonNR] = {"anion", "cation" };                       /**< Type of ion, used for verbose output */
-static char* IonStr[eIonNR]    = {"-", "+"      };                           /**< Type of ion, used for short output */
-static char* CompStr[eCompNR] = {"A", "B" };                                 /**< Compartment name */
-static char *SwapStr[eSwapTypesNR+1] = { "", "X-", "Y-", "Z-", NULL};        /**< Name for the swap types. */
-static char *DimStr[DIM+1] = { "X", "Y", "Z", NULL};                         /**< Name for the swap dimension. */
+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* IonString[eIonNR] = {"anion", "cation" };                       /**< Type of ion, used for verbose output */
+static const char* IonStr[eIonNR]    = {"-", "+"      };                           /**< Type of ion, used for short 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. */
 
 /* eGrpSplit0 and eGrpSplit1 _must_ be neighbors in this list because
  * we sometimes loop from eGrpSplit0 to eGrpSplit1 */
 enum {
     eGrpIons, eGrpSplit0, eGrpSplit1, eGrpSolvent, eGrpNr
-};                                                                           /**< Group identifier */
-static char* GrpString[eGrpNr] = { "ion", "split0", "split1", "solvent" };   /**< Group name */
+};                                                                               /**< Group identifier */
+static const char* GrpString[eGrpNr] = { "ion", "split0", "split1", "solvent" }; /**< Group name */
 
 /** Keep track of through which channel the ions have passed */
 enum eChannelHistory {
     eChHistPassedNone, eChHistPassedCh0, eChHistPassedCh1, eChHistNr
 };
-static char* ChannelString[eChHistNr] = { "none", "channel0", "channel1" };  /**< Name for the channels */
+static const char* ChannelString[eChHistNr] = { "none", "channel0", "channel1" };  /**< Name for the channels */
 
 /*! \brief Domain identifier.
  *
@@ -92,7 +93,7 @@ static char* ChannelString[eChHistNr] = { "none", "channel0", "channel1" };  /**
 enum eDomain {
     eDomainNotset, eDomainA, eDomainB, eDomainNr
 };
-static char* DomainString[eDomainNr] = { "not_assigned", "Domain_A", "Domain_B" }; /**< Name for the domains */
+static const char* DomainString[eDomainNr] = { "not_assigned", "Domain_A", "Domain_B" }; /**< Name for the domains */
 
 
 
@@ -148,7 +149,7 @@ typedef struct swap_group
 /*! \internal \brief
  * Main (private) data structure for the position swapping protocol.
  */
-typedef struct swap
+typedef struct t_swap
 {
     int               swapdim;                       /**< One of XX, YY, ZZ                               */
     t_pbc            *pbc;                           /**< Needed to make molecules whole.                 */
@@ -221,9 +222,9 @@ static gmx_bool is_in_channel(
 
 /*! \brief Prints to swap output file which ions are in which compartment. */
 static void print_ionlist(
-        t_swap *s,
-        double  time,
-        char    comment[])
+        t_swap       *s,
+        double        time,
+        const char    comment[])
 {
     int            itype, icomp, i, j;
     t_compartment *comp;
@@ -689,7 +690,7 @@ static void compartmentalize_ions(
         {
             fprintf(stderr, "\n"
                     "%s Warning: %d atoms were detected as being in both channels! Probably your split\n"
-                    "%s          cylinder is way too large, or one compartment has collapsed (step %"GMX_PRId64 ")\n",
+                    "%s          cylinder is way too large, or one compartment has collapsed (step %" GMX_PRId64 ")\n",
                     SwS, s->cyl0and1, SwS, step);
 
             fprintf(s->fpout, "Warning: %d atoms were assigned to both channels!\n", s->cyl0and1);
@@ -1932,7 +1933,6 @@ extern gmx_bool do_swapcoords(
         }
 
         /* Now actually correct the number of ions */
-        g      = &(s->group[eGrpSolvent]);
         nswaps = 0;
         alook  = gmx_mtop_atomlookup_init(mtop);
         for (ic = 0; ic < eCompNR; ic++)
@@ -1994,7 +1994,7 @@ extern gmx_bool do_swapcoords(
 
         if (bVerbose)
         {
-            fprintf(stderr, "%s Performed %d swap%s in step %"GMX_PRId64 ".\n", SwS, nswaps, nswaps > 1 ? "s" : "", step);
+            fprintf(stderr, "%s Performed %d swap%s in step %" GMX_PRId64 ".\n", SwS, nswaps, nswaps > 1 ? "s" : "", step);
         }
         if (s->fpout != NULL)
         {
index 4b0e384571a1b67d421cb32ffdc8ab60edabe907..1693e1b6703c90d93674f729f6f01b38a8deb72f 100644 (file)
@@ -52,8 +52,9 @@
 #ifndef GMX_SWAP_SWAPCOORDS_H
 #define GMX_SWAP_SWAPCOORDS_H
 
-#include "typedefs.h"
-#include "types/commrec.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/timing/wallcycle.h"
 
 #ifdef __cplusplus
 extern "C" {
index e73a1115a948308c939c3146d69b033f571906cb..f0a5af0a1b4e7a58d693ec80898d4e1b95dcd558 100644 (file)
 file(GLOB TIMING_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TIMING_SOURCES} PARENT_SCOPE)
 
-set(TIMING_PUBLIC_HEADERS
-    walltime_accounting.h)
-gmx_install_headers(timing ${TIMING_PUBLIC_HEADERS})
+gmx_install_headers(
+    wallcycle.h
+    walltime_accounting.h
+    )
 
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
index 4372575e4d6654e1f5afcc5bf484ecb597121067..780587e11477cca335e5de29aa0139d04aa0088a 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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/timing/cyclecounter.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "cyclecounter.h"
+
+#include "config.h"
 
 #include <time.h>
+
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
-
 #ifdef _MSC_VER
 #include <windows.h>
 #endif
index 7751db43906c65805b076820fd707be7f2d0dad9..4b3bede73610ad1a63a82d059f4bd4fa1f7956cd 100644 (file)
@@ -49,9 +49,7 @@
  * define HAVE_RDTSCP to use the serializing rdtscp instruction instead of rdtsc.
  * This is only supported on newer Intel/AMD hardware, but provides better accuracy.
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #ifdef _MSC_VER
 #include <intrin.h>
@@ -150,8 +148,8 @@ typedef hrtime_t
 
 #elif defined(__xlC__) && defined (_AIX)
 /* AIX compilers */
-#include <sys/time.h>
 #include <sys/systemcfg.h>
+#include <sys/time.h>
 typedef unsigned long long
     gmx_cycles_t;
 
index ae26c2cec4c0492ba6cdf92071587029d90d4709..7408a94449e1a8b8d964833f02b18eca9a22e76a 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, by the GROMACS development team, led by
+ * 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.
  * 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/timing/wallcycle.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "wallcycle.h"
 
-#include <string.h>
+#include "config.h"
 
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "md_logging.h"
-#include "gromacs/utility/cstringutil.h"
+#include <stdlib.h>
 
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/timing/cyclecounter.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 
 /* DEBUG_WCYCLE adds consistency checking for the counters.
  * It checks if you stop a counter different from the last
  */
 /* #define DEBUG_WCYCLE */
 
+#ifdef DEBUG_WCYCLE
+#include "gromacs/utility/fatalerror.h"
+#endif
+
 typedef struct
 {
     int          n;
@@ -109,7 +113,7 @@ static const char *wcsn[ewcsNR] =
     "DD redist.", "DD NS grid + sort", "DD setup comm.",
     "DD make top.", "DD make constr.", "DD top. other",
     "NS grid local", "NS grid non-loc.", "NS search local", "NS search non-loc.",
-    "Bonded F", "Nonbonded F", "Ewald F correction",
+    "Listed F", "Nonbonded F", "Ewald F correction",
     "NB X buffer ops.", "NB F buffer ops."
 };
 
@@ -524,6 +528,7 @@ static void print_cycles(FILE *fplog, double c2t, const char *name,
     char   nthreads_str[6];
     char   ncalls_str[11];
     double wallt;
+    double percentage = (tot > 0.) ? (100. * c_sum / tot) : 0.;
 
     if (c_sum > 0)
     {
@@ -558,7 +563,7 @@ static void print_cycles(FILE *fplog, double c2t, const char *name,
 
         fprintf(fplog, " %-19.19s %4s %4s %10s  %10.3f %14.3f %5.1f\n",
                 name, nnodes_str, nthreads_str, ncalls_str, wallt,
-                c_sum*1e-9, 100*c_sum/tot);
+                c_sum*1e-9, percentage);
     }
 }
 
@@ -627,7 +632,7 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime,
 {
     double     *cyc_sum;
     double      tot, tot_for_pp, tot_for_rest, tot_gpu, tot_cpu_overlap, gpu_cpu_ratio, tot_k;
-    double      c2t, c2t_pp, c2t_pme;
+    double      c2t, c2t_pp, c2t_pme = 0;
     int         i, j, npp, nth_pp, nth_pme, nth_tot;
     char        buf[STRLEN];
     const char *hline = "-----------------------------------------------------------------------------";
@@ -656,7 +661,10 @@ void wallcycle_print(FILE *fplog, int nnodes, int npme, double realtime,
     {
         c2t     = realtime/tot;
         c2t_pp  = c2t * nth_tot / (double) (npp*nth_pp);
-        c2t_pme = c2t * nth_tot / (double) (npme*nth_pme);
+        if (npme > 0)
+        {
+            c2t_pme = c2t * nth_tot / (double) (npme*nth_pme);
+        }
     }
     else
     {
index 7b48849707ca4b3ab1d78e93f8b02c779decf5d7..69c92cde722ddb801b16c4bf8114515d8792bf46 100644 (file)
 #define GMX_TIMING_WALLCYCLE_H
 
 #include <stdio.h>
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/legacyheaders/types/commrec.h"
+
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/nbnxn_cuda_types_ext.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+typedef struct gmx_wallcycle *gmx_wallcycle_t;
+
 enum {
     ewcRUN, ewcSTEP, ewcPPDURINGPME, ewcDOMDEC, ewcDDCOMMLOAD,
     ewcDDCOMMBOUND, ewcVSITECONSTR, ewcPP_PMESENDX, ewcNS, ewcLAUNCH_GPU_NB,
@@ -62,7 +66,7 @@ enum {
     ewcsDD_MAKETOP, ewcsDD_MAKECONSTR, ewcsDD_TOPOTHER,
     ewcsNBS_GRID_LOCAL, ewcsNBS_GRID_NONLOCAL,
     ewcsNBS_SEARCH_LOCAL, ewcsNBS_SEARCH_NONLOCAL,
-    ewcsBONDED, ewcsNONBONDED, ewcsEWALD_CORRECTION,
+    ewcsLISTED, ewcsNONBONDED, ewcsEWALD_CORRECTION,
     ewcsNB_X_BUF_OPS, ewcsNB_F_BUF_OPS,
     ewcsNR
 };
index ec256b22730656de4a25d9f39352d96410aab715..ec0cba0b1e35fc988e9029e78013005e2449eea0 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.
  */
-#include "gromacs/timing/walltime_accounting.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "walltime_accounting.h"
+
+#include "config.h"
 
 #include <time.h>
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -47,8 +48,7 @@
 #include <sys/time.h>
 #endif
 
-#include "gromacs/legacyheaders/types/simple.h"
-
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/smalloc.h"
 
 /* TODO in future: convert gmx_walltime_accounting to a class,
@@ -177,7 +177,7 @@ walltime_accounting_get_start_time_stamp(gmx_walltime_accounting_t walltime_acco
     return walltime_accounting->start_time_stamp;
 }
 
-double
+gmx_int64_t
 walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accounting)
 {
     return walltime_accounting->nsteps_done;
index 641393a0ddac227f50650cace0f90b9ef1c54e17..fe1767fe2c67d0a3f5678427a8235af1d151842f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,7 @@
 #ifndef GMX_TIMING_WALLTIME_ACCOUNTING_H
 #define GMX_TIMING_WALLTIME_ACCOUNTING_H
 
-#include "../legacyheaders/types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -48,8 +48,9 @@ extern "C" {
 }
 #endif
 
-/*! Contains per-process and per-thread data about elapsed wall-clock
- *  times and integration steps performed. */
+/*! \brief
+ * Contains per-process and per-thread data about elapsed wall-clock
+ * times and integration steps performed. */
 typedef struct gmx_walltime_accounting *gmx_walltime_accounting_t;
 
 //! Constructor
@@ -60,18 +61,21 @@ walltime_accounting_init(int numOpenMPThreads);
 void
 walltime_accounting_destroy(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Record initial time stamps, e.g. at run end or counter
- * re-initalization time */
+/*! \brief
+ * Record initial time stamps, e.g. at run end or counter re-initalization time
+ */
 void
 walltime_accounting_start(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Measure and cache the elapsed wall-clock time since
- * walltime_accounting_start */
+/*! \brief
+ * Measure and cache the elapsed wall-clock time since
+ * walltime_accounting_start() */
 void
 walltime_accounting_end(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Measure and return the elapsed wall-clock time since
- * walltime_accounting_start */
+/*! \brief
+ * Measure and return the elapsed wall-clock time since
+ * walltime_accounting_start() */
 double
 walltime_accounting_get_current_elapsed_time(gmx_walltime_accounting_t walltime_accounting);
 
@@ -88,18 +92,19 @@ double
 walltime_accounting_get_start_time_stamp(gmx_walltime_accounting_t walltime_accounting);
 
 //! Get the number of integration steps done
-double
+gmx_int64_t
 walltime_accounting_get_nsteps_done(gmx_walltime_accounting_t walltime_accounting);
 
-/*! Set the number of integration steps done
+/*! \brief Set the number of integration steps done
  *
  * TODO consider whether this should get done in walltime_accounting_end */
 void
 walltime_accounting_set_nsteps_done(gmx_walltime_accounting_t   walltime_accounting,
                                     gmx_int64_t                 nsteps_done);
 
-/*! \brief Calls system timing routines (e.g. clock_gettime) to get the
- * (fractional) number of seconds elapsed since the epoch.
+/*! \brief
+ * Calls system timing routines (e.g. clock_gettime) to get the (fractional)
+ * number of seconds elapsed since the epoch.
  *
  * Resolution is implementation-dependent, but typically nanoseconds
  * or microseconds. */
index ac60f30f0f369d34c6573c373c9e03d2aed17f56..ceec518fe6a0b676c3bdbaae0d708bbe3c511021 100644 (file)
 file(GLOB TOOLS_SOURCES *.cpp *.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOOLS_SOURCES} PARENT_SCOPE)
 
-set(TOOLS_PUBLIC_HEADERS
-    )
-gmx_install_headers(tools ${TOOLS_PUBLIC_HEADERS})
-
 if (BUILD_TESTING)
 #    add_subdirectory(tests)
 endif()
index 3d166cf465bba208a69497e52796fc7230842e95..ddb578dc0693d8511d116dfa4bfbda00359ec5c9 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "main.h"
-#include "macros.h"
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "gmx_fatal.h"
-#include "atomprop.h"
-#include "vec.h"
-#include "pbc.h"
-#include "physics.h"
-#include "index.h"
-#include "gromacs/utility/smalloc.h"
-#include "names.h"
-#include "mtop_util.h"
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/trnio.h"
-#include "gromacs/fileio/xtcio.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/enxio.h"
+#include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/trxio.h"
-
-#include "compare.h"
+#include "gromacs/fileio/xtcio.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/tools/compare.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     int bStep;
@@ -710,8 +706,8 @@ void chk_enx(const char *fn)
 int gmx_check(int argc, char *argv[])
 {
     const char     *desc[] = {
-        "[THISMODULE] reads a trajectory ([TT].trj[tt], [TT].trr[tt] or ",
-        "[TT].xtc[tt]), an energy file ([TT].ene[tt] or [TT].edr[tt])",
+        "[THISMODULE] reads a trajectory ([TT].tng[tt], [TT].trr[tt] or ",
+        "[TT].xtc[tt]), an energy file ([TT].edr[tt])",
         "or an index file ([TT].ndx[tt])",
         "and prints out useful information about them.[PAR]",
         "Option [TT]-c[tt] checks for presence of coordinates,",
@@ -727,8 +723,8 @@ int gmx_check(int argc, char *argv[])
         "file are indeed correct in the trajectory. If not you may have",
         "non-matching files due to e.g. deshuffling or due to problems with",
         "virtual sites. With these flags, [TT]gmx check[tt] provides a quick check for such problems.[PAR]",
-        "The program can compare two run input ([TT].tpr[tt], [TT].tpb[tt] or",
-        "[TT].tpa[tt]) files",
+        "The program can compare two run input ([TT].tpr[tt])",
+        "files",
         "when both [TT]-s1[tt] and [TT]-s2[tt] are supplied.",
         "Similarly a pair of trajectory files can be compared (using the [TT]-f2[tt]",
         "option), or a pair of energy files (using the [TT]-e2[tt] option).[PAR]",
@@ -740,8 +736,8 @@ int gmx_check(int argc, char *argv[])
     t_filenm        fnm[] = {
         { efTRX, "-f",  NULL, ffOPTRD },
         { efTRX, "-f2",  NULL, ffOPTRD },
-        { efTPX, "-s1", "top1", ffOPTRD },
-        { efTPX, "-s2", "top2", ffOPTRD },
+        { efTPR, "-s1", "top1", ffOPTRD },
+        { efTPR, "-s2", "top2", ffOPTRD },
         { efTPS, "-c",  NULL, ffOPTRD },
         { efEDR, "-e",  NULL, ffOPTRD },
         { efEDR, "-e2", "ener2", ffOPTRD },
@@ -798,7 +794,7 @@ int gmx_check(int argc, char *argv[])
     }
     else if (fn2)
     {
-        fprintf(stderr, "Please give me TWO trajectory (.xtc/.trr/.trj) files!\n");
+        fprintf(stderr, "Please give me TWO trajectory (.xtc/.trr/.tng) files!\n");
     }
 
     fn1 = opt2fn_null("-s1", NFILE, fnm);
@@ -821,7 +817,7 @@ int gmx_check(int argc, char *argv[])
     }
     else if ((fn1 && !opt2fn_null("-f", NFILE, fnm)) || (!fn1 && fn2))
     {
-        fprintf(stderr, "Please give me TWO run input (.tpr/.tpa/.tpb) files\n"
+        fprintf(stderr, "Please give me TWO run input (.tpr) files\n"
                 "or specify the -m flag to generate a methods.tex file\n");
     }
 
index 34775b0ef43e938c6d82013c2af8659db614a843..89038a4c244c72818f46900fcee9d3809f47a4cd 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
-#include "main.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/futil.h"
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "gmx_fatal.h"
-#include "names.h"
+
+#include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/enxio.h"
-#include "mtop_util.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/topology/mtop_util.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void cmp_int(FILE *fp, const char *s, int index, int i1, int i2)
 {
@@ -89,11 +86,11 @@ static void cmp_us(FILE *fp, const char *s, int index, unsigned short i1, unsign
     {
         if (index != -1)
         {
-            fprintf(fp, "%s[%d] (%u - %u)\n", s, index, i1, i2);
+            fprintf(fp, "%s[%d] (%hu - %hu)\n", s, index, i1, i2);
         }
         else
         {
-            fprintf(fp, "%s (%u - %u)\n", s, i1, i2);
+            fprintf(fp, "%s (%hu - %hu)\n", s, i1, i2);
         }
     }
 }
index 08c264e97e52a5198f92611c8f09f08fa1092d44..deaa798fced75621e8e528e696f73384ae3332b5 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "index.h"
-#include "gmx_fatal.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "names.h"
-#include "typedefs.h"
-#include "gromacs/gmxpreprocess/readir.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "mtop_util.h"
-#include "checkpoint.h"
+#include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trnio.h"
-#include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 #define RANGECHK(i, n) if ((i) >= (n)) gmx_fatal(FARGS, "Your index file contains atomnumbers (e.g. %d)\nthat are larger than the number of atoms in the tpr file (%d)", (i), (n))
 
@@ -372,11 +373,11 @@ int gmx_convert_tpr(int argc, char *argv[])
     char              buf[200], buf2[200];
     output_env_t      oenv;
     t_filenm          fnm[] = {
-        { efTPX, NULL,  NULL,    ffREAD  },
+        { efTPR, NULL,  NULL,    ffREAD  },
         { efTRN, "-f",  NULL,    ffOPTRD },
         { efEDR, "-e",  NULL,    ffOPTRD },
         { efNDX, NULL,  NULL,    ffOPTRD },
-        { efTPX, "-o",  "tpxout", ffWRITE }
+        { efTPR, "-o",  "tprout", ffWRITE }
     };
 #define NFILE asize(fnm)
 
@@ -421,7 +422,7 @@ int gmx_convert_tpr(int argc, char *argv[])
     bTime      = opt2parg_bSet("-time", asize(pa), pa);
     bTraj      = (opt2bSet("-f", NFILE, fnm) || bTime);
 
-    top_fn = ftp2fn(efTPX, NFILE, fnm);
+    top_fn = ftp2fn(efTPR, NFILE, fnm);
     fprintf(stderr, "Reading toplogy and stuff from %s\n", top_fn);
 
     snew(ir, 1);
index 559328908cf96362d2099f32b5400df04f10243a..e6dec521aa8c967c21fac69351e00395e6a5d38b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
+#include <assert.h>
+#include <math.h>
 #include <stdio.h>
 #include <string.h>
-#include <math.h>
-#include <assert.h>
-#include "main.h"
-#include "macros.h"
+
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "gmx_fatal.h"
-#include "gromacs/utility/smalloc.h"
-#include "names.h"
-#include "txtdump.h"
-#include "gromacs/gmxpreprocess/gmxcpp.h"
-#include "checkpoint.h"
-#include "mtop_util.h"
-#include "gromacs/fileio/xtcio.h"
 #include "gromacs/fileio/enxio.h"
 #include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/trnio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/fileio/mtxio.h"
 #include "gromacs/fileio/tngio.h"
 #include "gromacs/fileio/tngio_for_tools.h"
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "gromacs/linearalgebra/mtxio.h"
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/xtcio.h"
+#include "gromacs/gmxpreprocess/gmxcpp.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/txtdump.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
-
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void list_tpx(const char *fn, gmx_bool bShowNumbers, const char *mdpfn,
                      gmx_bool bSysTop)
@@ -411,25 +403,20 @@ static void list_tng(const char gmx_unused *fn)
 
 void list_trx(const char *fn)
 {
-    int ftp;
-
-    ftp = fn2ftp(fn);
-    if (ftp == efXTC)
-    {
-        list_xtc(fn);
-    }
-    else if ((ftp == efTRR) || (ftp == efTRJ))
-    {
-        list_trn(fn);
-    }
-    else if (ftp == efTNG)
-    {
-        list_tng(fn);
-    }
-    else
+    switch (fn2ftp(fn))
     {
-        fprintf(stderr, "File %s is of an unsupported type. Try using the command\n 'less %s'\n",
-                fn, fn);
+        case efXTC:
+            list_xtc(fn);
+            break;
+        case efTRR:
+            list_trn(fn);
+            break;
+        case efTNG:
+            list_tng(fn);
+            break;
+        default:
+            fprintf(stderr, "File %s is of an unsupported type. Try using the command\n 'less %s'\n",
+                    fn, fn);
     }
 }
 
@@ -610,9 +597,9 @@ static void list_mtx(const char *fn)
 int gmx_dump(int argc, char *argv[])
 {
     const char *desc[] = {
-        "[THISMODULE] reads a run input file ([TT].tpa[tt]/[TT].tpr[tt]/[TT].tpb[tt]),",
-        "a trajectory ([TT].trj[tt]/[TT].trr[tt]/[TT].xtc[tt]), an energy",
-        "file ([TT].ene[tt]/[TT].edr[tt]), or a checkpoint file ([TT].cpt[tt])",
+        "[THISMODULE] reads a run input file ([TT].tpr[tt]),",
+        "a trajectory ([TT].trr[tt]/[TT].xtc[tt]/[TT]/tng[tt]), an energy",
+        "file ([TT].edr[tt]) or a checkpoint file ([TT].cpt[tt])",
         "and prints that to standard output in a readable format.",
         "This program is essential for checking your run input file in case of",
         "problems.[PAR]",
@@ -624,7 +611,7 @@ int gmx_dump(int argc, char *argv[])
         "Position restraint output from -sys -s is broken"
     };
     t_filenm    fnm[] = {
-        { efTPX, "-s", NULL, ffOPTRD },
+        { efTPR, "-s", NULL, ffOPTRD },
         { efTRX, "-f", NULL, ffOPTRD },
         { efEDR, "-e", NULL, ffOPTRD },
         { efCPT, NULL, NULL, ffOPTRD },
@@ -650,9 +637,9 @@ int gmx_dump(int argc, char *argv[])
     }
 
 
-    if (ftp2bSet(efTPX, NFILE, fnm))
+    if (ftp2bSet(efTPR, NFILE, fnm))
     {
-        list_tpx(ftp2fn(efTPX, NFILE, fnm), bShowNumbers,
+        list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers,
                  ftp2fn_null(efMDP, NFILE, fnm), bSysTop);
     }
     else if (ftp2bSet(efTRX, NFILE, fnm))
index 08b7b77b73b2a67263c0bd6a720991d8433f7a6e..cf0195e1e3f3379586942d8bfa602983a0a0e100 100644 (file)
@@ -35,8 +35,6 @@
 #ifndef GMX_TOOLS_DUMP_H
 #define GMX_TOOLS_DUMP_H
 
-#include "gromacs/legacyheaders/types/simple.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/gromacs/topology/CMakeLists.txt b/src/gromacs/topology/CMakeLists.txt
new file mode 100644 (file)
index 0000000..fc8b546
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+file(GLOB TOPOLOGY_SOURCES *.cpp *.c)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOPOLOGY_SOURCES} PARENT_SCOPE)
+
+gmx_install_headers(
+    atomprop.h
+    atoms.h
+    block.h
+    idef.h
+    index.h
+    mtop_util.h
+    symtab.h
+    topology.h
+    )
+
+if (BUILD_TESTING)
+#    add_subdirectory(tests)
+endif()
similarity index 93%
rename from src/gromacs/gmxlib/atomprop.c
rename to src/gromacs/topology/atomprop.cpp
index c899adceaaa26a54b51da4eb97a5233d432c7ee2..0c237a122006200f8b8841650c0323769941b9bf 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "atomprop.h"
 
 #include <ctype.h>
+#include <stdio.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gmx_fatal.h"
-#include "atomprop.h"
-#include "macros.h"
-#include "index.h"
-#include "copyrite.h"
-
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/strdb.h"
+#include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/math/utilities.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     gmx_bool    bSet;
@@ -66,9 +63,9 @@ typedef struct {
 } aprop_t;
 
 typedef struct gmx_atomprop {
-    gmx_bool          bWarned, bWarnVDW;
-    aprop_t           prop[epropNR];
-    gmx_residuetype_t restype;
+    gmx_bool           bWarned, bWarnVDW;
+    aprop_t            prop[epropNR];
+    gmx_residuetype_t *restype;
 } gmx_atomprop;
 
 
@@ -97,7 +94,7 @@ static int dbcmp_len(char *search, char *database)
     return i;
 }
 
-static int get_prop_index(aprop_t *ap, gmx_residuetype_t restype,
+static int get_prop_index(aprop_t *ap, gmx_residuetype_t *restype,
                           char *resnm, char *atomnm,
                           gmx_bool *bExact)
 {
@@ -158,7 +155,7 @@ static int get_prop_index(aprop_t *ap, gmx_residuetype_t restype,
     return j;
 }
 
-static void add_prop(aprop_t *ap, gmx_residuetype_t restype,
+static void add_prop(aprop_t *ap, gmx_residuetype_t *restype,
                      char *resnm, char *atomnm,
                      real p, int line)
 {
@@ -184,8 +181,8 @@ static void add_prop(aprop_t *ap, gmx_residuetype_t restype,
                 ap->bAvail[i] = FALSE;
             }
         }
-        ap->atomnm[ap->nprop] = strdup(atomnm);
-        ap->resnm[ap->nprop]  = strdup(resnm);
+        ap->atomnm[ap->nprop] = gmx_strdup(atomnm);
+        ap->resnm[ap->nprop]  = gmx_strdup(resnm);
         j                     = ap->nprop;
         ap->nprop++;
     }
@@ -227,7 +224,7 @@ static void read_prop(gmx_atomprop_t aps, int eprop, double factor)
     while (get_a_line(fp, line, STRLEN))
     {
         line_no++;
-        if (sscanf(line, "%s %s %lf", resnm, atomnm, &pp) == 3)
+        if (sscanf(line, "%31s %31s %20lf", resnm, atomnm, &pp) == 3)
         {
             pp *= factor;
             add_prop(ap, aps->restype, resnm, atomnm, pp, line_no);
@@ -256,7 +253,7 @@ static void set_prop(gmx_atomprop_t aps, int eprop)
     ap = &ap2->prop[eprop];
     if (!ap->bSet)
     {
-        ap->db  = strdup(fns[eprop]);
+        ap->db  = gmx_strdup(fns[eprop]);
         ap->def = def[eprop];
         read_prop(aps, eprop, fac[eprop]);
 
@@ -282,7 +279,6 @@ static void set_prop(gmx_atomprop_t aps, int eprop)
 gmx_atomprop_t gmx_atomprop_init(void)
 {
     gmx_atomprop *aps;
-    int           p;
 
     snew(aps, 1);
 
@@ -351,7 +347,6 @@ gmx_bool gmx_atomprop_query(gmx_atomprop_t aps,
                             real *value)
 {
     gmx_atomprop *ap = (gmx_atomprop*) aps;
-    size_t        i;
     int           j;
 #define MAXQ 32
     char          atomname[MAXQ], resname[MAXQ];
@@ -368,8 +363,9 @@ gmx_bool gmx_atomprop_query(gmx_atomprop_t aps,
     }
     if (isdigit(atomnm[0]))
     {
+        int i;
         /* put digit after atomname */
-        for (i = 1; (i < min(MAXQ-1, strlen(atomnm))); i++)
+        for (i = 1; i < MAXQ-1 && atomnm[i] != '\0'; i++)
         {
             atomname[i-1] = atomnm[i];
         }
@@ -431,5 +427,5 @@ int gmx_atomprop_atomnumber(gmx_atomprop_t aps, const char *elem)
             return gmx_nint(ap->prop[epropElement].value[i]);
         }
     }
-    return NOTSET;
+    return -1;
 }
similarity index 92%
rename from src/gromacs/legacyheaders/atomprop.h
rename to src/gromacs/topology/atomprop.h
index c70f760ec514e70b8dd09a0095d6be8124b93082..5723123ac7b15718670ebb5d5b4d81641e59c1b9 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_TOPOLOGY_ATOMPROP_H
+#define GMX_TOPOLOGY_ATOMPROP_H
 
-#ifndef _atomprop_h
-#define _atomprop_h
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include "index.h"
-
 /* Abstract type for the atom property database */
 typedef struct gmx_atomprop *gmx_atomprop_t;
 
@@ -75,5 +75,4 @@ gmx_bool gmx_atomprop_query(gmx_atomprop_t aps,
 }
 #endif
 
-
 #endif
diff --git a/src/gromacs/topology/atoms.cpp b/src/gromacs/topology/atoms.cpp
new file mode 100644 (file)
index 0000000..9d08424
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "atoms.h"
+
+#include <cstring>
+
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/smalloc.h"
+
+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;
+}
+
+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;
+}
+
+void done_atom(t_atoms *at)
+{
+    at->nr       = 0;
+    at->nres     = 0;
+    sfree(at->atom);
+    sfree(at->resinfo);
+    sfree(at->atomname);
+    sfree(at->atomtype);
+    sfree(at->atomtypeB);
+    if (at->pdbinfo)
+    {
+        sfree(at->pdbinfo);
+    }
+}
+
+void done_atomtypes(t_atomtypes *atype)
+{
+    atype->nr = 0;
+    sfree(atype->radius);
+    sfree(atype->vol);
+    sfree(atype->surftens);
+    sfree(atype->atomnumber);
+    sfree(atype->gb_radius);
+    sfree(atype->S_hct);
+}
+
+void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra)
+{
+    int i;
+
+    if (natom_extra > 0)
+    {
+        srenew(atoms->atomname, atoms->nr+natom_extra);
+        srenew(atoms->atom, atoms->nr+natom_extra);
+        if (NULL != atoms->pdbinfo)
+        {
+            srenew(atoms->pdbinfo, atoms->nr+natom_extra);
+        }
+        if (NULL != atoms->atomtype)
+        {
+            srenew(atoms->atomtype, atoms->nr+natom_extra);
+        }
+        if (NULL != atoms->atomtypeB)
+        {
+            srenew(atoms->atomtypeB, atoms->nr+natom_extra);
+        }
+        for (i = atoms->nr; (i < atoms->nr+natom_extra); i++)
+        {
+            atoms->atomname[i] = NULL;
+            memset(&atoms->atom[i], 0, sizeof(atoms->atom[i]));
+            if (NULL != atoms->pdbinfo)
+            {
+                std::memset(&atoms->pdbinfo[i], 0, sizeof(atoms->pdbinfo[i]));
+            }
+            if (NULL != atoms->atomtype)
+            {
+                atoms->atomtype[i] = NULL;
+            }
+            if (NULL != atoms->atomtypeB)
+            {
+                atoms->atomtypeB[i] = NULL;
+            }
+        }
+        atoms->nr += natom_extra;
+    }
+    if (nres_extra > 0)
+    {
+        srenew(atoms->resinfo, atoms->nres+nres_extra);
+        for (i = atoms->nres; (i < atoms->nres+nres_extra); i++)
+        {
+            std::memset(&atoms->resinfo[i], 0, sizeof(atoms->resinfo[i]));
+        }
+        atoms->nres += nres_extra;
+    }
+}
+
+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;
+    snew(atoms->resinfo, natoms);
+    snew(atoms->atom, natoms);
+    if (bPdbinfo)
+    {
+        snew(atoms->pdbinfo, natoms);
+    }
+    else
+    {
+        atoms->pdbinfo = NULL;
+    }
+}
+
+t_atoms *copy_t_atoms(t_atoms *src)
+{
+    t_atoms *dst;
+    int      i;
+
+    snew(dst, 1);
+    init_t_atoms(dst, src->nr, (NULL != src->pdbinfo));
+    dst->nr = src->nr;
+    if (NULL != src->atomname)
+    {
+        snew(dst->atomname, src->nr);
+    }
+    if (NULL != src->atomtype)
+    {
+        snew(dst->atomtype, src->nr);
+    }
+    if (NULL != src->atomtypeB)
+    {
+        snew(dst->atomtypeB, src->nr);
+    }
+    for (i = 0; (i < src->nr); i++)
+    {
+        dst->atom[i] = src->atom[i];
+        if (NULL != src->pdbinfo)
+        {
+            dst->pdbinfo[i] = src->pdbinfo[i];
+        }
+        if (NULL != src->atomname)
+        {
+            dst->atomname[i]  = src->atomname[i];
+        }
+        if (NULL != src->atomtype)
+        {
+            dst->atomtype[i] = src->atomtype[i];
+        }
+        if (NULL != src->atomtypeB)
+        {
+            dst->atomtypeB[i] = src->atomtypeB[i];
+        }
+    }
+    dst->nres = src->nres;
+    for (i = 0; (i < src->nres); i++)
+    {
+        dst->resinfo[i] = src->resinfo[i];
+    }
+    return dst;
+}
+
+void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, t_symtab *symtab,
+                         const char *resname, int resnr, unsigned char ic,
+                         int chainnum, char chainid)
+{
+    t_resinfo *ri;
+
+    ri           = &atoms->resinfo[atoms->atom[atom_ind].resind];
+    ri->name     = put_symtab(symtab, resname);
+    ri->rtp      = NULL;
+    ri->nr       = resnr;
+    ri->ic       = ic;
+    ri->chainnum = chainnum;
+    ri->chainid  = chainid;
+}
+
+void free_t_atoms(t_atoms *atoms, gmx_bool bFreeNames)
+{
+    int i;
+
+    if (bFreeNames && atoms->atomname != NULL)
+    {
+        for (i = 0; i < atoms->nr; i++)
+        {
+            if (atoms->atomname[i] != NULL)
+            {
+                sfree(*atoms->atomname[i]);
+                *atoms->atomname[i] = NULL;
+            }
+        }
+    }
+    if (bFreeNames && atoms->resinfo != NULL)
+    {
+        for (i = 0; i < atoms->nres; i++)
+        {
+            if (atoms->resinfo[i].name != NULL)
+            {
+                sfree(*atoms->resinfo[i].name);
+                *atoms->resinfo[i].name = NULL;
+            }
+        }
+    }
+    if (bFreeNames && atoms->atomtype != NULL)
+    {
+        for (i = 0; i < atoms->nr; i++)
+        {
+            if (atoms->atomtype[i] != NULL)
+            {
+                sfree(*atoms->atomtype[i]);
+                *atoms->atomtype[i] = NULL;
+            }
+        }
+    }
+    if (bFreeNames && atoms->atomtypeB != NULL)
+    {
+        for (i = 0; i < atoms->nr; i++)
+        {
+            if (atoms->atomtypeB[i] != NULL)
+            {
+                sfree(*atoms->atomtypeB[i]);
+                *atoms->atomtypeB[i] = NULL;
+            }
+        }
+    }
+    sfree(atoms->atomname);
+    sfree(atoms->atomtype);
+    sfree(atoms->atomtypeB);
+    sfree(atoms->resinfo);
+    sfree(atoms->atom);
+    sfree(atoms->pdbinfo);
+    atoms->nr        = 0;
+    atoms->nres      = 0;
+    atoms->atomname  = NULL;
+    atoms->atomtype  = NULL;
+    atoms->atomtypeB = NULL;
+    atoms->resinfo   = NULL;
+    atoms->atom      = NULL;
+    atoms->pdbinfo   = NULL;
+}
similarity index 78%
rename from src/gromacs/legacyheaders/types/atoms.h
rename to src/gromacs/topology/atoms.h
index 790520803ed9e03274b7068e4eaf74359541bf3e..ed8d96c2aedd73de512a27d1c6ffbed588855f2a 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _atoms_h
-#define _atoms_h
+#ifndef GMX_TOPOLOGY_ATOMS_H
+#define GMX_TOPOLOGY_ATOMS_H
 
-
-#include "simple.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_symtab;
+
 enum {
     eptAtom, eptNucleus, eptShell, eptBond, eptVSite, eptNR
 };
 /* The particle type */
 
-typedef struct {
+typedef struct t_atom
+{
     real           m, q;        /* Mass and charge                      */
     real           mB, qB;      /* Mass and charge for Free Energy calc */
     unsigned short type;        /* Atom type                            */
@@ -60,7 +63,8 @@ typedef struct {
     char           elem[4];     /* Element name                         */
 } t_atom;
 
-typedef struct {
+typedef struct t_resinfo
+{
     char          **name;       /* Pointer to the residue name          */
     int             nr;         /* Residue number                       */
     unsigned char   ic;         /* Code for insertion of residues       */
@@ -69,7 +73,8 @@ typedef struct {
     char          **rtp;        /* rtp building block name (optional)   */
 } t_resinfo;
 
-typedef struct {
+typedef struct t_pdbinfo
+{
     int      type;              /* PDB record name                      */
     int      atomnr;            /* PDB atom number                      */
     char     altloc;            /* Alternate location indicator         */
@@ -80,12 +85,14 @@ typedef struct {
     int      uij[6];            /* Anisotropic B-factor                 */
 } t_pdbinfo;
 
-typedef struct {
+typedef struct t_grps
+{
     int   nr;                   /* Number of different groups           */
     int  *nm_ind;               /* Index in the group names             */
 } t_grps;
 
-typedef struct {
+typedef struct t_atoms
+{
     int            nr;          /* Nr of atoms                          */
     t_atom        *atom;        /* Array of atoms (dim: nr)             */
                                 /* The following entries will not       */
@@ -101,7 +108,8 @@ typedef struct {
     t_pdbinfo       *pdbinfo;   /* PDB Information, such as aniso. Bfac */
 } t_atoms;
 
-typedef struct {
+typedef struct t_atomtypes
+{
     int           nr;           /* number of atomtypes                          */
     real         *radius;       /* GBSA radius for each atomtype                */
     real         *vol;          /* GBSA efective volume for each atomtype       */
@@ -111,9 +119,36 @@ typedef struct {
     int          *atomnumber;   /* Atomic number, used for QM/MM                */
 } t_atomtypes;
 
-
 #define PERTURBED(a) (((a).mB != (a).m) || ((a).qB != (a).q) || ((a).typeB != (a).type))
 
+void init_atom(t_atoms *at);
+void init_atomtypes(t_atomtypes *at);
+void done_atom(t_atoms *at);
+void done_atomtypes(t_atomtypes *at);
+
+void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo);
+/* allocate memory for the arrays, set nr to natoms and nres to 0
+ * set pdbinfo to NULL or allocate memory for it */
+
+t_atoms *copy_t_atoms(t_atoms *src);
+/* copy an atoms struct from src to a new one */
+
+void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra);
+/* allocate extra space for more atoms and or residues */
+
+void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, struct t_symtab *symtab,
+                         const char *resname, int resnr, unsigned char ic,
+                         int chainnum, char chainid);
+/* Set the residue name, number, insertion code and chain identifier
+ * of atom index atom_ind.
+ */
+
+void free_t_atoms(t_atoms *atoms, gmx_bool bFreeNames);
+/* Free all the arrays and set the nr and nres to 0.
+ * bFreeNames tells if to free the atom and residue name strings,
+ * don't free them if they still need to be used in e.g. the topology struct.
+ */
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/gromacs/topology/atomsbuilder.cpp b/src/gromacs/topology/atomsbuilder.cpp
new file mode 100644 (file)
index 0000000..fda0c0f
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements classes from atomsbuilder.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ */
+#include "gmxpre.h"
+
+#include "atomsbuilder.h"
+
+#include <algorithm>
+
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/smalloc.h"
+
+namespace gmx
+{
+
+/********************************************************************
+ * AtomsBuilder
+ */
+
+AtomsBuilder::AtomsBuilder(t_atoms *atoms)
+    : atoms_(atoms), nrAlloc_(atoms->nr), nresAlloc_(atoms->nres),
+      currentResidueIndex_(atoms->nres), nextResidueNumber_(-1)
+{
+    if (atoms->nres > 0)
+    {
+        nextResidueNumber_ = atoms->resinfo[atoms->nres - 1].nr + 1;
+    }
+}
+
+AtomsBuilder::~AtomsBuilder()
+{
+}
+
+void AtomsBuilder::reserve(int atomCount, int residueCount)
+{
+    srenew(atoms_->atom,     atomCount);
+    srenew(atoms_->atomname, atomCount);
+    srenew(atoms_->resinfo,  residueCount);
+    nrAlloc_   = atomCount;
+    nresAlloc_ = residueCount;
+}
+
+void AtomsBuilder::clearAtoms()
+{
+    atoms_->nr           = 0;
+    atoms_->nres         = 0;
+    currentResidueIndex_ = 0;
+    nextResidueNumber_   = -1;
+}
+
+int AtomsBuilder::currentAtomCount() const
+{
+    return atoms_->nr;
+}
+
+void AtomsBuilder::setNextResidueNumber(int number)
+{
+    nextResidueNumber_ = number;
+}
+
+void AtomsBuilder::addAtom(const t_atoms &atoms, int i)
+{
+    const int index = atoms_->nr;
+    atoms_->atom[index]        = atoms.atom[i];
+    atoms_->atomname[index]    = atoms.atomname[i];
+    atoms_->atom[index].resind = currentResidueIndex_;
+    ++atoms_->nr;
+}
+
+void AtomsBuilder::startResidue(const t_resinfo &resinfo)
+{
+    if (nextResidueNumber_ == -1)
+    {
+        nextResidueNumber_ = resinfo.nr;
+    }
+    const int index = atoms_->nres;
+    atoms_->resinfo[index]    = resinfo;
+    atoms_->resinfo[index].nr = nextResidueNumber_;
+    ++nextResidueNumber_;
+    currentResidueIndex_      = index;
+    ++atoms_->nres;
+}
+
+void AtomsBuilder::finishResidue(const t_resinfo &resinfo)
+{
+    if (nextResidueNumber_ == -1)
+    {
+        nextResidueNumber_ = resinfo.nr;
+    }
+    const int index = currentResidueIndex_;
+    atoms_->resinfo[index]    = resinfo;
+    atoms_->resinfo[index].nr = nextResidueNumber_;
+    ++nextResidueNumber_;
+    currentResidueIndex_      = index + 1;
+    if (index >= atoms_->nres)
+    {
+        ++atoms_->nres;
+    }
+}
+
+void AtomsBuilder::discardCurrentResidue()
+{
+    int index = atoms_->nr - 1;
+    while (index > 0 && atoms_->atom[index - 1].resind == currentResidueIndex_)
+    {
+        --index;
+    }
+    atoms_->nr   = index;
+    atoms_->nres = currentResidueIndex_;
+}
+
+void AtomsBuilder::mergeAtoms(const t_atoms &atoms)
+{
+    if (atoms_->nr + atoms.nr > nrAlloc_
+        || atoms_->nres + atoms.nres > nresAlloc_)
+    {
+        reserve(atoms_->nr + atoms.nr, atoms_->nres + atoms.nres);
+    }
+    int prevResInd = -1;
+    for (int i = 0; i < atoms.nr; ++i)
+    {
+        const int resind = atoms.atom[i].resind;
+        if (resind != prevResInd)
+        {
+            startResidue(atoms.resinfo[resind]);
+            prevResInd = resind;
+        }
+        addAtom(atoms, i);
+    }
+}
+
+/********************************************************************
+ * AtomsRemover
+ */
+
+AtomsRemover::AtomsRemover(const t_atoms &atoms)
+    : removed_(atoms.nr, 0)
+{
+}
+
+AtomsRemover::~AtomsRemover()
+{
+}
+
+void AtomsRemover::markAll()
+{
+    std::fill(removed_.begin(), removed_.end(), 1);
+}
+
+void AtomsRemover::markResidue(const t_atoms &atoms, int atomIndex, bool bStatus)
+{
+    const int resind = atoms.atom[atomIndex].resind;
+    while (atomIndex > 0 && resind == atoms.atom[atomIndex - 1].resind)
+    {
+        --atomIndex;
+    }
+    while (atomIndex < atoms.nr && resind == atoms.atom[atomIndex].resind)
+    {
+        removed_[atomIndex] = (bStatus ? 1 : 0);
+        ++atomIndex;
+    }
+}
+
+void AtomsRemover::removeMarkedVectors(rvec array[]) const
+{
+    for (size_t i = 0, j = 0; i < removed_.size(); ++i)
+    {
+        if (!removed_[i])
+        {
+            copy_rvec(array[i], array[j]);
+            ++j;
+        }
+    }
+}
+
+void AtomsRemover::removeMarkedValues(real array[]) const
+{
+    for (size_t i = 0, j = 0; i < removed_.size(); ++i)
+    {
+        if (!removed_[i])
+        {
+            array[j] = array[i];
+            ++j;
+        }
+    }
+}
+
+void AtomsRemover::removeMarkedAtoms(t_atoms *atoms) const
+{
+    const int    originalAtomCount = atoms->nr;
+    AtomsBuilder builder(atoms);
+    if (atoms->nr > 0)
+    {
+        builder.setNextResidueNumber(atoms->resinfo[0].nr);
+    }
+    builder.clearAtoms();
+    int          prevResInd = -1;
+    for (int i = 0; i < originalAtomCount; ++i)
+    {
+        if (!removed_[i])
+        {
+            const int resind = atoms->atom[i].resind;
+            if (resind != prevResInd)
+            {
+                builder.startResidue(atoms->resinfo[resind]);
+                prevResInd = resind;
+            }
+            builder.addAtom(*atoms, i);
+        }
+    }
+}
+
+} // namespace gmx
diff --git a/src/gromacs/topology/atomsbuilder.h b/src/gromacs/topology/atomsbuilder.h
new file mode 100644 (file)
index 0000000..56d1c42
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Utility classes for manipulating \c t_atoms structures.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ */
+#ifndef GMX_TOPOLOGY_ATOMSBUILDER_H
+#define GMX_TOPOLOGY_ATOMSBUILDER_H
+
+#include <vector>
+
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/classhelpers.h"
+#include "gromacs/utility/real.h"
+
+struct t_atoms;
+struct t_resinfo;
+
+namespace gmx
+{
+
+class AtomsBuilder
+{
+    public:
+        explicit AtomsBuilder(t_atoms *atoms);
+        ~AtomsBuilder();
+
+        void reserve(int atomCount, int residueCount);
+        void clearAtoms();
+
+        int currentAtomCount() const;
+
+        void setNextResidueNumber(int number);
+        void addAtom(const t_atoms &atoms, int i);
+        void startResidue(const t_resinfo &resinfo);
+        void finishResidue(const t_resinfo &resinfo);
+        void discardCurrentResidue();
+
+        void mergeAtoms(const t_atoms &atoms);
+
+    private:
+        t_atoms *atoms_;
+        int      nrAlloc_;
+        int      nresAlloc_;
+        int      currentResidueIndex_;
+        int      nextResidueNumber_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(AtomsBuilder);
+};
+
+class AtomsRemover
+{
+    public:
+        explicit AtomsRemover(const t_atoms &atoms);
+        ~AtomsRemover();
+
+        void markAll();
+        void markResidue(const t_atoms &atoms, int atomIndex, bool bStatus);
+        bool isMarked(int atomIndex) const { return removed_[atomIndex] != 0; }
+
+        void removeMarkedVectors(rvec array[]) const;
+        void removeMarkedValues(real array[]) const;
+        void removeMarkedAtoms(t_atoms *atoms) const;
+
+    private:
+        std::vector<char> removed_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(AtomsRemover);
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/topology/block.cpp b/src/gromacs/topology/block.cpp
new file mode 100644 (file)
index 0000000..c4b2e51
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "block.h"
+
+#include <algorithm>
+
+#include "gromacs/utility/smalloc.h"
+
+void init_block(t_block *block)
+{
+    block->nr           = 0;
+    block->nalloc_index = 1;
+    snew(block->index, block->nalloc_index);
+    block->index[0]     = 0;
+}
+
+void init_blocka(t_blocka *block)
+{
+    block->nr           = 0;
+    block->nra          = 0;
+    block->nalloc_index = 1;
+    snew(block->index, block->nalloc_index);
+    block->index[0]     = 0;
+    block->nalloc_a     = 0;
+    block->a            = NULL;
+}
+
+t_blocka *new_blocka(void)
+{
+    t_blocka *block;
+
+    snew(block, 1);
+    snew(block->index, 1);
+
+    return block;
+}
+
+void done_block(t_block *block)
+{
+    block->nr    = 0;
+    sfree(block->index);
+    block->nalloc_index = 0;
+}
+
+void done_blocka(t_blocka *block)
+{
+    block->nr    = 0;
+    block->nra   = 0;
+    sfree(block->index);
+    sfree(block->a);
+    block->index        = NULL;
+    block->a            = NULL;
+    block->nalloc_index = 0;
+    block->nalloc_a     = 0;
+}
+
+void stupid_fill_block(t_block *grp, int natom, gmx_bool bOneIndexGroup)
+{
+    if (bOneIndexGroup)
+    {
+        grp->nalloc_index = 2;
+        snew(grp->index, grp->nalloc_index);
+        grp->index[0] = 0;
+        grp->index[1] = natom;
+        grp->nr       = 1;
+    }
+    else
+    {
+        grp->nalloc_index = natom+1;
+        snew(grp->index, grp->nalloc_index);
+        snew(grp->index, natom+1);
+        for (int i = 0; i <= natom; ++i)
+        {
+            grp->index[i] = i;
+        }
+        grp->nr = natom;
+    }
+}
+
+void stupid_fill_blocka(t_blocka *grp, int natom)
+{
+    grp->nalloc_a = natom;
+    snew(grp->a, grp->nalloc_a);
+    for (int i = 0; i < natom; ++i)
+    {
+        grp->a[i] = i;
+    }
+    grp->nra = natom;
+
+    grp->nalloc_index = natom + 1;
+    snew(grp->index, grp->nalloc_index);
+    for (int i = 0; i <= natom; ++i)
+    {
+        grp->index[i] = i;
+    }
+    grp->nr = natom;
+}
+
+void copy_blocka(const t_blocka *src, t_blocka *dest)
+{
+    dest->nr           = src->nr;
+    /* Workaround for inconsistent handling of nalloc_index in
+     * other parts of the code. Often nalloc_index and nalloc_a
+     * are not set.
+     */
+    dest->nalloc_index = std::max(src->nalloc_index, dest->nr + 1);
+    snew(dest->index, dest->nalloc_index);
+    for (int i = 0; i < dest->nr+1; ++i)
+    {
+        dest->index[i] = src->index[i];
+    }
+    dest->nra      = src->nra;
+    /* See above. */
+    dest->nalloc_a = std::max(src->nalloc_a, dest->nra);
+    snew(dest->a, dest->nalloc_a);
+    for (int i = 0; i < dest->nra; ++i)
+    {
+        dest->a[i] = src->a[i];
+    }
+}
similarity index 64%
rename from src/gromacs/legacyheaders/types/block.h
rename to src/gromacs/topology/block.h
index 0a753e2d84ac0572bc92dad27603238e6cca1213..a3680e1a62a9d5e3ae4c04a7f824aa67266e3f5d 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _block_h
-#define _block_h
+#ifndef GMX_TOPOLOGY_BLOCK_H
+#define GMX_TOPOLOGY_BLOCK_H
 
-
-#include "idef.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,26 +51,50 @@ extern "C" {
 
    This makes the mapping from atoms to molecules O(Nmolecules) instead
    of O(Natoms) in size.  */
-typedef struct {
-    int      nr;           /* The number of blocks                     */
+typedef struct t_block
+{
+    int      nr;           /* The number of blocks          */
     atom_id *index;        /* Array of indices (dim: nr+1)  */
-    int      nalloc_index; /* The allocation size for index        */
+    int      nalloc_index; /* The allocation size for index */
 } t_block;
 
-typedef struct {
-    int      nr;    /* The number of blocks                    */
-    atom_id *index; /* Array of indices in a (dim: nr+1)       */
-    int      nra;   /* The number of atoms          */
+typedef struct t_blocka
+{
+    int      nr;    /* The number of blocks              */
+    atom_id *index; /* Array of indices in a (dim: nr+1) */
+    int      nra;   /* The number of atoms               */
     atom_id *a;     /* Array of atom numbers in each group  */
-    /* (dim: nra)                              */
-    /* Block i (0<=i<nr) runs from             */
+    /* (dim: nra)                           */
+    /* Block i (0<=i<nr) runs from          */
     /* index[i] to index[i+1]-1. There will */
-    /* allways be an extra entry in index      */
-    /* to terminate the table          */
+    /* allways be an extra entry in index   */
+    /* to terminate the table               */
     int nalloc_index;           /* The allocation size for index        */
     int nalloc_a;               /* The allocation size for a            */
 } t_blocka;
 
+void init_block(t_block *block);
+void init_blocka(t_blocka *block);
+t_blocka *new_blocka(void);
+/* allocate new block */
+
+void done_block(t_block *block);
+void done_blocka(t_blocka *block);
+
+void copy_blocka(const t_blocka *src, t_blocka *dest);
+
+void stupid_fill_block(t_block *grp, int natom, gmx_bool bOneIndexGroup);
+/* Fill a block structure with numbers identical to the index
+ * (0, 1, 2, .. natom-1)
+ * If bOneIndexGroup, then all atoms are  lumped in one index group,
+ * otherwise there is one atom per index entry
+ */
+
+void stupid_fill_blocka(t_blocka *grp, int natom);
+/* Fill a block structure with numbers identical to the index
+ * (0, 1, 2, .. natom-1)
+ * There is one atom per index entry
+ */
 
 #ifdef __cplusplus
 }
similarity index 86%
rename from src/gromacs/legacyheaders/types/idef.h
rename to src/gromacs/topology/idef.h
index 51fa605399246d6d2fab1e5ecee234c7102ecb77..e243e453f1b4171c8556be1acccaa7e26139503e 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_TOPOLOGY_IDEF_H
+#define GMX_TOPOLOGY_IDEF_H
 
-
-#ifndef _idef_h
-#define _idef_h
-
-#include "simple.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -149,18 +147,12 @@ enum {
     F_DVDL_BONDED,
     F_DVDL_RESTRAINT,
     F_DVDL_TEMPERATURE, /* not calculated for now, but should just be the energy (NVT) or enthalpy (NPT), or 0 (NVE) */
-    F_NRE               /* This number is for the total number of energies     */
+    F_NRE               /* This number is for the total number of energies      */
 };
 
 #define IS_RESTRAINT_TYPE(ifunc) (((ifunc == F_POSRES) || (ifunc == F_FBPOSRES) || (ifunc == F_DISRES) || (ifunc == F_RESTRBONDS) || (ifunc == F_DISRESVIOL) || (ifunc == F_ORIRES) || (ifunc == F_ORIRESDEV) || (ifunc == F_ANGRES) || (ifunc == F_ANGRESZ) || (ifunc == F_DIHRES)))
 
-/* A macro for checking if ftype is an explicit pair-listed LJ or COULOMB
- * interaction type:
- * bonded LJ (usually 1-4), or special listed non-bonded for FEP.
- */
-#define IS_LISTED_LJ_C(ftype) ((ftype) >= F_LJ14 && (ftype) <= F_LJC_PAIRS_NB)
-
-typedef union
+typedef union t_iparams
 {
     /* Some parameters have A and B values for free energy calculations.
      * The B values are not used for regular simulations of course.
@@ -292,7 +284,7 @@ typedef int t_functype;
  * the remaining ones from nr_nonperturbed..(nr-1) are perturbed bonded
  * interactions.
  */
-typedef struct
+typedef struct t_ilist
 {
     int      nr;
     int      nr_nonperturbed;
@@ -304,36 +296,36 @@ typedef struct
  * The struct t_ilist defines a list of atoms with their interactions.
  * General field description:
  *   int nr
- *     the size (nr elements) of the interactions array (iatoms[]).
+ *      the size (nr elements) of the interactions array (iatoms[]).
  *   t_iatom *iatoms
  *  specifies which atoms are involved in an interaction of a certain
  *       type. The layout of this array is as follows:
  *
- *       +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
- *       |type1|at1|at2|at3|type2|at1|at2|type1|at1|at2|at3|type3|at1|at2|
- *       +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
+ *        +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
+ *        |type1|at1|at2|at3|type2|at1|at2|type1|at1|at2|at3|type3|at1|at2|
+ *        +-----+---+---+---+-----+---+---+-----+---+---+---+-----+---+---+...
  *
  *  So for interaction type type1 3 atoms are needed, and for type2 and
  *      type3 only 2. The type identifier is used to select the function to
- *     calculate the interaction and its actual parameters. This type
- *     identifier is an index in a params[] and functype[] array.
+ *      calculate the interaction and its actual parameters. This type
+ *      identifier is an index in a params[] and functype[] array.
  */
 
 typedef struct
 {
     real *cmap; /* Has length 4*grid_spacing*grid_spacing, */
     /* there are 4 entries for each cmap type (V,dVdx,dVdy,d2dVdxdy) */
-} cmapdata_t;
+} gmx_cmapdata_t;
 
-typedef struct
+typedef struct gmx_cmap_t
 {
-    int         ngrid;        /* Number of allocated cmap (cmapdata_t ) grids */
-    int         grid_spacing; /* Grid spacing */
-    cmapdata_t *cmapdata;     /* Pointer to grid with actual, pre-interpolated data */
+    int             ngrid;        /* Number of allocated cmap (cmapdata_t ) grids */
+    int             grid_spacing; /* Grid spacing */
+    gmx_cmapdata_t *cmapdata;     /* Pointer to grid with actual, pre-interpolated data */
 } gmx_cmap_t;
 
 
-typedef struct
+typedef struct gmx_ffparams_t
 {
     int         ntypes;
     int         atnr;
@@ -348,7 +340,7 @@ enum {
     ilsortUNKNOWN, ilsortNO_FE, ilsortFE_UNSORTED, ilsortFE_SORTED
 };
 
-typedef struct
+typedef struct t_idef
 {
     int         ntypes;
     int         atnr;
@@ -372,24 +364,24 @@ typedef struct
  * version of the program  can use it as easy as the single node version.
  * General field description:
  *   int ntypes
- *     defines the number of elements in functype[] and param[].
+ *      defines the number of elements in functype[] and param[].
  *   int nodeid
  *      the node id (if parallel machines)
  *   int atnr
  *      the number of atomtypes
  *   t_functype *functype
- *     array of length ntypes, defines for every force type what type of
+ *      array of length ntypes, defines for every force type what type of
  *      function to use. Every "bond" with the same function but different
- *     force parameters is a different force type. The type identifier in the
- *     forceatoms[] array is an index in this array.
+ *      force parameters is a different force type. The type identifier in the
+ *      forceatoms[] array is an index in this array.
  *   t_iparams *iparams
- *     array of length ntypes, defines the parameters for every interaction
+ *      array of length ntypes, defines the parameters for every interaction
  *      type. The type identifier in the actual interaction list
  *      (ilist[ftype].iatoms[]) is an index in this array.
  *   gmx_cmap_t cmap_grid
  *      the grid for the dihedral pair correction maps.
  *   t_iparams *iparams_posres, *iparams_fbposres
- *     defines the parameters for position restraints only.
+ *      defines the parameters for position restraints only.
  *      Position restraints are the only interactions that have different
  *      parameters (reference positions) for different molecules
  *      of the same type. ilist[F_POSRES].iatoms[] is an index in this array.
@@ -409,15 +401,8 @@ typedef struct
  *      should be at least F_NRE*(nthreads+1).
  */
 
-typedef struct {
-    int   n;      /* n+1 is the number of points */
-    real  scale;  /* distance between two points */
-    real *data;   /* the actual table data, per point there are 4 numbers */
-} bondedtable_t;
-
 #ifdef __cplusplus
 }
 #endif
 
-
 #endif
similarity index 78%
rename from src/gromacs/gmxlib/index.c
rename to src/gromacs/topology/index.cpp
index 1ac6062a0b12652b029106200c1a2d3b8e91dd7f..040966c2ac7ede74ef6cef9fcd34157851914b0d 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "index.h"
+
+#include <assert.h>
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
-#include <assert.h>
-#include "sysstuff.h"
-#include "macros.h"
-#include "names.h"
-#include "gromacs/utility/cstringutil.h"
-#include "main.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "invblock.h"
-#include "macros.h"
-#include "index.h"
-#include "txtdump.h"
 
-#include "gromacs/fileio/futil.h"
+#include <algorithm>
+
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/strdb.h"
-#include "gmx_fatal.h"
-
-const char gmx_residuetype_undefined[] = "Other";
-
-struct gmx_residuetype
-{
-    int      n;
-    char **  resname;
-    char **  restype;
-
-};
-
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/invblock.h"
+#include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static gmx_bool gmx_ask_yesno(gmx_bool bASK)
 {
@@ -89,16 +77,6 @@ static gmx_bool gmx_ask_yesno(gmx_bool bASK)
     }
 }
 
-t_blocka *new_blocka(void)
-{
-    t_blocka *block;
-
-    snew(block, 1);
-    snew(block->index, 1);
-
-    return block;
-}
-
 void write_index(const char *outf, t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms)
 {
     FILE *out;
@@ -148,7 +126,7 @@ void add_grp(t_blocka *b, char ***gnames, int nra, atom_id a[], const char *name
 
     srenew(b->index, b->nr+2);
     srenew(*gnames, b->nr+1);
-    (*gnames)[b->nr] = strdup(name);
+    (*gnames)[b->nr] = gmx_strdup(name);
 
     srenew(b->a, b->nra+nra);
     for (i = 0; (i < nra); i++)
@@ -189,11 +167,10 @@ static gmx_bool grp_cmp(t_blocka *b, int nra, atom_id a[], int index)
 }
 
 static void
-p_status(const char **restype, int nres, const char **typenames, int ntypes)
+p_status(const char *const *restype, int nres,
+         const char *const *typenames, int ntypes)
 {
     int   i, j;
-    int   found;
-
     int * counter;
 
     snew(counter, ntypes);
@@ -203,7 +180,6 @@ p_status(const char **restype, int nres, const char **typenames, int ntypes)
     }
     for (i = 0; i < nres; i++)
     {
-        found = 0;
         for (j = 0; j < ntypes; j++)
         {
             if (!gmx_strcasecmp(restype[i], typenames[j]))
@@ -225,7 +201,7 @@ p_status(const char **restype, int nres, const char **typenames, int ntypes)
 }
 
 
-atom_id *
+static atom_id *
 mk_aid(t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
 /* Make an array of atom_ids for all atoms with residuetypes matching typestring, or the opposite if bMatch is false */
 {
@@ -263,7 +239,7 @@ static void analyse_other(const char ** restype, t_atoms *atoms,
     restp_t *restp = NULL;
     char   **attp  = NULL;
     char    *rname, *aname;
-    atom_id *other_ndx, *aid, *aaid;
+    atom_id *aid, *aaid;
     int      i, j, k, l, resind, naid, naaid, natp, nrestp = 0;
 
     for (i = 0; (i < atoms->nres); i++)
@@ -280,7 +256,6 @@ static void analyse_other(const char ** restype, t_atoms *atoms,
         {
             printf("Analysing residues not classified as Protein/DNA/RNA/Water and splitting into groups...\n");
         }
-        snew(other_ndx, atoms->nr);
         for (k = 0; (k < atoms->nr); k++)
         {
             resind = atoms->atom[k].resind;
@@ -299,11 +274,10 @@ static void analyse_other(const char ** restype, t_atoms *atoms,
                 if (l == nrestp)
                 {
                     srenew(restp, nrestp+1);
-                    restp[nrestp].rname = strdup(rname);
+                    restp[nrestp].rname = gmx_strdup(rname);
                     restp[nrestp].bNeg  = FALSE;
-                    restp[nrestp].gname = strdup(rname);
+                    restp[nrestp].gname = gmx_strdup(rname);
                     nrestp++;
-
                 }
             }
         }
@@ -365,10 +339,12 @@ static void analyse_other(const char ** restype, t_atoms *atoms,
                     sfree(attp);
                     attp = NULL;
                 }
-                sfree(aid);
             }
+            sfree(aid);
+            sfree(restp[i].rname);
+            sfree(restp[i].gname);
         }
-        sfree(other_ndx);
+        sfree(restp);
     }
 }
 
@@ -381,7 +357,7 @@ typedef struct gmx_help_make_index_group
     /** The set of atom names that will be used to form this index group */
     const char **defining_atomnames;
     /** Size of the defining_atomnames array */
-    const int    num_defining_atomnames;
+    int          num_defining_atomnames;
     /** Name of this index group */
     const char  *group_name;
     /** Whether the above atom names name the atoms in the group, or
@@ -432,7 +408,7 @@ static void analyse_prot(const char ** restype, t_atoms *atoms,
 
     int         n, j;
     atom_id    *aid;
-    int         nra, nnpres, npres;
+    int         nra, npres;
     gmx_bool    match;
     char        ndx_name[STRLEN], *atnm;
     int         i;
@@ -590,7 +566,6 @@ static void analyse_prot(const char ** restype, t_atoms *atoms,
             if (nra > 0)
             {
                 add_grp(gb, gn, nra, aid, "SwapSC-CO");
-                nra = 0;
             }
         }
     }
@@ -598,257 +573,16 @@ static void analyse_prot(const char ** restype, t_atoms *atoms,
 }
 
 
-
-
-/* Return 0 if the name was found, otherwise -1.
- * p_restype is set to a pointer to the type name, or 'Other' if we did not find it.
- */
-int
-gmx_residuetype_get_type(gmx_residuetype_t rt, const char * resname, const char ** p_restype)
-{
-    int    i, rc;
-
-    rc = -1;
-    for (i = 0; i < rt->n && rc; i++)
-    {
-        rc = gmx_strcasecmp(rt->resname[i], resname);
-    }
-
-    *p_restype = (rc == 0) ? rt->restype[i-1] : gmx_residuetype_undefined;
-
-    return rc;
-}
-
-int
-gmx_residuetype_add(gmx_residuetype_t rt, const char *newresname, const char *newrestype)
-{
-    int           i;
-    int           found;
-    const char *  p_oldtype;
-
-    found = !gmx_residuetype_get_type(rt, newresname, &p_oldtype);
-
-    if (found && gmx_strcasecmp(p_oldtype, newrestype))
-    {
-        fprintf(stderr, "Warning: Residue '%s' already present with type '%s' in database, ignoring new type '%s'.",
-                newresname, p_oldtype, newrestype);
-    }
-
-    if (found == 0)
-    {
-        srenew(rt->resname, rt->n+1);
-        srenew(rt->restype, rt->n+1);
-        rt->resname[rt->n] = strdup(newresname);
-        rt->restype[rt->n] = strdup(newrestype);
-        rt->n++;
-    }
-
-    return 0;
-}
-
-
-int
-gmx_residuetype_init(gmx_residuetype_t *prt)
-{
-    FILE                 *  db;
-    char                    line[STRLEN];
-    char                    resname[STRLEN], restype[STRLEN], dum[STRLEN];
-    char                 *  p;
-    int                     i;
-    struct gmx_residuetype *rt;
-
-    snew(rt, 1);
-    *prt = rt;
-
-    rt->n        = 0;
-    rt->resname  = NULL;
-    rt->restype  = NULL;
-
-    db = libopen("residuetypes.dat");
-
-    while (get_a_line(db, line, STRLEN))
-    {
-        strip_comment(line);
-        trim(line);
-        if (line[0] != '\0')
-        {
-            if (sscanf(line, "%s %s %s", resname, restype, dum) != 2)
-            {
-                gmx_fatal(FARGS, "Incorrect number of columns (2 expected) for line in residuetypes.dat");
-            }
-            gmx_residuetype_add(rt, resname, restype);
-        }
-    }
-
-    fclose(db);
-
-    return 0;
-}
-
-
-
-int
-gmx_residuetype_destroy(gmx_residuetype_t rt)
-{
-    int i;
-
-    for (i = 0; i < rt->n; i++)
-    {
-        sfree(rt->resname[i]);
-        sfree(rt->restype[i]);
-    }
-    sfree(rt->resname);
-    sfree(rt->restype);
-    sfree(rt);
-
-    return 0;
-}
-
-int
-gmx_residuetype_get_alltypes(gmx_residuetype_t    rt,
-                             const char ***       p_typenames,
-                             int *                ntypes)
-{
-    int            i, j, n;
-    int            found;
-    const char **  my_typename;
-    char       *   p;
-
-    n = 0;
-
-    my_typename = NULL;
-    for (i = 0; i < rt->n; i++)
-    {
-        p     = rt->restype[i];
-        found = 0;
-        for (j = 0; j < n && !found; j++)
-        {
-            found = !gmx_strcasecmp(p, my_typename[j]);
-        }
-
-        if (!found)
-        {
-            srenew(my_typename, n+1);
-            my_typename[n] = p;
-            n++;
-        }
-    }
-    *ntypes      = n;
-    *p_typenames = my_typename;
-
-    return 0;
-}
-
-
-
-gmx_bool
-gmx_residuetype_is_protein(gmx_residuetype_t rt, const char *resnm)
-{
-    gmx_bool    rc;
-    const char *p_type;
-
-    if (gmx_residuetype_get_type(rt, resnm, &p_type) == 0 &&
-        gmx_strcasecmp(p_type, "Protein") == 0)
-    {
-        rc = TRUE;
-    }
-    else
-    {
-        rc = FALSE;
-    }
-    return rc;
-}
-
-gmx_bool
-gmx_residuetype_is_dna(gmx_residuetype_t rt, const char *resnm)
-{
-    gmx_bool    rc;
-    const char *p_type;
-
-    if (gmx_residuetype_get_type(rt, resnm, &p_type) == 0 &&
-        gmx_strcasecmp(p_type, "DNA") == 0)
-    {
-        rc = TRUE;
-    }
-    else
-    {
-        rc = FALSE;
-    }
-    return rc;
-}
-
-gmx_bool
-gmx_residuetype_is_rna(gmx_residuetype_t rt, const char *resnm)
-{
-    gmx_bool    rc;
-    const char *p_type;
-
-    if (gmx_residuetype_get_type(rt, resnm, &p_type) == 0 &&
-        gmx_strcasecmp(p_type, "RNA") == 0)
-    {
-        rc = TRUE;
-    }
-    else
-    {
-        rc = FALSE;
-    }
-    return rc;
-}
-
-/* Return the size of the arrays */
-int
-gmx_residuetype_get_size(gmx_residuetype_t rt)
-{
-    return rt->n;
-}
-
-/* Search for a residuetype with name resnm within the
- * gmx_residuetype database. Return the index if found,
- * otherwise -1.
- */
-int
-gmx_residuetype_get_index(gmx_residuetype_t rt, const char *resnm)
-{
-    int i, rc;
-
-    rc = -1;
-    for (i = 0; i < rt->n && rc; i++)
-    {
-        rc = gmx_strcasecmp(rt->resname[i], resnm);
-    }
-
-    return (0 == rc) ? i-1 : -1;
-}
-
-/* Return the name of the residuetype with the given index, or
- * NULL if not found. */
-const char *
-gmx_residuetype_get_name(gmx_residuetype_t rt, int index)
-{
-    if (index >= 0 && index < rt->n)
-    {
-        return rt->resname[index];
-    }
-    else
-    {
-        return NULL;
-    }
-}
-
-
-
 void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
-    gmx_residuetype_t rt = NULL;
+    gmx_residuetype_t*rt = NULL;
     char             *resnm;
     atom_id          *aid;
     const char    **  restype;
     int               nra;
     int               i, k;
-    size_t            j;
     int               ntypes;
-    char           *  p;
-    const char     ** p_typename;
+    char           ** p_typename;
     int               iwater, iion;
     int               nwater, nion;
     int               found;
@@ -884,12 +618,13 @@ void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool b
         found = 0;
         for (k = 0; k < ntypes && !found; k++)
         {
+            assert(p_typename != NULL);
             found = !strcmp(restype[i], p_typename[k]);
         }
         if (!found)
         {
             srenew(p_typename, ntypes+1);
-            p_typename[ntypes++] = strdup(restype[i]);
+            p_typename[ntypes++] = gmx_strdup(restype[i]);
         }
     }
 
@@ -941,6 +676,7 @@ void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool b
             sfree(aid);
             analyse_other(restype, atoms, gb, gn, bASK, bVerb);
         }
+        sfree(p_typename[k]);
     }
 
     sfree(p_typename);
@@ -971,7 +707,7 @@ void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool b
     {
         srenew(gb->index, gb->nr+2);
         srenew(*gn, gb->nr+1);
-        (*gn)[gb->nr] = strdup("Water_and_ions");
+        (*gn)[gb->nr] = gmx_strdup("Water_and_ions");
         srenew(gb->a, gb->nra+nwater+nion);
         if (nwater > 0)
         {
@@ -1017,81 +753,52 @@ t_blocka *init_index(const char *gfile, char ***grpname)
 {
     FILE      *in;
     t_blocka  *b;
-    int        a, maxentries;
-    int        i, j, ng, nread;
+    int        maxentries;
+    int        i, j;
     char       line[STRLEN], *pt, str[STRLEN];
 
     in = gmx_fio_fopen(gfile, "r");
     snew(b, 1);
-    get_a_line(in, line, STRLEN);
-    if (line[0] == '[')
+    b->nr      = 0;
+    b->index   = NULL;
+    b->nra     = 0;
+    b->a       = NULL;
+    *grpname   = NULL;
+    maxentries = 0;
+    while (get_a_line(in, line, STRLEN))
     {
-        /* new format */
-        b->nr      = 0;
-        b->index   = NULL;
-        b->nra     = 0;
-        b->a       = NULL;
-        *grpname   = NULL;
-        maxentries = 0;
-        do
+        if (get_header(line, str))
         {
-            if (get_header(line, str))
+            b->nr++;
+            srenew(b->index, b->nr+1);
+            srenew(*grpname, b->nr);
+            if (b->nr == 1)
             {
-                b->nr++;
-                srenew(b->index, b->nr+1);
-                srenew(*grpname, b->nr);
-                if (b->nr == 1)
-                {
-                    b->index[0] = 0;
-                }
-                b->index[b->nr]     = b->index[b->nr-1];
-                (*grpname)[b->nr-1] = strdup(str);
-            }
-            else
-            {
-                if (b->nr == 0)
-                {
-                    gmx_fatal(FARGS, "The first header of your indexfile is invalid");
-                }
-                pt = line;
-                while (sscanf(pt, "%s", str) == 1)
-                {
-                    i = b->index[b->nr];
-                    if (i >= maxentries)
-                    {
-                        maxentries += 1024;
-                        srenew(b->a, maxentries);
-                    }
-                    b->a[i] = strtol(str, NULL, 10)-1;
-                    b->index[b->nr]++;
-                    (b->nra)++;
-                    pt = strstr(pt, str)+strlen(str);
-                }
+                b->index[0] = 0;
             }
+            b->index[b->nr]     = b->index[b->nr-1];
+            (*grpname)[b->nr-1] = gmx_strdup(str);
         }
-        while (get_a_line(in, line, STRLEN));
-    }
-    else
-    {
-        /* old format */
-        sscanf(line, "%d%d", &b->nr, &b->nra);
-        snew(b->index, b->nr+1);
-        snew(*grpname, b->nr);
-        b->index[0] = 0;
-        snew(b->a, b->nra);
-        for (i = 0; (i < b->nr); i++)
+        else
         {
-            nread         = fscanf(in, "%s%d", str, &ng);
-            (*grpname)[i] = strdup(str);
-            b->index[i+1] = b->index[i]+ng;
-            if (b->index[i+1] > b->nra)
+            if (b->nr == 0)
             {
-                gmx_fatal(FARGS, "Something wrong in your indexfile at group %s", str);
+                gmx_fatal(FARGS, "The first header of your indexfile is invalid");
             }
-            for (j = 0; (j < ng); j++)
+            pt = line;
+            while (sscanf(pt, "%s", str) == 1)
             {
-                nread               = fscanf(in, "%d", &a);
-                b->a[b->index[i]+j] = a;
+                i = b->index[b->nr];
+                if (i >= maxentries)
+                {
+                    maxentries += 1024;
+                    srenew(b->a, maxentries);
+                }
+                assert(b->a != NULL); // for clang analyzer
+                b->a[i] = strtol(str, NULL, 10)-1;
+                b->index[b->nr]++;
+                (b->nra)++;
+                pt = strstr(pt, str)+strlen(str);
             }
         }
     }
@@ -1099,6 +806,7 @@ t_blocka *init_index(const char *gfile, char ***grpname)
 
     for (i = 0; (i < b->nr); i++)
     {
+        assert(b->a != NULL); // for clang analyzer
         for (j = b->index[i]; (j < b->index[i+1]); j++)
         {
             if (b->a[j] < 0)
@@ -1261,7 +969,7 @@ static void rd_groups(t_blocka *grps, char **grpname, char *gnames[],
             fprintf(stderr, "There is one group in the index\n");
             gnr1 = 0;
         }
-        gnames[i] = strdup(grpname[gnr1]);
+        gnames[i] = gmx_strdup(grpname[gnr1]);
         isize[i]  = grps->index[gnr1+1]-grps->index[gnr1];
         snew(index[i], isize[i]);
         for (j = 0; (j < isize[i]); j++)
@@ -1339,7 +1047,7 @@ t_cluster_ndx *cluster_index(FILE *fplog, const char *ndx)
     c->maxframe  = -1;
     for (i = 0; (i < c->clust->nra); i++)
     {
-        c->maxframe = max(c->maxframe, c->clust->a[i]);
+        c->maxframe = std::max(c->maxframe, c->clust->a[i]);
     }
     fprintf(fplog ? fplog : stdout,
             "There are %d clusters containing %d structures, highest framenr is %d\n",
similarity index 70%
rename from src/gromacs/legacyheaders/index.h
rename to src/gromacs/topology/index.h
index b47267593683d391cdfc5fb7e76504482a3fb478..e361be73d5e3f819e5ea5d42962c07bb6478c448 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_TOPOLOGY_INDEX_H
+#define GMX_TOPOLOGY_INDEX_H
 
-#ifndef _index_h
-#define _index_h
+#include <stdio.h>
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct t_atoms;
+struct t_blocka;
+
 void check_index(char *gname, int n, atom_id index[],
                  char *traj, int natoms);
 /* Checks if any index is smaller than zero or larger than natoms,
@@ -51,7 +55,7 @@ void check_index(char *gname, int n, atom_id index[],
  * and traj (if traj=NULL, "the trajectory" is used).
  */
 
-t_blocka *init_index(const char *gfile, char ***grpname);
+struct t_blocka *init_index(const char *gfile, char ***grpname);
 /* Lower level routine than the next */
 
 void rd_index(const char *statfile, int ngrps, int isize[],
@@ -75,7 +79,7 @@ void rd_index_nrs(char *statfile, int ngrps, int isize[],
                   atom_id *index[], char *grpnames[], int grpnr[]);
 /* the same but also reads the number of the selected group*/
 
-void get_index(t_atoms *atoms, const char *fnm, int ngrps,
+void get_index(struct t_atoms *atoms, const char *fnm, int ngrps,
                int isize[], atom_id *index[], char *grpnames[]);
 /* Does the same as rd_index, but if the fnm pointer is NULL it
  * will not read from fnm, but it will make default index groups
@@ -83,72 +87,22 @@ void get_index(t_atoms *atoms, const char *fnm, int ngrps,
  */
 
 typedef struct {
-    int        maxframe;
-    char     **grpname;
-    t_blocka  *clust;
-    atom_id   *inv_clust;
+    int               maxframe;
+    char            **grpname;
+    struct t_blocka  *clust;
+    atom_id          *inv_clust;
 } t_cluster_ndx;
 
 t_cluster_ndx *cluster_index(FILE *fplog, const char *ndx);
 
-typedef struct {
-    int    n;
-    char **name;
-} t_names;
-
-typedef struct gmx_residuetype *
-    gmx_residuetype_t;
-
-int
-gmx_residuetype_init(gmx_residuetype_t *rt);
-
-int
-gmx_residuetype_destroy(gmx_residuetype_t rt);
-
-int
-gmx_residuetype_get_type(gmx_residuetype_t rt, const char * resname, const char ** p_restype);
-
-int
-gmx_residuetype_add(gmx_residuetype_t rt, const char *newresname, const char *newrestype);
-
-int
-gmx_residuetype_get_alltypes(gmx_residuetype_t    rt,
-                             const char ***       p_typenames,
-                             int *                ntypes);
-
-gmx_bool
-gmx_residuetype_is_protein(gmx_residuetype_t rt, const char *resnm);
-
-gmx_bool
-gmx_residuetype_is_dna(gmx_residuetype_t rt, const char *resnm);
-
-gmx_bool
-gmx_residuetype_is_rna(gmx_residuetype_t rt, const char *resnm);
 
-int
-gmx_residuetype_get_size(gmx_residuetype_t rt);
-
-int
-gmx_residuetype_get_index(gmx_residuetype_t rt, const char *resnm);
-
-const char *
-gmx_residuetype_get_name(gmx_residuetype_t rt, int index);
-
-
-
-
-
-
-t_blocka *new_blocka(void);
-/* allocate new block */
-
-void write_index(const char *outf, t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms);
+void write_index(const char *outf, struct t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms);
 /* Writes index blocks to outf (writes an indexfile) */
 
-void add_grp(t_blocka *b, char ***gnames, int nra, atom_id a[], const char *name);
+void add_grp(struct t_blocka *b, char ***gnames, int nra, atom_id a[], const char *name);
 /* Ads group a with name name to block b and namelist gnames */
 
-void analyse(t_atoms *atoms, t_blocka *gb, char ***gn,
+void analyse(struct t_atoms *atoms, struct t_blocka *gb, char ***gn,
              gmx_bool bASK, gmx_bool bVerb);
 /* Makes index groups gb with names gn for atoms in atoms.
  * bASK=FALSE gives default groups.
@@ -161,4 +115,4 @@ int find_group(char s[], int ngrps, char **grpname);
 }
 #endif
 
-#endif  /* _index_h */
+#endif
similarity index 96%
rename from src/gromacs/gmxlib/invblock.c
rename to src/gromacs/topology/invblock.c
index 235a1f6c2a4768c9b35fefb5ead9e16bf908e1ea..48107b2c5f82b2b7116f38add9b08e9d4a18f10c 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
 #include "invblock.h"
-#include "gmx_fatal.h"
+
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 atom_id *make_invblock(const t_block *block, int nr)
 {
similarity index 85%
rename from src/gromacs/legacyheaders/invblock.h
rename to src/gromacs/topology/invblock.h
index 68379dc5add09a75f3806eccbb5f107245ccfe1a..f30e98a95798c3229de2bd245d4b3f5b466171ab 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_TOPOLOGY_INVBLOCK_H
+#define GMX_TOPOLOGY_INVBLOCK_H
 
-#ifndef _invblock_h
-#define _invblock_h
-
-#include "typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-atom_id *make_invblock(const t_block *block, int nr);
+struct t_block;
+struct t_blocka;
+
+atom_id *make_invblock(const struct t_block *block, int nr);
 /* Inverse the block structure. nr is the maximum entry in the inversed
  * array, and therefore the dimension of the returned array
  */
 
-atom_id *make_invblocka(const t_blocka *block, int nr);
+atom_id *make_invblocka(const struct t_blocka *block, int nr);
 /* Inverse the block structure. nr is the maximum entry in the inversed
  * array, and therefore the dimension of the returned array
  */
@@ -58,4 +60,4 @@ atom_id *make_invblocka(const t_blocka *block, int nr);
 }
 #endif
 
-#endif  /* _invblock_h */
+#endif
similarity index 97%
rename from src/gromacs/gmxlib/mtop_util.c
rename to src/gromacs/topology/mtop_util.c
index 83c615634ea71e672df443ae5ac7fb5d144d4c93..24eb127af26c37942623e8894c977b917d2c1f5a 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.
  */
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "mtop_util.h"
 
+#include <limits.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/topology/topsort.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "mtop_util.h"
-#include "topsort.h"
-#include "symtab.h"
-#include "gmx_fatal.h"
 
 static int gmx_mtop_maxresnr(const gmx_mtop_t *mtop, int maxres_renum)
 {
@@ -400,9 +411,11 @@ void gmx_mtop_atominfo_global(const gmx_mtop_t *mtop, int atnr_global,
     {
         if (mb >= 0)
         {
+            /* cppcheck-suppress nullPointer #6330*/
             if (atoms->nres <= mtop->maxres_renum)
             {
                 /* Single residue molecule, keep counting */
+                /* cppcheck-suppress nullPointer #6330*/
                 maxresnr += mtop->molblock[mb].nmol*atoms->nres;
             }
         }
similarity index 79%
rename from src/gromacs/legacyheaders/mtop_util.h
rename to src/gromacs/topology/mtop_util.h
index 7c5172c75ee015f5528c65bb2a81193dc79c6a39..308476ea764b87d249d83d201d3b0f2d56982bb8 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 "typedefs.h"
+#ifndef GMX_TOPOLOGY_MTOP_UTIL_H
+#define GMX_TOPOLOGY_MTOP_UTIL_H
+
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+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;
+
 /* Should be called after generating or reading mtop,
  * to set some compute intesive variables to avoid
  * N^2 operations later on.
  */
 void
-gmx_mtop_finalize(gmx_mtop_t *mtop);
+gmx_mtop_finalize(struct gmx_mtop_t *mtop);
 
 /* Counts the number of atoms of each type. State should be 0 for
  * state A and 1 for state B types.  typecount should have at
  * least mtop->ffparams.atnr elements.
  */
 void
-gmx_mtop_count_atomtypes(const gmx_mtop_t *mtop, int state, int typecount[]);
+gmx_mtop_count_atomtypes(const struct gmx_mtop_t *mtop, int state, int typecount[]);
 
 /* Returns the total number of charge groups in mtop */
 int
-ncg_mtop(const gmx_mtop_t *mtop);
+ncg_mtop(const struct 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);
+void gmx_mtop_remove_chargegroups(struct gmx_mtop_t *mtop);
 
 
 /* Abstract data type for looking up atoms by global atom number */
@@ -67,11 +80,11 @@ 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);
+gmx_mtop_atomlookup_init(const struct 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);
+gmx_mtop_atomlookup_settle_init(const struct gmx_mtop_t *mtop);
 
 /* Destroy a gmx_mtop_atomlookup_t data structure */
 void
@@ -85,7 +98,7 @@ gmx_mtop_atomlookup_destroy(gmx_mtop_atomlookup_t alook);
 void
 gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook,
                         int                         atnr_global,
-                        t_atom                    **atom);
+                        struct t_atom             **atom);
 
 
 /* Returns a pointer to the molecule interaction array ilist_mol[F_NRE]
@@ -94,7 +107,7 @@ gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook,
 void
 gmx_mtop_atomnr_to_ilist(const gmx_mtop_atomlookup_t alook,
                          int atnr_global,
-                         t_ilist **ilist_mol, int *atnr_offset);
+                         struct t_ilist **ilist_mol, int *atnr_offset);
 
 
 /* Returns the molecule block index
@@ -110,7 +123,7 @@ gmx_mtop_atomnr_to_molblock_ind(const gmx_mtop_atomlookup_t alook,
 
 /* 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,
+gmx_mtop_atominfo_global(const struct gmx_mtop_t *mtop, int atnr_global,
                          char **atomname, int *resnr, char **resname);
 
 
@@ -124,7 +137,7 @@ typedef struct gmx_mtop_atomloop_all *gmx_mtop_atomloop_all_t;
  * otherwise use gmx_mtop_atomloop_block.
  */
 gmx_mtop_atomloop_all_t
-gmx_mtop_atomloop_all_init(const gmx_mtop_t *mtop);
+gmx_mtop_atomloop_all_init(const struct gmx_mtop_t *mtop);
 
 /* Loop to the next atom.
  * When not at the end:
@@ -141,7 +154,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, struct t_atom **atom);
 
 /* Return the atomname, the residue number and residue name
  * of the current atom in the loop.
@@ -155,7 +168,7 @@ gmx_mtop_atomloop_all_names(gmx_mtop_atomloop_all_t aloop,
  */
 void
 gmx_mtop_atomloop_all_moltype(gmx_mtop_atomloop_all_t aloop,
-                              gmx_moltype_t **moltype, int *at_mol);
+                              struct gmx_moltype_t **moltype, int *at_mol);
 
 
 /* Abstract type for atom loop over atoms in all molecule blocks */
@@ -164,7 +177,7 @@ typedef struct gmx_mtop_atomloop_block *gmx_mtop_atomloop_block_t;
 /* Initialize an atom loop over atoms in all molecule blocks the system.
  */
 gmx_mtop_atomloop_block_t
-gmx_mtop_atomloop_block_init(const gmx_mtop_t *mtop);
+gmx_mtop_atomloop_block_init(const struct gmx_mtop_t *mtop);
 
 /* Loop to the next atom.
  * When not at the end:
@@ -181,7 +194,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);
+                             struct t_atom **atom, int *nmol);
 
 
 /* Abstract type for ilist loop over all ilists */
@@ -189,7 +202,7 @@ typedef struct gmx_mtop_ilistloop *gmx_mtop_ilistloop_t;
 
 /* Initialize an ilist loop over all molecule types in the system. */
 gmx_mtop_ilistloop_t
-gmx_mtop_ilistloop_init(const gmx_mtop_t *mtop);
+gmx_mtop_ilistloop_init(const struct gmx_mtop_t *mtop);
 
 
 /* Loop to the next molecule,
@@ -200,7 +213,7 @@ gmx_mtop_ilistloop_init(const gmx_mtop_t *mtop);
  */
 gmx_bool
 gmx_mtop_ilistloop_next(gmx_mtop_ilistloop_t iloop,
-                        t_ilist **ilist_mol, int *nmol);
+                        struct t_ilist **ilist_mol, int *nmol);
 
 
 /* Abstract type for ilist loop over all ilists of all molecules */
@@ -212,7 +225,7 @@ typedef struct gmx_mtop_ilistloop_all *gmx_mtop_ilistloop_all_t;
  * otherwise use gmx_mtop_ilistloop.
  */
 gmx_mtop_ilistloop_all_t
-gmx_mtop_ilistloop_all_init(const gmx_mtop_t *mtop);
+gmx_mtop_ilistloop_all_init(const struct gmx_mtop_t *mtop);
 
 /* Loop to the next molecule,
  * When not at the end:
@@ -222,22 +235,22 @@ gmx_mtop_ilistloop_all_init(const gmx_mtop_t *mtop);
  */
 gmx_bool
 gmx_mtop_ilistloop_all_next(gmx_mtop_ilistloop_all_t iloop,
-                            t_ilist **ilist_mol, int *atnr_offset);
+                            struct t_ilist **ilist_mol, int *atnr_offset);
 
 
 /* Returns the total number of interactions in the system of type ftype */
 int
-gmx_mtop_ftype_count(const gmx_mtop_t *mtop, int ftype);
+gmx_mtop_ftype_count(const struct gmx_mtop_t *mtop, int ftype);
 
 
 /* Returns a charge group index for the whole system */
-t_block
-gmx_mtop_global_cgs(const gmx_mtop_t *mtop);
+struct t_block
+gmx_mtop_global_cgs(const struct gmx_mtop_t *mtop);
 
 
 /* Returns a single t_atoms struct for the whole system */
-t_atoms
-gmx_mtop_global_atoms(const gmx_mtop_t *mtop);
+struct t_atoms
+gmx_mtop_global_atoms(const struct gmx_mtop_t *mtop);
 
 
 /* Make all charge groups the size of one atom.
@@ -245,22 +258,24 @@ gmx_mtop_global_atoms(const gmx_mtop_t *mtop);
  * that consist of a single charge group.
  */
 void
-gmx_mtop_make_atomic_charge_groups(gmx_mtop_t *mtop, gmx_bool bKeepSingleMolCG);
+gmx_mtop_make_atomic_charge_groups(struct gmx_mtop_t *mtop, gmx_bool bKeepSingleMolCG);
 
 
 /* Generate a 'local' topology for the whole system.
  * When ir!=NULL the free energy interactions will be sorted to the end.
  */
-gmx_localtop_t *
-gmx_mtop_generate_local_top(const gmx_mtop_t *mtop, const t_inputrec *ir);
+struct gmx_localtop_t *
+gmx_mtop_generate_local_top(const struct gmx_mtop_t *mtop, const t_inputrec *ir);
 
 
 /* Converts a gmx_mtop_t struct to t_topology.
  * All memory relating only to mtop will be freed.
  */
-t_topology
-gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop);
+struct t_topology
+gmx_mtop_t_to_t_topology(struct gmx_mtop_t *mtop);
 
 #ifdef __cplusplus
 }
 #endif
+
+#endif
diff --git a/src/gromacs/topology/residuetypes.cpp b/src/gromacs/topology/residuetypes.cpp
new file mode 100644 (file)
index 0000000..6745c96
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2010,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#include "gmxpre.h"
+
+#include "residuetypes.h"
+
+#include <cassert>
+#include <cstdio>
+
+#include "gromacs/fileio/strdb.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+
+const char gmx_residuetype_undefined[] = "Other";
+
+struct gmx_residuetype_t
+{
+    int      n;
+    char **  resname;
+    char **  restype;
+};
+
+int
+gmx_residuetype_init(gmx_residuetype_t **prt)
+{
+    FILE                 *  db;
+    char                    line[STRLEN];
+    char                    resname[STRLEN], restype[STRLEN], dum[STRLEN];
+    gmx_residuetype_t      *rt;
+
+    snew(rt, 1);
+    *prt = rt;
+
+    rt->n        = 0;
+    rt->resname  = NULL;
+    rt->restype  = NULL;
+
+    db = libopen("residuetypes.dat");
+
+    while (get_a_line(db, line, STRLEN))
+    {
+        strip_comment(line);
+        trim(line);
+        if (line[0] != '\0')
+        {
+            if (sscanf(line, "%1000s %1000s %1000s", resname, restype, dum) != 2)
+            {
+                gmx_fatal(FARGS, "Incorrect number of columns (2 expected) for line in residuetypes.dat");
+            }
+            gmx_residuetype_add(rt, resname, restype);
+        }
+    }
+
+    fclose(db);
+
+    return 0;
+}
+
+int
+gmx_residuetype_destroy(gmx_residuetype_t *rt)
+{
+    int i;
+
+    for (i = 0; i < rt->n; i++)
+    {
+        sfree(rt->resname[i]);
+        sfree(rt->restype[i]);
+    }
+    sfree(rt->resname);
+    sfree(rt->restype);
+    sfree(rt);
+
+    return 0;
+}
+
+/* Return 0 if the name was found, otherwise -1.
+ * p_restype is set to a pointer to the type name, or 'Other' if we did not find it.
+ */
+int
+gmx_residuetype_get_type(gmx_residuetype_t *rt, const char * resname, const char ** p_restype)
+{
+    int    i, rc;
+
+    rc = -1;
+    for (i = 0; i < rt->n && rc; i++)
+    {
+        rc = gmx_strcasecmp(rt->resname[i], resname);
+    }
+
+    *p_restype = (rc == 0) ? rt->restype[i-1] : gmx_residuetype_undefined;
+
+    return rc;
+}
+
+int
+gmx_residuetype_add(gmx_residuetype_t *rt, const char *newresname, const char *newrestype)
+{
+    int           found;
+    const char *  p_oldtype;
+
+    found = !gmx_residuetype_get_type(rt, newresname, &p_oldtype);
+
+    if (found && gmx_strcasecmp(p_oldtype, newrestype))
+    {
+        fprintf(stderr, "Warning: Residue '%s' already present with type '%s' in database, ignoring new type '%s'.",
+                newresname, p_oldtype, newrestype);
+    }
+
+    if (found == 0)
+    {
+        srenew(rt->resname, rt->n+1);
+        srenew(rt->restype, rt->n+1);
+        rt->resname[rt->n] = gmx_strdup(newresname);
+        rt->restype[rt->n] = gmx_strdup(newrestype);
+        rt->n++;
+    }
+
+    return 0;
+}
+
+int
+gmx_residuetype_get_alltypes(gmx_residuetype_t   *rt,
+                             const char ***       p_typenames,
+                             int *                ntypes)
+{
+    int            i, n;
+    const char **  my_typename;
+
+    n           = 0;
+    my_typename = NULL;
+    for (i = 0; i < rt->n; i++)
+    {
+        const char *const p      = rt->restype[i];
+        bool              bFound = false;
+        for (int j = 0; j < n && !bFound; j++)
+        {
+            assert(my_typename != NULL);
+            bFound = !gmx_strcasecmp(p, my_typename[j]);
+        }
+        if (!bFound)
+        {
+            srenew(my_typename, n+1);
+            my_typename[n] = p;
+            n++;
+        }
+    }
+    *ntypes      = n;
+    *p_typenames = my_typename;
+
+    return 0;
+}
+
+gmx_bool
+gmx_residuetype_is_protein(gmx_residuetype_t *rt, const char *resnm)
+{
+    gmx_bool    rc;
+    const char *p_type;
+
+    if (gmx_residuetype_get_type(rt, resnm, &p_type) == 0 &&
+        gmx_strcasecmp(p_type, "Protein") == 0)
+    {
+        rc = TRUE;
+    }
+    else
+    {
+        rc = FALSE;
+    }
+    return rc;
+}
+
+gmx_bool
+gmx_residuetype_is_dna(gmx_residuetype_t *rt, const char *resnm)
+{
+    gmx_bool    rc;
+    const char *p_type;
+
+    if (gmx_residuetype_get_type(rt, resnm, &p_type) == 0 &&
+        gmx_strcasecmp(p_type, "DNA") == 0)
+    {
+        rc = TRUE;
+    }
+    else
+    {
+        rc = FALSE;
+    }
+    return rc;
+}
+
+gmx_bool
+gmx_residuetype_is_rna(gmx_residuetype_t *rt, const char *resnm)
+{
+    gmx_bool    rc;
+    const char *p_type;
+
+    if (gmx_residuetype_get_type(rt, resnm, &p_type) == 0 &&
+        gmx_strcasecmp(p_type, "RNA") == 0)
+    {
+        rc = TRUE;
+    }
+    else
+    {
+        rc = FALSE;
+    }
+    return rc;
+}
+
+/* Return the size of the arrays */
+int
+gmx_residuetype_get_size(gmx_residuetype_t *rt)
+{
+    return rt->n;
+}
+
+/* Search for a residuetype with name resnm within the
+ * gmx_residuetype database. Return the index if found,
+ * otherwise -1.
+ */
+int
+gmx_residuetype_get_index(gmx_residuetype_t *rt, const char *resnm)
+{
+    int i, rc;
+
+    rc = -1;
+    for (i = 0; i < rt->n && rc; i++)
+    {
+        rc = gmx_strcasecmp(rt->resname[i], resnm);
+    }
+
+    return (0 == rc) ? i-1 : -1;
+}
+
+/* Return the name of the residuetype with the given index, or
+ * NULL if not found. */
+const char *
+gmx_residuetype_get_name(gmx_residuetype_t *rt, int index)
+{
+    if (index >= 0 && index < rt->n)
+    {
+        return rt->resname[index];
+    }
+    else
+    {
+        return NULL;
+    }
+}
similarity index 59%
rename from src/gromacs/legacyheaders/types/iteratedconstraints.h
rename to src/gromacs/topology/residuetypes.h
index 2f155ad5c0b28a39b0f841219988c8529924b0e3..f569e008f96ff3b64b585f299373007e81ae6869 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) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _iteratedconstraints_h
-#define _iteratedconstraints_h
+#ifndef GMX_TOPOLOGY_RESIDUETYPES_H
+#define GMX_TOPOLOGY_RESIDUETYPES_H
+
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-#if 0
-}
-/* Hack to make automatic indenting work */
-#endif
+typedef struct gmx_residuetype_t gmx_residuetype_t;
 
-/* Definitions for convergence of iterated constraints */
+int
+gmx_residuetype_init(gmx_residuetype_t **rt);
 
-/* iterate constraints up to 50 times  */
-#define MAXITERCONST       50
+int
+gmx_residuetype_destroy(gmx_residuetype_t *rt);
 
-/* data type */
-typedef struct
-{
-    real     f, fprev, x, xprev;
-    int      iter_i;
-    gmx_bool bIterationActive;
-    real     allrelerr[MAXITERCONST+2];
-    int      num_close; /* number of "close" violations, caused by limited precision. */
-} gmx_iterate_t;
+int
+gmx_residuetype_get_type(gmx_residuetype_t *rt, const char *resname, const char **p_restype);
+
+int
+gmx_residuetype_add(gmx_residuetype_t *rt, const char *newresname, const char *newrestype);
+
+int
+gmx_residuetype_get_alltypes(gmx_residuetype_t   *rt,
+                             const char        ***p_typenames,
+                             int                 *ntypes);
+
+gmx_bool
+gmx_residuetype_is_protein(gmx_residuetype_t *rt, const char *resnm);
+
+gmx_bool
+gmx_residuetype_is_dna(gmx_residuetype_t *rt, const char *resnm);
+
+gmx_bool
+gmx_residuetype_is_rna(gmx_residuetype_t *rt, const char *resnm);
+
+int
+gmx_residuetype_get_size(gmx_residuetype_t *rt);
 
-void gmx_iterate_init(gmx_iterate_t *iterate, gmx_bool bIterate);
+int
+gmx_residuetype_get_index(gmx_residuetype_t *rt, const char *resnm);
 
-gmx_bool done_iterating(const t_commrec *cr, FILE *fplog, int nsteps, gmx_iterate_t *iterate, gmx_bool bFirstIterate, real fom, real *newf);
+const char *
+gmx_residuetype_get_name(gmx_residuetype_t *rt, int index);
 
 #ifdef __cplusplus
 }
similarity index 94%
rename from src/gromacs/gmxlib/symtab.c
rename to src/gromacs/topology/symtab.cpp
index 7e9d65a450b934208623da5b242bad61e4cb1756..678088f47842a79d9eacfc45b67dfead0d784115 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "symtab.h"
 
 #include <stdio.h>
 #include <string.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gmx_fatal.h"
+
+#include <algorithm>
+
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "txtdump.h"
-#include "symtab.h"
-#include "macros.h"
 
 #define BUFSIZE         1024
 #define TABLESIZE       5
@@ -91,15 +91,14 @@ static char *trim_string(const char *s, char *out, int maxlen)
 
 int lookup_symtab(t_symtab *symtab, char **name)
 {
-    int       base, index;
+    int       base;
     t_symbuf *symbuf;
 
     base   = 0;
-    index  = 0;
     symbuf = symtab->symbuf;
     while (symbuf != NULL)
     {
-        index = name-symbuf->buf;
+        const int index = name-symbuf->buf;
         if ( ( index >= 0 ) && ( index < symbuf->bufsize ) )
         {
             return index+base;
@@ -166,7 +165,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
             if (symbuf->buf[i] == NULL)
             {
                 symtab->nr++;
-                symbuf->buf[i] = strdup(name);
+                symbuf->buf[i] = gmx_strdup(name);
                 return &(symbuf->buf[i]);
             }
             else if (strcmp(symbuf->buf[i], name) == 0)
@@ -190,7 +189,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
     symbuf       = symbuf->next;
 
     symtab->nr++;
-    symbuf->buf[0] = strdup(name);
+    symbuf->buf[0] = gmx_strdup(name);
     return &(symbuf->buf[0]);
 }
 
@@ -245,7 +244,7 @@ void free_symtab(t_symtab *symtab)
     symbuf = symtab->symbuf;
     while (symbuf != NULL)
     {
-        symtab->nr -= min(symbuf->bufsize, symtab->nr);
+        symtab->nr -= std::min(symbuf->bufsize, symtab->nr);
         freeptr     = symbuf;
         symbuf      = symbuf->next;
         sfree(freeptr);
similarity index 92%
rename from src/gromacs/legacyheaders/symtab.h
rename to src/gromacs/topology/symtab.h
index d0561340c25f3828b56d7ff9d5e36cade0711be1..d395e58c5fd29174ace16862dd22c0fe266f5a60 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _symtab_h
-#define _symtab_h
+#ifndef GMX_TOPOLOGY_SYMTAB_H
+#define GMX_TOPOLOGY_SYMTAB_H
 
 #include <stdio.h>
-#include "typedefs.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+typedef struct t_symbuf
+{
+    int               bufsize;
+    char            **buf;
+    struct t_symbuf  *next;
+} t_symbuf;
+
+typedef struct t_symtab
+{
+    int       nr;
+    t_symbuf *symbuf;
+} t_symtab;
+
 /*
  * This module handles symbol table manipulation. All text strings
  * needed by an application are allocated only once. All references
@@ -115,4 +126,4 @@ void pr_symtab(FILE *fp, int indent, const char *title, t_symtab *symtab);
 }
 #endif
 
-#endif  /* _symtab_h */
+#endif
diff --git a/src/gromacs/topology/topology.cpp b/src/gromacs/topology/topology.cpp
new file mode 100644 (file)
index 0000000..e5ff053
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "topology.h"
+
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/smalloc.h"
+
+static void init_groups(gmx_groups_t *groups)
+{
+    groups->ngrpname = 0;
+    groups->grpname  = NULL;
+    for (int g = 0; g < egcNR; g++)
+    {
+        groups->grps[g].nm_ind = NULL;
+        groups->ngrpnr[g]      = 0;
+        groups->grpnr[g]       = NULL;
+    }
+
+}
+
+void init_mtop(gmx_mtop_t *mtop)
+{
+    mtop->name         = NULL;
+    mtop->nmoltype     = 0;
+    mtop->moltype      = NULL;
+    mtop->nmolblock    = 0;
+    mtop->molblock     = NULL;
+    mtop->maxres_renum = 0;
+    mtop->maxresnr     = -1;
+    init_groups(&mtop->groups);
+    init_block(&mtop->mols);
+    open_symtab(&mtop->symtab);
+}
+
+void init_top(t_topology *top)
+{
+    top->name = NULL;
+    init_atom(&(top->atoms));
+    init_atomtypes(&(top->atomtypes));
+    init_block(&top->cgs);
+    init_block(&top->mols);
+    init_blocka(&top->excls);
+    open_symtab(&top->symtab);
+}
+
+
+void done_moltype(gmx_moltype_t *molt)
+{
+    done_atom(&molt->atoms);
+    done_block(&molt->cgs);
+    done_blocka(&molt->excls);
+
+    for (int f = 0; f < F_NRE; f++)
+    {
+        sfree(molt->ilist[f].iatoms);
+        molt->ilist[f].nalloc = 0;
+    }
+}
+
+void done_molblock(gmx_molblock_t *molb)
+{
+    if (molb->nposres_xA > 0)
+    {
+        molb->nposres_xA = 0;
+        sfree(molb->posres_xA);
+    }
+    if (molb->nposres_xB > 0)
+    {
+        molb->nposres_xB = 0;
+        sfree(molb->posres_xB);
+    }
+}
+
+void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab)
+{
+    if (bDoneSymtab)
+    {
+        done_symtab(&mtop->symtab);
+    }
+
+    sfree(mtop->ffparams.functype);
+    sfree(mtop->ffparams.iparams);
+
+    for (int i = 0; i < mtop->nmoltype; i++)
+    {
+        done_moltype(&mtop->moltype[i]);
+    }
+    sfree(mtop->moltype);
+    for (int i = 0; i < mtop->nmolblock; i++)
+    {
+        done_molblock(&mtop->molblock[i]);
+    }
+    sfree(mtop->molblock);
+    done_block(&mtop->mols);
+}
+
+void done_top(t_topology *top)
+{
+    sfree(top->idef.functype);
+    sfree(top->idef.iparams);
+    for (int f = 0; f < F_NRE; ++f)
+    {
+        sfree(top->idef.il[f].iatoms);
+        top->idef.il[f].iatoms = NULL;
+        top->idef.il[f].nalloc = 0;
+    }
+
+    done_atom(&(top->atoms));
+
+    /* For GB */
+    done_atomtypes(&(top->atomtypes));
+
+    done_symtab(&(top->symtab));
+    done_block(&(top->cgs));
+    done_block(&(top->mols));
+    done_blocka(&(top->excls));
+}
similarity index 86%
rename from src/gromacs/legacyheaders/types/topology.h
rename to src/gromacs/topology/topology.h
index 4ee71e582cd6d320f0c74e50ac61a46dce560d05..6f4e4792d47133634de53c4fa2f3545a13bbc24c 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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_LEGACYHEADERS_TOPOLOGY_H
-#define GMX_LEGACYHEADERS_TOPOLOGY_H
+#ifndef GMX_TOPOLOGY_TOPOLOGY_H
+#define GMX_TOPOLOGY_TOPOLOGY_H
 
-#include "atoms.h"
-#include "idef.h"
-#include "block.h"
-#include "simple.h"
-#include "symtab.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/symtab.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -54,7 +54,8 @@ enum {
     egcNR
 };
 
-typedef struct {
+typedef struct gmx_moltype_t
+{
     char          **name;       /* Name of the molecule type            */
     t_atoms         atoms;      /* The atoms                            */
     t_ilist         ilist[F_NRE];
@@ -62,7 +63,8 @@ typedef struct {
     t_blocka        excls;      /* The exclusions                       */
 } gmx_moltype_t;
 
-typedef struct {
+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    */
@@ -72,7 +74,8 @@ typedef struct {
     rvec          *posres_xB;   /* The posres coords for top B            */
 } gmx_molblock_t;
 
-typedef struct {
+typedef struct gmx_groups_t
+{
     t_grps            grps[egcNR];  /* Groups of things                     */
     int               ngrpname;     /* Number of groupnames                 */
     char           ***grpname;      /* Names of the groups                  */
@@ -88,7 +91,8 @@ typedef struct {
 
 /* The global, complete system topology struct, based on molecule types.
    This structure should contain no data that is O(natoms) in memory. */
-typedef struct {
+typedef struct gmx_mtop_t
+{
     char           **name;      /* Name of the topology                 */
     gmx_ffparams_t   ffparams;
     int              nmoltype;
@@ -105,17 +109,19 @@ typedef struct {
 } gmx_mtop_t;
 
 /* The mdrun node-local topology struct, completely written out */
-typedef struct {
-    t_idef        idef;         /* The interaction function definition */
+typedef struct gmx_localtop_t
+{
+    t_idef        idef;         /* The interaction function definition  */
     t_atomtypes   atomtypes;    /* Atomtype properties                  */
     t_block       cgs;          /* The charge groups                    */
     t_blocka      excls;        /* The exclusions                       */
 } gmx_localtop_t;
 
 /* The old topology struct, completely written out, used in analysis tools */
-typedef struct {
+typedef struct t_topology
+{
     char          **name;       /* Name of the topology                 */
-    t_idef          idef;       /* The interaction function definition */
+    t_idef          idef;       /* The interaction function definition  */
     t_atoms         atoms;      /* The atoms                            */
     t_atomtypes     atomtypes;  /* Atomtype properties                  */
     t_block         cgs;        /* The charge groups                    */
@@ -124,6 +130,16 @@ typedef struct {
     t_symtab        symtab;     /* The symbol table                     */
 } t_topology;
 
+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_top(t_topology *top);
+
+t_atoms *mtop2atoms(gmx_mtop_t *mtop);
+/* generate a t_atoms struct for the system from gmx_mtop_t */
+
 #ifdef __cplusplus
 }
 #endif
similarity index 98%
rename from src/gromacs/gmxlib/topsort.c
rename to src/gromacs/topology/topsort.c
index 7d1f5e5fb33530cbe0878876bb62aede35cac87f..1f8749916616d201eb55eb5b309eda5f7fe0ee80 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.
  */
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
 #include "topsort.h"
+
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
 
 static gmx_bool ip_pert(int ftype, const t_iparams *ip)
 {
similarity index 82%
rename from src/gromacs/gmxlib/topsort.h
rename to src/gromacs/topology/topsort.h
index 890df3bde11a3c67143bbf88bfdfa29a71746fc6..53505a40c3f3f6f437c4a21c12eaa1f9760809c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2013, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _topsort_h
-#define _topsort_h
+#ifndef GMX_TOPOLOGY_TOPSORT_H
+#define GMX_TOPOLOGY_TOPSORT_H
 
-
-#include "typedefs.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct gmx_mtop_t;
+struct t_idef;
 
 /* Returns if there are perturbed bonded interactions */
-gmx_bool gmx_mtop_bondeds_free_energy(const gmx_mtop_t *mtop);
+gmx_bool gmx_mtop_bondeds_free_energy(const struct gmx_mtop_t *mtop);
 
 /* Sort all the bonded ilists in idef to have the perturbed ones at the end
  * and set nr_nr_nonperturbed in ilist.
  */
-void gmx_sort_ilist_fe(t_idef *idef, const real *qA, const real *qB);
+void gmx_sort_ilist_fe(struct t_idef *idef, const real *qA, const real *qB);
 
 #ifdef __cplusplus
 }
index 2942a303a8ce7da30a95fdc6053af6ab19d957d7..d6c46cfb082cf568ec7103ea4ee52b856eb29d7b 100644 (file)
  * analysis module at appropriate points to perform the module-specific tasks.
  * The analysis module is responsible for creating and managing
  * gmx::AnalysisData objects, and the chart shows the most important
- * interactions with this module as well.  Interactions with options (for
- * command-line option processing) and selections is not shown for brevity: see
- * \ref module_options for an overview of how options work, and the second
- * chart for a more detailed view of how selections are accessed from an
- * analysis module.
+ * interactions with this module as well.  However, the runner takes
+ * responsibility of calling gmx::AnalysisData::finishFrameSerial().
+ * Interactions with options (for command-line option processing) and
+ * selections is not shown for brevity: see \ref module_options for an overview
+ * of how options work, and the second chart for a more detailed view of how
+ * selections are accessed from an analysis module.
  * \msc
  *     runner,
  *     module [ URL="\ref gmx::TrajectoryAnalysisModule" ],
@@ -97,7 +98,8 @@
  *                      URL="\ref gmx::AnalysisDataHandle" ];
  *     module => data [ label="finishFrame()",
  *                      URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     data => data [ label="process frame 0" ];
+ *     runner => data [ label="finishFrameSerial()",
+ *                      URL="\ref gmx::AnalysisData::finishFrameSerial()" ];
  *     runner => runner [ label="read and initialize frame 1" ];
  *     runner => module [ label="analyzeFrame(1)",
  *                         URL="\ref gmx::TrajectoryAnalysisModule::analyzeFrame()" ];
  * together with the appropriate thread-local data object.
  * The gmx::TrajectoryAnalysisModule::analyzeFrame() calls are only allowed to modify
  * the thread-local data object; everything else is read-only.  For any output,
- * they pass the information to gmx::AnalysisData, which takes care of ordering
- * the data from different frames such that it gets processed in the right
- * order.
+ * they pass the information to gmx::AnalysisData, which together with the
+ * runner takes care of ordering the data from different frames such that it
+ * gets processed in the right order.
  * When all frames are analyzed, gmx::TrajectoryAnalysisModule::finishFrames()
  * is called for each thread-local data object to destroy them and to
  * accumulate possible results from them into the main
  *                         URL="\ref gmx::TrajectoryAnalysisModule::analyzeFrame()" ];
  *     thread1 => data [ label="finishFrame(0)",
  *                       URL="\ref gmx::AnalysisDataHandle::finishFrame()" ];
- *     data => data [ label="process frame 0" ];
- *     data => data [ label="process frame 1" ];
  *     runner << thread1 [ label="analyzeFrame() (frame 0)" ];
+ *     runner => data [ label="finishFrameSerial() (frame 0)",
+ *                      URL="\ref gmx::AnalysisData::finishFrameSerial()" ];
+ *     runner => data [ label="finishFrameSerial() (frame 1)",
+ *                      URL="\ref gmx::AnalysisData::finishFrameSerial()" ];
  *     ...;
  *     runner => thread1 [ label="finishFrames(pdata1)",
  *                         URL="\ref gmx::TrajectoryAnalysisModule::finishFrames()" ];
 #ifndef GMX_TRAJECTORYANALYSIS_H
 #define GMX_TRAJECTORYANALYSIS_H
 
-#include "analysisdata.h"
-#include "options.h"
-#include "selection.h"
-
-#include "selection/nbsearch.h"
-#include "trajectoryanalysis/analysismodule.h"
-#include "trajectoryanalysis/analysissettings.h"
-#include "trajectoryanalysis/cmdlinerunner.h"
-#include "utility/arrayref.h"
-#include "utility/exceptions.h"
+#include "gromacs/analysisdata.h"
+#include "gromacs/options.h"
+#include "gromacs/selection.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysissettings.h"
+#include "gromacs/trajectoryanalysis/cmdlinerunner.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
 
 #endif
index a27ab151e19b313e819a71578c6151f9d336b931..a60b69a9241c917c179d4e24c7dc767fd7acc8cb 100644 (file)
 file(GLOB TRAJECTORYANALYSIS_SOURCES *.cpp modules/*.cpp modules/*.c)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TRAJECTORYANALYSIS_SOURCES} PARENT_SCOPE)
 
-set(TRAJECTORYANALYSIS_PUBLIC_HEADERS
+gmx_install_headers(
     analysismodule.h
     analysissettings.h
-    cmdlinerunner.h)
-gmx_install_headers(trajectoryanalysis ${TRAJECTORYANALYSIS_PUBLIC_HEADERS})
+    cmdlinerunner.h
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index 721bac031e50f2a6964ab1bc0a37de3873089da6..0f1a437edc2673c755c2caee25d70b4ea3b76bdb 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include "gromacs/trajectoryanalysis/analysismodule.h"
+#include "gmxpre.h"
+
+#include "analysismodule.h"
 
 #include <utility>
 
@@ -293,7 +295,9 @@ void TrajectoryAnalysisModule::optionsFinished(
 }
 
 
-void TrajectoryAnalysisModule::initAfterFirstFrame(const t_trxframe & /*fr*/)
+void TrajectoryAnalysisModule::initAfterFirstFrame(
+        const TrajectoryAnalysisSettings & /*settings*/,
+        const t_trxframe                 & /*fr*/)
 {
 }
 
@@ -381,4 +385,16 @@ void TrajectoryAnalysisModule::registerAnalysisDataset(AnalysisData *data,
     impl_->analysisDatasets_[name] = data;
 }
 
+
+void TrajectoryAnalysisModule::finishFrameSerial(int frameIndex)
+{
+    Impl::AnalysisDatasetContainer::const_iterator data;
+    for (data = impl_->analysisDatasets_.begin();
+         data != impl_->analysisDatasets_.end();
+         ++data)
+    {
+        data->second->finishFrameSerial(frameIndex);
+    }
+}
+
 } // namespace gmx
index 9ae568aebd6740d408e7e78769b1cff969f12782..f2756b88f0af1e1b963cec75c0e75bf232e442b5 100644 (file)
 #include <string>
 #include <vector>
 
-#include "../legacyheaders/typedefs.h"
+#include <boost/shared_ptr.hpp>
 
-#include "../selection/selection.h" // For gmx::SelectionList
-#include "../utility/common.h"
-#include "../utility/uniqueptr.h"
+#include "gromacs/selection/selection.h" // For gmx::SelectionList
+#include "gromacs/utility/classhelpers.h"
+
+struct t_pbc;
+struct t_trxframe;
 
 namespace gmx
 {
@@ -176,7 +178,7 @@ class TrajectoryAnalysisModuleData
 };
 
 //! Smart pointer to manage a TrajectoryAnalysisModuleData object.
-typedef gmx_unique_ptr<TrajectoryAnalysisModuleData>::type
+typedef boost::shared_ptr<TrajectoryAnalysisModuleData>
     TrajectoryAnalysisModuleDataPointer;
 
 /*! \brief
@@ -293,7 +295,8 @@ class TrajectoryAnalysisModule
          *
          * The default implementation does nothing.
          */
-        virtual void initAfterFirstFrame(const t_trxframe &fr);
+        virtual void initAfterFirstFrame(const TrajectoryAnalysisSettings &settings,
+                                         const t_trxframe                 &fr);
 
         /*! \brief
          * Starts the analysis of frames.
@@ -440,6 +443,20 @@ class TrajectoryAnalysisModule
          * care about external modifications.
          */
         AbstractAnalysisData &datasetFromName(const char *name) const;
+        /*! \brief
+         * Processes data in AnalysisData objects in serial for each frame.
+         *
+         * \param[in] frameIndex  Index of the frame that has been finished.
+         *
+         * This method is called by the framework in order for each frame,
+         * after the analysis for that frame has been finished.  These calls
+         * always execute in serial and in sequential frame order, even during
+         * parallel analysis where multiple analyzeFrame() calls may be
+         * executing concurrently.
+         *
+         * \see AnalysisData::finishFrameSerial()
+         */
+        void finishFrameSerial(int frameIndex);
 
     protected:
         /*! \brief
@@ -495,7 +512,7 @@ class TrajectoryAnalysisModule
 };
 
 //! Smart pointer to manage a TrajectoryAnalysisModule.
-typedef gmx_unique_ptr<TrajectoryAnalysisModule>::type
+typedef boost::shared_ptr<TrajectoryAnalysisModule>
     TrajectoryAnalysisModulePointer;
 
 } // namespace gmx
index a19c73b0ab81e1f3e1117499eb9a33b9480ee319..b42defaaa610f6e899c34e627f51a58e96a3fa9a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_TRAJECTORYANALYSIS_ANALYSISSETTINGS_IMPL_H
 #define GMX_TRAJECTORYANALYSIS_ANALYSISSETTINGS_IMPL_H
 
-#include "analysissettings.h"
-
-#include "../analysisdata/modules/plot.h"
-#include "../options/timeunitmanager.h"
+#include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/options/timeunitmanager.h"
+#include "gromacs/trajectoryanalysis/analysissettings.h"
 
 namespace gmx
 {
index 6cfc1d20d7597ea7b3a883045afc3c9b20851036..da9031abb82b40b91daefafe620f3ba63d6f68c5 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include "analysissettings.h"
+#include "gmxpre.h"
 
-#include "gromacs/legacyheaders/vec.h"
+#include "analysissettings.h"
 
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/smalloc.h"
 
index 391b3791d8407b163e8211025e6792d29b783288..20383df9cd0fa39a8b858687617906be9e5ddaa4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_TRAJECTORYANALYSIS_ANALYSISSETTINGS_H
 #define GMX_TRAJECTORYANALYSIS_ANALYSISSETTINGS_H
 
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/options/timeunitmanager.h"
+#include "gromacs/utility/classhelpers.h"
 
-#include "../options/timeunitmanager.h"
-#include "../utility/common.h"
+struct t_topology;
 
 namespace gmx
 {
index 2838db6d5ae15a7c2079555d4db91b976edafc8f..a6e3107cfbc1020c50b29c827496fbce68e099fb 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include "cmdlinerunner.h"
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "gmxpre.h"
 
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/rmpbc.h"
+#include "cmdlinerunner.h"
 
 #include "gromacs/analysisdata/paralleloptions.h"
 #include "gromacs/commandline/cmdlinehelpcontext.h"
 #include "gromacs/commandline/cmdlinemodule.h"
 #include "gromacs/commandline/cmdlinemodulemanager.h"
 #include "gromacs/commandline/cmdlineparser.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/options/filenameoptionmanager.h"
 #include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/selectioncollection.h"
 #include "gromacs/selection/selectionoptionmanager.h"
 #include "gromacs/trajectoryanalysis/analysismodule.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
-#include "gromacs/trajectoryanalysis/runnercommon.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
 #include "gromacs/utility/gmxassert.h"
 
+#include "runnercommon.h"
+
 namespace gmx
 {
 
@@ -109,20 +108,22 @@ TrajectoryAnalysisCommandLineRunner::Impl::parseOptions(
         SelectionCollection *selections,
         int *argc, char *argv[])
 {
-    Options options(NULL, NULL);
-    Options moduleOptions(module_->name(), module_->description());
-    Options commonOptions("common", "Common analysis control");
-    Options selectionOptions("selection", "Common selection control");
-    module_->initOptions(&moduleOptions, settings);
-    common->initOptions(&commonOptions);
-    selections->initOptions(&selectionOptions);
+    FileNameOptionManager  fileoptManager;
+    SelectionOptionManager seloptManager(selections);
+    Options                options(NULL, NULL);
+    Options                moduleOptions(module_->name(), module_->description());
+    Options                commonOptions("common", "Common analysis control");
+    Options                selectionOptions("selection", "Common selection control");
 
+    options.addManager(&fileoptManager);
+    options.addManager(&seloptManager);
     options.addSubSection(&commonOptions);
     options.addSubSection(&selectionOptions);
     options.addSubSection(&moduleOptions);
 
-    SelectionOptionManager seloptManager(selections);
-    setManagerForSelectionOptions(&options, &seloptManager);
+    module_->initOptions(&moduleOptions, settings);
+    common->initOptions(&commonOptions);
+    selections->initOptions(&selectionOptions);
 
     {
         CommandLineParser  parser(&options);
@@ -195,7 +196,7 @@ TrajectoryAnalysisCommandLineRunner::run(int argc, char *argv[])
 
     // Load first frame.
     common.initFirstFrame();
-    module->initAfterFirstFrame(common.frame());
+    module->initAfterFirstFrame(settings, common.frame());
 
     t_pbc  pbc;
     t_pbc *ppbc = settings.hasPBC() ? &pbc : NULL;
@@ -215,8 +216,9 @@ TrajectoryAnalysisCommandLineRunner::run(int argc, char *argv[])
 
         selections.evaluate(&frame, ppbc);
         module->analyzeFrame(nframes, frame, ppbc, pdata.get());
+        module->finishFrameSerial(nframes);
 
-        nframes++;
+        ++nframes;
     }
     while (common.readNextFrame());
     module->finishFrames(pdata.get());
@@ -255,21 +257,20 @@ TrajectoryAnalysisCommandLineRunner::writeHelp(const CommandLineHelpContext &con
     TrajectoryAnalysisSettings      settings;
     TrajectoryAnalysisRunnerCommon  common(&settings);
 
-    Options options(NULL, NULL);
-    Options moduleOptions(impl_->module_->name(), impl_->module_->description());
-    Options commonOptions("common", "Common analysis control");
-    Options selectionOptions("selection", "Common selection control");
-
-    impl_->module_->initOptions(&moduleOptions, &settings);
-    common.initOptions(&commonOptions);
-    selections.initOptions(&selectionOptions);
+    SelectionOptionManager          seloptManager(&selections);
+    Options                         options(NULL, NULL);
+    Options                         moduleOptions(impl_->module_->name(), impl_->module_->description());
+    Options                         commonOptions("common", "Common analysis control");
+    Options                         selectionOptions("selection", "Common selection control");
 
+    options.addManager(&seloptManager);
     options.addSubSection(&commonOptions);
     options.addSubSection(&selectionOptions);
     options.addSubSection(&moduleOptions);
 
-    SelectionOptionManager seloptManager(&selections);
-    setManagerForSelectionOptions(&options, &seloptManager);
+    impl_->module_->initOptions(&moduleOptions, &settings);
+    common.initOptions(&commonOptions);
+    selections.initOptions(&selectionOptions);
 
     CommandLineHelpWriter(options)
         .setShowDescriptions(true)
@@ -306,6 +307,7 @@ class TrajectoryAnalysisCommandLineRunner::Impl::RunnerCommandLineModule
         virtual const char *name() const { return name_; }
         virtual const char *shortDescription() const { return description_; };
 
+        virtual void init(CommandLineModuleSettings *settings);
         virtual int run(int argc, char *argv[]);
         virtual void writeHelp(const CommandLineHelpContext &context) const;
 
@@ -317,6 +319,11 @@ class TrajectoryAnalysisCommandLineRunner::Impl::RunnerCommandLineModule
         GMX_DISALLOW_COPY_AND_ASSIGN(RunnerCommandLineModule);
 };
 
+void TrajectoryAnalysisCommandLineRunner::Impl::RunnerCommandLineModule::init(
+        CommandLineModuleSettings * /*settings*/)
+{
+}
+
 int TrajectoryAnalysisCommandLineRunner::Impl::RunnerCommandLineModule::run(
         int argc, char *argv[])
 {
index 0b87455e851a6960341e3426276e3178f3d41392..c99a0a80f076c78a99c99332085acf03439bd6bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,8 +43,8 @@
 #ifndef GMX_TRAJECTORYANALYSIS_CMDLINERUNNER_H
 #define GMX_TRAJECTORYANALYSIS_CMDLINERUNNER_H
 
-#include "analysismodule.h"
-#include "../utility/common.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index bea3ad50ab3b3099f70b108f64a23c751fbab0a4..7fc2601f6df577ae02d2d9245c960d2316655d96 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include "gromacs/trajectoryanalysis/modules.h"
+#include "gmxpre.h"
+
+#include "modules.h"
 
 #include "gromacs/commandline/cmdlinemodulemanager.h"
 #include "gromacs/trajectoryanalysis/cmdlinerunner.h"
@@ -47,6 +49,8 @@
 #include "modules/angle.h"
 #include "modules/distance.h"
 #include "modules/freevolume.h"
+#include "modules/pairdist.h"
+#include "modules/rdf.h"
 #include "modules/sasa.h"
 #include "modules/select.h"
 
@@ -88,6 +92,8 @@ void registerTrajectoryAnalysisModules(CommandLineModuleManager *manager)
     registerModule<AngleInfo>(manager, group);
     registerModule<DistanceInfo>(manager, group);
     registerModule<FreeVolumeInfo>(manager, group);
+    registerModule<PairDistanceInfo>(manager, group);
+    registerModule<RdfInfo>(manager, group);
     registerModule<SasaInfo>(manager, group);
     registerModule<SelectInfo>(manager, group);
 }
index 25f8346dad0be3c013056b11b78c0857dfd6fd81..200aed1924fc44c206c63639f48936e4a74b3823 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "angle.h"
 
 #include <algorithm>
 #include <string>
 #include <vector>
 
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
-
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/average.h"
 #include "gromacs/analysisdata/modules/histogram.h"
 #include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectionoption.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
@@ -242,7 +244,6 @@ class Angle : public TrajectoryAnalysisModule
 {
     public:
         Angle();
-        virtual ~Angle();
 
         virtual void initOptions(Options                    *options,
                                  TrajectoryAnalysisSettings *settings);
@@ -282,8 +283,7 @@ class Angle : public TrajectoryAnalysisModule
         std::vector<int>                         angleCount_;
         int                                      natoms1_;
         int                                      natoms2_;
-        // TODO: It is not possible to put rvec into a container.
-        std::vector<rvec *>                      vt0_;
+        std::vector<std::vector<RVec> >          vt0_;
 
         // Copy and assign disallowed by base.
 };
@@ -303,15 +303,6 @@ Angle::Angle()
 }
 
 
-Angle::~Angle()
-{
-    for (size_t g = 0; g < vt0_.size(); ++g)
-    {
-        delete [] vt0_[g];
-    }
-}
-
-
 void
 Angle::initOptions(Options *options, TrajectoryAnalysisSettings * /*settings*/)
 {
@@ -582,7 +573,7 @@ Angle::initAnalysis(const TrajectoryAnalysisSettings &settings,
         vt0_.resize(sel1_.size());
         for (size_t g = 0; g < sel1_.size(); ++g)
         {
-            vt0_[g] = new rvec[sel1_[g].posCount() / natoms1_];
+            vt0_[g].resize(sel1_[g].posCount() / natoms1_);
         }
     }
 
index 80976ebca4b6d243920368b9216233a1a1b80f74..24b81c73560306575729a2a3428cd36e5d6c9d68 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 #ifndef GMX_TRAJECTORYANALYSIS_MODULES_ANGLE_H
 #define GMX_TRAJECTORYANALYSIS_MODULES_ANGLE_H
 
-#include "../analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
 
 namespace gmx
 {
index 13794cb2a9fea01427eb0124cd679e463ccb626e..96f752b5d54425812a8b7d2dbdda0a8346b67969 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "distance.h"
 
 #include <string>
 
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
-
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/average.h"
 #include "gromacs/analysisdata/modules/histogram.h"
 #include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectionoption.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
@@ -147,7 +149,11 @@ Distance::initOptions(Options *options, TrajectoryAnalysisSettings * /*settings*
         "The location of the histogram is set with [TT]-len[tt] and",
         "[TT]-tol[tt]. Bin width is set with [TT]-binw[tt].",
         "[TT]-oallstat[tt] writes out the average and standard deviation for",
-        "each individual distance, calculated over the frames."
+        "each individual distance, calculated over the frames.[PAR]",
+        "Note that [THISMODULE] calculates distances between fixed pairs",
+        "(1-2, 3-4, etc.) within a single selection.  To calculate distances",
+        "between two selections, including minimum, maximum, and pairwise",
+        "distances, use [gmx-pairdist]."
     };
 
     options->setDescription(desc);
@@ -367,9 +373,9 @@ Distance::writeOutput()
         printf("%s:\n", sel->name());
         printf("  Number of samples:  %d\n",
                summaryStatsModule_->sampleCount(index, 0));
-        printf("  Average distance:   %-6.3f nm\n",
+        printf("  Average distance:   %-8.5f nm\n",
                summaryStatsModule_->average(index, 0));
-        printf("  Standard deviation: %-6.3f nm\n",
+        printf("  Standard deviation: %-8.5f nm\n",
                summaryStatsModule_->standardDeviation(index, 0));
     }
 }
index 7d354e38942a9fe92bab7bcc2d136187370b1172..519176d57724559d5540486fba6c0117fa4ffc58 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 #ifndef GMX_TRAJECTORYANALYSIS_MODULES_DISTANCE_H
 #define GMX_TRAJECTORYANALYSIS_MODULES_DISTANCE_H
 
-#include "../analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
 
 namespace gmx
 {
index 3e24e2fbfc00b7a67f9786994e418222c0edfe7a..127a834b1baca86426d04114f7755471c68f6026 100644 (file)
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "freevolume.h"
 
 #include <string>
 
-#include "gromacs/legacyheaders/atomprop.h"
-#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/random/random.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/vec.h"
-
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/average.h"
 #include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/random/random.h"
 #include "gromacs/selection/nbsearch.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectionoption.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
index cc96d6a8e693ad7a6fac34766c34b80a1278716f..ba24de0951712d44bdd852e389a3fba05828caef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 #ifndef GMX_TRAJECTORYANALYSIS_MODULES_FREEVOLUME_H
 #define GMX_TRAJECTORYANALYSIS_MODULES_FREEVOLUME_H
 
-#include "../analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
 
 namespace gmx
 {
diff --git a/src/gromacs/trajectoryanalysis/modules/nsc.c b/src/gromacs/trajectoryanalysis/modules/nsc.c
deleted file mode 100644 (file)
index ab27dae..0000000
+++ /dev/null
@@ -1,1228 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-#include <stdarg.h>
-/* Modified DvdS */
-#include "pbc.h"
-#include "macros.h"
-#include "vec.h"
-#include "gromacs/utility/smalloc.h"
-#include "nsc.h"
-
-#define TEST_NSC 0
-
-#define TEST_ARC 0
-#define TEST_DOD 0
-#define TEST_CUBE 0
-
-#define UNSP_ICO_DOD      9
-#define UNSP_ICO_ARC     10
-
-real   *xpunsp = NULL;
-real    del_cube;
-int     n_dot, ico_cube, last_n_dot = 0, last_densit = 0, last_unsp = 0;
-int     last_cubus = 0;
-
-#define FOURPI (4.*M_PI)
-#define TORAD(A)     ((A)*0.017453293)
-#define DP_TOL     0.001
-
-#define UPDATE_FL  __file__ = __FILE__, __line__ = __LINE__
-const char * __file__;   /* declared versions of macros */
-int          __line__;   /* __FILE__  and __LINE__ */
-
-#ifdef ERROR
-#undef ERROR
-#endif
-#define ERROR UPDATE_FL, error
-void error(const char *fmt, ...)
-{
-    va_list args;
-    fprintf(stderr,
-            "\n---> ERROR when executing line %i in file %s !\n",
-            __line__, __file__);
-    va_start(args, fmt);
-    vfprintf(stderr, fmt, args);
-    va_end(args);
-    fprintf(stderr, "\n---> Execution stopped !\n\n");
-}
-
-#define WARNING UPDATE_FL, warning2
-void warning2(const char *fmt, ...)
-{
-    va_list args;
-    fprintf(stderr,
-            "\n---> WARNING : line %i in file %s\n",
-            __line__, __file__);
-    va_start(args, fmt);
-    vfprintf(stderr, fmt, args);
-    va_end(args);
-    fprintf(stderr, " ...!\n\n");
-    fflush(stderr);
-    fflush(stdout);
-}
-
-#define ASIN safe_asin
-real safe_asin(real f)
-{
-    if ( (fabs(f) < 1.00) )
-    {
-        return( asin(f) );
-    }
-    if ( (fabs(f) - 1.00)  <= DP_TOL)
-    {
-        ERROR("ASIN : invalid argument %f", f);
-    }
-    return(M_PI_2);
-}
-
-
-
-
-/* routines for dot distributions on the surface of the unit sphere */
-real rg, rh;
-
-void icosaeder_vertices(real *xus)
-{
-    rh = sqrt(1.-2.*cos(TORAD(72.)))/(1.-cos(TORAD(72.)));
-    rg = cos(TORAD(72.))/(1.-cos(TORAD(72.)));
-    /* icosaeder vertices */
-    xus[ 0] = 0.;                  xus[ 1] = 0.;                  xus[ 2] = 1.;
-    xus[ 3] = rh*cos(TORAD(72.));  xus[ 4] = rh*sin(TORAD(72.));  xus[ 5] = rg;
-    xus[ 6] = rh*cos(TORAD(144.)); xus[ 7] = rh*sin(TORAD(144.)); xus[ 8] = rg;
-    xus[ 9] = rh*cos(TORAD(216.)); xus[10] = rh*sin(TORAD(216.)); xus[11] = rg;
-    xus[12] = rh*cos(TORAD(288.)); xus[13] = rh*sin(TORAD(288.)); xus[14] = rg;
-    xus[15] = rh;                  xus[16] = 0;                   xus[17] = rg;
-    xus[18] = rh*cos(TORAD(36.));  xus[19] = rh*sin(TORAD(36.));  xus[20] = -rg;
-    xus[21] = rh*cos(TORAD(108.)); xus[22] = rh*sin(TORAD(108.)); xus[23] = -rg;
-    xus[24] = -rh;                 xus[25] = 0;                   xus[26] = -rg;
-    xus[27] = rh*cos(TORAD(252.)); xus[28] = rh*sin(TORAD(252.)); xus[29] = -rg;
-    xus[30] = rh*cos(TORAD(324.)); xus[31] = rh*sin(TORAD(324.)); xus[32] = -rg;
-    xus[33] = 0.;                  xus[34] = 0.;                  xus[35] = -1.;
-}
-
-
-void divarc(real x1, real y1, real z1,
-            real x2, real y2, real z2,
-            int div1, int div2, real *xr, real *yr, real *zr)
-{
-
-    real xd, yd, zd, dd, d1, d2, s, x, y, z;
-    real phi, sphi, cphi;
-
-    xd = y1*z2-y2*z1;
-    yd = z1*x2-z2*x1;
-    zd = x1*y2-x2*y1;
-    dd = sqrt(xd*xd+yd*yd+zd*zd);
-    if (dd < DP_TOL)
-    {
-        ERROR("divarc: rotation axis of length %f", dd);
-    }
-
-    d1 = x1*x1+y1*y1+z1*z1;
-    if (d1 < 0.5)
-    {
-        ERROR("divarc: vector 1 of sq.length %f", d1);
-    }
-    d2 = x2*x2+y2*y2+z2*z2;
-    if (d2 < 0.5)
-    {
-        ERROR("divarc: vector 2 of sq.length %f", d2);
-    }
-
-    phi  = ASIN(dd/sqrt(d1*d2));
-    phi  = phi*((real)div1)/((real)div2);
-    sphi = sin(phi); cphi = cos(phi);
-    s    = (x1*xd+y1*yd+z1*zd)/dd;
-
-    x   = xd*s*(1.-cphi)/dd + x1 * cphi + (yd*z1-y1*zd)*sphi/dd;
-    y   = yd*s*(1.-cphi)/dd + y1 * cphi + (zd*x1-z1*xd)*sphi/dd;
-    z   = zd*s*(1.-cphi)/dd + z1 * cphi + (xd*y1-x1*yd)*sphi/dd;
-    dd  = sqrt(x*x+y*y+z*z);
-    *xr = x/dd; *yr = y/dd; *zr = z/dd;
-}
-
-int ico_dot_arc(int densit)   /* densit...required dots per unit sphere */
-{
-    /* dot distribution on a unit sphere based on an icosaeder *
-     * great circle average refining of icosahedral face       */
-
-    int   i, j, k, tl, tl2, tn, tess;
-    real  a, d, x, y, z, x2, y2, z2, x3, y3, z3;
-    real  xij, yij, zij, xji, yji, zji, xik, yik, zik, xki, yki, zki,
-          xjk, yjk, zjk, xkj, ykj, zkj;
-    real *xus = NULL;
-
-    /* calculate tessalation level */
-    a     = sqrt((((real) densit)-2.)/10.);
-    tess  = (int) ceil(a);
-    n_dot = 10*tess*tess+2;
-    if (n_dot < densit)
-    {
-        ERROR("ico_dot_arc: error in formula for tessalation level (%d->%d, %d)",
-              tess, n_dot, densit);
-    }
-
-    snew(xus, 3*n_dot);
-    xpunsp = xus;
-    icosaeder_vertices(xus);
-
-    if (tess > 1)
-    {
-        tn = 12;
-        a  = rh*rh*2.*(1.-cos(TORAD(72.)));
-        /* calculate tessalation of icosaeder edges */
-        for (i = 0; i < 11; i++)
-        {
-            for (j = i+1; j < 12; j++)
-            {
-                x = xus[3*i]-xus[3*j];
-                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
-                d = x*x+y*y+z*z;
-                if (fabs(a-d) > DP_TOL)
-                {
-                    continue;
-                }
-                for (tl = 1; tl < tess; tl++)
-                {
-                    if (tn >= n_dot)
-                    {
-                        ERROR("ico_dot: tn exceeds dimension of xus");
-                    }
-                    divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
-                           xus[3*j], xus[1+3*j], xus[2+3*j],
-                           tl, tess, &xus[3*tn], &xus[1+3*tn], &xus[2+3*tn]);
-                    tn++;
-                }
-            }
-        }
-        /* calculate tessalation of icosaeder faces */
-        for (i = 0; i < 10; i++)
-        {
-            for (j = i+1; j < 11; j++)
-            {
-                x = xus[3*i]-xus[3*j];
-                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
-                d = x*x+y*y+z*z;
-                if (fabs(a-d) > DP_TOL)
-                {
-                    continue;
-                }
-
-                for (k = j+1; k < 12; k++)
-                {
-                    x = xus[3*i]-xus[3*k];
-                    y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
-                    d = x*x+y*y+z*z;
-                    if (fabs(a-d) > DP_TOL)
-                    {
-                        continue;
-                    }
-                    x = xus[3*j]-xus[3*k];
-                    y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
-                    d = x*x+y*y+z*z;
-                    if (fabs(a-d) > DP_TOL)
-                    {
-                        continue;
-                    }
-                    for (tl = 1; tl < tess-1; tl++)
-                    {
-                        divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
-                               xus[3*i], xus[1+3*i], xus[2+3*i],
-                               tl, tess, &xji, &yji, &zji);
-                        divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
-                               xus[3*i], xus[1+3*i], xus[2+3*i],
-                               tl, tess, &xki, &yki, &zki);
-
-                        for (tl2 = 1; tl2 < tess-tl; tl2++)
-                        {
-                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
-                                   xus[3*j], xus[1+3*j], xus[2+3*j],
-                                   tl2, tess, &xij, &yij, &zij);
-                            divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
-                                   xus[3*j], xus[1+3*j], xus[2+3*j],
-                                   tl2, tess, &xkj, &ykj, &zkj);
-                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
-                                   xus[3*k], xus[1+3*k], xus[2+3*k],
-                                   tess-tl-tl2, tess, &xik, &yik, &zik);
-                            divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
-                                   xus[3*k], xus[1+3*k], xus[2+3*k],
-                                   tess-tl-tl2, tess, &xjk, &yjk, &zjk);
-                            if (tn >= n_dot)
-                            {
-                                ERROR("ico_dot: tn exceeds dimension of xus");
-                            }
-                            divarc(xki, yki, zki, xji, yji, zji, tl2, tess-tl,
-                                   &x, &y, &z);
-                            divarc(xkj, ykj, zkj, xij, yij, zij, tl, tess-tl2,
-                                   &x2, &y2, &z2);
-                            divarc(xjk, yjk, zjk, xik, yik, zik, tl, tl+tl2,
-                                   &x3, &y3, &z3);
-                            x           = x+x2+x3; y = y+y2+y3; z = z+z2+z3;
-                            d           = sqrt(x*x+y*y+z*z);
-                            xus[3*tn]   = x/d;
-                            xus[1+3*tn] = y/d;
-                            xus[2+3*tn] = z/d;
-                            tn++;
-                        } /* cycle tl2 */
-                    }     /* cycle tl */
-                }         /* cycle k */
-            }             /* cycle j */
-        }                 /* cycle i */
-        if (n_dot != tn)
-        {
-            ERROR("ico_dot: n_dot(%d) and tn(%d) differ", n_dot, tn);
-        }
-    }   /* end of if (tess > 1) */
-
-    return n_dot;
-}                           /* end of routine ico_dot_arc */
-
-int ico_dot_dod(int densit) /* densit...required dots per unit sphere */
-{
-    /* dot distribution on a unit sphere based on an icosaeder *
-     * great circle average refining of icosahedral face       */
-
-    int   i, j, k, tl, tl2, tn, tess, j1, j2;
-    real  a, d, x, y, z, x2, y2, z2, x3, y3, z3, ai_d, adod;
-    real  xij, yij, zij, xji, yji, zji, xik, yik, zik, xki, yki, zki,
-          xjk, yjk, zjk, xkj, ykj, zkj;
-    real *xus = NULL;
-    /* calculate tesselation level */
-    a     = sqrt((((real) densit)-2.)/30.);
-    tess  = max((int) ceil(a), 1);
-    n_dot = 30*tess*tess+2;
-    if (n_dot < densit)
-    {
-        ERROR("ico_dot_dod: error in formula for tessalation level (%d->%d, %d)",
-              tess, n_dot, densit);
-    }
-
-    snew(xus, 3*n_dot);
-    xpunsp = xus;
-    icosaeder_vertices(xus);
-
-    tn = 12;
-    /* square of the edge of an icosaeder */
-    a = rh*rh*2.*(1.-cos(TORAD(72.)));
-    /* dodecaeder vertices */
-    for (i = 0; i < 10; i++)
-    {
-        for (j = i+1; j < 11; j++)
-        {
-            x = xus[3*i]-xus[3*j];
-            y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
-            d = x*x+y*y+z*z;
-            if (fabs(a-d) > DP_TOL)
-            {
-                continue;
-            }
-            for (k = j+1; k < 12; k++)
-            {
-                x = xus[3*i]-xus[3*k];
-                y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
-                d = x*x+y*y+z*z;
-                if (fabs(a-d) > DP_TOL)
-                {
-                    continue;
-                }
-                x = xus[3*j]-xus[3*k];
-                y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
-                d = x*x+y*y+z*z;
-                if (fabs(a-d) > DP_TOL)
-                {
-                    continue;
-                }
-                x         = xus[  3*i]+xus[  3*j]+xus[  3*k];
-                y         = xus[1+3*i]+xus[1+3*j]+xus[1+3*k];
-                z         = xus[2+3*i]+xus[2+3*j]+xus[2+3*k];
-                d         = sqrt(x*x+y*y+z*z);
-                xus[3*tn] = x/d; xus[1+3*tn] = y/d; xus[2+3*tn] = z/d;
-                tn++;
-            }
-        }
-    }
-
-    if (tess > 1)
-    {
-        tn = 32;
-        /* square of the edge of an dodecaeder */
-        adod = 4.*(cos(TORAD(108.))-cos(TORAD(120.)))/(1.-cos(TORAD(120.)));
-        /* square of the distance of two adjacent vertices of ico- and dodecaeder */
-        ai_d = 2.*(1.-sqrt(1.-a/3.));
-
-        /* calculate tessalation of mixed edges */
-        for (i = 0; i < 31; i++)
-        {
-            j1 = 12; j2 = 32; a = ai_d;
-            if (i >= 12)
-            {
-                j1 = i+1; a = adod;
-            }
-            for (j = j1; j < j2; j++)
-            {
-                x = xus[3*i]-xus[3*j];
-                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
-                d = x*x+y*y+z*z;
-                if (fabs(a-d) > DP_TOL)
-                {
-                    continue;
-                }
-                for (tl = 1; tl < tess; tl++)
-                {
-                    if (tn >= n_dot)
-                    {
-                        ERROR("ico_dot: tn exceeds dimension of xus");
-                    }
-                    divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
-                           xus[3*j], xus[1+3*j], xus[2+3*j],
-                           tl, tess, &xus[3*tn], &xus[1+3*tn], &xus[2+3*tn]);
-                    tn++;
-                }
-            }
-        }
-        /* calculate tessalation of pentakisdodecahedron faces */
-        for (i = 0; i < 12; i++)
-        {
-            for (j = 12; j < 31; j++)
-            {
-                x = xus[3*i]-xus[3*j];
-                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
-                d = x*x+y*y+z*z;
-                if (fabs(ai_d-d) > DP_TOL)
-                {
-                    continue;
-                }
-
-                for (k = j+1; k < 32; k++)
-                {
-                    x = xus[3*i]-xus[3*k];
-                    y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
-                    d = x*x+y*y+z*z;
-                    if (fabs(ai_d-d) > DP_TOL)
-                    {
-                        continue;
-                    }
-                    x = xus[3*j]-xus[3*k];
-                    y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
-                    d = x*x+y*y+z*z;
-                    if (fabs(adod-d) > DP_TOL)
-                    {
-                        continue;
-                    }
-                    for (tl = 1; tl < tess-1; tl++)
-                    {
-                        divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
-                               xus[3*i], xus[1+3*i], xus[2+3*i],
-                               tl, tess, &xji, &yji, &zji);
-                        divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
-                               xus[3*i], xus[1+3*i], xus[2+3*i],
-                               tl, tess, &xki, &yki, &zki);
-
-                        for (tl2 = 1; tl2 < tess-tl; tl2++)
-                        {
-                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
-                                   xus[3*j], xus[1+3*j], xus[2+3*j],
-                                   tl2, tess, &xij, &yij, &zij);
-                            divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
-                                   xus[3*j], xus[1+3*j], xus[2+3*j],
-                                   tl2, tess, &xkj, &ykj, &zkj);
-                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
-                                   xus[3*k], xus[1+3*k], xus[2+3*k],
-                                   tess-tl-tl2, tess, &xik, &yik, &zik);
-                            divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
-                                   xus[3*k], xus[1+3*k], xus[2+3*k],
-                                   tess-tl-tl2, tess, &xjk, &yjk, &zjk);
-                            if (tn >= n_dot)
-                            {
-                                ERROR("ico_dot: tn exceeds dimension of xus");
-                            }
-                            divarc(xki, yki, zki, xji, yji, zji, tl2, tess-tl,
-                                   &x, &y, &z);
-                            divarc(xkj, ykj, zkj, xij, yij, zij, tl, tess-tl2,
-                                   &x2, &y2, &z2);
-                            divarc(xjk, yjk, zjk, xik, yik, zik, tl, tl+tl2,
-                                   &x3, &y3, &z3);
-                            x           = x+x2+x3; y = y+y2+y3; z = z+z2+z3;
-                            d           = sqrt(x*x+y*y+z*z);
-                            xus[3*tn]   = x/d;
-                            xus[1+3*tn] = y/d;
-                            xus[2+3*tn] = z/d;
-                            tn++;
-                        } /* cycle tl2 */
-                    }     /* cycle tl */
-                }         /* cycle k */
-            }             /* cycle j */
-        }                 /* cycle i */
-        if (n_dot != tn)
-        {
-            ERROR("ico_dot: n_dot(%d) and tn(%d) differ", n_dot, tn);
-        }
-    }   /* end of if (tess > 1) */
-
-    return n_dot;
-}       /* end of routine ico_dot_dod */
-
-int unsp_type(int densit)
-{
-    int i1, i2;
-    i1 = 1;
-    while (10*i1*i1+2 < densit)
-    {
-        i1++;
-    }
-    i2 = 1;
-    while (30*i2*i2+2 < densit)
-    {
-        i2++;
-    }
-    if (10*i1*i1-2 < 30*i2*i2-2)
-    {
-        return UNSP_ICO_ARC;
-    }
-    else
-    {
-        return UNSP_ICO_DOD;
-    }
-}
-
-int make_unsp(int densit, int mode, int * num_dot, int cubus)
-{
-    int  *ico_wk, *ico_pt;
-    int   ndot, ico_cube_cb, i, j, k, l, ijk, tn, tl, tl2;
-    real *xus;
-    int  *work;
-    real  x, y, z;
-
-    if (xpunsp)
-    {
-        free(xpunsp);
-    }
-
-    k = 1; if (mode < 0)
-    {
-        k = 0; mode = -mode;
-    }
-    if (mode == UNSP_ICO_ARC)
-    {
-        ndot = ico_dot_arc(densit);
-    }
-    else if (mode == UNSP_ICO_DOD)
-    {
-        ndot = ico_dot_dod(densit);
-    }
-    else
-    {
-        WARNING("make_unsp: mode %c%d not allowed", (k) ? '+' : '-', mode);
-        return 1;
-    }
-
-    last_n_dot = ndot; last_densit = densit; last_unsp = mode;
-    *num_dot   = ndot; if (k)
-    {
-        return 0;
-    }
-
-    /* in the following the dots of the unit sphere may be resorted */
-    last_unsp = -last_unsp;
-
-    /* determine distribution of points in elementary cubes */
-    if (cubus)
-    {
-        ico_cube = cubus;
-    }
-    else
-    {
-        last_cubus = 0;
-        i          = 1;
-        while (i*i*i*2 < ndot)
-        {
-            i++;
-        }
-        ico_cube = max(i-1, 0);
-    }
-    ico_cube_cb = ico_cube*ico_cube*ico_cube;
-    del_cube    = 2./((real)ico_cube);
-    snew(work, ndot);
-    xus = xpunsp;
-    for (l = 0; l < ndot; l++)
-    {
-        i = max((int) floor((1.+xus[3*l])/del_cube), 0);
-        if (i >= ico_cube)
-        {
-            i = ico_cube-1;
-        }
-        j = max((int) floor((1.+xus[1+3*l])/del_cube), 0);
-        if (j >= ico_cube)
-        {
-            j = ico_cube-1;
-        }
-        k = max((int) floor((1.+xus[2+3*l])/del_cube), 0);
-        if (k >= ico_cube)
-        {
-            k = ico_cube-1;
-        }
-        ijk     = i+j*ico_cube+k*ico_cube*ico_cube;
-        work[l] = ijk;
-    }
-
-    snew(ico_wk, 2*ico_cube_cb+1);
-
-    ico_pt = ico_wk+ico_cube_cb;
-    for (l = 0; l < ndot; l++)
-    {
-        ico_wk[work[l]]++; /* dots per elementary cube */
-    }
-
-    /* reordering of the coordinate array in accordance with box number */
-    tn = 0;
-    for (i = 0; i < ico_cube; i++)
-    {
-        for (j = 0; j < ico_cube; j++)
-        {
-            for (k = 0; k < ico_cube; k++)
-            {
-                tl            = 0;
-                tl2           = tn;
-                ijk           = i+ico_cube*j+ico_cube*ico_cube*k;
-                *(ico_pt+ijk) = tn;
-                for (l = tl2; l < ndot; l++)
-                {
-                    if (ijk == work[l])
-                    {
-                        x          = xus[3*l]; y = xus[1+3*l]; z = xus[2+3*l];
-                        xus[3*l]   = xus[3*tn];
-                        xus[1+3*l] = xus[1+3*tn]; xus[2+3*l] = xus[2+3*tn];
-                        xus[3*tn]  = x; xus[1+3*tn] = y; xus[2+3*tn] = z;
-                        ijk        = work[l]; work[l] = work[tn]; work[tn] = ijk;
-                        tn++; tl++;
-                    }
-                }
-                *(ico_wk+ijk) = tl;
-            } /* cycle k */
-        }     /* cycle j */
-    }         /* cycle i */
-    sfree(ico_wk);
-    sfree(work);
-
-    return 0;
-}
-
-
-typedef struct _stwknb {
-    real x;
-    real y;
-    real z;
-    real dot;
-} Neighb;
-
-int nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
-                 int  densit, int mode,
-                 real *value_of_area, real **at_area,
-                 real *value_of_vol,
-                 real **lidots, int *nu_dots,
-                 atom_id index[], int ePBC, matrix box)
-{
-    int         iat, i, ii, iii, ix, iy, iz, ixe, ixs, iye, iys, ize, izs, i_ac;
-    int         jat, j, jj, jjj, jx, jy, jz;
-    int         distribution;
-    int         l;
-    int         maxnei, nnei, last, maxdots = 0;
-    int        *wkdot = NULL, *wkbox = NULL, *wkat1 = NULL, *wkatm = NULL;
-    Neighb     *wknb, *ctnb;
-    int         iii1, iii2, iiat, lfnr = 0, i_at, j_at;
-    real        dx, dy, dz, dd, ai, aisq, ajsq, aj, as, a;
-    real        xi, yi, zi, xs = 0., ys = 0., zs = 0.;
-    real        dotarea, area, vol = 0.;
-    real       *xus, *dots = NULL, *atom_area = NULL;
-    int         nxbox, nybox, nzbox, nxy, nxyz;
-    real        xmin = 0, ymin = 0, zmin = 0, xmax, ymax, zmax, ra2max, d;
-    const real *pco;
-    /* Added DvdS 2006-07-19 */
-    t_pbc       pbc;
-    rvec        ddx, *x = NULL;
-    int         iat_xx, jat_xx;
-
-    distribution = unsp_type(densit);
-    if (distribution != -last_unsp || last_cubus != 4 ||
-        (densit != last_densit && densit != last_n_dot))
-    {
-        if (make_unsp(densit, (-distribution), &n_dot, 4))
-        {
-            return 1;
-        }
-    }
-    xus = xpunsp;
-
-    dotarea = FOURPI/(real) n_dot;
-    area    = 0.;
-
-    if (debug)
-    {
-        fprintf(debug, "nsc_dclm: n_dot=%5d %9.3f\n", n_dot, dotarea);
-    }
-
-    /* start with neighbour list */
-    /* calculate neighbour list with the box algorithm */
-    if (nat == 0)
-    {
-        WARNING("nsc_dclm: no surface atoms selected");
-        return 1;
-    }
-    if (mode & FLAG_VOLUME)
-    {
-        vol = 0.;
-    }
-    if (mode & FLAG_DOTS)
-    {
-        maxdots = (3*n_dot*nat)/10;
-        /* should be set to NULL on first user call */
-        if (dots == NULL)
-        {
-            snew(dots, maxdots);
-        }
-        else
-        {
-            srenew(dots, maxdots);
-        }
-
-        lfnr = 0;
-    }
-    if (mode & FLAG_ATOM_AREA)
-    {
-        /* should be set to NULL on first user call */
-        if (atom_area == NULL)
-        {
-            snew(atom_area, nat);
-        }
-        else
-        {
-            srenew(atom_area, nat);
-        }
-    }
-
-    /* Compute minimum size for grid cells */
-    ra2max = radius[index[0]];
-    for (iat_xx = 1; (iat_xx < nat); iat_xx++)
-    {
-        iat    = index[iat_xx];
-        ra2max = max(ra2max, radius[iat]);
-    }
-    ra2max = 2*ra2max;
-
-    /* Added DvdS 2006-07-19 */
-    /* Updated 2008-10-09 */
-    if (box)
-    {
-        set_pbc(&pbc, ePBC, box);
-        snew(x, nat);
-        for (i = 0; (i < nat); i++)
-        {
-            iat  = index[0];
-            copy_rvec(coords[iat], x[i]);
-        }
-        put_atoms_in_triclinic_unitcell(ecenterTRIC, box, nat, x);
-        nxbox = max(1, floor(norm(box[XX])/ra2max));
-        nybox = max(1, floor(norm(box[YY])/ra2max));
-        nzbox = max(1, floor(norm(box[ZZ])/ra2max));
-        if (debug)
-        {
-            fprintf(debug, "nbox = %d, %d, %d\n", nxbox, nybox, nzbox);
-        }
-    }
-    else
-    {
-        /* dimensions of atomic set, cell edge is 2*ra_max */
-        iat    = index[0];
-        xmin   = coords[iat][XX]; xmax = xmin; xs = xmin;
-        ymin   = coords[iat][YY]; ymax = ymin; ys = ymin;
-        zmin   = coords[iat][ZZ]; zmax = zmin; zs = zmin;
-
-        for (iat_xx = 1; (iat_xx < nat); iat_xx++)
-        {
-            iat  = index[iat_xx];
-            pco  = coords[iat];
-            xmin = min(xmin, *pco);     xmax = max(xmax, *pco);
-            ymin = min(ymin, *(pco+1)); ymax = max(ymax, *(pco+1));
-            zmin = min(zmin, *(pco+2)); zmax = max(zmax, *(pco+2));
-            xs   = xs+ *pco; ys = ys+ *(pco+1); zs = zs+ *(pco+2);
-        }
-        xs = xs/ (real) nat;
-        ys = ys/ (real) nat;
-        zs = zs/ (real) nat;
-        if (debug)
-        {
-            fprintf(debug, "nsc_dclm: n_dot=%5d ra2max=%9.3f %9.3f\n", n_dot, ra2max, dotarea);
-        }
-
-        d    = xmax-xmin; nxbox = (int) max(ceil(d/ra2max), 1.);
-        d    = (((real)nxbox)*ra2max-d)/2.;
-        xmin = xmin-d; xmax = xmax+d;
-        d    = ymax-ymin; nybox = (int) max(ceil(d/ra2max), 1.);
-        d    = (((real)nybox)*ra2max-d)/2.;
-        ymin = ymin-d; ymax = ymax+d;
-        d    = zmax-zmin; nzbox = (int) max(ceil(d/ra2max), 1.);
-        d    = (((real)nzbox)*ra2max-d)/2.;
-        zmin = zmin-d; zmax = zmax+d;
-    }
-    /* Help variables */
-    nxy  = nxbox*nybox;
-    nxyz = nxy*nzbox;
-
-    /* box number of atoms */
-    snew(wkatm, nat);
-    snew(wkat1, nat);
-    snew(wkdot, n_dot);
-    snew(wkbox, nxyz+1);
-
-    if (box)
-    {
-        matrix box_1;
-        rvec   x_1;
-        int    ix, iy, iz, m;
-        m_inv(box, box_1);
-        for (i = 0; (i < nat); i++)
-        {
-            mvmul(box_1, x[i], x_1);
-            ix = ((int)floor(x_1[XX]*nxbox) + 2*nxbox) % nxbox;
-            iy = ((int)floor(x_1[YY]*nybox) + 2*nybox) % nybox;
-            iz = ((int)floor(x_1[ZZ]*nzbox) + 2*nzbox) % nzbox;
-            j  =  ix + iy*nxbox + iz*nxbox*nybox;
-            if (debug)
-            {
-                fprintf(debug, "Atom %d cell index %d. x = (%8.3f,%8.3f,%8.3f) fc = (%8.3f,%8.3f,%8.3f)\n",
-                        i, j, x[i][XX], x[i][YY], x[i][ZZ], x_1[XX], x_1[YY], x_1[ZZ]);
-            }
-            range_check(j, 0, nxyz);
-            wkat1[i] = j;
-            wkbox[j]++;
-        }
-    }
-    else
-    {
-        /* Put the atoms in their boxes */
-        for (iat_xx = 0; (iat_xx < nat); iat_xx++)
-        {
-            iat           = index[iat_xx];
-            pco           = coords[iat];
-            i             = (int) max(floor((pco[XX]-xmin)/ra2max), 0);
-            i             = min(i, nxbox-1);
-            j             = (int) max(floor((pco[YY]-ymin)/ra2max), 0);
-            j             = min(j, nybox-1);
-            l             = (int) max(floor((pco[ZZ]-zmin)/ra2max), 0);
-            l             = min(l, nzbox-1);
-            i             = i+j*nxbox+l*nxy;
-            wkat1[iat_xx] = i;
-            wkbox[i]++;
-        }
-    }
-
-    /* sorting of atoms in accordance with box numbers */
-    j = wkbox[0];
-    for (i = 1; i < nxyz; i++)
-    {
-        j = max(wkbox[i], j);
-    }
-    for (i = 1; i <= nxyz; i++)
-    {
-        wkbox[i] += wkbox[i-1];
-    }
-
-    /* maxnei = (int) floor(ra2max*ra2max*ra2max*0.5); */
-    maxnei = min(nat, 27*j);
-    snew(wknb, maxnei);
-    for (iat_xx = 0; iat_xx < nat; iat_xx++)
-    {
-        iat = index[iat_xx];
-        range_check(wkat1[iat_xx], 0, nxyz);
-        wkatm[--wkbox[wkat1[iat_xx]]] = iat_xx;
-        if (debug)
-        {
-            fprintf(debug, "atom %5d on place %5d\n", iat, wkbox[wkat1[iat_xx]]);
-        }
-    }
-
-    if (debug)
-    {
-        fprintf(debug, "nsc_dclm: n_dot=%5d ra2max=%9.3f %9.3f\n",
-                n_dot, ra2max, dotarea);
-        fprintf(debug, "neighbour list calculated/box(xyz):%d %d %d\n",
-                nxbox, nybox, nzbox);
-
-        for (i = 0; i < nxyz; i++)
-        {
-            fprintf(debug, "box %6d : atoms %4d-%4d    %5d\n",
-                    i, wkbox[i], wkbox[i+1]-1, wkbox[i+1]-wkbox[i]);
-        }
-        for (i = 0; i < nat; i++)
-        {
-            fprintf(debug, "list place %5d by atom %7d\n", i, index[wkatm[i]]);
-        }
-    }
-
-    /* calculate surface for all atoms, step cube-wise */
-    for (iz = 0; iz < nzbox; iz++)
-    {
-        iii = iz*nxy;
-        if (box)
-        {
-            izs = iz-1;
-            ize = min(iz+2, izs+nzbox);
-        }
-        else
-        {
-            izs = max(iz-1, 0);
-            ize = min(iz+2, nzbox);
-        }
-        for (iy = 0; iy < nybox; iy++)
-        {
-            ii = iy*nxbox+iii;
-            if (box)
-            {
-                iys = iy-1;
-                iye = min(iy+2, iys+nybox);
-            }
-            else
-            {
-                iys = max(iy-1, 0);
-                iye = min(iy+2, nybox);
-            }
-            for (ix = 0; ix < nxbox; ix++)
-            {
-                i    = ii+ix;
-                iii1 = wkbox[i];
-                iii2 = wkbox[i+1];
-                if (iii1 >= iii2)
-                {
-                    continue;
-                }
-                if (box)
-                {
-                    ixs = ix-1;
-                    ixe = min(ix+2, ixs+nxbox);
-                }
-                else
-                {
-                    ixs = max(ix-1, 0);
-                    ixe = min(ix+2, nxbox);
-                }
-                iiat = 0;
-                /* make intermediate atom list */
-                for (jz = izs; jz < ize; jz++)
-                {
-                    jjj = ((jz+nzbox) % nzbox)*nxy;
-                    for (jy = iys; jy < iye; jy++)
-                    {
-                        jj = ((jy+nybox) % nybox)*nxbox+jjj;
-                        for (jx = ixs; jx < ixe; jx++)
-                        {
-                            j = jj+((jx+nxbox) % nxbox);
-                            for (jat = wkbox[j]; jat < wkbox[j+1]; jat++)
-                            {
-                                range_check(wkatm[jat], 0, nat);
-                                range_check(iiat, 0, nat);
-                                wkat1[iiat] = wkatm[jat];
-                                iiat++;
-                            } /* end of cycle "jat" */
-                        }     /* end of cycle "jx" */
-                    }         /* end of cycle "jy" */
-                }             /* end of cycle "jz" */
-                for (iat = iii1; iat < iii2; iat++)
-                {
-                    i_at = index[wkatm[iat]];
-                    ai   = radius[i_at];
-                    aisq = ai*ai;
-                    pco  = coords[i_at];
-                    xi   = pco[XX]; yi = pco[YY]; zi = pco[ZZ];
-                    for (i = 0; i < n_dot; i++)
-                    {
-                        wkdot[i] = 0;
-                    }
-
-                    ctnb = wknb; nnei = 0;
-                    for (j = 0; j < iiat; j++)
-                    {
-                        j_at = index[wkat1[j]];
-                        if (j_at == i_at)
-                        {
-                            continue;
-                        }
-
-                        aj   = radius[j_at];
-                        ajsq = aj*aj;
-                        pco  = coords[j_at];
-
-                        /* Added DvdS 2006-07-19 */
-                        if (box)
-                        {
-                            /*rvec xxi;
-
-                               xxi[XX] = xi;
-                               xxi[YY] = yi;
-                               xxi[ZZ] = zi;
-                               pbc_dx(&pbc,pco,xxi,ddx);*/
-                            pbc_dx(&pbc, coords[j_at], coords[i_at], ddx);
-                            dx = ddx[XX];
-                            dy = ddx[YY];
-                            dz = ddx[ZZ];
-                        }
-                        else
-                        {
-                            dx = pco[XX]-xi;
-                            dy = pco[YY]-yi;
-                            dz = pco[ZZ]-zi;
-                        }
-                        dd = dx*dx+dy*dy+dz*dz;
-                        as = ai+aj;
-                        if (dd > as*as)
-                        {
-                            continue;
-                        }
-                        nnei++;
-                        ctnb->x   = dx;
-                        ctnb->y   = dy;
-                        ctnb->z   = dz;
-                        ctnb->dot = (dd+aisq-ajsq)/(2.*ai); /* reference dot product */
-                        ctnb++;
-                    }
-
-                    /* check points on accessibility */
-                    if (nnei)
-                    {
-                        last = 0; i_ac = 0;
-                        for (l = 0; l < n_dot; l++)
-                        {
-                            if (xus[3*l]*(wknb+last)->x+
-                                xus[1+3*l]*(wknb+last)->y+
-                                xus[2+3*l]*(wknb+last)->z <= (wknb+last)->dot)
-                            {
-                                for (j = 0; j < nnei; j++)
-                                {
-                                    if (xus[3*l]*(wknb+j)->x+xus[1+3*l]*(wknb+j)->y+
-                                        xus[2+3*l]*(wknb+j)->z > (wknb+j)->dot)
-                                    {
-                                        last = j;
-                                        break;
-                                    }
-                                }
-                                if (j >= nnei)
-                                {
-                                    i_ac++;
-                                    wkdot[l] = 1;
-                                }
-                            } /* end of cycle j */
-                        }     /* end of cycle l */
-                    }
-                    else
-                    {
-                        i_ac  = n_dot;
-                        for (l = 0; l < n_dot; l++)
-                        {
-                            wkdot[l] = 1;
-                        }
-                    }
-
-                    if (debug)
-                    {
-                        fprintf(debug, "i_ac=%d, dotarea=%8.3f, aisq=%8.3f\n",
-                                i_ac, dotarea, aisq);
-                    }
-
-                    a    = aisq*dotarea* (real) i_ac;
-                    area = area + a;
-                    if (mode & FLAG_ATOM_AREA)
-                    {
-                        range_check(wkatm[iat], 0, nat);
-                        atom_area[wkatm[iat]] = a;
-                    }
-                    if (mode & FLAG_DOTS)
-                    {
-                        for (l = 0; l < n_dot; l++)
-                        {
-                            if (wkdot[l])
-                            {
-                                lfnr++;
-                                if (maxdots <= 3*lfnr+1)
-                                {
-                                    maxdots = maxdots+n_dot*3;
-                                    srenew(dots, maxdots);
-                                }
-                                dots[3*lfnr-3] = ai*xus[3*l]+xi;
-                                dots[3*lfnr-2] = ai*xus[1+3*l]+yi;
-                                dots[3*lfnr-1] = ai*xus[2+3*l]+zi;
-                            }
-                        }
-                    }
-                    if (mode & FLAG_VOLUME)
-                    {
-                        dx = 0.; dy = 0.; dz = 0.;
-                        for (l = 0; l < n_dot; l++)
-                        {
-                            if (wkdot[l])
-                            {
-                                dx = dx+xus[3*l];
-                                dy = dy+xus[1+3*l];
-                                dz = dz+xus[2+3*l];
-                            }
-                        }
-                        vol = vol+aisq*(dx*(xi-xs)+dy*(yi-ys)+dz*(zi-zs)+ai* (real) i_ac);
-                    }
-
-                } /* end of cycle "iat" */
-            }     /* end of cycle "ix" */
-        }         /* end of cycle "iy" */
-    }             /* end of cycle "iz" */
-
-    sfree(wkatm);
-    sfree(wkat1);
-    sfree(wkdot);
-    sfree(wkbox);
-    sfree(wknb);
-    if (box)
-    {
-        sfree(x);
-    }
-    if (mode & FLAG_VOLUME)
-    {
-        vol           = vol*FOURPI/(3.* (real) n_dot);
-        *value_of_vol = vol;
-    }
-    if (mode & FLAG_DOTS)
-    {
-        *nu_dots = lfnr;
-        *lidots  = dots;
-    }
-    if (mode & FLAG_ATOM_AREA)
-    {
-        *at_area = atom_area;
-    }
-    *value_of_area = area;
-
-    if (debug)
-    {
-        fprintf(debug, "area=%8.3f\n", area);
-    }
-
-    return 0;
-}
-
-
-#if TEST_NSC > 0
-#define NAT 2
-main () {
-
-    int    i, j, ndots;
-    real   co[3*NAT], ra[NAT], area, volume, a, b, c;
-    real * dots;
-    real * at_area;
-    FILE  *fp;
-
-
-    a  = 1.; c = 0.1;
-    fp = fopen("nsc.txt", "w+");
-    for (i = 1; i <= NAT; i++)
-    {
-        j         = i-1;
-        co[3*i-3] = j*1*c;
-        co[3*i-2] = j*1*c;
-        co[3*i-1] = j*1*c;
-        /*
-           co[3*i-3] = i*1.4;
-           co[3*i-2] = 0.;
-           co[3*i-1] = 0.;
-         */
-        /*
-           co[3*i-2] = a*0.3;
-           a = -a; b=0;
-           if (i%3 == 0) b=0.5;
-           co[3*i-1] = b;
-           ra[i-1] = 2.0;
-         */
-        ra[i-1] = (1.+j*0.5)*c;
-    }
-    /*
-       if (NSC(co, ra, NAT, 42, NULL, &area,
-     */
-    if (NSC(co, ra, NAT, 42, NULL, &area,
-            NULL, NULL, NULL, NULL))
-    {
-        ERROR("error in NSC");
-    }
-    fprintf(fp, "\n");
-    fprintf(fp, "area     : %8.3f\n", area);
-    fprintf(fp, "\n");
-    fprintf(fp, "\n");
-    fprintf(fp, "next call\n");
-    fprintf(fp, "\n");
-    fprintf(fp, "\n");
-
-    if (NSC(co, ra, NAT, 42, FLAG_VOLUME | FLAG_ATOM_AREA | FLAG_DOTS, &area,
-            &at_area, &volume,
-            &dots, &ndots))
-    {
-        ERROR("error in NSC");
-    }
-
-    fprintf(fp, "\n");
-    fprintf(fp, "area     : %8.3f\n", area);
-    printf("area     : %8.3f\n", area);
-    fprintf(fp, "volume   : %8.3f\n", volume);
-    printf("volume   : %8.3f\n", volume);
-    fprintf(fp, "ndots    : %8d\n", ndots);
-    printf("ndots    : %8d\n", ndots);
-    fprintf(fp, "\n");
-    for (i = 1; i <= NAT; i++)
-    {
-        fprintf(fp, "%4d ATOM %7.2f %7.2f %7.2f  ra=%4.1f  area=%8.3f\n",
-                i, co[3*i-3], co[3*i-2], co[3*i-1], ra[i-1], at_area[i-1]);
-    }
-    fprintf(fp, "\n");
-    fprintf(fp, "DOTS : %8d\n", ndots);
-    for (i = 1; i <= ndots; i++)
-    {
-        fprintf(fp, "%4d DOTS %8.2f %8.2f %8.2f\n",
-                i, dots[3*i-3], dots[3*i-2], dots[3*i-1]);
-    }
-}
-#endif
diff --git a/src/gromacs/trajectoryanalysis/modules/nsc.h b/src/gromacs/trajectoryanalysis/modules/nsc.h
deleted file mode 100644 (file)
index 6394c56..0000000
+++ /dev/null
@@ -1,144 +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, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and 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 "typedefs.h"
-
-#define FLAG_DOTS       01
-#define FLAG_VOLUME     02
-#define FLAG_ATOM_AREA  04
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-int nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
-                 int  densit, int mode,
-                 real *value_of_area, real **at_area,
-                 real *value_of_vol,
-                 real **lidots, int *nu_dots,
-                 atom_id index[], int ePBC, matrix box);
-
-/*
-    User notes :
-   The input requirements :
-   The arrays with atom coordinates and radii are thought to start
-   with index 0, i.e., places 0, 1, and 2 are the x-, y-, and z-
-   coordinates of the zero-th atom and place 0 in the other array
-   is its radius.
-
-   PLEASE TAKE INTO ACCOUNT THAT THE RADII GIVEN HERE ARE DIRECTLY
-   USED FOR SURFACE CALCULATION. NSC does not increment with a probe
-   radius.
-
-   The user can define any number of dots. The program selects a
-   dot density that is the lowest possible with at least the required
-   number of dots. The points are distributed in accordance with the
-   icosahedron-based or the dodecahedron-based method as described in
-   ref. 1.
-
-   The output requirements are :
-   1 and 3 :  pointer to an existing real
-   2 and 4 :  pointer to an existing pointer to real
-             NSC allocates memory for an array
-   5       :  pointer to an existing integer
-
-   The subroutine NSC makes use of variant 2 described in reference 1.
-   By selecting the necessary output via flags, the requirements for
-   cpu-time and computer memory can be adapted to the actual needs.
-
-   Example : flag = FLAG_VOLUME | FLAG_ATOM_AREA | FLAG_DOTS
-          The routine calculates the area, volume and the dot surface. The
-          program allocates arrays for the atomwise areas and for the surface
-          dots. The addresses are returned in the pointers to pointers to
-          real.
-          This variant is not recommended because normally the dot surface
-          is needed for low point density (e.g.42) at which area and volume
-          are inaccurate. The sign "|" is used as binary AND !
-
-          flag = FLAG_VOLUME | FLAG_ATOM_AREA
-          In this case the large arrays for storing the surface dots
-          are not allocated. A large point number of the fully accessible
-          sphere can be selected. Good accuracy is already achieved with
-          600-700 points per sphere (accuracy of about 1.5 square Angstrem
-          per atomic sphere).
-          Output pointers 4 and 5 may be NULL.
-
-          flag = FLAG_DOTS
-          Only the dot surface is produced.
-          Output pointers 2 and 3 may be NULL.
-
-   The output pointer 1 cannot be set to NULL in any circumstances. The
-   overall area value is returned in every mode.
-
-   All files calling NSC should include nsc.h !!
-
-
-   Example for calling NSC (contents of user file):
-
-   ...
-   #include "nsc.h"
-
-   int routine_calling_NSC(int n_atom, real *coordinates, real *radii) {
-   real area, volume, *atomwise_area, *surface_dots;
-   int    i, density = 300, n_dots;
-
-   ...
-
-   for (i=0; i<n_atom; i++) {
-   radii[i]  += 1.4      /# add the probe radius if necessary #/
-
-   if (NSC(coordinates, radii, n_atom, density,
-          FLAG_AREA | FLAG_VOLUME | FLAG_DOTS,
-          &area, &atomwise_area, &volume, &surface_dots, &n_dots))
-    printf("error occured\n");
-    return 1;
-    }
-
-   ...
-
-   /# do something with areas, volume and surface dots #/
-
-   ...
-
-   return 0;
-   }
-
- */
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/gromacs/trajectoryanalysis/modules/pairdist.cpp b/src/gromacs/trajectoryanalysis/modules/pairdist.cpp
new file mode 100644 (file)
index 0000000..37b2bbb
--- /dev/null
@@ -0,0 +1,554 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements gmx::analysismodules::PairDistance.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "pairdist.h"
+
+#include <cmath>
+
+#include <algorithm>
+#include <limits>
+#include <string>
+#include <vector>
+
+#include "gromacs/analysisdata/analysisdata.h"
+#include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/options.h"
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectionoption.h"
+#include "gromacs/trajectoryanalysis/analysissettings.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace analysismodules
+{
+
+namespace
+{
+
+//! \addtogroup module_trajectoryanalysis
+//! \{
+
+//! Enum value to store the selected value for `-type`.
+enum DistanceType
+{
+    eDistanceType_Min,
+    eDistanceType_Max
+};
+
+//! Enum value to store the selected value for `-refgrouping`/`-selgrouping`.
+enum GroupType
+{
+    eGroupType_All,
+    eGroupType_Residue,
+    eGroupType_Molecule,
+    eGroupType_None
+};
+
+//! Strings corresponding to DistanceType.
+const char *const           c_distanceTypes[] = { "min", "max" };
+//! Strings corresponding to GroupType.
+const char *const           c_groupTypes[]    = { "all", "res", "mol", "none" };
+
+/*! \brief
+ * Implements `gmx pairdist` trajectory analysis module.
+ */
+class PairDistance : public TrajectoryAnalysisModule
+{
+    public:
+        PairDistance();
+
+        virtual void initOptions(Options                    *options,
+                                 TrajectoryAnalysisSettings *settings);
+        virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
+                                  const TopologyInformation        &top);
+
+        virtual TrajectoryAnalysisModuleDataPointer startFrames(
+            const AnalysisDataParallelOptions &opt,
+            const SelectionCollection         &selections);
+        virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+                                  TrajectoryAnalysisModuleData *pdata);
+
+        virtual void finishAnalysis(int nframes);
+        virtual void writeOutput();
+
+    private:
+        /*! \brief
+         * Computed distances as a function of time.
+         *
+         * There is one data set for each selection in `sel_`.
+         * Within each data set, there is one column for each distance to be
+         * computed, as explained in the `-h` text.
+         */
+        AnalysisData            distances_;
+
+        /*! \brief
+         * Reference selection to compute distances to.
+         *
+         * mappedId() identifies the group (of type `refGroupType_`) into which
+         * each position belogs.
+         */
+        Selection               refSel_;
+        /*! \brief
+         * Selections to compute distances from.
+         *
+         * mappedId() identifies the group (of type `selGroupType_`) into which
+         * each position belogs.
+         */
+        SelectionList           sel_;
+
+        std::string             fnDist_;
+
+        double                  cutoff_;
+        int                     distanceType_;
+        int                     refGroupType_;
+        int                     selGroupType_;
+
+        //! Number of groups in `refSel_`.
+        int                     refGroupCount_;
+        //! Maximum number of pairs of groups for one selection.
+        int                     maxGroupCount_;
+        //! Initial squared distance for distance accumulation.
+        real                    initialDist2_;
+        //! Cutoff squared for use in the actual calculation.
+        real                    cutoff2_;
+
+        //! Neighborhood search object for the pair search.
+        AnalysisNeighborhood    nb_;
+
+        // Copy and assign disallowed by base.
+};
+
+PairDistance::PairDistance()
+    : TrajectoryAnalysisModule(PairDistanceInfo::name, PairDistanceInfo::shortDescription),
+      cutoff_(0.0), distanceType_(eDistanceType_Min),
+      refGroupType_(eGroupType_All), selGroupType_(eGroupType_All),
+      refGroupCount_(0), maxGroupCount_(0), initialDist2_(0.0), cutoff2_(0.0)
+{
+    registerAnalysisDataset(&distances_, "dist");
+}
+
+
+void
+PairDistance::initOptions(Options *options, TrajectoryAnalysisSettings * /*settings*/)
+{
+    static const char *const desc[] = {
+        "[THISMODULE] calculates pairwise distances between one reference",
+        "selection (given with [TT]-ref[tt]) and one or more other selections",
+        "(given with [TT]-sel[tt]).  It can calculate either the minimum",
+        "distance (the default), or the maximum distance (with",
+        "[TT]-type max[tt]).  Distances to each selection provided with",
+        "[TT]-sel[tt] are computed independently.[PAR]",
+        "By default, the global minimum/maximum distance is computed.",
+        "To compute more distances (e.g., minimum distances to each residue",
+        "in [TT]-ref[tt]), use [TT]-refgrouping[tt] and/or [TT]-selgrouping[tt]",
+        "to specify how the positions within each selection should be",
+        "grouped.[PAR]",
+        "Computed distances are written to the file specified with [TT]-o[tt].",
+        "If there are N groups in [TT]-ref[tt] and M groups in the first",
+        "selection in [TT]-sel[tt], then the output contains N*M columns",
+        "for the first selection. The columns contain distances like this:",
+        "r1-s1, r2-s1, ..., r1-s2, r2-s2, ..., where rn is the n'th group",
+        "in [TT]-ref[tt] and sn is the n'th group in the other selection.",
+        "The distances for the second selection comes as separate columns",
+        "after the first selection, and so on.  If some selections are",
+        "dynamic, only the selected positions are used in the computation",
+        "but the same number of columns is always written out.  If there",
+        "are no positions contributing to some group pair, then the cutoff",
+        "value is written (see below).[PAR]",
+        "[TT]-cutoff[tt] sets a cutoff for the computed distances.",
+        "If the result would contain a distance over the cutoff, the cutoff",
+        "value is written to the output file instead. By default, no cutoff",
+        "is used, but if you are not interested in values beyond a cutoff,",
+        "or if you know that the minimum distance is smaller than a cutoff,",
+        "you should set this option to allow the tool to use grid-based",
+        "searching and be significantly faster.[PAR]",
+        "If you want to compute distances between fixed pairs,",
+        "[gmx-distance] may be a more suitable tool."
+    };
+
+    options->setDescription(desc);
+
+    options->addOption(FileNameOption("o").filetype(eftPlot).outputFile().required()
+                           .store(&fnDist_).defaultBasename("dist")
+                           .description("Distances as function of time"));
+
+    options->addOption(DoubleOption("cutoff").store(&cutoff_)
+                           .description("Maximum distance to consider"));
+    options->addOption(StringOption("type").storeEnumIndex(&distanceType_)
+                           .defaultEnumIndex(0).enumValue(c_distanceTypes)
+                           .description("Type of distances to calculate"));
+    options->addOption(StringOption("refgrouping").storeEnumIndex(&refGroupType_)
+                           .defaultEnumIndex(0).enumValue(c_groupTypes)
+                           .description("Grouping of -ref positions to compute the min/max over"));
+    options->addOption(StringOption("selgrouping").storeEnumIndex(&selGroupType_)
+                           .defaultEnumIndex(0).enumValue(c_groupTypes)
+                           .description("Grouping of -sel positions to compute the min/max over"));
+
+    options->addOption(SelectionOption("ref").store(&refSel_).required()
+                           .description("Reference positions to calculate distances from"));
+    options->addOption(SelectionOption("sel").storeVector(&sel_).required().multiValue()
+                           .description("Positions to calculate distances for"));
+}
+
+//! Helper function to initialize the grouping for a selection.
+int initSelectionGroups(Selection *sel, t_topology *top, int type)
+{
+    e_index_t indexType = INDEX_UNKNOWN;
+    switch (type)
+    {
+        case eGroupType_All:      indexType = INDEX_ALL; break;
+        case eGroupType_Residue:  indexType = INDEX_RES; break;
+        case eGroupType_Molecule: indexType = INDEX_MOL; break;
+        case eGroupType_None:     indexType = INDEX_ATOM; break;
+    }
+    return sel->initOriginalIdsToGroup(top, indexType);
+}
+
+
+void
+PairDistance::initAnalysis(const TrajectoryAnalysisSettings &settings,
+                           const TopologyInformation        &top)
+{
+    refGroupCount_ = initSelectionGroups(&refSel_, top.topology(), 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_);
+        const int columnCount = refGroupCount_ * selGroupCount;
+        maxGroupCount_ = std::max(maxGroupCount_, columnCount);
+        distances_.setColumnCount(i, columnCount);
+    }
+
+    if (!fnDist_.empty())
+    {
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(settings.plotSettings()));
+        plotm->setFileName(fnDist_);
+        if (distanceType_ == eDistanceType_Max)
+        {
+            plotm->setTitle("Maximum distance");
+        }
+        else
+        {
+            plotm->setTitle("Minimum distance");
+        }
+        // TODO: Figure out and add a descriptive subtitle and/or a longer
+        // title and/or better legends based on the grouping and the reference
+        // selection.
+        plotm->setXAxisIsTime();
+        plotm->setYLabel("Distance (nm)");
+        for (size_t g = 0; g < sel_.size(); ++g)
+        {
+            plotm->appendLegend(sel_[g].name());
+        }
+        distances_.addModule(plotm);
+    }
+
+    nb_.setCutoff(cutoff_);
+    if (cutoff_ <= 0.0)
+    {
+        cutoff_       = 0.0;
+        initialDist2_ = std::numeric_limits<real>::max();
+    }
+    else
+    {
+        initialDist2_ = cutoff_ * cutoff_;
+    }
+    if (distanceType_ == eDistanceType_Max)
+    {
+        initialDist2_ = 0.0;
+    }
+    cutoff2_ = cutoff_ * cutoff_;
+}
+
+/*! \brief
+ * Temporary memory for use within a single-frame calculation.
+ */
+class PairDistanceModuleData : public TrajectoryAnalysisModuleData
+{
+    public:
+        /*! \brief
+         * Reserves memory for the frame-local data.
+         */
+        PairDistanceModuleData(TrajectoryAnalysisModule          *module,
+                               const AnalysisDataParallelOptions &opt,
+                               const SelectionCollection         &selections,
+                               int                                refGroupCount,
+                               const Selection                   &refSel,
+                               int                                maxGroupCount)
+            : TrajectoryAnalysisModuleData(module, opt, selections)
+        {
+            distArray_.resize(maxGroupCount);
+            countArray_.resize(maxGroupCount);
+            refCountArray_.resize(refGroupCount);
+            if (!refSel.isDynamic())
+            {
+                initRefCountArray(refSel);
+            }
+        }
+
+        virtual void finish() { finishDataHandles(); }
+
+        /*! \brief
+         * Computes the number of positions in each group in \p refSel
+         * and stores them into `refCountArray_`.
+         */
+        void initRefCountArray(const Selection &refSel)
+        {
+            std::fill(refCountArray_.begin(), refCountArray_.end(), 0);
+            int refPos = 0;
+            while (refPos < refSel.posCount())
+            {
+                const int refIndex = refSel.position(refPos).mappedId();
+                const int startPos = refPos;
+                ++refPos;
+                while (refPos < refSel.posCount()
+                       && refSel.position(refPos).mappedId() == refIndex)
+                {
+                    ++refPos;
+                }
+                refCountArray_[refIndex] = refPos - startPos;
+            }
+        }
+
+        /*! \brief
+         * Squared distance between each group
+         *
+         * One entry for each group pair for the current selection.
+         * Enough memory is allocated to fit the largest calculation selection.
+         * This is needed to support neighborhood searching, which may not
+         * return the pairs in order: for each group pair, we need to search
+         * through all the position pairs and update this array to find the
+         * minimum/maximum distance between them.
+         */
+        std::vector<real> distArray_;
+        /*! \brief
+         * Number of pairs within the cutoff that have contributed to the value
+         * in `distArray_`.
+         *
+         * This is needed to identify whether there were any pairs inside the
+         * cutoff and whether there were additional pairs outside the cutoff
+         * that were not covered by the neihborhood search.
+         */
+        std::vector<int>  countArray_;
+        /*! \brief
+         * Number of positions within each reference group.
+         *
+         * This is used to more efficiently compute the total number of pairs
+         * (for comparison with `countArray_`), as otherwise these numbers
+         * would need to be recomputed for each selection.
+         */
+        std::vector<int>  refCountArray_;
+};
+
+TrajectoryAnalysisModuleDataPointer PairDistance::startFrames(
+        const AnalysisDataParallelOptions &opt,
+        const SelectionCollection         &selections)
+{
+    return TrajectoryAnalysisModuleDataPointer(
+            new PairDistanceModuleData(this, opt, selections, refGroupCount_,
+                                       refSel_, maxGroupCount_));
+}
+
+void
+PairDistance::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+                           TrajectoryAnalysisModuleData *pdata)
+{
+    AnalysisDataHandle         dh            = pdata->dataHandle(distances_);
+    const Selection           &refSel        = pdata->parallelSelection(refSel_);
+    const SelectionList       &sel           = pdata->parallelSelections(sel_);
+    PairDistanceModuleData    &frameData     = *static_cast<PairDistanceModuleData *>(pdata);
+    std::vector<real>         &distArray     = frameData.distArray_;
+    std::vector<int>          &countArray    = frameData.countArray_;
+
+    if (cutoff_ > 0.0 && refSel.isDynamic())
+    {
+        // Count the number of reference positions in each group, so that
+        // this does not need to be computed again for each selection.
+        // This is needed only if it is possible that the neighborhood search
+        // does not cover all the pairs, hence the cutoff > 0.0 check.
+        // If refSel is static, then the array contents are static as well,
+        // and it has been initialized in the constructor of the data object.
+        frameData.initRefCountArray(refSel);
+    }
+    const std::vector<int>    &refCountArray = frameData.refCountArray_;
+
+    AnalysisNeighborhoodSearch nbsearch  = nb_.initSearch(pbc, refSel);
+    dh.startFrame(frnr, fr.time);
+    for (size_t g = 0; g < sel.size(); ++g)
+    {
+        const int columnCount = distances_.columnCount(g);
+        std::fill(distArray.begin(), distArray.begin() + columnCount, initialDist2_);
+        std::fill(countArray.begin(), countArray.begin() + columnCount, 0);
+
+        // Accumulate the number of position pairs within the cutoff and the
+        // min/max distance for each group pair.
+        AnalysisNeighborhoodPairSearch pairSearch = nbsearch.startPairSearch(sel[g]);
+        AnalysisNeighborhoodPair       pair;
+        while (pairSearch.findNextPair(&pair))
+        {
+            const SelectionPosition &refPos   = refSel.position(pair.refIndex());
+            const SelectionPosition &selPos   = sel[g].position(pair.testIndex());
+            const int                refIndex = refPos.mappedId();
+            const int                selIndex = selPos.mappedId();
+            const int                index    = selIndex * refGroupCount_ + refIndex;
+            const real               r2       = pair.distance2();
+            if (distanceType_ == eDistanceType_Min)
+            {
+                if (distArray[index] > r2)
+                {
+                    distArray[index] = r2;
+                }
+            }
+            else
+            {
+                if (distArray[index] < r2)
+                {
+                    distArray[index] = r2;
+                }
+            }
+            ++countArray[index];
+        }
+
+        // If it is possible that positions outside the cutoff (or lack of
+        // them) affects the result, then we need to check whether there were
+        // any.  This is necessary for two cases:
+        //  - With max distances, if there are pairs outside the cutoff, then
+        //    the computed distance should be equal to the cutoff instead of
+        //    the largest distance that was found above.
+        //  - With either distance type, if all pairs are outside the cutoff,
+        //    then countArray must be updated so that the presence flag
+        //    in the output data reflects the dynamic selection status, not
+        //    whether something was inside the cutoff or not.
+        if (cutoff_ > 0.0)
+        {
+            int selPos = 0;
+            // Loop over groups in this selection (at start, selPos is always
+            // the first position in the next group).
+            while (selPos < sel[g].posCount())
+            {
+                // Count the number of positions in this group.
+                const int selIndex = sel[g].position(selPos).mappedId();
+                const int startPos = selPos;
+                ++selPos;
+                while (selPos < sel[g].posCount()
+                       && sel[g].position(selPos).mappedId() == selIndex)
+                {
+                    ++selPos;
+                }
+                const int count = selPos - startPos;
+                // Check all group pairs that contain this group.
+                for (int i = 0; i < refGroupCount_; ++i)
+                {
+                    const int index      = selIndex * refGroupCount_ + i;
+                    const int totalCount = refCountArray[i] * count;
+                    // If there were positions outside the cutoff,
+                    // update the distance if necessary and the count.
+                    if (countArray[index] < totalCount)
+                    {
+                        if (distanceType_ == eDistanceType_Max)
+                        {
+                            distArray[index] = cutoff2_;
+                        }
+                        countArray[index] = totalCount;
+                    }
+                }
+            }
+        }
+
+        // Write the computed distances to the output data.
+        dh.selectDataSet(g);
+        for (int i = 0; i < columnCount; ++i)
+        {
+            if (countArray[i] > 0)
+            {
+                dh.setPoint(i, std::sqrt(distArray[i]));
+            }
+            else
+            {
+                // If there are no contributing positions, write out the cutoff
+                // value.
+                dh.setPoint(i, cutoff_, false);
+            }
+        }
+    }
+    dh.finishFrame();
+}
+
+void
+PairDistance::finishAnalysis(int /*nframes*/)
+{
+}
+
+void
+PairDistance::writeOutput()
+{
+}
+
+//! \}
+
+}       // namespace
+
+const char PairDistanceInfo::name[]             = "pairdist";
+const char PairDistanceInfo::shortDescription[] =
+    "Calculate pairwise distances between groups of positions";
+
+TrajectoryAnalysisModulePointer PairDistanceInfo::create()
+{
+    return TrajectoryAnalysisModulePointer(new PairDistance);
+}
+
+} // namespace analysismodules
+
+} // namespace gmx
diff --git a/src/gromacs/trajectoryanalysis/modules/pairdist.h b/src/gromacs/trajectoryanalysis/modules/pairdist.h
new file mode 100644 (file)
index 0000000..eca2b87
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Declares trajectory analysis module for pairwise distance calculations.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#ifndef GMX_TRAJECTORYANALYSIS_MODULES_PAIRDIST_H
+#define GMX_TRAJECTORYANALYSIS_MODULES_PAIRDIST_H
+
+#include "gromacs/trajectoryanalysis/analysismodule.h"
+
+namespace gmx
+{
+
+namespace analysismodules
+{
+
+class PairDistanceInfo
+{
+    public:
+        static const char name[];
+        static const char shortDescription[];
+        static TrajectoryAnalysisModulePointer create();
+};
+
+} // namespace analysismodules
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/trajectoryanalysis/modules/rdf.cpp b/src/gromacs/trajectoryanalysis/modules/rdf.cpp
new file mode 100644 (file)
index 0000000..468b729
--- /dev/null
@@ -0,0 +1,663 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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::Rdf.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com> (C++ conversion)
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "rdf.h"
+
+#include <cmath>
+
+#include <algorithm>
+#include <limits>
+#include <string>
+#include <vector>
+
+#include "gromacs/analysisdata/analysisdata.h"
+#include "gromacs/analysisdata/modules/average.h"
+#include "gromacs/analysisdata/modules/histogram.h"
+#include "gromacs/analysisdata/modules/plot.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/filenameoption.h"
+#include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selectionoption.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysissettings.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace analysismodules
+{
+
+namespace
+{
+
+//! \addtogroup module_trajectoryanalysis
+//! \{
+
+/********************************************************************
+ * Actual analysis module
+ */
+
+/*! \brief
+ * Implements `gmx rdf` trajectory analysis module.
+ */
+class Rdf : public TrajectoryAnalysisModule
+{
+    public:
+        Rdf();
+
+        virtual void initOptions(Options                    *options,
+                                 TrajectoryAnalysisSettings *settings);
+        virtual void optionsFinished(Options                    *options,
+                                     TrajectoryAnalysisSettings *settings);
+        virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
+                                  const TopologyInformation        &top);
+        virtual void initAfterFirstFrame(const TrajectoryAnalysisSettings &settings,
+                                         const t_trxframe                 &fr);
+
+        virtual TrajectoryAnalysisModuleDataPointer startFrames(
+            const AnalysisDataParallelOptions &opt,
+            const SelectionCollection         &selections);
+        virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+                                  TrajectoryAnalysisModuleData *pdata);
+
+        virtual void finishAnalysis(int nframes);
+        virtual void writeOutput();
+
+    private:
+        std::string                               fnRdf_;
+        std::string                               fnCumulative_;
+        std::string                               surface_;
+        AnalysisDataPlotSettings                  plotSettings_;
+
+        /*! \brief
+         * Reference selection to compute RDFs around.
+         *
+         * With -surf, Selection::originalIds() and Selection::mappedIds()
+         * store the index of the surface group to which that position belongs.
+         * The RDF is computed by finding the nearest position from each
+         * surface group for each position, and then binning those distances.
+         */
+        Selection                                 refSel_;
+        /*! \brief
+         * Selections to compute RDFs for.
+         */
+        SelectionList                             sel_;
+
+        /*! \brief
+         * Raw pairwise distance data from which the RDF is computed.
+         *
+         * There is a data set for each selection in `sel_`, with a single
+         * column.  Each point set will contain a single pairwise distance
+         * that contributes to the RDF.
+         */
+        AnalysisData                              pairDist_;
+        /*! \brief
+         * Normalization factors for each frame.
+         *
+         * The first column contains the number of positions in `refSel_` for
+         * that frame (with surface RDF, the number of groups).  There are
+         * `sel_.size()` more columns, each containing the number density of
+         * positions for one selection.
+         */
+        AnalysisData                              normFactors_;
+        /*! \brief
+         * Histogram module that computes the actual RDF from `pairDist_`.
+         *
+         * The per-frame histograms are raw pair counts in each bin;
+         * the averager is normalized by the average number of reference
+         * positions (average of the first column of `normFactors_`).
+         */
+        AnalysisDataSimpleHistogramModulePointer  pairCounts_;
+        /*! \brief
+         * Average normalization factors.
+         */
+        AnalysisDataAverageModulePointer          normAve_;
+        //! Neighborhood search with `refSel_` as the reference positions.
+        AnalysisNeighborhood                      nb_;
+
+        // User input options.
+        double                                    binwidth_;
+        double                                    cutoff_;
+        double                                    rmax_;
+        bool                                      bNormalize_;
+        bool                                      bXY_;
+        bool                                      bExclusions_;
+
+        // Pre-computed values for faster access during analysis.
+        real                                      cut2_;
+        real                                      rmax2_;
+        int                                       surfaceGroupCount_;
+
+        // Copy and assign disallowed by base.
+};
+
+Rdf::Rdf()
+    : TrajectoryAnalysisModule(RdfInfo::name, RdfInfo::shortDescription),
+      pairCounts_(new AnalysisDataSimpleHistogramModule()),
+      normAve_(new AnalysisDataAverageModule()),
+      binwidth_(0.002), cutoff_(0.0), rmax_(0.0),
+      bNormalize_(true), bXY_(false), bExclusions_(false),
+      cut2_(0.0), rmax2_(0.0), surfaceGroupCount_(0)
+{
+    pairDist_.setMultipoint(true);
+    pairDist_.addModule(pairCounts_);
+    registerAnalysisDataset(&pairDist_, "pairdist");
+    registerBasicDataset(pairCounts_.get(), "paircount");
+
+    normFactors_.addModule(normAve_);
+    registerAnalysisDataset(&normFactors_, "norm");
+}
+
+void
+Rdf::initOptions(Options *options, TrajectoryAnalysisSettings * /*settings*/)
+{
+    static const char *const desc[] = {
+        "[THISMODULE] calculates radial distribution functions from one",
+        "refernce set of position (set with [TT]-ref[tt]) to one or more",
+        "sets of positions (set with [TT]-sel[tt]).  To compute the RDF with",
+        "respect to the closest position in a set in [TT]-ref[tt] instead, use",
+        "[TT]-surf[tt]: if set, then [TT]-ref[tt] is partitioned into sets",
+        "based on the value of [TT]-surf[tt], and the closest position in each",
+        "set is used. To compute the RDF around axes parallel to the",
+        "[IT]z[it]-axis, i.e., only in the [IT]x[it]-[IT]y[it] plane, use",
+        "[TT]-xy[tt].[PAR]",
+        "To set the bin width and maximum distance to use in the RDF, use",
+        "[TT]-bin[tt] and [TT]-rmax[tt], respectively. The latter can be",
+        "used to limit the computational cost if the RDF is not of interest",
+        "up to the default (half of the box size with PBC, three times the",
+        "box size without PBC).[PAR]",
+        "To use exclusions from the topology ([TT]-s[tt]), set [TT]-excl[tt]",
+        "and ensure that both [TT]-ref[tt] and [TT]-sel[tt] only select atoms.",
+        "A rougher alternative to exclude intra-molecular peaks is to set",
+        "[TT]-cut[tt] to a non-zero value to clear the RDF at small",
+        "distances.[PAR]",
+        "The RDFs are normalized by 1) average number of positions in",
+        "[TT]-ref[tt] (the number of groups with [TT]-surf[tt]), 2) volume",
+        "of the bin, and 3) average particle density of [TT]-sel[tt] positions",
+        "for that selection. To only use the first factor for normalization,",
+        "set [TT]-nonorm[tt]. In this case, the RDF is only scaled with the",
+        "bin width to make the integral of the curve represent the number of",
+        "pairs within a range. Note that exclusions do not affect the",
+        "normalization: even if [TT]-excl[tt] is set, or [TT]-ref[tt] and",
+        "[TT]-sel[tt] contain the same selection, the normalization factor",
+        "is still N*M, not N*(M-excluded).[PAR]",
+        "For [TT]-surf[tt], the selection provided to [TT]-ref[tt] must",
+        "select atoms, i.e., centers of mass are not supported. Further,",
+        "[TT]-nonorm[tt] is implied, as the bins have irregular shapes and",
+        "the volume of a bin is not easily computable.[PAR]",
+        "Option [TT]-cn[tt] produces the cumulative number RDF,",
+        "i.e. the average number of particles within a distance r.[PAR]"
+    };
+
+    options->setDescription(desc);
+
+    options->addOption(FileNameOption("o").filetype(eftPlot).outputFile().required()
+                           .store(&fnRdf_).defaultBasename("rdf")
+                           .description("Computed RDFs"));
+    options->addOption(FileNameOption("cn").filetype(eftPlot).outputFile()
+                           .store(&fnCumulative_).defaultBasename("rdf_cn")
+                           .description("Cumulative RDFs"));
+
+    options->addOption(DoubleOption("bin").store(&binwidth_)
+                           .description("Bin width (nm)"));
+    options->addOption(BooleanOption("norm").store(&bNormalize_)
+                           .description("Normalize for bin volume and density"));
+    options->addOption(BooleanOption("xy").store(&bXY_)
+                           .description("Use only the x and y components of the distance"));
+    options->addOption(BooleanOption("excl").store(&bExclusions_)
+                           .description("Use exclusions from topology"));
+    options->addOption(DoubleOption("cut").store(&cutoff_)
+                           .description("Shortest distance (nm) to be considered"));
+    options->addOption(DoubleOption("rmax").store(&rmax_)
+                           .description("Largest distance (nm) to calculate"));
+
+    const char *const cSurfaceEnum[] = { "no", "mol", "res" };
+    options->addOption(StringOption("surf").enumValue(cSurfaceEnum)
+                           .defaultEnumIndex(0).store(&surface_)
+                           .description("RDF with respect to the surface of the reference"));
+
+    options->addOption(SelectionOption("ref").store(&refSel_).required()
+                           .description("Reference selection for RDF computation"));
+    options->addOption(SelectionOption("sel").storeVector(&sel_)
+                           .required().multiValue()
+                           .description("Selections to compute RDFs for from the reference"));
+}
+
+void
+Rdf::optionsFinished(Options *options, TrajectoryAnalysisSettings *settings)
+{
+    if (surface_ != "no")
+    {
+        settings->setFlag(TrajectoryAnalysisSettings::efRequireTop);
+
+        if (options->isSet("norm") && bNormalize_)
+        {
+            GMX_THROW(InconsistentInputError("-surf cannot be combined with -norm"));
+        }
+        bNormalize_ = false;
+        if (bExclusions_)
+        {
+            GMX_THROW(InconsistentInputError("-surf cannot be combined with -excl"));
+        }
+    }
+    if (bExclusions_)
+    {
+        settings->setFlag(TrajectoryAnalysisSettings::efRequireTop);
+    }
+    if (cutoff_ < 0.0)
+    {
+        cutoff_ = 0.0;
+    }
+}
+
+void
+Rdf::initAnalysis(const TrajectoryAnalysisSettings &settings,
+                  const TopologyInformation        &top)
+{
+    pairDist_.setDataSetCount(sel_.size());
+    for (size_t i = 0; i < sel_.size(); ++i)
+    {
+        pairDist_.setColumnCount(i, 1);
+    }
+    plotSettings_ = settings.plotSettings();
+    nb_.setXYMode(bXY_);
+
+    normFactors_.setColumnCount(0, sel_.size() + 1);
+
+    const bool bSurface = (surface_ != "no");
+    if (bSurface)
+    {
+        if (!refSel_.hasOnlyAtoms())
+        {
+            GMX_THROW(InconsistentInputError("-surf only works with -refsel that consists of atoms"));
+        }
+        const e_index_t type = (surface_ == "mol" ? INDEX_MOL : INDEX_RES);
+        surfaceGroupCount_ = refSel_.initOriginalIdsToGroup(top.topology(), type);
+    }
+
+    if (bExclusions_)
+    {
+        if (!refSel_.hasOnlyAtoms())
+        {
+            GMX_THROW(InconsistentInputError("-excl only works with selections that consist of atoms"));
+        }
+        for (size_t i = 0; i < sel_.size(); ++i)
+        {
+            if (!sel_[i].hasOnlyAtoms())
+            {
+                GMX_THROW(InconsistentInputError("-excl only works with selections that consist of atoms"));
+            }
+        }
+        const t_topology *topology = top.topology();
+        if (topology->excls.nr == 0)
+        {
+            GMX_THROW(InconsistentInputError("-excl is set, but the file provided to -s does not define exclusions"));
+        }
+        nb_.setTopologyExclusions(&topology->excls);
+    }
+}
+
+void
+Rdf::initAfterFirstFrame(const TrajectoryAnalysisSettings &settings,
+                         const t_trxframe                 &fr)
+{
+    // If -rmax is not provided, determine one from the box for the first frame.
+    if (rmax_ <= 0.0)
+    {
+        matrix box;
+        copy_mat(fr.box, box);
+        if (settings.hasPBC())
+        {
+            if (bXY_)
+            {
+                box[ZZ][ZZ] = 2*std::max(box[XX][XX], box[YY][YY]);
+            }
+            rmax_ = std::sqrt(0.99*0.99*max_cutoff2(bXY_ ? epbcXY : epbcXYZ, box));
+        }
+        else
+        {
+            if (bXY_)
+            {
+                clear_rvec(box[ZZ]);
+            }
+            rmax_ = 3*std::max(box[XX][XX], std::max(box[YY][YY], box[ZZ][ZZ]));
+        }
+    }
+    cut2_  = sqr(cutoff_);
+    rmax2_ = sqr(rmax_);
+    nb_.setCutoff(rmax_);
+    // We use the double amount of bins, so we can correctly
+    // write the rdf and rdf_cn output at i*binwidth values.
+    pairCounts_->init(histogramFromRange(0.0, rmax_).binWidth(binwidth_ / 2.0));
+}
+
+/*! \brief
+ * Temporary memory for use within a single-frame calculation.
+ */
+class RdfModuleData : public TrajectoryAnalysisModuleData
+{
+    public:
+        /*! \brief
+         * Reserves memory for the frame-local data.
+         *
+         * `surfaceGroupCount` will be zero if -surf is not specified.
+         */
+        RdfModuleData(TrajectoryAnalysisModule          *module,
+                      const AnalysisDataParallelOptions &opt,
+                      const SelectionCollection         &selections,
+                      int                                surfaceGroupCount)
+            : TrajectoryAnalysisModuleData(module, opt, selections)
+        {
+            surfaceDist2_.resize(surfaceGroupCount);
+        }
+
+        virtual void finish() { finishDataHandles(); }
+
+        /*! \brief
+         * Minimum distance to each surface group.
+         *
+         * One entry for each group (residue/molecule, per -surf) in the
+         * reference selection.
+         * This is needed to support neighborhood searching, which may not
+         * return the reference positions in order: for each position, we need
+         * to search through all the reference positions and update this array
+         * to find the minimum distance to each surface group, and then compute
+         * the RDF from these numbers.
+         */
+        std::vector<real> surfaceDist2_;
+};
+
+TrajectoryAnalysisModuleDataPointer Rdf::startFrames(
+        const AnalysisDataParallelOptions &opt,
+        const SelectionCollection         &selections)
+{
+    return TrajectoryAnalysisModuleDataPointer(
+            new RdfModuleData(this, opt, selections, surfaceGroupCount_));
+}
+
+void
+Rdf::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+                  TrajectoryAnalysisModuleData *pdata)
+{
+    AnalysisDataHandle   dh        = pdata->dataHandle(pairDist_);
+    AnalysisDataHandle   nh        = pdata->dataHandle(normFactors_);
+    const Selection     &refSel    = pdata->parallelSelection(refSel_);
+    const SelectionList &sel       = pdata->parallelSelections(sel_);
+    RdfModuleData       &frameData = *static_cast<RdfModuleData *>(pdata);
+    const bool           bSurface  = !frameData.surfaceDist2_.empty();
+
+    matrix               boxForVolume;
+    copy_mat(fr.box, boxForVolume);
+    if (bXY_)
+    {
+        // Set z-size to 1 so we get the surface are iso the volume
+        clear_rvec(boxForVolume[ZZ]);
+        boxForVolume[ZZ][ZZ] = 1;
+    }
+    const real inverseVolume = 1.0 / det(boxForVolume);
+
+    nh.startFrame(frnr, fr.time);
+    // Compute the normalization factor for the number of reference positions.
+    if (bSurface)
+    {
+        if (refSel.isDynamic())
+        {
+            // Count the number of distinct groups.
+            // This assumes that each group is continuous, which is currently
+            // the case.
+            int count  = 0;
+            int prevId = -1;
+            for (int i = 0; i < refSel.posCount(); ++i)
+            {
+                const int id = refSel.position(i).mappedId();
+                if (id != prevId)
+                {
+                    ++count;
+                    prevId = id;
+                }
+            }
+            nh.setPoint(0, count);
+        }
+        else
+        {
+            nh.setPoint(0, surfaceGroupCount_);
+        }
+    }
+    else
+    {
+        nh.setPoint(0, refSel.posCount());
+    }
+
+    dh.startFrame(frnr, fr.time);
+    AnalysisNeighborhoodSearch    nbsearch = nb_.initSearch(pbc, refSel);
+    for (size_t g = 0; g < sel.size(); ++g)
+    {
+        dh.selectDataSet(g);
+
+        if (bSurface)
+        {
+            // Special loop for surface calculation, where a separate neighbor
+            // search is done for each position in the selection, and the
+            // nearest position from each surface group is tracked.
+            std::vector<real> &surfaceDist2 = frameData.surfaceDist2_;
+            for (int i = 0; i < sel[g].posCount(); ++i)
+            {
+                std::fill(surfaceDist2.begin(), surfaceDist2.end(),
+                          std::numeric_limits<real>::max());
+                AnalysisNeighborhoodPairSearch pairSearch =
+                    nbsearch.startPairSearch(sel[g].position(i));
+                AnalysisNeighborhoodPair       pair;
+                while (pairSearch.findNextPair(&pair))
+                {
+                    const real r2    = pair.distance2();
+                    const int  refId = refSel.position(pair.refIndex()).mappedId();
+                    if (r2 < surfaceDist2[refId])
+                    {
+                        surfaceDist2[refId] = r2;
+                    }
+                }
+                // Accumulate the RDF from the distances to the surface.
+                for (size_t i = 0; i < surfaceDist2.size(); ++i)
+                {
+                    const real r2 = surfaceDist2[i];
+                    // Here, we need to check for rmax, since the value might
+                    // be above the cutoff if no points were close to some
+                    // surface positions.
+                    if (r2 > cut2_ && r2 <= rmax2_)
+                    {
+                        dh.setPoint(0, std::sqrt(r2));
+                        dh.finishPointSet();
+                    }
+                }
+            }
+        }
+        else
+        {
+            // Standard neighborhood search over all pairs within the cutoff
+            // for the -surf no case.
+            AnalysisNeighborhoodPairSearch pairSearch = nbsearch.startPairSearch(sel[g]);
+            AnalysisNeighborhoodPair       pair;
+            while (pairSearch.findNextPair(&pair))
+            {
+                const real r2 = pair.distance2();
+                if (r2 > cut2_)
+                {
+                    // TODO: Consider whether the histogramming could be done with
+                    // less overhead (after first measuring the overhead).
+                    dh.setPoint(0, std::sqrt(r2));
+                    dh.finishPointSet();
+                }
+            }
+        }
+        // Normalization factor for the number density (only used without
+        // -surf, but does not hurt to populate otherwise).
+        nh.setPoint(g + 1, sel[g].posCount() * inverseVolume);
+    }
+    dh.finishFrame();
+    nh.finishFrame();
+}
+
+void
+Rdf::finishAnalysis(int /*nframes*/)
+{
+    // Normalize the averager with the number of reference positions,
+    // from where the normalization propagates to all the output.
+    const real refPosCount = normAve_->average(0, 0);
+    pairCounts_->averager().scaleAll(1.0 / refPosCount);
+    pairCounts_->averager().done();
+
+    // TODO: Consider how these could be exposed to the testing framework
+    // through the dataset registration mechanism.
+    AverageHistogramPointer finalRdf
+        = pairCounts_->averager().resampleDoubleBinWidth(true);
+
+    if (bNormalize_)
+    {
+        // Normalize by the volume of the bins (volume of sphere segments or
+        // length of circle segments).
+        std::vector<real> invBinVolume;
+        const int         nbin = finalRdf->settings().binCount();
+        invBinVolume.resize(nbin);
+        real              prevSphereVolume = 0.0;
+        for (int i = 0; i < nbin; ++i)
+        {
+            const real r = (i + 0.5)*binwidth_;
+            real       sphereVolume;
+            if (bXY_)
+            {
+                sphereVolume = M_PI*r*r;
+            }
+            else
+            {
+                sphereVolume = (4.0/3.0)*M_PI*r*r*r;
+            }
+            const real binVolume = sphereVolume - prevSphereVolume;
+            invBinVolume[i]  = 1.0 / binVolume;
+            prevSphereVolume = sphereVolume;
+        }
+        finalRdf->scaleAllByVector(&invBinVolume[0]);
+
+        // Normalize by particle density.
+        for (size_t g = 0; g < sel_.size(); ++g)
+        {
+            finalRdf->scaleSingle(g, 1.0 / normAve_->average(0, g + 1));
+        }
+    }
+    else
+    {
+        // With -nonorm, just scale with bin width to make the integral of the
+        // curve (instead of raw bin sum) represent the pair count.
+        finalRdf->scaleAll(1.0 / binwidth_);
+    }
+    finalRdf->done();
+
+    // TODO: Consider if some of this should be done in writeOutput().
+    {
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(plotSettings_));
+        plotm->setFileName(fnRdf_);
+        plotm->setTitle("Radial distribution");
+        plotm->setSubtitle(formatString("reference %s", refSel_.name()));
+        plotm->setXLabel("r (nm)");
+        plotm->setYLabel("g(r)");
+        for (size_t i = 0; i < sel_.size(); ++i)
+        {
+            plotm->appendLegend(sel_[i].name());
+        }
+        finalRdf->addModule(plotm);
+    }
+
+    if (!fnCumulative_.empty())
+    {
+        AverageHistogramPointer cumulativeRdf
+            = pairCounts_->averager().resampleDoubleBinWidth(false);
+        cumulativeRdf->makeCumulative();
+        cumulativeRdf->done();
+
+        AnalysisDataPlotModulePointer plotm(
+                new AnalysisDataPlotModule(plotSettings_));
+        plotm->setFileName(fnCumulative_);
+        plotm->setTitle("Cumulative Number RDF");
+        plotm->setSubtitle(formatString("reference %s", refSel_.name()));
+        plotm->setXLabel("r (nm)");
+        plotm->setYLabel("number");
+        for (size_t i = 0; i < sel_.size(); ++i)
+        {
+            plotm->appendLegend(sel_[i].name());
+        }
+        cumulativeRdf->addModule(plotm);
+    }
+}
+
+void
+Rdf::writeOutput()
+{
+}
+
+//! \}
+
+}       // namespace
+
+const char RdfInfo::name[]             = "rdf";
+const char RdfInfo::shortDescription[] =
+    "Calculate radial distribution functions";
+
+TrajectoryAnalysisModulePointer RdfInfo::create()
+{
+    return TrajectoryAnalysisModulePointer(new Rdf);
+}
+
+} // namespace analysismodules
+
+} // namespace gmx
diff --git a/src/gromacs/trajectoryanalysis/modules/rdf.h b/src/gromacs/trajectoryanalysis/modules/rdf.h
new file mode 100644 (file)
index 0000000..269d2a8
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Declares trajectory analysis module for RDF calculations.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#ifndef GMX_TRAJECTORYANALYSIS_MODULES_RDF_H
+#define GMX_TRAJECTORYANALYSIS_MODULES_RDF_H
+
+#include "gromacs/trajectoryanalysis/analysismodule.h"
+
+namespace gmx
+{
+
+namespace analysismodules
+{
+
+class RdfInfo
+{
+    public:
+        static const char name[];
+        static const char shortDescription[];
+        static TrajectoryAnalysisModulePointer create();
+};
+
+} // namespace analysismodules
+
+} // namespace gmx
+
+#endif
index eb7a3d3e69b215282c4ae987ce4151b690ec0e30..4f2b2d9fdf530fa68f4577b6f128dd3c52949068 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, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com> (C++ conversion)
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "sasa.h"
 
 #include <algorithm>
 #include <string>
 #include <vector>
 
-#include "gromacs/legacyheaders/atomprop.h"
-#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/pbc.h"
-#include "gromacs/legacyheaders/physics.h"
-#include "gromacs/legacyheaders/symtab.h"
-#include "gromacs/legacyheaders/vec.h"
-
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/average.h"
 #include "gromacs/analysisdata/modules/plot.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/pdbio.h"
+#include "gromacs/fileio/trx.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectionoption.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/trajectoryanalysis/analysismodule.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/scoped_ptr_sfree.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "nsc.h"
+#include "surfacearea.h"
 
 namespace gmx
 {
@@ -384,6 +387,8 @@ class Sasa : public TrajectoryAnalysisModule
          * Empty if the free energy output has not been requested.
          */
         std::vector<real>       dgsFactor_;
+        //! Calculation algorithm.
+        SurfaceAreaCalculator   calculator_;
 
         // Copy and assign disallowed by base.
 };
@@ -429,8 +434,10 @@ Sasa::initOptions(Options *options, TrajectoryAnalysisSettings *settings)
         //"which can be used to restrain surface atoms.[PAR]",
 
         "With the [TT]-tv[tt] option the total volume and density of the",
-        "molecule can be computed.",
-        "Please consider whether the normal probe radius is appropriate",
+        "molecule can be computed. With [TT]-pbc[tt] (the default), you",
+        "must ensure that your molecule/surface group is not split across PBC.",
+        "Otherwise, you will get non-sensical results.",
+        "Please also consider whether the normal probe radius is appropriate",
         "in this case or whether you would rather use, e.g., 0. It is good",
         "to keep in mind that the results for volume and density are very",
         "approximate. For example, in ice Ih, one can easily fit water molecules in the",
@@ -549,24 +556,18 @@ Sasa::initAnalysis(const TrajectoryAnalysisSettings &settings,
         dgsFactor_.reserve(surfaceSel_.posCount());
     }
 
+    const int resCount = surfaceSel_.initOriginalIdsToGroup(top_, INDEX_RES);
+
     // TODO: Not exception-safe, but nice solution would be to have a C++
     // atom properties class...
     gmx_atomprop_t     aps = gmx_atomprop_init();
 
     ConstArrayRef<int> atomIndices = surfaceSel_.atomIndices();
-    int                prevResind  = atoms.atom[atomIndices[0]].resind;
-    int                resCount    = 0;
     int                ndefault    = 0;
     for (int i = 0; i < surfaceSel_.posCount(); i++)
     {
         const int ii     = atomIndices[i];
         const int resind = atoms.atom[ii].resind;
-        if (resind != prevResind)
-        {
-            ++resCount;
-            prevResind = resind;
-        }
-        surfaceSel_.setOriginalId(i, resCount);
         real      radius;
         if (!gmx_atomprop_query(aps, epropVDW,
                                 *(atoms.resinfo[resind].name),
@@ -593,9 +594,6 @@ Sasa::initAnalysis(const TrajectoryAnalysisSettings &settings,
     }
     gmx_atomprop_destroy(aps);
 
-    // The loop above doesn't count the last residue.
-    ++resCount;
-
     // Pre-compute mapping from the output groups to the calculation group,
     // and store it in the selection ID map for easy lookup.
     for (size_t g = 0; g < outputSel_.size(); ++g)
@@ -615,6 +613,9 @@ Sasa::initAnalysis(const TrajectoryAnalysisSettings &settings,
         }
     }
 
+    calculator_.setDotCount(ndots_);
+    calculator_.setRadii(radii_);
+
     // Initialize all the output data objects and initialize the output plotters.
 
     area_.setColumnCount(0, 1 + outputSel_.size());
@@ -913,12 +914,10 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
     real  totarea, totvolume;
     real *area = NULL, *surfacedots = NULL;
     int   nsurfacedots;
-    int   retval = nsc_dclm_pbc(surfaceSel.coordinates().data(), &radii_[0],
-                                frameData.index_.size(), ndots_, flag, &totarea,
-                                &area, &totvolume, &surfacedots, &nsurfacedots,
-                                &frameData.index_[0],
-                                pbc != NULL ? pbc->ePBC : epbcNONE,
-                                pbc != NULL ? pbc->box : NULL);
+    calculator_.calculate(surfaceSel.coordinates().data(), pbc,
+                          frameData.index_.size(), &frameData.index_[0], flag,
+                          &totarea, &totvolume, &area,
+                          &surfacedots, &nsurfacedots);
     // Unpack the atomwise areas into the frameData.atomAreas_ array for easier
     // indexing in the case of dynamic surfaceSel.
     if (area != NULL)
@@ -939,11 +938,7 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
         }
         sfree(area);
     }
-    scoped_ptr_sfree dotsGuard(surfacedots);
-    if (retval != 0)
-    {
-        GMX_THROW(InternalError("nsc_dclm_pbc failed"));
-    }
+    scoped_guard_sfree dotsGuard(surfacedots);
 
     if (bConnolly)
     {
index dcf73297024b07c15033f8df33e21f25e9237389..4e2ca5eb1efe4dd82e03f72b4245a56d05786611 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef GMX_TRAJECTORYANALYSIS_MODULES_SASA_H
 #define GMX_TRAJECTORYANALYSIS_MODULES_SASA_H
 
-#include "../analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
 
 namespace gmx
 {
index fc8f592e93ebcd19a2a9773d47d53fd283222abe..443c4a129c7934aa0668eca5b4bfdfb68a350541 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "select.h"
 
 #include <cstdio>
 #include "gromacs/analysisdata/modules/lifetime.h"
 #include "gromacs/analysisdata/modules/plot.h"
 #include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
 #include "gromacs/selection/selection.h"
 #include "gromacs/selection/selectionoption.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/scoped_ptr_sfree.h"
+#include "gromacs/utility/scoped_cptr.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
@@ -648,11 +652,11 @@ Select::writeOutput()
     {
         GMX_RELEASE_ASSERT(top_->hasTopology(),
                            "Topology should have been loaded or an error given earlier");
-        t_atoms          atoms;
+        t_atoms            atoms;
         atoms = top_->topology()->atoms;
-        t_pdbinfo       *pdbinfo;
+        t_pdbinfo         *pdbinfo;
         snew(pdbinfo, atoms.nr);
-        scoped_ptr_sfree pdbinfoGuard(pdbinfo);
+        scoped_guard_sfree pdbinfoGuard(pdbinfo);
         if (atoms.pdbinfo != NULL)
         {
             std::memcpy(pdbinfo, atoms.pdbinfo, atoms.nr*sizeof(*pdbinfo));
index 90c4898fa3fcc16e3c6af02ab9d13f40cce81722..62b26a34af0aed34046a5f6bcdfcb2b16b3913f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 #ifndef GMX_TRAJECTORYANALYSIS_MODULES_SELECT_H
 #define GMX_TRAJECTORYANALYSIS_MODULES_SELECT_H
 
-#include "../analysismodule.h"
+#include "gromacs/trajectoryanalysis/analysismodule.h"
 
 namespace gmx
 {
diff --git a/src/gromacs/trajectoryanalysis/modules/surfacearea.cpp b/src/gromacs/trajectoryanalysis/modules/surfacearea.cpp
new file mode 100644 (file)
index 0000000..e8c839b
--- /dev/null
@@ -0,0 +1,845 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * 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
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "surfacearea.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <algorithm>
+#include <vector>
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+
+using namespace gmx;
+
+#define UNSP_ICO_DOD      9
+#define UNSP_ICO_ARC     10
+
+#define FOURPI (4.*M_PI)
+#define TORAD(A)     ((A)*0.017453293)
+#define DP_TOL     0.001
+
+static real safe_asin(real f)
+{
+    if ( (fabs(f) < 1.00) )
+    {
+        return( asin(f) );
+    }
+    GMX_ASSERT(fabs(f) - 1.0 > DP_TOL, "Invalid argument");
+    return(M_PI_2);
+}
+
+/* routines for dot distributions on the surface of the unit sphere */
+static real icosaeder_vertices(real *xus)
+{
+    const real rh = sqrt(1.-2.*cos(TORAD(72.)))/(1.-cos(TORAD(72.)));
+    const real rg = cos(TORAD(72.))/(1.-cos(TORAD(72.)));
+    /* icosaeder vertices */
+    xus[ 0] = 0.;                  xus[ 1] = 0.;                  xus[ 2] = 1.;
+    xus[ 3] = rh*cos(TORAD(72.));  xus[ 4] = rh*sin(TORAD(72.));  xus[ 5] = rg;
+    xus[ 6] = rh*cos(TORAD(144.)); xus[ 7] = rh*sin(TORAD(144.)); xus[ 8] = rg;
+    xus[ 9] = rh*cos(TORAD(216.)); xus[10] = rh*sin(TORAD(216.)); xus[11] = rg;
+    xus[12] = rh*cos(TORAD(288.)); xus[13] = rh*sin(TORAD(288.)); xus[14] = rg;
+    xus[15] = rh;                  xus[16] = 0;                   xus[17] = rg;
+    xus[18] = rh*cos(TORAD(36.));  xus[19] = rh*sin(TORAD(36.));  xus[20] = -rg;
+    xus[21] = rh*cos(TORAD(108.)); xus[22] = rh*sin(TORAD(108.)); xus[23] = -rg;
+    xus[24] = -rh;                 xus[25] = 0;                   xus[26] = -rg;
+    xus[27] = rh*cos(TORAD(252.)); xus[28] = rh*sin(TORAD(252.)); xus[29] = -rg;
+    xus[30] = rh*cos(TORAD(324.)); xus[31] = rh*sin(TORAD(324.)); xus[32] = -rg;
+    xus[33] = 0.;                  xus[34] = 0.;                  xus[35] = -1.;
+    return rh;
+}
+
+
+static void divarc(real x1, real y1, real z1,
+                   real x2, real y2, real z2,
+                   int div1, int div2, real *xr, real *yr, real *zr)
+{
+
+    real xd, yd, zd, dd, d1, d2, s, x, y, z;
+    real phi, sphi, cphi;
+
+    xd = y1*z2-y2*z1;
+    yd = z1*x2-z2*x1;
+    zd = x1*y2-x2*y1;
+    dd = sqrt(xd*xd+yd*yd+zd*zd);
+    GMX_ASSERT(dd >= DP_TOL, "Rotation axis vector too short");
+
+    d1 = x1*x1+y1*y1+z1*z1;
+    d2 = x2*x2+y2*y2+z2*z2;
+    GMX_ASSERT(d1 >= 0.5, "Vector 1 too short");
+    GMX_ASSERT(d2 >= 0.5, "Vector 2 too short");
+
+    phi  = safe_asin(dd/sqrt(d1*d2));
+    phi  = phi*((real)div1)/((real)div2);
+    sphi = sin(phi); cphi = cos(phi);
+    s    = (x1*xd+y1*yd+z1*zd)/dd;
+
+    x   = xd*s*(1.-cphi)/dd + x1 * cphi + (yd*z1-y1*zd)*sphi/dd;
+    y   = yd*s*(1.-cphi)/dd + y1 * cphi + (zd*x1-z1*xd)*sphi/dd;
+    z   = zd*s*(1.-cphi)/dd + z1 * cphi + (xd*y1-x1*yd)*sphi/dd;
+    dd  = sqrt(x*x+y*y+z*z);
+    *xr = x/dd; *yr = y/dd; *zr = z/dd;
+}
+
+/* densit...required dots per unit sphere */
+static std::vector<real> ico_dot_arc(int densit)
+{
+    /* dot distribution on a unit sphere based on an icosaeder *
+     * great circle average refining of icosahedral face       */
+
+    int   i, j, k, tl, tl2, tn;
+    real  a, d, x, y, z, x2, y2, z2, x3, y3, z3;
+    real  xij, yij, zij, xji, yji, zji, xik, yik, zik, xki, yki, zki,
+          xjk, yjk, zjk, xkj, ykj, zkj;
+
+    /* calculate tessalation level */
+    a = sqrt((((real) densit)-2.)/10.);
+    const int  tess = (int) ceil(a);
+    const int  ndot = 10*tess*tess+2;
+    GMX_RELEASE_ASSERT(ndot >= densit, "Inconsistent surface dot formula");
+
+    std::vector<real> xus(3*ndot);
+    const real        rh = icosaeder_vertices(&xus[0]);
+
+    if (tess > 1)
+    {
+        tn = 12;
+        a  = rh*rh*2.*(1.-cos(TORAD(72.)));
+        /* calculate tessalation of icosaeder edges */
+        for (i = 0; i < 11; i++)
+        {
+            for (j = i+1; j < 12; j++)
+            {
+                x = xus[3*i]-xus[3*j];
+                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
+                d = x*x+y*y+z*z;
+                if (fabs(a-d) > DP_TOL)
+                {
+                    continue;
+                }
+                for (tl = 1; tl < tess; tl++)
+                {
+                    GMX_ASSERT(tn < ndot, "Inconsistent precomputed surface dot count");
+                    divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
+                           xus[3*j], xus[1+3*j], xus[2+3*j],
+                           tl, tess, &xus[3*tn], &xus[1+3*tn], &xus[2+3*tn]);
+                    tn++;
+                }
+            }
+        }
+        /* calculate tessalation of icosaeder faces */
+        for (i = 0; i < 10; i++)
+        {
+            for (j = i+1; j < 11; j++)
+            {
+                x = xus[3*i]-xus[3*j];
+                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
+                d = x*x+y*y+z*z;
+                if (fabs(a-d) > DP_TOL)
+                {
+                    continue;
+                }
+
+                for (k = j+1; k < 12; k++)
+                {
+                    x = xus[3*i]-xus[3*k];
+                    y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
+                    d = x*x+y*y+z*z;
+                    if (fabs(a-d) > DP_TOL)
+                    {
+                        continue;
+                    }
+                    x = xus[3*j]-xus[3*k];
+                    y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
+                    d = x*x+y*y+z*z;
+                    if (fabs(a-d) > DP_TOL)
+                    {
+                        continue;
+                    }
+                    for (tl = 1; tl < tess-1; tl++)
+                    {
+                        divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
+                               xus[3*i], xus[1+3*i], xus[2+3*i],
+                               tl, tess, &xji, &yji, &zji);
+                        divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
+                               xus[3*i], xus[1+3*i], xus[2+3*i],
+                               tl, tess, &xki, &yki, &zki);
+
+                        for (tl2 = 1; tl2 < tess-tl; tl2++)
+                        {
+                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
+                                   xus[3*j], xus[1+3*j], xus[2+3*j],
+                                   tl2, tess, &xij, &yij, &zij);
+                            divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
+                                   xus[3*j], xus[1+3*j], xus[2+3*j],
+                                   tl2, tess, &xkj, &ykj, &zkj);
+                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
+                                   xus[3*k], xus[1+3*k], xus[2+3*k],
+                                   tess-tl-tl2, tess, &xik, &yik, &zik);
+                            divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
+                                   xus[3*k], xus[1+3*k], xus[2+3*k],
+                                   tess-tl-tl2, tess, &xjk, &yjk, &zjk);
+                            divarc(xki, yki, zki, xji, yji, zji, tl2, tess-tl,
+                                   &x, &y, &z);
+                            divarc(xkj, ykj, zkj, xij, yij, zij, tl, tess-tl2,
+                                   &x2, &y2, &z2);
+                            divarc(xjk, yjk, zjk, xik, yik, zik, tl, tl+tl2,
+                                   &x3, &y3, &z3);
+                            GMX_ASSERT(tn < ndot,
+                                       "Inconsistent precomputed surface dot count");
+                            x           = x+x2+x3; y = y+y2+y3; z = z+z2+z3;
+                            d           = sqrt(x*x+y*y+z*z);
+                            xus[3*tn]   = x/d;
+                            xus[1+3*tn] = y/d;
+                            xus[2+3*tn] = z/d;
+                            tn++;
+                        } /* cycle tl2 */
+                    }     /* cycle tl */
+                }         /* cycle k */
+            }             /* cycle j */
+        }                 /* cycle i */
+        GMX_ASSERT(tn == ndot, "Inconsistent precomputed surface dot count");
+    }                     /* end of if (tess > 1) */
+
+    return xus;
+}                                  /* end of routine ico_dot_arc */
+
+/* densit...required dots per unit sphere */
+static std::vector<real> ico_dot_dod(int densit)
+{
+    /* dot distribution on a unit sphere based on an icosaeder *
+     * great circle average refining of icosahedral face       */
+
+    int   i, j, k, tl, tl2, tn, tess, j1, j2;
+    real  a, d, x, y, z, x2, y2, z2, x3, y3, z3, ai_d, adod;
+    real  xij, yij, zij, xji, yji, zji, xik, yik, zik, xki, yki, zki,
+          xjk, yjk, zjk, xkj, ykj, zkj;
+
+    /* calculate tesselation level */
+    a     = sqrt((((real) densit)-2.)/30.);
+    tess  = std::max((int) ceil(a), 1);
+    const int ndot = 30*tess*tess+2;
+    GMX_RELEASE_ASSERT(ndot >= densit, "Inconsistent surface dot formula");
+
+    std::vector<real> xus(3*ndot);
+    const real        rh = icosaeder_vertices(&xus[0]);
+
+    tn = 12;
+    /* square of the edge of an icosaeder */
+    a = rh*rh*2.*(1.-cos(TORAD(72.)));
+    /* dodecaeder vertices */
+    for (i = 0; i < 10; i++)
+    {
+        for (j = i+1; j < 11; j++)
+        {
+            x = xus[3*i]-xus[3*j];
+            y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
+            d = x*x+y*y+z*z;
+            if (fabs(a-d) > DP_TOL)
+            {
+                continue;
+            }
+            for (k = j+1; k < 12; k++)
+            {
+                x = xus[3*i]-xus[3*k];
+                y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
+                d = x*x+y*y+z*z;
+                if (fabs(a-d) > DP_TOL)
+                {
+                    continue;
+                }
+                x = xus[3*j]-xus[3*k];
+                y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
+                d = x*x+y*y+z*z;
+                if (fabs(a-d) > DP_TOL)
+                {
+                    continue;
+                }
+                x         = xus[  3*i]+xus[  3*j]+xus[  3*k];
+                y         = xus[1+3*i]+xus[1+3*j]+xus[1+3*k];
+                z         = xus[2+3*i]+xus[2+3*j]+xus[2+3*k];
+                d         = sqrt(x*x+y*y+z*z);
+                xus[3*tn] = x/d; xus[1+3*tn] = y/d; xus[2+3*tn] = z/d;
+                tn++;
+            }
+        }
+    }
+
+    if (tess > 1)
+    {
+        tn = 32;
+        /* square of the edge of an dodecaeder */
+        adod = 4.*(cos(TORAD(108.))-cos(TORAD(120.)))/(1.-cos(TORAD(120.)));
+        /* square of the distance of two adjacent vertices of ico- and dodecaeder */
+        ai_d = 2.*(1.-sqrt(1.-a/3.));
+
+        /* calculate tessalation of mixed edges */
+        for (i = 0; i < 31; i++)
+        {
+            j1 = 12; j2 = 32; a = ai_d;
+            if (i >= 12)
+            {
+                j1 = i+1; a = adod;
+            }
+            for (j = j1; j < j2; j++)
+            {
+                x = xus[3*i]-xus[3*j];
+                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
+                d = x*x+y*y+z*z;
+                if (fabs(a-d) > DP_TOL)
+                {
+                    continue;
+                }
+                for (tl = 1; tl < tess; tl++)
+                {
+                    GMX_ASSERT(tn < ndot,
+                               "Inconsistent precomputed surface dot count");
+                    divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
+                           xus[3*j], xus[1+3*j], xus[2+3*j],
+                           tl, tess, &xus[3*tn], &xus[1+3*tn], &xus[2+3*tn]);
+                    tn++;
+                }
+            }
+        }
+        /* calculate tessalation of pentakisdodecahedron faces */
+        for (i = 0; i < 12; i++)
+        {
+            for (j = 12; j < 31; j++)
+            {
+                x = xus[3*i]-xus[3*j];
+                y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
+                d = x*x+y*y+z*z;
+                if (fabs(ai_d-d) > DP_TOL)
+                {
+                    continue;
+                }
+
+                for (k = j+1; k < 32; k++)
+                {
+                    x = xus[3*i]-xus[3*k];
+                    y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
+                    d = x*x+y*y+z*z;
+                    if (fabs(ai_d-d) > DP_TOL)
+                    {
+                        continue;
+                    }
+                    x = xus[3*j]-xus[3*k];
+                    y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
+                    d = x*x+y*y+z*z;
+                    if (fabs(adod-d) > DP_TOL)
+                    {
+                        continue;
+                    }
+                    for (tl = 1; tl < tess-1; tl++)
+                    {
+                        divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
+                               xus[3*i], xus[1+3*i], xus[2+3*i],
+                               tl, tess, &xji, &yji, &zji);
+                        divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
+                               xus[3*i], xus[1+3*i], xus[2+3*i],
+                               tl, tess, &xki, &yki, &zki);
+
+                        for (tl2 = 1; tl2 < tess-tl; tl2++)
+                        {
+                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
+                                   xus[3*j], xus[1+3*j], xus[2+3*j],
+                                   tl2, tess, &xij, &yij, &zij);
+                            divarc(xus[3*k], xus[1+3*k], xus[2+3*k],
+                                   xus[3*j], xus[1+3*j], xus[2+3*j],
+                                   tl2, tess, &xkj, &ykj, &zkj);
+                            divarc(xus[3*i], xus[1+3*i], xus[2+3*i],
+                                   xus[3*k], xus[1+3*k], xus[2+3*k],
+                                   tess-tl-tl2, tess, &xik, &yik, &zik);
+                            divarc(xus[3*j], xus[1+3*j], xus[2+3*j],
+                                   xus[3*k], xus[1+3*k], xus[2+3*k],
+                                   tess-tl-tl2, tess, &xjk, &yjk, &zjk);
+                            divarc(xki, yki, zki, xji, yji, zji, tl2, tess-tl,
+                                   &x, &y, &z);
+                            divarc(xkj, ykj, zkj, xij, yij, zij, tl, tess-tl2,
+                                   &x2, &y2, &z2);
+                            divarc(xjk, yjk, zjk, xik, yik, zik, tl, tl+tl2,
+                                   &x3, &y3, &z3);
+                            GMX_ASSERT(tn < ndot,
+                                       "Inconsistent precomputed surface dot count");
+                            x           = x+x2+x3; y = y+y2+y3; z = z+z2+z3;
+                            d           = sqrt(x*x+y*y+z*z);
+                            xus[3*tn]   = x/d;
+                            xus[1+3*tn] = y/d;
+                            xus[2+3*tn] = z/d;
+                            tn++;
+                        } /* cycle tl2 */
+                    }     /* cycle tl */
+                }         /* cycle k */
+            }             /* cycle j */
+        }                 /* cycle i */
+        GMX_ASSERT(tn == ndot, "Inconsistent precomputed surface dot count");
+    }                     /* end of if (tess > 1) */
+
+    return xus;
+}       /* end of routine ico_dot_dod */
+
+static int unsp_type(int densit)
+{
+    int i1, i2;
+    i1 = 1;
+    while (10*i1*i1+2 < densit)
+    {
+        i1++;
+    }
+    i2 = 1;
+    while (30*i2*i2+2 < densit)
+    {
+        i2++;
+    }
+    if (10*i1*i1-2 < 30*i2*i2-2)
+    {
+        return UNSP_ICO_ARC;
+    }
+    else
+    {
+        return UNSP_ICO_DOD;
+    }
+}
+
+static std::vector<real> make_unsp(int densit, int cubus)
+{
+    int              *ico_wk, *ico_pt;
+    int               ico_cube, ico_cube_cb, i, j, k, l, ijk, tn, tl, tl2;
+    int              *work;
+    real              x, y, z;
+
+    int               mode = unsp_type(densit);
+    std::vector<real> xus;
+    if (mode == UNSP_ICO_ARC)
+    {
+        xus = ico_dot_arc(densit);
+    }
+    else if (mode == UNSP_ICO_DOD)
+    {
+        xus = ico_dot_dod(densit);
+    }
+    else
+    {
+        GMX_RELEASE_ASSERT(false, "Invalid unit sphere mode");
+    }
+
+    const int ndot = static_cast<int>(xus.size())/3;
+
+    /* determine distribution of points in elementary cubes */
+    if (cubus)
+    {
+        ico_cube = cubus;
+    }
+    else
+    {
+        i          = 1;
+        while (i*i*i*2 < ndot)
+        {
+            i++;
+        }
+        ico_cube = std::max(i-1, 0);
+    }
+    ico_cube_cb = ico_cube*ico_cube*ico_cube;
+    const real del_cube = 2./((real)ico_cube);
+    snew(work, ndot);
+    for (l = 0; l < ndot; l++)
+    {
+        i = std::max((int) floor((1.+xus[3*l])/del_cube), 0);
+        if (i >= ico_cube)
+        {
+            i = ico_cube-1;
+        }
+        j = std::max((int) floor((1.+xus[1+3*l])/del_cube), 0);
+        if (j >= ico_cube)
+        {
+            j = ico_cube-1;
+        }
+        k = std::max((int) floor((1.+xus[2+3*l])/del_cube), 0);
+        if (k >= ico_cube)
+        {
+            k = ico_cube-1;
+        }
+        ijk     = i+j*ico_cube+k*ico_cube*ico_cube;
+        work[l] = ijk;
+    }
+
+    snew(ico_wk, 2*ico_cube_cb+1);
+
+    ico_pt = ico_wk+ico_cube_cb;
+    for (l = 0; l < ndot; l++)
+    {
+        ico_wk[work[l]]++; /* dots per elementary cube */
+    }
+
+    /* reordering of the coordinate array in accordance with box number */
+    tn = 0;
+    for (i = 0; i < ico_cube; i++)
+    {
+        for (j = 0; j < ico_cube; j++)
+        {
+            for (k = 0; k < ico_cube; k++)
+            {
+                tl            = 0;
+                tl2           = tn;
+                ijk           = i+ico_cube*j+ico_cube*ico_cube*k;
+                *(ico_pt+ijk) = tn;
+                for (l = tl2; l < ndot; l++)
+                {
+                    if (ijk == work[l])
+                    {
+                        x          = xus[3*l]; y = xus[1+3*l]; z = xus[2+3*l];
+                        xus[3*l]   = xus[3*tn];
+                        xus[1+3*l] = xus[1+3*tn]; xus[2+3*l] = xus[2+3*tn];
+                        xus[3*tn]  = x; xus[1+3*tn] = y; xus[2+3*tn] = z;
+                        ijk        = work[l]; work[l] = work[tn]; work[tn] = ijk;
+                        tn++; tl++;
+                    }
+                }
+                *(ico_wk+ijk) = tl;
+            } /* cycle k */
+        }     /* cycle j */
+    }         /* cycle i */
+    sfree(ico_wk);
+    sfree(work);
+
+    return xus;
+}
+
+static void
+nsc_dclm_pbc(const rvec *coords, const ConstArrayRef<real> &radius, int nat,
+             const real *xus, int n_dot, int mode,
+             real *value_of_area, real **at_area,
+             real *value_of_vol,
+             real **lidots, int *nu_dots,
+             atom_id index[], AnalysisNeighborhood *nb,
+             const t_pbc *pbc)
+{
+    const real dotarea = FOURPI/(real) n_dot;
+
+    if (debug)
+    {
+        fprintf(debug, "nsc_dclm: n_dot=%5d %9.3f\n", n_dot, dotarea);
+    }
+
+    /* start with neighbour list */
+    /* calculate neighbour list with the box algorithm */
+    if (nat == 0)
+    {
+        return;
+    }
+    real        area = 0.0, vol = 0.0;
+    real       *dots = NULL, *atom_area = NULL;
+    int         lfnr = 0, maxdots = 0;
+    if (mode & FLAG_VOLUME)
+    {
+        vol = 0.;
+    }
+    if (mode & FLAG_DOTS)
+    {
+        maxdots = (3*n_dot*nat)/10;
+        snew(dots, maxdots);
+        lfnr = 0;
+    }
+    if (mode & FLAG_ATOM_AREA)
+    {
+        snew(atom_area, nat);
+    }
+
+    // Compute the center of the molecule for volume calculation.
+    // In principle, the center should not influence the results, but that is
+    // only true at the limit of infinite dot density, so this makes the
+    // results translation-invariant.
+    // With PBC, if the molecule is broken across the boundary, the computation
+    // is broken in other ways as well, so it does not need to be considered
+    // here.
+    real xs = 0.0, ys = 0.0, zs = 0.0;
+    for (int i = 0; i < nat; ++i)
+    {
+        const int iat = index[i];
+        xs += coords[iat][XX];
+        ys += coords[iat][YY];
+        zs += coords[iat][ZZ];
+    }
+    xs /= nat;
+    ys /= nat;
+    zs /= nat;
+
+    AnalysisNeighborhoodPositions pos(coords, radius.size());
+    pos.indexed(constArrayRefFromArray(index, nat));
+    AnalysisNeighborhoodSearch    nbsearch(nb->initSearch(pbc, pos));
+
+    std::vector<int>              wkdot(n_dot);
+
+    for (int i = 0; i < nat; ++i)
+    {
+        const int                      iat  = index[i];
+        const real                     ai   = radius[iat];
+        const real                     aisq = ai*ai;
+        AnalysisNeighborhoodPairSearch pairSearch(
+                nbsearch.startPairSearch(coords[iat]));
+        AnalysisNeighborhoodPair       pair;
+        std::fill(wkdot.begin(), wkdot.end(), 1);
+        int currDotCount = n_dot;
+        while (currDotCount > 0 && pairSearch.findNextPair(&pair))
+        {
+            const int  jat = index[pair.refIndex()];
+            const real aj  = radius[jat];
+            const real d2  = pair.distance2();
+            if (iat == jat || d2 > sqr(ai+aj))
+            {
+                continue;
+            }
+            const rvec &dx     = pair.dx();
+            const real  refdot = (d2 + aisq - aj*aj)/(2*ai);
+            // TODO: Consider whether micro-optimizations from the old
+            // implementation would be useful, compared to the complexity that
+            // they bring: instead of this direct loop, the neighbors were
+            // stored into a temporary array, the loop order was
+            // reversed (first over dots, then over neighbors), and for each
+            // dot, it was first checked whether the same neighbor that
+            // resulted in marking the previous dot covered would also cover
+            // this dot. This presumably plays together with sorting of the
+            // surface dots (done in make_unsp) to avoid some of the looping.
+            // Alternatively, we could keep a skip list here to avoid
+            // repeatedly looping over dots that have already marked as
+            // covered.
+            for (int j = 0; j < n_dot; ++j)
+            {
+                if (wkdot[j] && iprod(&xus[3*j], dx) > refdot)
+                {
+                    --currDotCount;
+                    wkdot[j] = 0;
+                }
+            }
+        }
+
+        const real a = aisq * dotarea * currDotCount;
+        area = area + a;
+        if (mode & FLAG_ATOM_AREA)
+        {
+            atom_area[i] = a;
+        }
+        const real xi = coords[iat][XX];
+        const real yi = coords[iat][YY];
+        const real zi = coords[iat][ZZ];
+        if (mode & FLAG_DOTS)
+        {
+            for (int l = 0; l < n_dot; l++)
+            {
+                if (wkdot[l])
+                {
+                    lfnr++;
+                    if (maxdots <= 3*lfnr+1)
+                    {
+                        maxdots = maxdots+n_dot*3;
+                        srenew(dots, maxdots);
+                    }
+                    dots[3*lfnr-3] = ai*xus[3*l]+xi;
+                    dots[3*lfnr-2] = ai*xus[1+3*l]+yi;
+                    dots[3*lfnr-1] = ai*xus[2+3*l]+zi;
+                }
+            }
+        }
+        if (mode & FLAG_VOLUME)
+        {
+            real dx = 0.0, dy = 0.0, dz = 0.0;
+            for (int l = 0; l < n_dot; l++)
+            {
+                if (wkdot[l])
+                {
+                    dx = dx+xus[3*l];
+                    dy = dy+xus[1+3*l];
+                    dz = dz+xus[2+3*l];
+                }
+            }
+            vol = vol+aisq*(dx*(xi-xs)+dy*(yi-ys)+dz*(zi-zs) + ai*currDotCount);
+        }
+    }
+
+    if (mode & FLAG_VOLUME)
+    {
+        *value_of_vol = vol*FOURPI/(3.*n_dot);
+    }
+    if (mode & FLAG_DOTS)
+    {
+        *nu_dots = lfnr;
+        *lidots  = dots;
+    }
+    if (mode & FLAG_ATOM_AREA)
+    {
+        *at_area = atom_area;
+    }
+    *value_of_area = area;
+
+    if (debug)
+    {
+        fprintf(debug, "area=%8.3f\n", area);
+    }
+}
+
+namespace gmx
+{
+
+class SurfaceAreaCalculator::Impl
+{
+    public:
+        Impl() : flags_(0)
+        {
+        }
+
+        std::vector<real>             unitSphereDots_;
+        ConstArrayRef<real>           radius_;
+        int                           flags_;
+        mutable AnalysisNeighborhood  nb_;
+};
+
+SurfaceAreaCalculator::SurfaceAreaCalculator()
+    : impl_(new Impl())
+{
+}
+
+SurfaceAreaCalculator::~SurfaceAreaCalculator()
+{
+}
+
+void SurfaceAreaCalculator::setDotCount(int dotCount)
+{
+    impl_->unitSphereDots_ = make_unsp(dotCount, 4);
+}
+
+void SurfaceAreaCalculator::setRadii(const ConstArrayRef<real> &radius)
+{
+    impl_->radius_ = radius;
+    if (!radius.empty())
+    {
+        const real maxRadius = *std::max_element(radius.begin(), radius.end());
+        impl_->nb_.setCutoff(2*maxRadius);
+    }
+}
+
+void SurfaceAreaCalculator::setCalculateVolume(bool bVolume)
+{
+    if (bVolume)
+    {
+        impl_->flags_ |= FLAG_VOLUME;
+    }
+    else
+    {
+        impl_->flags_ &= ~FLAG_VOLUME;
+    }
+}
+
+void SurfaceAreaCalculator::setCalculateAtomArea(bool bAtomArea)
+{
+    if (bAtomArea)
+    {
+        impl_->flags_ |= FLAG_ATOM_AREA;
+    }
+    else
+    {
+        impl_->flags_ &= ~FLAG_ATOM_AREA;
+    }
+}
+
+void SurfaceAreaCalculator::setCalculateSurfaceDots(bool bDots)
+{
+    if (bDots)
+    {
+        impl_->flags_ |= FLAG_DOTS;
+    }
+    else
+    {
+        impl_->flags_ &= ~FLAG_DOTS;
+    }
+}
+
+void SurfaceAreaCalculator::calculate(
+        const rvec *x, const t_pbc *pbc,
+        int nat, atom_id index[], int flags, real *area, real *volume,
+        real **at_area, real **lidots, int *n_dots) const
+{
+    flags |= impl_->flags_;
+    *area  = 0;
+    if (volume == NULL)
+    {
+        flags &= ~FLAG_VOLUME;
+    }
+    else
+    {
+        *volume = 0;
+    }
+    if (at_area == NULL)
+    {
+        flags &= ~FLAG_ATOM_AREA;
+    }
+    else
+    {
+        *at_area = NULL;
+    }
+    if (lidots == NULL)
+    {
+        flags &= ~FLAG_DOTS;
+    }
+    else
+    {
+        *lidots = NULL;
+    }
+    if (n_dots == NULL)
+    {
+        flags &= ~FLAG_DOTS;
+    }
+    else
+    {
+        *n_dots = 0;
+    }
+    nsc_dclm_pbc(x, impl_->radius_, nat,
+                 &impl_->unitSphereDots_[0], impl_->unitSphereDots_.size()/3,
+                 flags, area, at_area, volume, lidots, n_dots, index,
+                 &impl_->nb_, pbc);
+}
+
+} // namespace gmx
diff --git a/src/gromacs/trajectoryanalysis/modules/surfacearea.h b/src/gromacs/trajectoryanalysis/modules/surfacearea.h
new file mode 100644 (file)
index 0000000..94c8c1e
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * 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.
+ */
+#ifndef GMX_TRAJECTORYANALYSIS_SURFACEAREA_H
+#define GMX_TRAJECTORYANALYSIS_SURFACEAREA_H
+
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/classhelpers.h"
+
+struct t_pbc;
+
+#define FLAG_DOTS       01
+#define FLAG_VOLUME     02
+#define FLAG_ATOM_AREA  04
+
+namespace gmx
+{
+
+/*! \internal
+ * \brief
+ * Computes surface areas for a group of atoms/spheres.
+ *
+ * This class provides a surface area/volume calculator.
+ *
+ * The algorithm is based on representing each atom/sphere surface as a set of
+ * dots, and determining which dots are on the surface (not covered by any
+ * other atom/sphere).  The dots are distributed evenly using an icosahedron- or
+ * a dodecahedron-based method (see the original reference cited in the code).
+ * The area is then estimated from the area represented by each dot.
+ * The volume is calculated by selecting a fixed point and integrating over the
+ * surface dots, summing up the cones whose tip is at the fixed point and base
+ * at the surface points.
+ *
+ * The default dot density per sphere is 32, which gives quite inaccurate
+ * areas and volumes, but a reasonable number of surface points.  According to
+ * original documentation of the method, a density of 600-700 dots gives an
+ * accuracy of 1.5 A^2 per atom.
+ *
+ * \ingroup module_trajectoryanalysis
+ */
+class SurfaceAreaCalculator
+{
+    public:
+        /*! \brief
+         * Initializes a surface area calculator.
+         *
+         * \throws std::bad_alloc if out of memory.
+         */
+        SurfaceAreaCalculator();
+        ~SurfaceAreaCalculator();
+
+        /*! \brief
+         * Sets the number of surface dots per sphere to use.
+         *
+         * This function must be called before calculate() to set the desired
+         * accuracy/computational cost.
+         */
+        void setDotCount(int dotCount);
+        /*! \brief
+         * Sets the radii of spheres to use in the calculation.
+         *
+         * \param[in]  radius  Radius for each atom/sphere.
+         *
+         * This function must be called before calculate() to set the radii for
+         * the spheres.  All calculations must use the same set of radii to
+         * share the same grid search.
+         * These radii are used as-is, without adding any probe radius.
+         * The passed array must remain valid for the lifetime of this object.
+         *
+         * Does not throw.
+         */
+        void setRadii(const ConstArrayRef<real> &radius);
+
+        /*! \brief
+         * Requests calculation of volume.
+         *
+         * If not called, and FLAG_VOLUME is not passed to calculate(), the
+         * volume output is not produced.
+         *
+         * Does not throw.
+         */
+        void setCalculateVolume(bool bVolume);
+        /*! \brief
+         * Requests output of per-atom areas.
+         *
+         * If not called, and FLAG_ATOM_AREA is not passed to calculate(), the
+         * atom area output is not produced.
+         *
+         * Does not throw.
+         */
+        void setCalculateAtomArea(bool bAtomArea);
+        /*! \brief
+         * Requests output of all surface dots.
+         *
+         * If not called, and FLAG_DOTS is not passed to calculate(), the
+         * surface dot output is not produced.
+         *
+         * Does not throw.
+         */
+        void setCalculateSurfaceDots(bool bDots);
+
+        /*! \brief
+         * Calculates the surface area for a set of positions.
+         *
+         * \param[in]  x       Atom positions (sphere centers).
+         * \param[in]  pbc     PBC information (if `NULL`, calculation is done
+         *     without PBC).
+         * \param[in]  nat     Number of atoms to calculate.
+         * \param[in]  index   Atom indices to include in the calculation.
+         * \param[in]  flags   Additional flags for the calculation.
+         * \param[out] area    Total surface area (must be non-`NULL`).
+         * \param[out] volume  Total volume (can be `NULL`).
+         * \param[out] at_area Surface area for each atom in \p index
+         *     (\p nat values) (can be `NULL`).
+         * \param[out] lidots  Surface dots as x,y,z triplets (`3*lidots` values)
+         *     (can be `NULL`).
+         * \param[out] n_dots Number of surface dots in \p lidots
+         *     (can be `NULL`).
+         *
+         * Calculates the surface area of spheres centered at `x[index[0]]`,
+         * ..., `x[index[nat-1]]`, with radii `radii[index[0]]`, ..., where
+         * `radii` is the array passed to setRadii().
+         *
+         * If \p flags is 0, the calculation is done for the items specified
+         * with setCalculateVolume(), setCalculateAtomArea(), and
+         * setCalculateSurfaceDots().  Flags can specify FLAG_VOLUME,
+         * FLAG_ATOM_AREA, and/or FLAG_DOTS to request additional output for
+         * this particular calculation.  If any output is `NULL`, that output
+         * is not calculated, irrespective of the calculation mode set.
+         *
+         * \todo
+         * Make the output options more C++-like, in particular for the array
+         * outputs.
+         */
+        void calculate(const rvec *x, const t_pbc *pbc,
+                       int nat, atom_id index[], int flags, real *area,
+                       real *volume, real **at_area,
+                       real **lidots, int *n_dots) const;
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace gmx
+
+#endif
index b69fe77f497b1676beff499c601919d9977dc5be..4d9513ed28d6268e8245c7eebea9125b1f535e7f 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include "runnercommon.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "runnercommon.h"
 
 #include <string.h>
 
-#include "gromacs/legacyheaders/oenv.h"
-#include "gromacs/legacyheaders/rmpbc.h"
-#include "gromacs/legacyheaders/vec.h"
-
 #include "gromacs/fileio/timecontrol.h"
 #include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/options/options.h"
+#include "gromacs/pbcutil/rmpbc.h"
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/selection/selectioncollection.h"
 #include "gromacs/selection/selectionfileoption.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/trajectoryanalysis/analysissettings.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
@@ -348,7 +347,7 @@ TrajectoryAnalysisRunnerCommon::initFirstFrame()
     }
     time_unit_t time_unit
         = static_cast<time_unit_t>(impl_->settings_.timeUnit() + 1);
-    output_env_init(&impl_->oenv_, getProgramContext(), time_unit, FALSE, exvgNONE, 0, 0);
+    output_env_init(&impl_->oenv_, getProgramContext(), time_unit, FALSE, exvgNONE, 0);
 
     int frflags = impl_->settings_.frflags();
     frflags |= TRX_NEED_X;
@@ -371,17 +370,6 @@ TrajectoryAnalysisRunnerCommon::initFirstFrame()
                                                      "Trajectory (%d atoms) does not match topology (%d atoms)",
                                                      impl_->fr->natoms, top.topology()->atoms.nr)));
         }
-        // TODO: Check index groups if they have been initialized based on the topology.
-        /*
-           if (top)
-           {
-            for (int i = 0; i < impl_->sel->nr(); ++i)
-            {
-                gmx_ana_index_check(impl_->sel->sel(i)->indexGroup(),
-                                    impl_->fr->natoms);
-            }
-           }
-         */
     }
     else
     {
index 44b22eceae082da7dacedda549bdb86186564c40..3fd5057ec6ada73d27112fc3545f3ada5b7dfa07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_TRAJECTORYANALYSIS_RUNNERCOMMON_H
 #define GMX_TRAJECTORYANALYSIS_RUNNERCOMMON_H
 
-#include "../legacyheaders/types/simple.h"
-#include "gromacs/fileio/trx.h"
+#include "gromacs/utility/classhelpers.h"
 
-#include "../utility/common.h"
+struct t_trxframe;
 
 namespace gmx
 {
index b07003f628bef568c0266ca6f94a370261fd52a4..27bfbd17c4a8cbbf0ac61bb30a76e9b42dfc5dd2 100644 (file)
@@ -37,8 +37,11 @@ gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
                   angle.cpp
                   distance.cpp
                   freevolume.cpp
+                  pairdist.cpp
+                  rdf.cpp
                   sasa.cpp
                   select.cpp
+                  surfacearea.cpp
                   $<TARGET_OBJECTS:analysisdata-test-shared>)
 
 add_executable(test_selection ${UNITTEST_TARGET_OPTIONS} test_selection.cpp)
index 11c51d1f676f08a4aaacf742c2478c27ef8b99c3..94701813fb08dd994ced5de2174cef7c121a2787 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/trajectoryanalysis/modules/angle.h"
 
+#include <gtest/gtest.h>
+
 #include "testutils/cmdlinetest.h"
 
 #include "moduletest.h"
index 14db4b20b93f968fef4426a43130ec5d21cdc1dc..5a63636346d0f6b1af0f47651165f3c62b894658 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/trajectoryanalysis/modules/distance.h"
 
+#include <gtest/gtest.h>
+
 #include "testutils/cmdlinetest.h"
 
 #include "moduletest.h"
index a4879651e0fb908b830203973b9cb15065a040e7..f199976cc5dfa1547aa94d2628de95d0fdd6379d 100644 (file)
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
  * \ingroup module_trajectoryanalysis
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/trajectoryanalysis/modules/freevolume.h"
 
+#include <gtest/gtest.h>
+
 #include "testutils/cmdlinetest.h"
 
 #include "moduletest.h"
index dc1a265127c2b102fe77eccaa3ea43529d7df54b..93314445a14c0ea791674bcbd0963d77098dc0dc 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "moduletest.h"
 
 #include <map>
 
 #include "gromacs/trajectoryanalysis/analysismodule.h"
 #include "gromacs/trajectoryanalysis/cmdlinerunner.h"
-#include "gromacs/utility/file.h"
-#include "gromacs/utility/stringutil.h"
 
 #include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/cmdlinetest.h"
 #include "testutils/refdata.h"
 #include "testutils/testasserts.h"
-#include "testutils/testfilemanager.h"
 
 namespace gmx
 {
@@ -79,19 +78,7 @@ class AbstractTrajectoryAnalysisModuleTestFixture::Impl
             FloatingPointTolerance tolerance;
         };
 
-        struct OutputFileInfo
-        {
-            OutputFileInfo(const char *option, const std::string &path)
-                : option(option), path(path)
-            {
-            }
-
-            std::string         option;
-            std::string         path;
-        };
-
         typedef std::map<std::string, DatasetInfo> DatasetList;
-        typedef std::vector<OutputFileInfo>        OutputFileList;
 
         explicit Impl(AbstractTrajectoryAnalysisModuleTestFixture *parent);
 
@@ -101,11 +88,7 @@ class AbstractTrajectoryAnalysisModuleTestFixture::Impl
 
         AbstractTrajectoryAnalysisModuleTestFixture    &parent_;
         TrajectoryAnalysisModulePointer                 module_;
-        TestReferenceData                               data_;
-        CommandLine                                     cmdline_;
-        TestFileManager                                 tempFiles_;
         DatasetList                                     datasets_;
-        OutputFileList                                  outputFiles_;
         bool                                            bDatasetsIncluded_;
 };
 
@@ -113,7 +96,6 @@ AbstractTrajectoryAnalysisModuleTestFixture::Impl::Impl(
         AbstractTrajectoryAnalysisModuleTestFixture *parent)
     : parent_(*parent), bDatasetsIncluded_(false)
 {
-    cmdline_.append("module");
 }
 
 TrajectoryAnalysisModule &
@@ -169,35 +151,13 @@ AbstractTrajectoryAnalysisModuleTestFixture::~AbstractTrajectoryAnalysisModuleTe
 void
 AbstractTrajectoryAnalysisModuleTestFixture::setTopology(const char *filename)
 {
-    impl_->cmdline_.append("-s");
-    impl_->cmdline_.append(TestFileManager::getInputFilePath(filename));
+    setInputFile("-s", filename);
 }
 
 void
 AbstractTrajectoryAnalysisModuleTestFixture::setTrajectory(const char *filename)
 {
-    impl_->cmdline_.append("-f");
-    impl_->cmdline_.append(TestFileManager::getInputFilePath(filename));
-}
-
-void
-AbstractTrajectoryAnalysisModuleTestFixture::setOutputFile(const char *option,
-                                                           const char *filename)
-{
-    std::string fullFilename = impl_->tempFiles_.getTemporaryFilePath(filename);
-    impl_->cmdline_.append(option);
-    impl_->cmdline_.append(fullFilename);
-    impl_->outputFiles_.push_back(Impl::OutputFileInfo(option, fullFilename));
-}
-
-void
-AbstractTrajectoryAnalysisModuleTestFixture::setOutputFileNoTest(
-        const char *option, const char *extension)
-{
-    std::string fullFilename = impl_->tempFiles_.getTemporaryFilePath(
-                formatString("%d.%s", impl_->cmdline_.argc(), extension));
-    impl_->cmdline_.append(option);
-    impl_->cmdline_.append(fullFilename);
+    setInputFile("-f", filename);
 }
 
 void
@@ -242,16 +202,11 @@ AbstractTrajectoryAnalysisModuleTestFixture::setDatasetTolerance(
 void
 AbstractTrajectoryAnalysisModuleTestFixture::runTest(const CommandLine &args)
 {
-    TrajectoryAnalysisModule &module = impl_->module();
-    // Skip first argument if it is the module name.
-    int firstArg = (args.arg(0)[0] == '-' ? 0 : 1);
-    for (int i = firstArg; i < args.argc(); ++i)
-    {
-        impl_->cmdline_.append(args.arg(i));
-    }
-
-    TestReferenceChecker rootChecker(impl_->data_.rootChecker());
+    TrajectoryAnalysisModule &module  = impl_->module();
+    CommandLine              &cmdline = commandLine();
+    cmdline.merge(args);
 
+    TestReferenceChecker rootChecker(this->rootChecker());
     rootChecker.checkString(args.toString(), "CommandLine");
 
     if (impl_->hasCheckedDatasets())
@@ -276,22 +231,10 @@ AbstractTrajectoryAnalysisModuleTestFixture::runTest(const CommandLine &args)
     TrajectoryAnalysisCommandLineRunner runner(&module);
     runner.setUseDefaultGroups(false);
     int rc = 0;
-    EXPECT_NO_THROW_GMX(rc = runner.run(impl_->cmdline_.argc(), impl_->cmdline_.argv()));
+    EXPECT_NO_THROW_GMX(rc = runner.run(cmdline.argc(), cmdline.argv()));
     EXPECT_EQ(0, rc);
 
-    if (!impl_->outputFiles_.empty())
-    {
-        TestReferenceChecker                 outputChecker(
-                rootChecker.checkCompound("OutputFiles", "Files"));
-        Impl::OutputFileList::const_iterator outfile;
-        for (outfile = impl_->outputFiles_.begin();
-             outfile != impl_->outputFiles_.end();
-             ++outfile)
-        {
-            std::string output = File::readToString(outfile->path);
-            outputChecker.checkStringBlock(output, outfile->option.c_str());
-        }
-    }
+    checkOutputFiles();
 }
 
 } // namespace test
index 9971cd18aa3377a17ed0ad4e6bb5a6328d80a37d..f0e9ab6e37c3bbdd9fe19a9e075295acabc212f8 100644 (file)
@@ -45,7 +45,9 @@
 #include <gtest/gtest.h>
 
 #include "gromacs/trajectoryanalysis/analysismodule.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
+
+#include "testutils/cmdlinetest.h"
 
 namespace gmx
 {
@@ -55,7 +57,6 @@ class TrajectoryAnalysisModule;
 namespace test
 {
 
-class CommandLine;
 class FloatingPointTolerance;
 
 /*! \internal
@@ -69,15 +70,26 @@ class FloatingPointTolerance;
  * methods in this class.  runTest() then runs the specified module with the
  * given options and performs all the requested tests against reference data.
  *
+ * Tests should prefer to test the underlying data sets instead of string
+ * comparison on the output files using setOutputFile().
+ *
  * The actual module to be tested is constructed in the pure virtual
  * createModule() method, which should be implemented in a subclass.
  * Typically, the TrajectoryAnalysisModuleTestFixture template can be used.
  *
  * Any method in this class may throw std::bad_alloc if out of memory.
  *
+ * \todo
+ * Adding facilities to AnalysisData to check whether there are any
+ * output modules attached to the data object (directly or indirectly),
+ * marking the mocks as output modules, and using these checks in the
+ * tools instead of or in addition to the output file presence would be
+ * a superior.
+ * Also, the full file names should be deducible from the options.
+ *
  * \ingroup module_trajectoryanalysis
  */
-class AbstractTrajectoryAnalysisModuleTestFixture : public ::testing::Test
+class AbstractTrajectoryAnalysisModuleTestFixture : public CommandLineTestBase
 {
     public:
         AbstractTrajectoryAnalysisModuleTestFixture();
@@ -107,52 +119,6 @@ class AbstractTrajectoryAnalysisModuleTestFixture : public ::testing::Test
          * must be called before runTest().
          */
         void setTrajectory(const char *filename);
-        /*! \brief
-         * Sets an output file to use for the test.
-         *
-         * \param[in] option    Option to set.
-         * \param[in] filename  Name of the output file.
-         *
-         * This method:
-         *  - Sets \p option in the tested module to a temporary file name
-         *    constructed from \p filename.
-         *  - Makes runTest() to check the contents of the file against
-         *    reference data after running the module.
-         *  - Marks the temporary file for removal at test teardown.
-         *
-         * \p filename is given to TestTemporaryFileManager to make a unique
-         * filename for the temporary file, but is not otherwise used.
-         *
-         * Currently, this method should not be called for an XVG file, because
-         * the comments in the beginning of the file contain timestamps and
-         * other variable information, causing the test to fail.  Best used
-         * only for custom data formats.  For numeric data, testing the
-         * underlying dataset is typically sufficient.
-         */
-        void setOutputFile(const char *option, const char *filename);
-        /*! \brief
-         * Sets an output file parameter needed for the test.
-         *
-         * \param[in] option    Option to set.
-         * \param[in] extension Extension for the file to create.
-         *
-         * This method:
-         *  - Sets \p option in the tested module to a temporary file name.
-         *  - Marks the temporary file for removal at test teardown.
-         *
-         * This method provides the mechanism to set output files that are
-         * required to trigger computation of values that are required for
-         * the test.  The contents of the output file are not tested.
-         *
-         * \todo
-         * Adding facilities to AnalysisData to check whether there are any
-         * output modules attached to the data object (directly or indirectly),
-         * marking the mocks as output modules, and using these checks in the
-         * tools instead of or in addition to the output file presence would be
-         * a superior.
-         * Also, the extension should be deducible from the option.
-         */
-        void setOutputFileNoTest(const char *option, const char *extension);
         /*! \brief
          * Includes only specified dataset for the test.
          *
diff --git a/src/gromacs/trajectoryanalysis/tests/pairdist.cpp b/src/gromacs/trajectoryanalysis/tests/pairdist.cpp
new file mode 100644 (file)
index 0000000..dcbfa20
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for functionality of the "pairdist" trajectory analysis module.
+ *
+ * These tests test the basic functionality of the tool itself, but currently
+ * the following are missing:
+ *  - Tests related to -odg output.  This would require a full tpr file, and
+ *    some investigation on what kind of tpr it should be to produce reasonable
+ *    output.
+ *  - Tests for the X axes in the area per atom/residue plots.  These could be
+ *    added once better X axes are implemented.
+ *  - Tests for XVG labels.  This is a limitation of the current testing
+ *    framework.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "gromacs/trajectoryanalysis/modules/pairdist.h"
+
+#include <gtest/gtest.h>
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/testasserts.h"
+
+#include "moduletest.h"
+
+namespace
+{
+
+using gmx::test::CommandLine;
+
+/********************************************************************
+ * Tests for gmx::analysismodules::PairDistance.
+ */
+
+//! Test fixture for the select analysis module.
+typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::PairDistanceInfo>
+    PairDistanceModuleTest;
+
+TEST_F(PairDistanceModuleTest, ComputesAllDistances)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1", "-refgrouping", "none",
+        "-sel", "resindex 3", "-selgrouping", "none"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, ComputesAllDistancesWithCutoff)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1", "-refgrouping", "none",
+        "-sel", "resindex 3", "-selgrouping", "none",
+        "-cutoff", "1.5"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, ComputesMinDistanceWithCutoff)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1",
+        "-sel", "resindex 3",
+        "-cutoff", "1.5"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, ComputesMaxDistance)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1",
+        "-sel", "resindex 3",
+        "-type", "max"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, ComputesMaxDistanceWithCutoff)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1",
+        "-sel", "resindex 3",
+        "-cutoff", "1.5", "-type", "max"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, ComputesGroupedMinDistanceWithCutoff)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1 to 2", "-refgrouping", "res",
+        "-sel", "resindex 3 to 5", "-selgrouping", "res",
+        "-cutoff", "2.5"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(PairDistanceModuleTest, ComputesGroupedMaxDistanceWithCutoff)
+{
+    const char *const cmdline[] = {
+        "pairdist",
+        "-ref", "resindex 1 to 2", "-refgrouping", "res",
+        "-sel", "resindex 3 to 5", "-selgrouping", "res",
+        "-cutoff", "3.5", "-type", "max"
+    };
+    setTopology("simple.gro");
+    setOutputFileNoTest("-o", "xvg");
+    runTest(CommandLine(cmdline));
+}
+
+} // namespace
diff --git a/src/gromacs/trajectoryanalysis/tests/rdf.cpp b/src/gromacs/trajectoryanalysis/tests/rdf.cpp
new file mode 100644 (file)
index 0000000..db97f2d
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for functionality of the "rdf" trajectory analysis module.
+ *
+ * These tests are essentially regression tests for the actual RDF calculation
+ * from very small configurations.  Exclusions are not tested (since the input
+ * does not contain any), nor is the effect of -cut of -rmax.
+ * At the moment, they do not test the final normalization, but only the pair
+ * counts calculated for each frame.  Tests for the final normalization should
+ * be added once related TODOs in the implementation/framework have been
+ * resolved (currently, the test framework does not see the final output data).
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "gromacs/trajectoryanalysis/modules/rdf.h"
+
+#include <gtest/gtest.h>
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/testasserts.h"
+
+#include "moduletest.h"
+
+namespace
+{
+
+using gmx::test::CommandLine;
+
+/********************************************************************
+ * Tests for gmx::analysismodules::Rdf.
+ */
+
+//! Test fixture for the `rdf` analysis module.
+typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::RdfInfo>
+    RdfModuleTest;
+
+TEST_F(RdfModuleTest, BasicTest)
+{
+    const char *const cmdline[] = {
+        "rdf",
+        "-bin", "0.05",
+        "-ref", "name OW",
+        "-sel", "name OW", "not name OW"
+    };
+    setTopology("spc216.gro");
+    setOutputFileNoTest("-o", "xvg");
+    excludeDataset("pairdist");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(RdfModuleTest, CalculatesSurf)
+{
+    const char *const cmdline[] = {
+        "rdf",
+        "-bin", "0.05", "-surf", "res",
+        "-ref", "within 0.5 of (resnr 1 and name OW)",
+        "-sel", "name OW", "not name OW"
+    };
+    setTopology("spc216.gro");
+    setOutputFileNoTest("-o", "xvg");
+    excludeDataset("pairdist");
+    runTest(CommandLine(cmdline));
+}
+
+TEST_F(RdfModuleTest, CalculatesXY)
+{
+    const char *const cmdline[] = {
+        "rdf",
+        "-bin", "0.05", "-xy",
+        "-ref", "name OW",
+        "-sel", "name OW", "not name OW"
+    };
+    setTopology("spc216.gro");
+    setOutputFileNoTest("-o", "xvg");
+    excludeDataset("pairdist");
+    // TODO: Consider if it is possible to get a more reproducible result
+    // and/or a stricter tolerance (e.g., by checking that the sum of
+    // neighboring values still stays constant).
+    setDatasetTolerance("paircount", gmx::test::absoluteTolerance(2.5));
+    runTest(CommandLine(cmdline));
+}
+
+} // namespace
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesAllDistances.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesAllDistances.xml
new file mode 100644 (file)
index 0000000..8816f4d
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1' -refgrouping none -sel 'resindex 3' -selgrouping none</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <DataValue>
+            <Real Name="Value">2.2360679774997898</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.4142135623730951</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.1622776601683795</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2.2360679774997898</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.4142135623730951</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2.2360679774997898</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2.8284271247461903</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesAllDistancesWithCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesAllDistancesWithCutoff.xml
new file mode 100644 (file)
index 0000000..52a9f88
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1' -refgrouping none -sel 'resindex 3' -selgrouping none -cutoff 1.5</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">9</Int>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.4142135623730951</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.4142135623730951</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesGroupedMaxDistanceWithCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesGroupedMaxDistanceWithCutoff.xml
new file mode 100644 (file)
index 0000000..a97626b
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1 to 2' -refgrouping res -sel 'resindex 3 to 5' -selgrouping res -cutoff 3.5 -type max</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">6</Int>
+          <DataValue>
+            <Real Name="Value">3.1622776601683795</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.1622776601683795</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3.5</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesGroupedMinDistanceWithCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesGroupedMinDistanceWithCutoff.xml
new file mode 100644 (file)
index 0000000..f554d8e
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1 to 2' -refgrouping res -sel 'resindex 3 to 5' -selgrouping res -cutoff 2.5</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">6</Int>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2.5</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMaxDistance.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMaxDistance.xml
new file mode 100644 (file)
index 0000000..0e5510f
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1' -sel 'resindex 3' -type max</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">3.1622776601683795</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMaxDistanceWithCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMaxDistanceWithCutoff.xml
new file mode 100644 (file)
index 0000000..fe5f3ee
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1' -sel 'resindex 3' -cutoff 1.5 -type max</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">1.5</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMinDistanceWithCutoff.xml b/src/gromacs/trajectoryanalysis/tests/refdata/PairDistanceModuleTest_ComputesMinDistanceWithCutoff.xml
new file mode 100644 (file)
index 0000000..54b4bd6
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">pairdist -ref 'resindex 1' -sel 'resindex 3' -cutoff 1.5</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="dist">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">1</Int>
+          <DataValue>
+            <Real Name="Value">1</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_BasicTest.xml b/src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_BasicTest.xml
new file mode 100644 (file)
index 0000000..8fff980
--- /dev/null
@@ -0,0 +1,259 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">rdf -bin 0.05 -ref 'name OW' -sel 'name OW' 'not name OW'</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="norm">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">3</Int>
+          <DataValue>
+            <Real Name="Value">216</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">33.455901630929986</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">66.911803261859973</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="paircount">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">37</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">274</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">360</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">226</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">234</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">270</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">332</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">420</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">456</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">548</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">588</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">546</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">632</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">660</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">696</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">822</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">922</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1060</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1084</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1276</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1260</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1260</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1416</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1468</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1560</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1668</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1774</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1578</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">37</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">215</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">217</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">114</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">163</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">87</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">52</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">103</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">266</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">618</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">751</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">703</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">722</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">772</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">821</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">946</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1065</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1229</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1281</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1402</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1518</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1640</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1844</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2058</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2137</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2412</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2451</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2650</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2886</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2928</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3101</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3374</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3623</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3288</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_CalculatesSurf.xml b/src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_CalculatesSurf.xml
new file mode 100644 (file)
index 0000000..1c8be52
--- /dev/null
@@ -0,0 +1,259 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">rdf -bin 0.05 -surf res -ref 'within 0.5 of (resnr 1 and name OW)' -sel 'name OW' 'not name OW'</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="norm">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">3</Int>
+          <DataValue>
+            <Real Name="Value">22</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">33.455901630929986</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">66.911803261859973</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="paircount">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">37</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <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">7</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">15</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">8</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">22</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">28</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">28</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">42</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">38</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">41</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">52</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">48</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">57</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">77</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">58</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">80</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">83</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">82</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">90</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">98</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">128</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">127</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">136</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">130</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">155</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">151</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">189</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">153</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">183</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">201</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">153</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">37</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">0</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">0</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">10</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">22</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">21</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">33</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">51</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">43</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">61</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">74</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">61</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">80</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">86</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">116</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">136</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">138</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">123</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">137</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">177</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">168</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">179</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">205</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">241</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">239</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">303</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">261</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">303</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">319</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">321</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">354</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">362</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">374</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">352</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_CalculatesXY.xml b/src/gromacs/trajectoryanalysis/tests/refdata/RdfModuleTest_CalculatesXY.xml
new file mode 100644 (file)
index 0000000..6fb0ae3
--- /dev/null
@@ -0,0 +1,259 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="CommandLine">rdf -bin 0.05 -xy -ref 'name OW' -sel 'name OW' 'not name OW'</String>
+  <OutputData Name="Data">
+    <AnalysisData Name="norm">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">3</Int>
+          <DataValue>
+            <Real Name="Value">216</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">62.296896190889484</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">124.59379238177897</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+    <AnalysisData Name="paircount">
+      <DataFrame Name="Frame0">
+        <Real Name="X">0</Real>
+        <DataValues>
+          <Int Name="Count">37</Int>
+          <Int Name="DataSet">0</Int>
+          <DataValue>
+            <Real Name="Value">28</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">66</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">90</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">150</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">206</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">222</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">276</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">366</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">420</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">522</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">600</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">632</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">644</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">766</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">820</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">818</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">828</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">932</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">950</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1042</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1088</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1030</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1184</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1276</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1346</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1388</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1380</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1466</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1572</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1474</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1578</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1630</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1782</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1754</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1772</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1854</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1686</Real>
+          </DataValue>
+        </DataValues>
+        <DataValues>
+          <Int Name="Count">37</Int>
+          <Int Name="DataSet">1</Int>
+          <DataValue>
+            <Real Name="Value">64</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">184</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">288</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">567</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">408</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">539</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">630</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">743</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">821</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">897</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1094</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1236</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1394</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1504</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1568</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1691</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1770</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1827</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">1907</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2001</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2170</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2194</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2367</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2521</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2546</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2731</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2909</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">2962</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3044</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3038</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3139</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3296</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3507</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3404</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3612</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3945</Real>
+          </DataValue>
+          <DataValue>
+            <Real Name="Value">3388</Real>
+          </DataValue>
+        </DataValues>
+      </DataFrame>
+    </AnalysisData>
+  </OutputData>
+</ReferenceData>
index 91f830507db9aabbb6c68890f11ef68b0931ab8e..a26657b9e068debc59012c9ba93794074c445b68 100644 (file)
         <DataValues>
           <Int Name="Count">2</Int>
           <DataValue>
-            <Real Name="Value">2.7441690613360836</Real>
+            <Real Name="Value">2.5505606048765408</Real>
           </DataValue>
           <DataValue>
-            <Real Name="Value">698.86027894441133</Real>
+            <Real Name="Value">751.9095025655306</Real>
           </DataValue>
         </DataValues>
       </DataFrame>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100Points.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100Points.xml
new file mode 100644 (file)
index 0000000..490019c
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="100Points">
+    <Real Name="Area">1041.9522794772724</Real>
+    <Real Name="Volume">808.03995831604618</Real>
+    <Sequence Name="AtomArea">
+      <Int Name="Length">100</Int>
+      <Real>0.95131516208197198</Real>
+      <Real>19.01541145000165</Real>
+      <Real>22.043110642171214</Real>
+      <Real>18.151215320405854</Real>
+      <Real>0.63204646296068279</Real>
+      <Real>0</Real>
+      <Real>15.153269443643612</Real>
+      <Real>7.3352383071855414</Real>
+      <Real>4.1967272329122345</Real>
+      <Real>0</Real>
+      <Real>14.120138371629922</Real>
+      <Real>17.613045388151775</Real>
+      <Real>24.026150792470702</Real>
+      <Real>18.227081273770153</Real>
+      <Real>3.4343773695403952</Real>
+      <Real>19.754449542129247</Real>
+      <Real>21.485580504254141</Real>
+      <Real>12.292225741625185</Real>
+      <Real>19.030725859555776</Real>
+      <Real>0</Real>
+      <Real>9.4242992760866073</Real>
+      <Real>2.3664904848604777</Real>
+      <Real>21.704207650824099</Real>
+      <Real>0</Real>
+      <Real>13.730659331066482</Real>
+      <Real>14.531937785202674</Real>
+      <Real>4.5894783541023525</Real>
+      <Real>3.6755820832244703</Real>
+      <Real>0.44427283053350852</Real>
+      <Real>0.1066189700313567</Real>
+      <Real>2.0456369215234842</Real>
+      <Real>8.5740365276665162</Real>
+      <Real>18.165852189840816</Real>
+      <Real>10.496616250155016</Real>
+      <Real>21.080864118880193</Real>
+      <Real>2.3899727797298986</Real>
+      <Real>0.78849936521174724</Real>
+      <Real>13.408721074833956</Real>
+      <Real>13.658708645471602</Real>
+      <Real>25.966986031945716</Real>
+      <Real>0.85119617060510389</Real>
+      <Real>19.63570848962739</Real>
+      <Real>0.14968475148186061</Real>
+      <Real>10.306327915331671</Real>
+      <Real>4.3963272956306936</Real>
+      <Real>24.525460566049077</Real>
+      <Real>8.0156199763235296</Real>
+      <Real>0</Real>
+      <Real>5.3750282656324613</Real>
+      <Real>0</Real>
+      <Real>12.294379373044716</Real>
+      <Real>10.315417503550229</Real>
+      <Real>12.029185950445784</Real>
+      <Real>2.0160888710349627</Real>
+      <Real>0</Real>
+      <Real>0.13787251489085933</Real>
+      <Real>7.9417939895007734</Real>
+      <Real>42.12368047628528</Real>
+      <Real>15.724000321454668</Real>
+      <Real>12.462533452088378</Real>
+      <Real>15.79912862220181</Real>
+      <Real>6.2688853022092417</Real>
+      <Real>12.486923176542316</Real>
+      <Real>6.6320474695863378</Real>
+      <Real>20.983750899642256</Real>
+      <Real>30.213450121453786</Real>
+      <Real>0.6401170350458556</Real>
+      <Real>5.4877256580120797</Real>
+      <Real>7.5123761006137872</Real>
+      <Real>6.6756067906869934</Real>
+      <Real>14.293717932888253</Real>
+      <Real>6.9724919386790729</Real>
+      <Real>27.362816599110033</Real>
+      <Real>4.4291554575110448</Real>
+      <Real>3.7993133931974961</Real>
+      <Real>8.2368423448648969</Real>
+      <Real>6.5443862216435997</Real>
+      <Real>5.4944959373624975</Real>
+      <Real>31.691642853696951</Real>
+      <Real>12.180941103950339</Real>
+      <Real>24.133979864235052</Real>
+      <Real>11.141753032303363</Real>
+      <Real>12.053564446854951</Real>
+      <Real>3.0590924364990446</Real>
+      <Real>5.0901076005888326</Real>
+      <Real>12.701834505720841</Real>
+      <Real>1.6067117447360322</Real>
+      <Real>8.586295906028095</Real>
+      <Real>3.7715811132613966</Real>
+      <Real>13.891761175025035</Real>
+      <Real>14.091748610057952</Real>
+      <Real>13.276603955659391</Real>
+      <Real>9.7895079276620454</Real>
+      <Real>0.80200851184333233</Real>
+      <Real>0</Real>
+      <Real>17.970129415135109</Real>
+      <Real>24.853015014087575</Real>
+      <Real>4.7620404205235838</Real>
+      <Real>9.4941606968585042</Real>
+      <Real>4.2587127226353019</Real>
+    </Sequence>
+    <Int Name="DotCount">1338</Int>
+  </SASA>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithRectangularPBC.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithRectangularPBC.xml
new file mode 100644 (file)
index 0000000..b54cf45
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="100Points">
+    <Real Name="Area">1041.9522794772727</Real>
+    <Real Name="Volume">808.03995831604618</Real>
+    <Sequence Name="AtomArea">
+      <Int Name="Length">100</Int>
+      <Real>0.95131516208197198</Real>
+      <Real>19.01541145000165</Real>
+      <Real>22.043110642171214</Real>
+      <Real>18.151215320405854</Real>
+      <Real>0.63204646296068279</Real>
+      <Real>0</Real>
+      <Real>15.153269443643612</Real>
+      <Real>7.3352383071855414</Real>
+      <Real>4.1967272329122345</Real>
+      <Real>0</Real>
+      <Real>14.120138371629922</Real>
+      <Real>17.613045388151775</Real>
+      <Real>24.026150792470702</Real>
+      <Real>18.227081273770153</Real>
+      <Real>3.4343773695403952</Real>
+      <Real>19.754449542129247</Real>
+      <Real>21.485580504254141</Real>
+      <Real>12.292225741625185</Real>
+      <Real>19.030725859555776</Real>
+      <Real>0</Real>
+      <Real>9.4242992760866073</Real>
+      <Real>2.3664904848604777</Real>
+      <Real>21.704207650824099</Real>
+      <Real>0</Real>
+      <Real>13.730659331066482</Real>
+      <Real>14.531937785202674</Real>
+      <Real>4.5894783541023525</Real>
+      <Real>3.6755820832244703</Real>
+      <Real>0.44427283053350852</Real>
+      <Real>0.1066189700313567</Real>
+      <Real>2.0456369215234842</Real>
+      <Real>8.5740365276665162</Real>
+      <Real>18.165852189840816</Real>
+      <Real>10.496616250155016</Real>
+      <Real>21.080864118880193</Real>
+      <Real>2.3899727797298986</Real>
+      <Real>0.78849936521174724</Real>
+      <Real>13.408721074833956</Real>
+      <Real>13.658708645471602</Real>
+      <Real>25.966986031945716</Real>
+      <Real>0.85119617060510389</Real>
+      <Real>19.63570848962739</Real>
+      <Real>0.14968475148186061</Real>
+      <Real>10.306327915331671</Real>
+      <Real>4.3963272956306936</Real>
+      <Real>24.525460566049077</Real>
+      <Real>8.0156199763235296</Real>
+      <Real>0</Real>
+      <Real>5.3750282656324613</Real>
+      <Real>0</Real>
+      <Real>12.294379373044716</Real>
+      <Real>10.315417503550229</Real>
+      <Real>12.029185950445784</Real>
+      <Real>2.0160888710349627</Real>
+      <Real>0</Real>
+      <Real>0.13787251489085933</Real>
+      <Real>7.9417939895007734</Real>
+      <Real>42.12368047628528</Real>
+      <Real>15.724000321454668</Real>
+      <Real>12.462533452088378</Real>
+      <Real>15.79912862220181</Real>
+      <Real>6.2688853022092417</Real>
+      <Real>12.486923176542316</Real>
+      <Real>6.6320474695863378</Real>
+      <Real>20.983750899642256</Real>
+      <Real>30.213450121453786</Real>
+      <Real>0.6401170350458556</Real>
+      <Real>5.4877256580120797</Real>
+      <Real>7.5123761006137872</Real>
+      <Real>6.6756067906869934</Real>
+      <Real>14.293717932888253</Real>
+      <Real>6.9724919386790729</Real>
+      <Real>27.362816599110033</Real>
+      <Real>4.4291554575110448</Real>
+      <Real>3.7993133931974961</Real>
+      <Real>8.2368423448648969</Real>
+      <Real>6.5443862216435997</Real>
+      <Real>5.4944959373624975</Real>
+      <Real>31.691642853696951</Real>
+      <Real>12.180941103950339</Real>
+      <Real>24.133979864235052</Real>
+      <Real>11.141753032303363</Real>
+      <Real>12.053564446854951</Real>
+      <Real>3.0590924364990446</Real>
+      <Real>5.0901076005888326</Real>
+      <Real>12.701834505720841</Real>
+      <Real>1.6067117447360322</Real>
+      <Real>8.586295906028095</Real>
+      <Real>3.7715811132613966</Real>
+      <Real>13.891761175025035</Real>
+      <Real>14.091748610057952</Real>
+      <Real>13.276603955659391</Real>
+      <Real>9.7895079276620454</Real>
+      <Real>0.80200851184333233</Real>
+      <Real>0</Real>
+      <Real>17.970129415135109</Real>
+      <Real>24.853015014087575</Real>
+      <Real>4.7620404205235838</Real>
+      <Real>9.4941606968585042</Real>
+      <Real>4.2587127226353019</Real>
+    </Sequence>
+    <Int Name="DotCount">1338</Int>
+  </SASA>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithTriclinicPBC.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_Computes100PointsWithTriclinicPBC.xml
new file mode 100644 (file)
index 0000000..b54cf45
--- /dev/null
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="100Points">
+    <Real Name="Area">1041.9522794772727</Real>
+    <Real Name="Volume">808.03995831604618</Real>
+    <Sequence Name="AtomArea">
+      <Int Name="Length">100</Int>
+      <Real>0.95131516208197198</Real>
+      <Real>19.01541145000165</Real>
+      <Real>22.043110642171214</Real>
+      <Real>18.151215320405854</Real>
+      <Real>0.63204646296068279</Real>
+      <Real>0</Real>
+      <Real>15.153269443643612</Real>
+      <Real>7.3352383071855414</Real>
+      <Real>4.1967272329122345</Real>
+      <Real>0</Real>
+      <Real>14.120138371629922</Real>
+      <Real>17.613045388151775</Real>
+      <Real>24.026150792470702</Real>
+      <Real>18.227081273770153</Real>
+      <Real>3.4343773695403952</Real>
+      <Real>19.754449542129247</Real>
+      <Real>21.485580504254141</Real>
+      <Real>12.292225741625185</Real>
+      <Real>19.030725859555776</Real>
+      <Real>0</Real>
+      <Real>9.4242992760866073</Real>
+      <Real>2.3664904848604777</Real>
+      <Real>21.704207650824099</Real>
+      <Real>0</Real>
+      <Real>13.730659331066482</Real>
+      <Real>14.531937785202674</Real>
+      <Real>4.5894783541023525</Real>
+      <Real>3.6755820832244703</Real>
+      <Real>0.44427283053350852</Real>
+      <Real>0.1066189700313567</Real>
+      <Real>2.0456369215234842</Real>
+      <Real>8.5740365276665162</Real>
+      <Real>18.165852189840816</Real>
+      <Real>10.496616250155016</Real>
+      <Real>21.080864118880193</Real>
+      <Real>2.3899727797298986</Real>
+      <Real>0.78849936521174724</Real>
+      <Real>13.408721074833956</Real>
+      <Real>13.658708645471602</Real>
+      <Real>25.966986031945716</Real>
+      <Real>0.85119617060510389</Real>
+      <Real>19.63570848962739</Real>
+      <Real>0.14968475148186061</Real>
+      <Real>10.306327915331671</Real>
+      <Real>4.3963272956306936</Real>
+      <Real>24.525460566049077</Real>
+      <Real>8.0156199763235296</Real>
+      <Real>0</Real>
+      <Real>5.3750282656324613</Real>
+      <Real>0</Real>
+      <Real>12.294379373044716</Real>
+      <Real>10.315417503550229</Real>
+      <Real>12.029185950445784</Real>
+      <Real>2.0160888710349627</Real>
+      <Real>0</Real>
+      <Real>0.13787251489085933</Real>
+      <Real>7.9417939895007734</Real>
+      <Real>42.12368047628528</Real>
+      <Real>15.724000321454668</Real>
+      <Real>12.462533452088378</Real>
+      <Real>15.79912862220181</Real>
+      <Real>6.2688853022092417</Real>
+      <Real>12.486923176542316</Real>
+      <Real>6.6320474695863378</Real>
+      <Real>20.983750899642256</Real>
+      <Real>30.213450121453786</Real>
+      <Real>0.6401170350458556</Real>
+      <Real>5.4877256580120797</Real>
+      <Real>7.5123761006137872</Real>
+      <Real>6.6756067906869934</Real>
+      <Real>14.293717932888253</Real>
+      <Real>6.9724919386790729</Real>
+      <Real>27.362816599110033</Real>
+      <Real>4.4291554575110448</Real>
+      <Real>3.7993133931974961</Real>
+      <Real>8.2368423448648969</Real>
+      <Real>6.5443862216435997</Real>
+      <Real>5.4944959373624975</Real>
+      <Real>31.691642853696951</Real>
+      <Real>12.180941103950339</Real>
+      <Real>24.133979864235052</Real>
+      <Real>11.141753032303363</Real>
+      <Real>12.053564446854951</Real>
+      <Real>3.0590924364990446</Real>
+      <Real>5.0901076005888326</Real>
+      <Real>12.701834505720841</Real>
+      <Real>1.6067117447360322</Real>
+      <Real>8.586295906028095</Real>
+      <Real>3.7715811132613966</Real>
+      <Real>13.891761175025035</Real>
+      <Real>14.091748610057952</Real>
+      <Real>13.276603955659391</Real>
+      <Real>9.7895079276620454</Real>
+      <Real>0.80200851184333233</Real>
+      <Real>0</Real>
+      <Real>17.970129415135109</Real>
+      <Real>24.853015014087575</Real>
+      <Real>4.7620404205235838</Real>
+      <Real>9.4941606968585042</Real>
+      <Real>4.2587127226353019</Real>
+    </Sequence>
+    <Int Name="DotCount">1338</Int>
+  </SASA>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints12.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints12.xml
new file mode 100644 (file)
index 0000000..bf3932b
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="Surface">
+    <Real Name="Area">12.566370614359172</Real>
+    <Sequence Name="Dots">
+      <Int Name="Length">36</Int>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>-1</Real>
+      <Real>-0.27639310998086691</Real>
+      <Real>-0.85065087452807109</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360690737127242</Real>
+      <Real>-0.52573101980466264</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360681651420888</Real>
+      <Real>0.52573114485870043</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.27639325699069922</Real>
+      <Real>0.85065082676168668</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.27639333049561254</Real>
+      <Real>-0.85065080287848482</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360677108566906</Real>
+      <Real>-0.52573120738571333</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360686194274337</Real>
+      <Real>0.52573108233168353</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.27639318348578412</Real>
+      <Real>0.85065085064488211</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>1</Real>
+    </Sequence>
+  </SASA>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints122.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints122.xml
new file mode 100644 (file)
index 0000000..71fd5e3
--- /dev/null
@@ -0,0 +1,376 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="Surface">
+    <Real Name="Area">12.566370614359172</Real>
+    <Sequence Name="Dots">
+      <Int Name="Length">366</Int>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>-1</Real>
+      <Real>0.099017100750074208</Real>
+      <Real>-0.30474315751655773</Real>
+      <Real>-0.94727357278976609</Real>
+      <Real>-0.25923000773171251</Real>
+      <Real>-0.18834164910928383</Real>
+      <Real>-0.94727357521584643</Real>
+      <Real>0.32042594696241011</Real>
+      <Real>2.7688072479927719e-08</Real>
+      <Real>-0.94727356793760586</Real>
+      <Real>-0.25923003561123026</Real>
+      <Real>0.18834163514060129</Real>
+      <Real>-0.94727357036368598</Real>
+      <Real>0.099017048084233991</Real>
+      <Real>0.30474317462872957</Real>
+      <Real>-0.94727357278976609</Real>
+      <Real>-0.16245980125708112</Real>
+      <Real>-0.50000003709380847</Real>
+      <Real>-0.85065079549818778</Real>
+      <Real>0.42532548914805512</Real>
+      <Real>-0.3090169737533614</Real>
+      <Real>-0.85065077335724681</Real>
+      <Real>-0.52573114485869987</Real>
+      <Real>-1.5142845699589461e-08</Real>
+      <Real>-0.85065078811787431</Real>
+      <Real>0.42532543574360737</Real>
+      <Real>0.30901704725828416</Real>
+      <Real>-0.8506507733572467</Real>
+      <Real>-0.1624598806459048</Real>
+      <Real>0.50000003641109625</Real>
+      <Real>-0.85065078073756029</Real>
+      <Real>0.18759256558961399</Real>
+      <Real>-0.57735027920788806</Real>
+      <Real>-0.79465444341177649</Real>
+      <Real>-0.49112347245450155</Real>
+      <Real>-0.35682213462759943</Real>
+      <Real>-0.79465445260442358</Real>
+      <Real>0.60706206007773655</Real>
+      <Real>5.2456358414752335e-08</Real>
+      <Real>-0.79465442502648409</Real>
+      <Real>-0.49112352275791088</Real>
+      <Real>0.35682210633554395</Real>
+      <Real>-0.79465443421912996</Real>
+      <Real>0.18759246581169672</Real>
+      <Real>0.57735031162770434</Real>
+      <Real>-0.79465444341177638</Real>
+      <Real>-0.046871646661550442</Real>
+      <Real>-0.75374273850500617</Real>
+      <Real>-0.65549594422102153</Real>
+      <Real>-0.40511875788237067</Real>
+      <Real>-0.6373412338447112</Real>
+      <Real>-0.6554959524307884</Real>
+      <Real>0.48095898541609272</Real>
+      <Real>-0.58224008918771142</Real>
+      <Real>-0.65549594422102164</Real>
+      <Real>0.70236782279174126</Real>
+      <Real>-0.2774969011402712</Real>
+      <Real>-0.65549592780148958</Real>
+      <Real>-0.73133609169283587</Real>
+      <Real>-0.18834165055637986</Real>
+      <Real>-0.6554959524307884</Real>
+      <Real>-0.73133611075236105</Real>
+      <Real>0.18834163369350529</Real>
+      <Real>-0.65549593601125533</Real>
+      <Real>0.70236777483460133</Real>
+      <Real>0.27749702252376535</Real>
+      <Real>-0.65549592780148958</Real>
+      <Real>0.48095888479311216</Real>
+      <Real>0.58224017230723379</Real>
+      <Real>-0.65549594422102153</Real>
+      <Real>-0.40511885788011226</Real>
+      <Real>0.63734118716951105</Real>
+      <Real>-0.65549593601125544</Real>
+      <Real>-0.046871776923682162</Real>
+      <Real>0.75374273040461759</Real>
+      <Real>-0.65549594422102153</Real>
+      <Real>0.26286567453986009</Real>
+      <Real>-0.80901697843275555</Real>
+      <Real>-0.52573107741148295</Real>
+      <Real>-0.68819093826563327</Real>
+      <Real>-0.50000005836206629</Real>
+      <Real>-0.52573108537254831</Real>
+      <Real>0.85065083964296051</Real>
+      <Real>5.6152759798857928e-08</Real>
+      <Real>-0.52573106148935433</Real>
+      <Real>-0.68819099963114494</Real>
+      <Real>0.49999999064120482</Real>
+      <Real>-0.52573106945041825</Real>
+      <Real>0.26286553472520674</Real>
+      <Real>0.80901702386129837</Real>
+      <Real>-0.52573107741148284</Real>
+      <Real>-0.27639310998086691</Real>
+      <Real>-0.85065087452807109</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360690737127242</Real>
+      <Real>-0.52573101980466264</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360681651420888</Real>
+      <Real>0.52573114485870043</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.27639325699069922</Real>
+      <Real>0.85065082676168668</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.014324278037483651</Real>
+      <Real>-0.9420843338704582</Real>
+      <Real>-0.33507002691162935</Real>
+      <Real>0.54215490657597232</Real>
+      <Real>-0.77058168570310492</Real>
+      <Real>-0.33507002691162935</Real>
+      <Real>-0.56533168971421621</Real>
+      <Real>-0.75374276489632219</Real>
+      <Real>-0.33507002995092922</Real>
+      <Real>-0.89154902505459532</Real>
+      <Real>-0.30474318677637491</Real>
+      <Real>-0.33507003154203469</Real>
+      <Real>0.90040188534718624</Real>
+      <Real>-0.27749689752267748</Real>
+      <Real>-0.33507001765082056</Real>
+      <Real>0.90040184594129713</Real>
+      <Real>0.27749702154159639</Real>
+      <Real>-0.33507002083303039</Real>
+      <Real>-0.89154904724027939</Real>
+      <Real>0.30474313205289755</Real>
+      <Real>-0.33507002228122468</Real>
+      <Real>-0.56533180027257979</Real>
+      <Real>0.75374268467611705</Real>
+      <Real>-0.33507002387232976</Real>
+      <Real>0.54215477340371809</Real>
+      <Real>0.77058177939852901</Real>
+      <Real>-0.33507002691162935</Real>
+      <Real>0.014324115226078571</Real>
+      <Real>0.94208433634597177</Real>
+      <Real>-0.33507002691162935</Real>
+      <Real>0.30353113023123213</Real>
+      <Real>-0.93417232306880937</Real>
+      <Real>-0.1875924406599985</Real>
+      <Real>-0.79465443246348733</Real>
+      <Real>-0.57735033372812661</Real>
+      <Real>-0.18759244417127635</Real>
+      <Real>0.98224695410165486</Real>
+      <Real>5.2456354487327486e-08</Real>
+      <Real>-0.18759243363744385</Real>
+      <Real>-0.79465450249337599</Real>
+      <Real>0.57735023962202381</Real>
+      <Real>-0.18759243714872095</Real>
+      <Real>0.30353096878717961</Real>
+      <Real>0.93417237552517096</Real>
+      <Real>-0.18759244065999844</Real>
+      <Real>-0.30610163692434295</Real>
+      <Real>-0.94208435645226973</Real>
+      <Real>-0.13703595586615472</Real>
+      <Real>0.80138486174169055</Real>
+      <Real>-0.58224002713709733</Real>
+      <Real>-0.13703595940717078</Real>
+      <Real>-0.99056607391927598</Real>
+      <Real>-2.7688068789135795e-08</Real>
+      <Real>-0.13703595586615464</Real>
+      <Real>0.80138477778966677</Real>
+      <Real>0.58224014352057152</Real>
+      <Real>-0.13703595586615475</Real>
+      <Real>-0.30610179973574703</Real>
+      <Real>0.94208430355164396</Real>
+      <Real>-0.13703595586615469</Real>
+      <Real>1.2961531081767674e-07</Real>
+      <Real>-0.99999999999999167</Real>
+      <Real>-5.5511151231257827e-17</Real>
+      <Real>-0.58778517212449111</Real>
+      <Real>-0.80901705262038981</Real>
+      <Real>-1.8793522849058775e-09</Real>
+      <Real>0.58778534971183316</Real>
+      <Real>-0.80901692359563038</Real>
+      <Real>-3.7587038759223645e-09</Real>
+      <Real>-0.95105649618237209</Real>
+      <Real>-0.30901705627571729</Real>
+      <Real>-1.879352201639151e-09</Real>
+      <Real>0.95105654032715115</Real>
+      <Real>-0.30901692041205481</Real>
+      <Real>2.7755575615628914e-17</Real>
+      <Real>-0.95105653106748755</Real>
+      <Real>0.3090169489103749</Real>
+      <Real>1.879352062861273e-09</Real>
+      <Real>0.95105650544203846</Real>
+      <Real>0.30901702777739931</Real>
+      <Real>3.7587038759223654e-09</Real>
+      <Real>-0.58778529051605588</Real>
+      <Real>0.80901696660388756</Real>
+      <Real>1.8793520073501213e-09</Real>
+      <Real>0.58778523132027516</Real>
+      <Real>0.80901700961214085</Real>
+      <Real>2.7755575615628914e-17</Real>
+      <Real>-4.3205103550381097e-08</Real>
+      <Real>0.99999999999999911</Real>
+      <Real>-2.7755575615628914e-17</Real>
+      <Real>0.30610188114144588</Real>
+      <Real>-0.94208427710132048</Real>
+      <Real>0.13703595586615475</Real>
+      <Real>-0.80138473581364844</Real>
+      <Real>-0.58224020171230428</Real>
+      <Real>0.13703595409564634</Real>
+      <Real>0.99056607342940817</Real>
+      <Real>2.7688069489002942e-08</Real>
+      <Real>0.13703595940717081</Real>
+      <Real>-0.80138481976568088</Real>
+      <Real>0.58224008532883575</Real>
+      <Real>0.13703595763666276</Real>
+      <Real>0.30610171833004618</Real>
+      <Real>0.94208433000196035</Real>
+      <Real>0.13703595586615469</Real>
+      <Real>-0.30353088806515</Real>
+      <Real>-0.93417240175334149</Real>
+      <Real>0.1875924406599985</Real>
+      <Real>0.79465453750831549</Real>
+      <Real>-0.5773501925689698</Real>
+      <Real>0.18759243363744388</Real>
+      <Real>-0.98224695276046647</Real>
+      <Real>-5.245635309796613e-08</Real>
+      <Real>0.18759244065999858</Real>
+      <Real>0.79465446747843327</Real>
+      <Real>0.57735028667507615</Real>
+      <Real>0.18759244065999844</Real>
+      <Real>-0.3035310495092069</Real>
+      <Real>0.93417234929699366</Real>
+      <Real>0.18759244065999844</Real>
+      <Real>-0.014324033820375781</Real>
+      <Real>-0.94208433758371801</Real>
+      <Real>0.33507002691162935</Real>
+      <Real>-0.54215470681758493</Real>
+      <Real>-0.77058182624623239</Real>
+      <Real>0.33507002691162935</Real>
+      <Real>0.56533185555175702</Real>
+      <Real>-0.75374264456600837</Real>
+      <Real>0.33507002083303045</Real>
+      <Real>0.8915490583331197</Real>
+      <Real>-0.30474310469115867</Real>
+      <Real>0.33507001765082062</Real>
+      <Real>-0.90040183190415546</Real>
+      <Real>-0.27749705782731754</Real>
+      <Real>0.33507002850273465</Real>
+      <Real>-0.90040187131004945</Real>
+      <Real>0.27749693380840212</Real>
+      <Real>0.33507002532052427</Real>
+      <Real>0.89154903614743786</Real>
+      <Real>0.30474315941463637</Real>
+      <Real>0.33507002691162935</Real>
+      <Real>0.56533174499339967</Real>
+      <Real>0.75374272478622162</Real>
+      <Real>0.33507002691162935</Real>
+      <Real>-0.54215483998984715</Real>
+      <Real>0.77058173255081996</Real>
+      <Real>0.33507002691162935</Real>
+      <Real>-0.014324196631781194</Real>
+      <Real>0.94208433510821854</Real>
+      <Real>0.33507002691162929</Real>
+      <Real>0.27639333049561254</Real>
+      <Real>-0.85065080287848482</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360677108566906</Real>
+      <Real>-0.52573120738571333</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360686194274337</Real>
+      <Real>0.52573108233168353</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.27639318348578412</Real>
+      <Real>0.85065085064488211</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.26286546481787715</Real>
+      <Real>-0.80901704657556062</Real>
+      <Real>0.52573107741148295</Real>
+      <Real>0.68819103031389739</Real>
+      <Real>-0.49999995678077147</Real>
+      <Real>0.52573106148935422</Real>
+      <Real>-0.85065082980254492</Real>
+      <Real>-5.6152758158248256e-08</Real>
+      <Real>0.52573107741148306</Real>
+      <Real>0.68819096894839027</Real>
+      <Real>0.5000000245016365</Real>
+      <Real>0.52573107741148284</Real>
+      <Real>-0.26286560463253433</Real>
+      <Real>0.80901700114703001</Real>
+      <Real>0.52573107741148306</Real>
+      <Real>0.046871842054747564</Real>
+      <Real>-0.75374272635441475</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>0.40511890787898003</Real>
+      <Real>-0.63734116383190476</Real>
+      <Real>0.65549592780148969</Real>
+      <Real>-0.48095883448161647</Real>
+      <Real>-0.58224021386698843</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>-0.70236774534829738</Real>
+      <Real>-0.27749705837024763</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>0.7313361202821228</Real>
+      <Real>-0.18834162526206655</Real>
+      <Real>0.65549592780148969</Real>
+      <Real>0.73133610122259873</Real>
+      <Real>0.18834164212494314</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>-0.70236779330544363</Real>
+      <Real>0.27749693698675881</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>-0.48095893510460419</Real>
+      <Real>0.58224013074747483</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>0.4051188078812426</Real>
+      <Real>0.63734121050711312</Real>
+      <Real>0.65549594422102153</Real>
+      <Real>0.046871711792616434</Real>
+      <Real>0.75374273445481466</Real>
+      <Real>0.65549594422102175</Real>
+      <Real>-0.18759241592273596</Real>
+      <Real>-0.57735032783760598</Real>
+      <Real>0.79465444341177638</Real>
+      <Real>0.49112354790961382</Real>
+      <Real>-0.35682209218951294</Real>
+      <Real>0.79465442502648398</Real>
+      <Real>-0.60706203601107944</Real>
+      <Real>-5.2456356275319567e-08</Real>
+      <Real>0.79465444341177627</Real>
+      <Real>0.49112349760620688</Real>
+      <Real>0.3568221204815728</Real>
+      <Real>0.79465444341177638</Real>
+      <Real>-0.18759251570065602</Real>
+      <Real>0.57735029541779825</Real>
+      <Real>0.79465444341177627</Real>
+      <Real>0.16245992034031653</Real>
+      <Real>-0.50000003606973475</Real>
+      <Real>0.8506507733572467</Real>
+      <Real>-0.42532539862021479</Real>
+      <Real>-0.30901705772173071</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>0.52573116874189396</Real>
+      <Real>1.5142847809013205e-08</Real>
+      <Real>0.85065077335724681</Real>
+      <Real>-0.42532545202466426</Real>
+      <Real>0.30901698421681456</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>0.16245984095149318</Real>
+      <Real>0.50000003675245419</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>-0.099017021751312745</Real>
+      <Real>-0.30474318318481203</Real>
+      <Real>0.94727357278976609</Real>
+      <Real>0.25923004955098822</Real>
+      <Real>-0.18834162815625813</Real>
+      <Real>0.94727356793760586</Real>
+      <Real>-0.32042593261799379</Real>
+      <Real>-2.7688071208844714e-08</Real>
+      <Real>0.94727357278976598</Real>
+      <Real>0.25923002167147174</Real>
+      <Real>0.1883416421249432</Real>
+      <Real>0.94727357278976609</Real>
+      <Real>-0.09901707441715446</Real>
+      <Real>0.30474316607264479</Real>
+      <Real>0.94727357278976609</Real>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>1</Real>
+    </Sequence>
+  </SASA>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints32.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints32.xml
new file mode 100644 (file)
index 0000000..20dab27
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="Surface">
+    <Real Name="Area">12.566370614359172</Real>
+    <Sequence Name="Dots">
+      <Int Name="Length">96</Int>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>-1</Real>
+      <Real>0.18759256558961399</Real>
+      <Real>-0.57735027920788806</Real>
+      <Real>-0.79465444341177649</Real>
+      <Real>-0.49112347245450155</Real>
+      <Real>-0.35682213462759943</Real>
+      <Real>-0.79465445260442358</Real>
+      <Real>0.60706206007773655</Real>
+      <Real>5.2456358414752335e-08</Real>
+      <Real>-0.79465442502648409</Real>
+      <Real>-0.49112352275791088</Real>
+      <Real>0.35682210633554395</Real>
+      <Real>-0.79465443421912996</Real>
+      <Real>0.18759246581169672</Real>
+      <Real>0.57735031162770434</Real>
+      <Real>-0.79465444341177638</Real>
+      <Real>-0.27639310998086691</Real>
+      <Real>-0.85065087452807109</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360690737127242</Real>
+      <Real>-0.52573101980466264</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360681651420888</Real>
+      <Real>0.52573114485870043</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.27639325699069922</Real>
+      <Real>0.85065082676168668</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.30353113023123213</Real>
+      <Real>-0.93417232306880937</Real>
+      <Real>-0.1875924406599985</Real>
+      <Real>-0.79465443246348733</Real>
+      <Real>-0.57735033372812661</Real>
+      <Real>-0.18759244417127635</Real>
+      <Real>0.98224695410165486</Real>
+      <Real>5.2456354487327486e-08</Real>
+      <Real>-0.18759243363744385</Real>
+      <Real>-0.79465450249337599</Real>
+      <Real>0.57735023962202381</Real>
+      <Real>-0.18759243714872095</Real>
+      <Real>0.30353096878717961</Real>
+      <Real>0.93417237552517096</Real>
+      <Real>-0.18759244065999844</Real>
+      <Real>-0.30353088806515</Real>
+      <Real>-0.93417240175334149</Real>
+      <Real>0.1875924406599985</Real>
+      <Real>0.79465453750831549</Real>
+      <Real>-0.5773501925689698</Real>
+      <Real>0.18759243363744388</Real>
+      <Real>-0.98224695276046647</Real>
+      <Real>-5.245635309796613e-08</Real>
+      <Real>0.18759244065999858</Real>
+      <Real>0.79465446747843327</Real>
+      <Real>0.57735028667507615</Real>
+      <Real>0.18759244065999844</Real>
+      <Real>-0.3035310495092069</Real>
+      <Real>0.93417234929699366</Real>
+      <Real>0.18759244065999844</Real>
+      <Real>0.27639333049561254</Real>
+      <Real>-0.85065080287848482</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360677108566906</Real>
+      <Real>-0.52573120738571333</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360686194274337</Real>
+      <Real>0.52573108233168353</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.27639318348578412</Real>
+      <Real>0.85065085064488211</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.18759241592273596</Real>
+      <Real>-0.57735032783760598</Real>
+      <Real>0.79465444341177638</Real>
+      <Real>0.49112354790961382</Real>
+      <Real>-0.35682209218951294</Real>
+      <Real>0.79465442502648398</Real>
+      <Real>-0.60706203601107944</Real>
+      <Real>-5.2456356275319567e-08</Real>
+      <Real>0.79465444341177627</Real>
+      <Real>0.49112349760620688</Real>
+      <Real>0.3568221204815728</Real>
+      <Real>0.79465444341177638</Real>
+      <Real>-0.18759251570065602</Real>
+      <Real>0.57735029541779825</Real>
+      <Real>0.79465444341177627</Real>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>1</Real>
+    </Sequence>
+  </SASA>
+</ReferenceData>
diff --git a/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints42.xml b/src/gromacs/trajectoryanalysis/tests/refdata/SurfaceAreaTest_SurfacePoints42.xml
new file mode 100644 (file)
index 0000000..1f7f0f1
--- /dev/null
@@ -0,0 +1,136 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <SASA Name="Surface">
+    <Real Name="Area">12.566370614359172</Real>
+    <Sequence Name="Dots">
+      <Int Name="Length">126</Int>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>-1</Real>
+      <Real>-0.16245979774638578</Real>
+      <Real>-0.5000000507906408</Real>
+      <Real>-0.85065078811787398</Real>
+      <Real>0.42532547872688431</Real>
+      <Real>-0.30901694746435276</Real>
+      <Real>-0.85065078811787398</Real>
+      <Real>-0.52573114485870054</Real>
+      <Real>0</Real>
+      <Real>-0.85065078811787398</Real>
+      <Real>0.42532542532244111</Real>
+      <Real>0.30901702096927364</Real>
+      <Real>-0.85065078811787398</Real>
+      <Real>-0.16245988415659918</Real>
+      <Real>0.5000000227142638</Real>
+      <Real>-0.85065078811787398</Real>
+      <Real>0.26286568098049856</Real>
+      <Real>-0.80901699825499351</Real>
+      <Real>-0.52573104368787149</Real>
+      <Real>-0.68819095823684195</Real>
+      <Real>-0.50000006214777759</Real>
+      <Real>-0.52573105562946909</Real>
+      <Real>0.85065086540550006</Real>
+      <Real>7.3504917541544756e-08</Real>
+      <Real>-0.52573101980467962</Real>
+      <Real>-0.68819101338354338</Real>
+      <Real>0.50000001135712879</Real>
+      <Real>-0.52573103174627511</Real>
+      <Real>0.26286554116584188</Real>
+      <Real>0.80901704368353733</Real>
+      <Real>-0.52573104368787138</Real>
+      <Real>-0.27639310998086691</Real>
+      <Real>-0.85065087452807109</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360690737127242</Real>
+      <Real>-0.52573101980466264</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>0.72360681651420888</Real>
+      <Real>0.52573114485870043</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>-0.27639325699069922</Real>
+      <Real>0.85065082676168668</Real>
+      <Real>-0.44721352665112024</Real>
+      <Real>1.2961531078992119e-07</Real>
+      <Real>-0.99999999999999167</Real>
+      <Real>5.5511151231257839e-17</Real>
+      <Real>-0.58778516141294568</Real>
+      <Real>-0.80901706040278132</Real>
+      <Real>5.5511151231257827e-17</Real>
+      <Real>0.58778537113492124</Real>
+      <Real>-0.80901690803084136</Real>
+      <Real>-1.1102230246251565e-16</Real>
+      <Real>-0.95105650027381883</Real>
+      <Real>-0.30901704368354138</Real>
+      <Real>1.1102230246251568e-16</Real>
+      <Real>0.95105654032715092</Real>
+      <Real>-0.30901692041205486</Real>
+      <Real>0</Real>
+      <Real>-0.95105652697604204</Real>
+      <Real>0.30901696150255092</Real>
+      <Real>-1.6653345369377348e-16</Real>
+      <Real>0.95105651362493138</Real>
+      <Real>0.30901700259304649</Real>
+      <Real>0</Real>
+      <Real>-0.58778530122760031</Real>
+      <Real>0.80901695882149427</Real>
+      <Real>-1.6653345369377348e-16</Real>
+      <Real>0.58778523132027516</Real>
+      <Real>0.80901700961214085</Real>
+      <Real>0</Real>
+      <Real>-4.3205103550381097e-08</Real>
+      <Real>0.99999999999999911</Real>
+      <Real>0</Real>
+      <Real>0.27639333049561254</Real>
+      <Real>-0.85065080287848482</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360677108566906</Real>
+      <Real>-0.52573120738571333</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.8944272254243314</Real>
+      <Real>0</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.72360686194274337</Real>
+      <Real>0.52573108233168353</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>0.27639318348578412</Real>
+      <Real>0.85065085064488211</Real>
+      <Real>0.44721352665112024</Real>
+      <Real>-0.26286547125851051</Real>
+      <Real>-0.80901706639780024</Real>
+      <Real>0.52573104368787149</Real>
+      <Real>0.68819104095689176</Real>
+      <Real>-0.49999998596180112</Real>
+      <Real>0.52573101980467962</Real>
+      <Real>-0.85065085064487889</Real>
+      <Real>-7.3504916320299429e-08</Real>
+      <Real>0.52573104368787138</Real>
+      <Real>0.68819098581019356</Real>
+      <Real>0.50000003675245419</Real>
+      <Real>0.52573104368787149</Real>
+      <Real>-0.26286561107317141</Real>
+      <Real>0.80901702096926842</Real>
+      <Real>0.52573104368787149</Real>
+      <Real>0.16245992736170423</Real>
+      <Real>-0.50000000867606953</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>-0.42532539862021468</Real>
+      <Real>-0.30901705772173055</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>0.52573114485870043</Real>
+      <Real>0</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>-0.42532545202466426</Real>
+      <Real>0.30901698421681439</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>0.1624598409514931</Real>
+      <Real>0.50000003675245419</Real>
+      <Real>0.85065078811787398</Real>
+      <Real>0</Real>
+      <Real>0</Real>
+      <Real>1</Real>
+    </Sequence>
+  </SASA>
+</ReferenceData>
index 129597991ddff72486a43d1b9b96fcf561dfad38..ca387efd4ceed24b4febbf5111dccd356f39f152 100644 (file)
  *  - Tests for XVG labels.  This is a limitation of the current testing
  *    framework.
  *
- * The actual surface area algorithm should be tested separately with a more
- * extensive set of data, but those fit better as a separate set of unit tests.
+ * The actual surface area algorithm is tested separately in surfacearea.cpp.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/trajectoryanalysis/modules/sasa.h"
 
+#include <gtest/gtest.h>
+
 #include "testutils/cmdlinetest.h"
 #include "testutils/testasserts.h"
 
@@ -67,10 +68,10 @@ namespace
 using gmx::test::CommandLine;
 
 /********************************************************************
- * Tests for gmx::analysismodules::Sas.
+ * Tests for gmx::analysismodules::Sasa.
  */
 
-//! Test fixture for the select analysis module.
+//! Test fixture for the `sasa` analysis module.
 typedef gmx::test::TrajectoryAnalysisModuleTestFixture<gmx::analysismodules::SasaInfo>
     SasaModuleTest;
 
index 0b101b29c7193d98899b0412ae7079980819a8b4..05a24a4707aed057f5583427175a7a749f72b97d 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
-#include <gtest/gtest.h>
+#include "gmxpre.h"
 
 #include "gromacs/trajectoryanalysis/modules/select.h"
 
+#include <gtest/gtest.h>
+
 #include "testutils/cmdlinetest.h"
 
 #include "moduletest.h"
diff --git a/src/gromacs/trajectoryanalysis/tests/spc216.gro b/src/gromacs/trajectoryanalysis/tests/spc216.gro
new file mode 100644 (file)
index 0000000..49449af
--- /dev/null
@@ -0,0 +1,651 @@
+216H2O,WATJP01,SPC216,SPC-MODEL,300K,BOX(M)=1.86206NM,WFVG,MAR. 1984
+  648
+    1SOL     OW    1    .230    .628    .113
+    1SOL    HW1    2    .137    .626    .150
+    1SOL    HW2    3    .231    .589    .021
+    2SOL     OW    4    .225    .275   -.866
+    2SOL    HW1    5    .260    .258   -.774
+    2SOL    HW2    6    .137    .230   -.878
+    3SOL     OW    7    .019    .368    .647
+    3SOL    HW1    8   -.063    .411    .686
+    3SOL    HW2    9   -.009    .295    .584
+    4SOL     OW   10    .569   -.587   -.697
+    4SOL    HW1   11    .476   -.594   -.734
+    4SOL    HW2   12    .580   -.498   -.653
+    5SOL     OW   13   -.307   -.351    .703
+    5SOL    HW1   14   -.364   -.367    .784
+    5SOL    HW2   15   -.366   -.341    .623
+    6SOL     OW   16   -.119    .618    .856
+    6SOL    HW1   17   -.086    .712    .856
+    6SOL    HW2   18   -.068    .564    .922
+    7SOL     OW   19   -.727    .703    .717
+    7SOL    HW1   20   -.670    .781    .692
+    7SOL    HW2   21   -.787    .729    .793
+    8SOL     OW   22   -.107    .607    .231
+    8SOL    HW1   23   -.119    .594    .132
+    8SOL    HW2   24   -.137    .526    .280
+    9SOL     OW   25    .768   -.718   -.839
+    9SOL    HW1   26    .690   -.701   -.779
+    9SOL    HW2   27    .802   -.631   -.875
+   10SOL     OW   28    .850    .798   -.039
+   10SOL    HW1   29    .846    .874    .026
+   10SOL    HW2   30    .872    .834   -.130
+   11SOL     OW   31    .685   -.850    .665
+   11SOL    HW1   32    .754   -.866    .735
+   11SOL    HW2   33    .612   -.793    .703
+   12SOL     OW   34    .686   -.701   -.059
+   12SOL    HW1   35    .746   -.622   -.045
+   12SOL    HW2   36    .600   -.670   -.100
+   13SOL     OW   37    .335   -.427   -.801
+   13SOL    HW1   38    .257   -.458   -.854
+   13SOL    HW2   39    .393   -.369   -.858
+   14SOL     OW   40   -.402   -.357   -.523
+   14SOL    HW1   41   -.378   -.263   -.497
+   14SOL    HW2   42   -.418   -.411   -.441
+   15SOL     OW   43    .438    .392   -.363
+   15SOL    HW1   44    .520    .336   -.354
+   15SOL    HW2   45    .357    .334   -.359
+   16SOL     OW   46   -.259    .447    .737
+   16SOL    HW1   47   -.333    .493    .687
+   16SOL    HW2   48   -.208    .515    .790
+   17SOL     OW   49    .231   -.149    .483
+   17SOL    HW1   50    .265   -.072    .537
+   17SOL    HW2   51    .275   -.149    .393
+   18SOL     OW   52   -.735   -.521   -.172
+   18SOL    HW1   53   -.688   -.521   -.084
+   18SOL    HW2   54   -.783   -.608   -.183
+   19SOL     OW   55    .230   -.428    .538
+   19SOL    HW1   56    .204   -.332    .538
+   19SOL    HW2   57    .159   -.482    .583
+   20SOL     OW   58    .240   -.771    .886
+   20SOL    HW1   59    .254   -.855    .938
+   20SOL    HW2   60    .185   -.707    .941
+   21SOL     OW   61    .620   -.076   -.423
+   21SOL    HW1   62    .528   -.093   -.388
+   21SOL    HW2   63    .648    .016   -.397
+   22SOL     OW   64    .606   -.898    .123
+   22SOL    HW1   65    .613   -.814    .069
+   22SOL    HW2   66    .652   -.885    .211
+   23SOL     OW   67   -.268    .114   -.382
+   23SOL    HW1   68   -.286    .181   -.454
+   23SOL    HW2   69   -.271    .160   -.293
+   24SOL     OW   70    .122    .643    .563
+   24SOL    HW1   71    .077    .555    .580
+   24SOL    HW2   72    .121    .697    .647
+   25SOL     OW   73   -.020   -.095    .359
+   25SOL    HW1   74    .034   -.124    .439
+   25SOL    HW2   75    .010   -.005    .330
+   26SOL     OW   76    .027   -.266    .117
+   26SOL    HW1   77    .008   -.362    .138
+   26SOL    HW2   78   -.006   -.208    .192
+   27SOL     OW   79   -.173    .922    .612
+   27SOL    HW1   80   -.078    .893    .620
+   27SOL    HW2   81   -.181    .987    .537
+   28SOL     OW   82   -.221   -.754    .432
+   28SOL    HW1   83   -.135   -.752    .380
+   28SOL    HW2   84   -.207   -.707    .520
+   29SOL     OW   85    .113    .737   -.265
+   29SOL    HW1   86    .201    .724   -.220
+   29SOL    HW2   87    .100    .834   -.287
+   30SOL     OW   88    .613   -.497    .726
+   30SOL    HW1   89    .564   -.584    .735
+   30SOL    HW2   90    .590   -.454    .639
+   31SOL     OW   91   -.569   -.634   -.439
+   31SOL    HW1   92   -.532   -.707   -.497
+   31SOL    HW2   93   -.517   -.629   -.354
+   32SOL     OW   94    .809    .004    .502
+   32SOL    HW1   95    .849    .095    .493
+   32SOL    HW2   96    .709    .012    .508
+   33SOL     OW   97    .197   -.886   -.598
+   33SOL    HW1   98    .286   -.931   -.612
+   33SOL    HW2   99    .124   -.951   -.617
+   34SOL     OW  100   -.337   -.863    .190
+   34SOL    HW1  101   -.400   -.939    .203
+   34SOL    HW2  102   -.289   -.845    .276
+   35SOL     OW  103   -.675   -.070   -.246
+   35SOL    HW1  104   -.651   -.010   -.322
+   35SOL    HW2  105   -.668   -.165   -.276
+   36SOL     OW  106    .317    .251   -.061
+   36SOL    HW1  107    .388    .322   -.055
+   36SOL    HW2  108    .229    .290   -.033
+   37SOL     OW  109   -.396   -.445   -.909
+   37SOL    HW1  110   -.455   -.439   -.829
+   37SOL    HW2  111   -.411   -.533   -.955
+   38SOL     OW  112   -.195   -.148    .572
+   38SOL    HW1  113   -.236   -.171    .484
+   38SOL    HW2  114   -.213   -.222    .637
+   39SOL     OW  115    .598    .729    .270
+   39SOL    HW1  116    .622    .798    .202
+   39SOL    HW2  117    .520    .762    .324
+   40SOL     OW  118   -.581    .345   -.918
+   40SOL    HW1  119   -.667    .295   -.931
+   40SOL    HW2  120   -.519    .291   -.862
+   41SOL     OW  121   -.286   -.200    .307
+   41SOL    HW1  122   -.197   -.154    .310
+   41SOL    HW2  123   -.307   -.224    .212
+   42SOL     OW  124    .807    .605   -.397
+   42SOL    HW1  125    .760    .602   -.308
+   42SOL    HW2  126    .756    .550   -.463
+   43SOL     OW  127   -.468    .469   -.188
+   43SOL    HW1  128   -.488    .512   -.100
+   43SOL    HW2  129   -.390    .407   -.179
+   44SOL     OW  130   -.889    .890   -.290
+   44SOL    HW1  131   -.843    .806   -.319
+   44SOL    HW2  132   -.945    .924   -.365
+   45SOL     OW  133   -.871    .410   -.620
+   45SOL    HW1  134   -.948    .444   -.566
+   45SOL    HW2  135   -.905    .359   -.699
+   46SOL     OW  136   -.821    .701    .429
+   46SOL    HW1  137   -.795    .697    .525
+   46SOL    HW2  138   -.906    .650    .415
+   47SOL     OW  139    .076    .811    .789
+   47SOL    HW1  140    .175    .799    .798
+   47SOL    HW2  141    .052    .906    .810
+   48SOL     OW  142    .130   -.041   -.291
+   48SOL    HW1  143    .120   -.056   -.192
+   48SOL    HW2  144    .044   -.005   -.327
+   49SOL     OW  145    .865    .348    .195
+   49SOL    HW1  146    .924    .411    .146
+   49SOL    HW2  147    .884    .254    .166
+   50SOL     OW  148   -.143    .585   -.031
+   50SOL    HW1  149   -.169    .674   -.067
+   50SOL    HW2  150   -.145    .517   -.104
+   51SOL     OW  151   -.500   -.718    .545
+   51SOL    HW1  152   -.417   -.747    .497
+   51SOL    HW2  153   -.549   -.651    .489
+   52SOL     OW  154    .550    .196    .885
+   52SOL    HW1  155    .545    .191    .985
+   52SOL    HW2  156    .552    .292    .856
+   53SOL     OW  157   -.854   -.406    .477
+   53SOL    HW1  158   -.900   -.334    .425
+   53SOL    HW2  159   -.858   -.386    .575
+   54SOL     OW  160    .351   -.061    .853
+   54SOL    HW1  161    .401   -.147    .859
+   54SOL    HW2  162    .416    .016    .850
+   55SOL     OW  163   -.067   -.796    .873
+   55SOL    HW1  164   -.129   -.811    .797
+   55SOL    HW2  165   -.119   -.785    .958
+   56SOL     OW  166   -.635   -.312   -.356
+   56SOL    HW1  167   -.629   -.389   -.292
+   56SOL    HW2  168   -.687   -.338   -.436
+   57SOL     OW  169    .321   -.919    .242
+   57SOL    HW1  170    .403   -.880    .200
+   57SOL    HW2  171    .294  -1.001    .193
+   58SOL     OW  172   -.404    .735    .728
+   58SOL    HW1  173   -.409    .670    .803
+   58SOL    HW2  174   -.324    .794    .741
+   59SOL     OW  175    .461   -.596   -.135
+   59SOL    HW1  176    .411   -.595   -.221
+   59SOL    HW2  177    .398   -.614   -.059
+   60SOL     OW  178   -.751   -.086    .237
+   60SOL    HW1  179   -.811   -.148    .287
+   60SOL    HW2  180   -.720   -.130    .152
+   61SOL     OW  181    .202    .285   -.364
+   61SOL    HW1  182    .122    .345   -.377
+   61SOL    HW2  183    .192    .236   -.278
+   62SOL     OW  184   -.230   -.485    .081
+   62SOL    HW1  185   -.262   -.391    .071
+   62SOL    HW2  186   -.306   -.548    .069
+   63SOL     OW  187    .464   -.119    .323
+   63SOL    HW1  188    .497   -.080    .409
+   63SOL    HW2  189    .540   -.126    .258
+   64SOL     OW  190   -.462    .107    .426
+   64SOL    HW1  191   -.486    .070    .336
+   64SOL    HW2  192   -.363    .123    .430
+   65SOL     OW  193    .249   -.077   -.621
+   65SOL    HW1  194    .306   -.142   -.571
+   65SOL    HW2  195    .233   -.110   -.714
+   66SOL     OW  196   -.922   -.164    .904
+   66SOL    HW1  197   -.842   -.221    .925
+   66SOL    HW2  198   -.971   -.204    .827
+   67SOL     OW  199    .382    .700    .480
+   67SOL    HW1  200    .427    .610    .477
+   67SOL    HW2  201    .288    .689    .513
+   68SOL     OW  202   -.315    .222   -.133
+   68SOL    HW1  203   -.320    .259   -.041
+   68SOL    HW2  204   -.387    .153   -.145
+   69SOL     OW  205    .614    .122    .117
+   69SOL    HW1  206    .712    .100    .124
+   69SOL    HW2  207    .583    .105    .024
+   70SOL     OW  208    .781    .264   -.113
+   70SOL    HW1  209    .848    .203   -.070
+   70SOL    HW2  210    .708    .283   -.048
+   71SOL     OW  211    .888   -.348   -.667
+   71SOL    HW1  212    .865   -.373   -.761
+   71SOL    HW2  213    .949   -.417   -.628
+   72SOL     OW  214   -.511    .590   -.429
+   72SOL    HW1  215   -.483    .547   -.344
+   72SOL    HW2  216   -.486    .686   -.428
+   73SOL     OW  217    .803   -.460    .924
+   73SOL    HW1  218    .893   -.446    .882
+   73SOL    HW2  219    .732   -.458    .853
+   74SOL     OW  220    .922    .503    .899
+   74SOL    HW1  221    .897    .494    .803
+   74SOL    HW2  222    .970    .421    .930
+   75SOL     OW  223    .539    .064    .512
+   75SOL    HW1  224    .458    .065    .570
+   75SOL    HW2  225    .542    .147    .457
+   76SOL     OW  226   -.428   -.674    .041
+   76SOL    HW1  227   -.396   -.750    .098
+   76SOL    HW2  228   -.520   -.647    .071
+   77SOL     OW  229    .297    .035    .171
+   77SOL    HW1  230    .346    .119    .150
+   77SOL    HW2  231    .359   -.030    .216
+   78SOL     OW  232   -.927    .236    .480
+   78SOL    HW1  233   -.975    .277    .402
+   78SOL    HW2  234   -.828    .234    .461
+   79SOL     OW  235   -.786    .683   -.398
+   79SOL    HW1  236   -.866    .622   -.395
+   79SOL    HW2  237   -.705    .630   -.422
+   80SOL     OW  238   -.635   -.292    .793
+   80SOL    HW1  239   -.614   -.218    .728
+   80SOL    HW2  240   -.567   -.292    .866
+   81SOL     OW  241    .459   -.710    .741
+   81SOL    HW1  242    .388   -.737    .806
+   81SOL    HW2  243    .433   -.738    .648
+   82SOL     OW  244   -.591   -.065    .591
+   82SOL    HW1  245   -.547   -.001    .527
+   82SOL    HW2  246   -.641   -.013    .661
+   83SOL     OW  247   -.830    .549    .016
+   83SOL    HW1  248   -.871    .631   -.023
+   83SOL    HW2  249   -.766    .575    .089
+   84SOL     OW  250    .078    .556   -.476
+   84SOL    HW1  251    .170    .555   -.517
+   84SOL    HW2  252    .072    .630   -.409
+   85SOL     OW  253    .561    .222   -.715
+   85SOL    HW1  254    .599    .138   -.678
+   85SOL    HW2  255    .473    .241   -.671
+   86SOL     OW  256    .866    .454    .642
+   86SOL    HW1  257    .834    .526    .580
+   86SOL    HW2  258    .890    .373    .589
+   87SOL     OW  259   -.845    .039    .753
+   87SOL    HW1  260   -.917    .044    .684
+   87SOL    HW2  261   -.869   -.030    .822
+   88SOL     OW  262   -.433   -.689    .867
+   88SOL    HW1  263   -.488   -.773    .860
+   88SOL    HW2  264   -.407   -.660    .775
+   89SOL     OW  265   -.396    .590   -.870
+   89SOL    HW1  266   -.426    .495   -.863
+   89SOL    HW2  267   -.323    .606   -.804
+   90SOL     OW  268   -.005    .833    .377
+   90SOL    HW1  269    .037    .769    .441
+   90SOL    HW2  270   -.043    .782    .299
+   91SOL     OW  271    .488   -.477    .174
+   91SOL    HW1  272    .401   -.492    .221
+   91SOL    HW2  273    .471   -.451    .079
+   92SOL     OW  274   -.198   -.582    .657
+   92SOL    HW1  275   -.099   -.574    .671
+   92SOL    HW2  276   -.243   -.498    .688
+   93SOL     OW  277   -.472    .575    .078
+   93SOL    HW1  278   -.526    .554    .159
+   93SOL    HW2  279   -.381    .534    .087
+   94SOL     OW  280    .527    .256    .328
+   94SOL    HW1  281    .554    .197    .253
+   94SOL    HW2  282    .527    .351    .297
+   95SOL     OW  283   -.108   -.639   -.274
+   95SOL    HW1  284   -.017   -.678   -.287
+   95SOL    HW2  285   -.100   -.543   -.250
+   96SOL     OW  286   -.798   -.515   -.522
+   96SOL    HW1  287   -.878   -.538   -.467
+   96SOL    HW2  288   -.715   -.541   -.473
+   97SOL     OW  289   -.270   -.233   -.237
+   97SOL    HW1  290   -.243   -.199   -.327
+   97SOL    HW2  291   -.191   -.271   -.191
+   98SOL     OW  292   -.751   -.667   -.762
+   98SOL    HW1  293   -.791   -.623   -.681
+   98SOL    HW2  294   -.792   -.630   -.845
+   99SOL     OW  295   -.224   -.763   -.783
+   99SOL    HW1  296   -.219   -.682   -.724
+   99SOL    HW2  297   -.310   -.761   -.834
+  100SOL     OW  298    .915    .089   -.460
+  100SOL    HW1  299    .940    .069   -.555
+  100SOL    HW2  300    .987    .145   -.418
+  101SOL     OW  301   -.882   -.746   -.143
+  101SOL    HW1  302   -.981   -.740   -.133
+  101SOL    HW2  303   -.859   -.826   -.199
+  102SOL     OW  304    .705   -.812    .368
+  102SOL    HW1  305    .691   -.805    .467
+  102SOL    HW2  306    .789   -.863    .350
+  103SOL     OW  307    .410    .813   -.611
+  103SOL    HW1  308    .496    .825   -.561
+  103SOL    HW2  309    .368    .726   -.584
+  104SOL     OW  310   -.588    .386   -.600
+  104SOL    HW1  311   -.567    .460   -.536
+  104SOL    HW2  312   -.677    .403   -.643
+  105SOL     OW  313    .064   -.298   -.531
+  105SOL    HW1  314    .018   -.216   -.565
+  105SOL    HW2  315    .162   -.279   -.522
+  106SOL     OW  316    .367   -.762    .501
+  106SOL    HW1  317    .360   -.679    .445
+  106SOL    HW2  318    .371   -.842    .441
+  107SOL     OW  319    .566    .537    .865
+  107SOL    HW1  320    .578    .603    .791
+  107SOL    HW2  321    .612    .571    .948
+  108SOL     OW  322   -.610   -.514    .388
+  108SOL    HW1  323   -.560   -.437    .428
+  108SOL    HW2  324   -.705   -.512    .420
+  109SOL     OW  325   -.590   -.417   -.720
+  109SOL    HW1  326   -.543   -.404   -.633
+  109SOL    HW2  327   -.656   -.491   -.711
+  110SOL     OW  328   -.280    .639    .472
+  110SOL    HW1  329   -.311    .700    .545
+  110SOL    HW2  330   -.230    .691    .403
+  111SOL     OW  331    .354   -.352   -.533
+  111SOL    HW1  332    .333   -.396   -.620
+  111SOL    HW2  333    .451   -.326   -.530
+  112SOL     OW  334    .402    .751   -.264
+  112SOL    HW1  335    .470    .806   -.311
+  112SOL    HW2  336    .442    .663   -.237
+  113SOL     OW  337   -.275    .779   -.192
+  113SOL    HW1  338   -.367    .817   -.197
+  113SOL    HW2  339   -.215    .826   -.257
+  114SOL     OW  340   -.849    .105   -.092
+  114SOL    HW1  341   -.843    .190   -.144
+  114SOL    HW2  342   -.817    .029   -.149
+  115SOL     OW  343    .504    .050   -.122
+  115SOL    HW1  344    .462   -.007   -.192
+  115SOL    HW2  345    .438    .119   -.090
+  116SOL     OW  346    .573    .870   -.833
+  116SOL    HW1  347    .617    .959   -.842
+  116SOL    HW2  348    .510    .870   -.756
+  117SOL     OW  349   -.502    .862   -.817
+  117SOL    HW1  350   -.577    .862   -.883
+  117SOL    HW2  351   -.465    .770   -.808
+  118SOL     OW  352   -.653    .525    .275
+  118SOL    HW1  353   -.640    .441    .329
+  118SOL    HW2  354   -.682    .599    .335
+  119SOL     OW  355    .307    .213   -.631
+  119SOL    HW1  356    .284    .250   -.541
+  119SOL    HW2  357    .277    .118   -.637
+  120SOL     OW  358    .037   -.552   -.580
+  120SOL    HW1  359    .090   -.601   -.512
+  120SOL    HW2  360    .059   -.454   -.575
+  121SOL     OW  361    .732    .634   -.798
+  121SOL    HW1  362    .791    .608   -.874
+  121SOL    HW2  363    .704    .730   -.809
+  122SOL     OW  364   -.134   -.927   -.008
+  122SOL    HW1  365   -.180   -.934   -.097
+  122SOL    HW2  366   -.196   -.883    .058
+  123SOL     OW  367    .307    .063    .618
+  123SOL    HW1  368    .296    .157    .651
+  123SOL    HW2  369    .302   -.000    .695
+  124SOL     OW  370   -.240    .367    .374
+  124SOL    HW1  371   -.238    .291    .438
+  124SOL    HW2  372   -.288    .444    .414
+  125SOL     OW  373   -.839    .766   -.896
+  125SOL    HW1  374   -.824    .787   -.800
+  125SOL    HW2  375   -.869    .671   -.905
+  126SOL     OW  376   -.882   -.289   -.162
+  126SOL    HW1  377   -.902   -.245   -.250
+  126SOL    HW2  378   -.843   -.380   -.178
+  127SOL     OW  379   -.003   -.344   -.257
+  127SOL    HW1  380    .011   -.317   -.352
+  127SOL    HW2  381    .080   -.322   -.204
+  128SOL     OW  382    .350    .898   -.058
+  128SOL    HW1  383    .426    .942   -.010
+  128SOL    HW2  384    .385    .851   -.140
+  129SOL     OW  385   -.322    .274    .125
+  129SOL    HW1  386   -.383    .199    .148
+  129SOL    HW2  387   -.300    .326    .208
+  130SOL     OW  388   -.559    .838    .042
+  130SOL    HW1  389   -.525    .745    .057
+  130SOL    HW2  390   -.541    .865   -.053
+  131SOL     OW  391   -.794   -.529    .849
+  131SOL    HW1  392   -.787   -.613    .794
+  131SOL    HW2  393   -.732   -.460    .813
+  132SOL     OW  394    .319    .810   -.913
+  132SOL    HW1  395    .412    .846   -.908
+  132SOL    HW2  396    .313    .725   -.861
+  133SOL     OW  397    .339    .509   -.856
+  133SOL    HW1  398    .287    .426   -.873
+  133SOL    HW2  399    .416    .514   -.920
+  134SOL     OW  400    .511    .415   -.054
+  134SOL    HW1  401    .493    .460    .034
+  134SOL    HW2  402    .553    .480   -.117
+  135SOL     OW  403   -.724    .380   -.184
+  135SOL    HW1  404   -.769    .443   -.120
+  135SOL    HW2  405   -.631    .411   -.201
+  136SOL     OW  406   -.702    .207   -.385
+  136SOL    HW1  407   -.702    .271   -.308
+  136SOL    HW2  408   -.674    .255   -.468
+  137SOL     OW  409    .008   -.536    .200
+  137SOL    HW1  410   -.085   -.515    .169
+  137SOL    HW2  411    .018   -.635    .213
+  138SOL     OW  412    .088   -.061    .927
+  138SOL    HW1  413    .046   -.147    .900
+  138SOL    HW2  414    .182   -.058    .893
+  139SOL     OW  415    .504   -.294    .910
+  139SOL    HW1  416    .570   -.220    .919
+  139SOL    HW2  417    .548   -.373    .868
+  140SOL     OW  418   -.860    .796   -.624
+  140SOL    HW1  419   -.819    .764   -.538
+  140SOL    HW2  420   -.956    .769   -.627
+  141SOL     OW  421    .040    .544   -.748
+  141SOL    HW1  422    .125    .511   -.789
+  141SOL    HW2  423    .053    .559   -.650
+  142SOL     OW  424    .189    .520   -.140
+  142SOL    HW1  425    .248    .480   -.210
+  142SOL    HW2  426    .131    .591   -.181
+  143SOL     OW  427   -.493   -.912   -.202
+  143SOL    HW1  428   -.454   -.823   -.182
+  143SOL    HW2  429   -.483   -.932   -.299
+  144SOL     OW  430    .815    .572    .325
+  144SOL    HW1  431    .822    .483    .279
+  144SOL    HW2  432    .721    .606    .317
+  145SOL     OW  433   -.205    .604   -.656
+  145SOL    HW1  434   -.243    .535   -.594
+  145SOL    HW2  435   -.123    .568   -.700
+  146SOL     OW  436    .252   -.298   -.118
+  146SOL    HW1  437    .222   -.241   -.042
+  146SOL    HW2  438    .245   -.395   -.092
+  147SOL     OW  439    .671    .464   -.593
+  147SOL    HW1  440    .637    .375   -.623
+  147SOL    HW2  441    .697    .518   -.673
+  148SOL     OW  442    .930   -.184   -.397
+  148SOL    HW1  443    .906   -.202   -.492
+  148SOL    HW2  444    .960   -.090   -.387
+  149SOL     OW  445    .473    .500    .191
+  149SOL    HW1  446    .534    .580    .195
+  149SOL    HW2  447    .378    .531    .198
+  150SOL     OW  448    .159   -.725   -.396
+  150SOL    HW1  449    .181   -.786   -.320
+  150SOL    HW2  450    .169   -.774   -.482
+  151SOL     OW  451   -.515   -.803   -.628
+  151SOL    HW1  452   -.491   -.866   -.702
+  151SOL    HW2  453   -.605   -.763   -.646
+  152SOL     OW  454   -.560    .855    .309
+  152SOL    HW1  455   -.646    .824    .351
+  152SOL    HW2  456   -.564    .841    .210
+  153SOL     OW  457   -.103   -.115   -.708
+  153SOL    HW1  458   -.042   -.085   -.781
+  153SOL    HW2  459   -.141   -.204   -.730
+  154SOL     OW  460   -.610   -.131   -.734
+  154SOL    HW1  461   -.526   -.126   -.788
+  154SOL    HW2  462   -.633   -.227   -.716
+  155SOL     OW  463    .083   -.604   -.840
+  155SOL    HW1  464    .078   -.605   -.740
+  155SOL    HW2  465    .000   -.645   -.878
+  156SOL     OW  466    .688   -.200   -.146
+  156SOL    HW1  467    .632   -.119   -.137
+  156SOL    HW2  468    .740   -.196   -.232
+  157SOL     OW  469    .903    .086    .133
+  157SOL    HW1  470    .954    .087    .047
+  157SOL    HW2  471    .959    .044    .204
+  158SOL     OW  472   -.136    .135    .523
+  158SOL    HW1  473   -.063    .118    .456
+  158SOL    HW2  474   -.167    .048    .561
+  159SOL     OW  475   -.474   -.289    .477
+  159SOL    HW1  476   -.407   -.277    .403
+  159SOL    HW2  477   -.514   -.200    .500
+  160SOL     OW  478    .130   -.068   -.011
+  160SOL    HW1  479    .089   -.142    .042
+  160SOL    HW2  480    .194   -.017    .047
+  161SOL     OW  481   -.582    .927    .672
+  161SOL    HW1  482   -.522    .846    .674
+  161SOL    HW2  483   -.542    .996    .612
+  162SOL     OW  484    .830   -.589   -.440
+  162SOL    HW1  485    .825   -.556   -.345
+  162SOL    HW2  486    .744   -.570   -.486
+  163SOL     OW  487    .672   -.246    .154
+  163SOL    HW1  488    .681   -.236    .055
+  163SOL    HW2  489    .632   -.335    .175
+  164SOL     OW  490   -.212   -.142   -.468
+  164SOL    HW1  491   -.159   -.132   -.552
+  164SOL    HW2  492   -.239   -.052   -.434
+  165SOL     OW  493   -.021    .175   -.899
+  165SOL    HW1  494    .018    .090   -.935
+  165SOL    HW2  495   -.119    .177   -.918
+  166SOL     OW  496    .263    .326    .720
+  166SOL    HW1  497    .184    .377    .686
+  166SOL    HW2  498    .254    .311    .818
+  167SOL     OW  499   -.668   -.250    .031
+  167SOL    HW1  500   -.662   -.343    .068
+  167SOL    HW2  501   -.727   -.250   -.049
+  168SOL     OW  502    .822   -.860   -.490
+  168SOL    HW1  503    .862   -.861   -.582
+  168SOL    HW2  504    .832   -.768   -.450
+  169SOL     OW  505    .916    .910    .291
+  169SOL    HW1  506    .979    .948    .223
+  169SOL    HW2  507    .956    .827    .330
+  170SOL     OW  508   -.358   -.255    .044
+  170SOL    HW1  509   -.450   -.218    .051
+  170SOL    HW2  510   -.320   -.235   -.046
+  171SOL     OW  511    .372   -.574   -.372
+  171SOL    HW1  512    .359   -.481   -.406
+  171SOL    HW2  513    .288   -.626   -.385
+  172SOL     OW  514   -.248   -.570   -.573
+  172SOL    HW1  515   -.188   -.567   -.493
+  172SOL    HW2  516   -.323   -.506   -.560
+  173SOL     OW  517   -.823   -.764    .696
+  173SOL    HW1  518   -.893   -.811    .750
+  173SOL    HW2  519   -.764   -.832    .653
+  174SOL     OW  520   -.848    .236   -.891
+  174SOL    HW1  521   -.856    .200   -.984
+  174SOL    HW2  522   -.850    .160   -.826
+  175SOL     OW  523    .590   -.375    .491
+  175SOL    HW1  524    .632   -.433    .421
+  175SOL    HW2  525    .546   -.296    .447
+  176SOL     OW  526   -.153    .385   -.481
+  176SOL    HW1  527   -.080    .454   -.477
+  176SOL    HW2  528   -.125    .310   -.540
+  177SOL     OW  529    .255   -.514    .290
+  177SOL    HW1  530    .159   -.513    .263
+  177SOL    HW2  531    .267   -.461    .374
+  178SOL     OW  532    .105   -.849   -.136
+  178SOL    HW1  533    .028   -.882   -.082
+  178SOL    HW2  534    .190   -.879   -.094
+  179SOL     OW  535    .672    .203   -.373
+  179SOL    HW1  536    .762    .187   -.413
+  179SOL    HW2  537    .680    .208   -.274
+  180SOL     OW  538    .075    .345    .033
+  180SOL    HW1  539   -.017    .317    .004
+  180SOL    HW2  540    .106    .422   -.023
+  181SOL     OW  541   -.422    .856   -.464
+  181SOL    HW1  542   -.479    .908   -.527
+  181SOL    HW2  543   -.326    .868   -.488
+  182SOL     OW  544    .072    .166    .318
+  182SOL    HW1  545    .055    .249    .264
+  182SOL    HW2  546    .162    .129    .296
+  183SOL     OW  547   -.679   -.527    .119
+  183SOL    HW1  548   -.778   -.538    .121
+  183SOL    HW2  549   -.645   -.512    .212
+  184SOL     OW  550    .613    .842   -.431
+  184SOL    HW1  551    .669    .923   -.448
+  184SOL    HW2  552    .672    .762   -.428
+  185SOL     OW  553   -.369   -.095   -.903
+  185SOL    HW1  554   -.336   -.031   -.972
+  185SOL    HW2  555   -.303   -.101   -.828
+  186SOL     OW  556    .716    .565   -.154
+  186SOL    HW1  557    .735    .630   -.080
+  186SOL    HW2  558    .776    .485   -.145
+  187SOL     OW  559   -.412   -.642   -.229
+  187SOL    HW1  560   -.421   -.652   -.130
+  187SOL    HW2  561   -.316   -.649   -.255
+  188SOL     OW  562    .390   -.121   -.302
+  188SOL    HW1  563    .299   -.080   -.304
+  188SOL    HW2  564    .383   -.215   -.270
+  189SOL     OW  565   -.188    .883   -.608
+  189SOL    HW1  566   -.215    .794   -.645
+  189SOL    HW2  567   -.187    .951   -.681
+  190SOL     OW  568   -.637    .325    .449
+  190SOL    HW1  569   -.572    .251    .438
+  190SOL    HW2  570   -.617    .375    .533
+  191SOL     OW  571    .594    .745    .652
+  191SOL    HW1  572    .644    .830    .633
+  191SOL    HW2  573    .506    .747    .604
+  192SOL     OW  574   -.085    .342   -.220
+  192SOL    HW1  575   -.102    .373   -.314
+  192SOL    HW2  576   -.169    .305   -.182
+  193SOL     OW  577   -.132   -.928   -.345
+  193SOL    HW1  578   -.094   -.837   -.330
+  193SOL    HW2  579   -.140   -.945   -.444
+  194SOL     OW  580    .859   -.488    .016
+  194SOL    HW1  581    .813   -.473    .104
+  194SOL    HW2  582    .903   -.403   -.014
+  195SOL     OW  583    .661   -.072   -.909
+  195SOL    HW1  584    .615    .016   -.922
+  195SOL    HW2  585    .760   -.060   -.916
+  196SOL     OW  586   -.454   -.011   -.142
+  196SOL    HW1  587   -.550   -.022   -.169
+  196SOL    HW2  588   -.398   -.078   -.190
+  197SOL     OW  589    .859   -.906    .861
+  197SOL    HW1  590    .913   -.975    .909
+  197SOL    HW2  591    .827   -.837    .927
+  198SOL     OW  592   -.779   -.878    .087
+  198SOL    HW1  593   -.802   -.825    .005
+  198SOL    HW2  594   -.698   -.934    .068
+  199SOL     OW  595   -.001   -.293    .851
+  199SOL    HW1  596   -.072   -.305    .781
+  199SOL    HW2  597    .000   -.372    .911
+  200SOL     OW  598    .221   -.548   -.018
+  200SOL    HW1  599    .156   -.621   -.039
+  200SOL    HW2  600    .225   -.534    .080
+  201SOL     OW  601    .079   -.622    .653
+  201SOL    HW1  602    .078   -.669    .741
+  201SOL    HW2  603    .161   -.650    .602
+  202SOL     OW  604    .672   -.471   -.238
+  202SOL    HW1  605    .594   -.521   -.200
+  202SOL    HW2  606    .669   -.376   -.207
+  203SOL     OW  607   -.038    .192   -.635
+  203SOL    HW1  608   -.042    .102   -.591
+  203SOL    HW2  609   -.035    .181   -.734
+  204SOL     OW  610    .428    .424    .520
+  204SOL    HW1  611    .458    .352    .458
+  204SOL    HW2  612    .389    .384    .603
+  205SOL     OW  613   -.157   -.375   -.758
+  205SOL    HW1  614   -.250   -.400   -.785
+  205SOL    HW2  615   -.131   -.425   -.676
+  206SOL     OW  616    .317    .547   -.582
+  206SOL    HW1  617    .355    .488   -.510
+  206SOL    HW2  618    .357    .521   -.670
+  207SOL     OW  619    .812   -.276    .687
+  207SOL    HW1  620    .844   -.266    .593
+  207SOL    HW2  621    .733   -.338    .689
+  208SOL     OW  622   -.438    .214   -.750
+  208SOL    HW1  623   -.386    .149   -.695
+  208SOL    HW2  624   -.487    .277   -.689
+  209SOL     OW  625   -.861    .034   -.708
+  209SOL    HW1  626   -.924   -.038   -.739
+  209SOL    HW2  627   -.768   -.002   -.708
+  210SOL     OW  628    .770   -.532    .301
+  210SOL    HW1  629    .724   -.619    .318
+  210SOL    HW2  630    .861   -.535    .342
+  211SOL     OW  631    .618   -.295   -.578
+  211SOL    HW1  632    .613   -.213   -.521
+  211SOL    HW2  633    .707   -.298   -.623
+  212SOL     OW  634   -.510    .052    .168
+  212SOL    HW1  635   -.475    .011    .084
+  212SOL    HW2  636   -.600    .014    .188
+  213SOL     OW  637   -.562    .453    .691
+  213SOL    HW1  638   -.621    .533    .695
+  213SOL    HW2  639   -.547    .418    .784
+  214SOL     OW  640   -.269    .221    .882
+  214SOL    HW1  641   -.353    .220    .936
+  214SOL    HW2  642   -.267    .304    .826
+  215SOL     OW  643    .039   -.785    .300
+  215SOL    HW1  644    .138   -.796    .291
+  215SOL    HW2  645   -.001   -.871    .332
+  216SOL     OW  646    .875   -.216    .337
+  216SOL    HW1  647    .798   -.251    .283
+  216SOL    HW2  648    .843   -.145    .399
+   1.86206   1.86206   1.86206
diff --git a/src/gromacs/trajectoryanalysis/tests/surfacearea.cpp b/src/gromacs/trajectoryanalysis/tests/surfacearea.cpp
new file mode 100644 (file)
index 0000000..0445a94
--- /dev/null
@@ -0,0 +1,386 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for the surface area calculation used by the `sasa` analysis module.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_trajectoryanalysis
+ */
+#include "gmxpre.h"
+
+#include "gromacs/trajectoryanalysis/modules/surfacearea.h"
+
+#include <cstdlib>
+
+#include <gtest/gtest.h>
+
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/random/random.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testasserts.h"
+
+namespace
+{
+
+/********************************************************************
+ * SurfaceAreaTest
+ */
+
+class SurfaceAreaTest : public ::testing::Test
+{
+    public:
+        SurfaceAreaTest()
+            : rng_(NULL), area_(0.0), volume_(0.0),
+              atomArea_(NULL), dotCount_(0), dots_(NULL)
+        {
+            // TODO: Handle errors.
+            rng_ = gmx_rng_init(12345);
+            clear_mat(box_);
+        }
+        ~SurfaceAreaTest()
+        {
+            if (rng_ != NULL)
+            {
+                gmx_rng_destroy(rng_);
+            }
+            sfree(atomArea_);
+            sfree(dots_);
+        }
+
+        void addSphere(real x, real y, real z, real radius,
+                       bool bAddToIndex = true)
+        {
+            if (bAddToIndex)
+            {
+                index_.push_back(x_.size());
+            }
+            x_.push_back(gmx::RVec(x, y, z));
+            radius_.push_back(radius);
+        }
+
+        void generateRandomPosition(rvec x, real *radius)
+        {
+            rvec fx;
+            fx[XX]  = gmx_rng_uniform_real(rng_);
+            fx[YY]  = gmx_rng_uniform_real(rng_);
+            fx[ZZ]  = gmx_rng_uniform_real(rng_);
+            mvmul(box_, fx, x);
+            *radius = 1.5*gmx_rng_uniform_real(rng_) + 0.5;
+        }
+
+        void addDummySpheres(int count)
+        {
+            for (int i = 0; i < count; ++i)
+            {
+                rvec x;
+                real radius;
+                generateRandomPosition(x, &radius);
+                addSphere(x[XX], x[YY], x[ZZ], radius, false);
+            }
+        }
+
+        void generateRandomPositions(int count)
+        {
+            x_.reserve(count);
+            radius_.reserve(count);
+            index_.reserve(count);
+            for (int i = 0; i < count; ++i)
+            {
+                rvec x;
+                real radius;
+                generateRandomPosition(x, &radius);
+                addSphere(x[XX], x[YY], x[ZZ], radius);
+            }
+        }
+        void translatePoints(real x, real y, real z)
+        {
+            for (size_t i = 0; i < x_.size(); ++i)
+            {
+                x_[i][XX] += x;
+                x_[i][YY] += y;
+                x_[i][ZZ] += z;
+            }
+        }
+
+        void calculate(int ndots, int flags, bool bPBC)
+        {
+            volume_   = 0.0;
+            sfree(atomArea_);
+            atomArea_ = NULL;
+            dotCount_ = 0;
+            sfree(dots_);
+            dots_     = NULL;
+            t_pbc       pbc;
+            if (bPBC)
+            {
+                set_pbc(&pbc, epbcXYZ, box_);
+            }
+            ASSERT_NO_THROW_GMX(
+                    {
+                        gmx::SurfaceAreaCalculator calculator;
+                        calculator.setDotCount(ndots);
+                        calculator.setRadii(radius_);
+                        calculator.calculate(as_rvec_array(&x_[0]), bPBC ? &pbc : NULL,
+                                             index_.size(), &index_[0], flags,
+                                             &area_, &volume_, &atomArea_,
+                                             &dots_, &dotCount_);
+                    });
+        }
+        real resultArea() const { return area_; }
+        real resultVolume() const { return volume_; }
+        real atomArea(int index) const { return atomArea_[index]; }
+
+        void checkReference(gmx::test::TestReferenceChecker *checker, const char *id,
+                            bool checkDotCoordinates)
+        {
+            gmx::test::TestReferenceChecker compound(
+                    checker->checkCompound("SASA", id));
+            compound.checkReal(area_, "Area");
+            if (volume_ > 0.0)
+            {
+                compound.checkReal(volume_, "Volume");
+            }
+            if (atomArea_ != NULL)
+            {
+                compound.checkSequenceArray(index_.size(), atomArea_, "AtomArea");
+            }
+            if (dots_ != NULL)
+            {
+                if (checkDotCoordinates)
+                {
+                    // The algorithm may produce the dots in different order in
+                    // single and double precision due to some internal
+                    // sorting...
+                    std::qsort(dots_, dotCount_, sizeof(rvec), &dotComparer);
+                    compound.checkSequenceArray(3*dotCount_, dots_, "Dots");
+                }
+                else
+                {
+                    compound.checkInteger(dotCount_, "DotCount");
+                }
+            }
+        }
+
+        gmx::test::TestReferenceData    data_;
+        matrix                          box_;
+
+    private:
+        static int dotComparer(const void *a, const void *b)
+        {
+            for (int d = DIM - 1; d >= 0; --d)
+            {
+                const real ad = reinterpret_cast<const real *>(a)[d];
+                const real bd = reinterpret_cast<const real *>(b)[d];
+                // A fudge factor is needed to get an ordering that is the same
+                // in single and double precision, since the points are not
+                // exactly on the same Z plane even though in exact arithmetic
+                // they probably would be.
+                if (ad < bd - 0.001)
+                {
+                    return -1;
+                }
+                else if (ad > bd + 0.001)
+                {
+                    return 1;
+                }
+            }
+            return 0;
+        }
+
+        gmx_rng_t               rng_;
+        std::vector<gmx::RVec>  x_;
+        std::vector<real>       radius_;
+        std::vector<int>        index_;
+
+        real                    area_;
+        real                    volume_;
+        real                   *atomArea_;
+        int                     dotCount_;
+        real                   *dots_;
+};
+
+TEST_F(SurfaceAreaTest, ComputesSinglePoint)
+{
+    gmx::test::FloatingPointTolerance tolerance(
+            gmx::test::defaultRealTolerance());
+    addSphere(1, 1, 1, 1);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, FLAG_VOLUME | FLAG_ATOM_AREA, false));
+    EXPECT_REAL_EQ_TOL(4*M_PI, resultArea(), tolerance);
+    EXPECT_REAL_EQ_TOL(4*M_PI, atomArea(0), tolerance);
+    EXPECT_REAL_EQ_TOL(4*M_PI/3, resultVolume(), tolerance);
+}
+
+TEST_F(SurfaceAreaTest, ComputesTwoPoints)
+{
+    gmx::test::FloatingPointTolerance tolerance(
+            gmx::test::relativeToleranceAsFloatingPoint(1.0, 0.005));
+    addSphere(1, 1, 1, 1);
+    addSphere(2, 1, 1, 1);
+    ASSERT_NO_FATAL_FAILURE(calculate(1000, FLAG_ATOM_AREA, false));
+    EXPECT_REAL_EQ_TOL(2*2*M_PI*1.5, resultArea(), tolerance);
+    EXPECT_REAL_EQ_TOL(2*M_PI*1.5, atomArea(0), tolerance);
+    EXPECT_REAL_EQ_TOL(2*M_PI*1.5, atomArea(1), tolerance);
+}
+
+TEST_F(SurfaceAreaTest, ComputesTwoPointsOfUnequalRadius)
+{
+    gmx::test::FloatingPointTolerance tolerance(
+            gmx::test::relativeToleranceAsFloatingPoint(1.0, 0.005));
+    // Spheres of radius 1 and 2 with intersection at 1.5
+    const real dist = 0.5 + sqrt(3.25);
+    addSphere(1.0, 1.0, 1.0, 1);
+    addSphere(1.0 + dist, 1.0, 1.0, 2);
+    ASSERT_NO_FATAL_FAILURE(calculate(1000, FLAG_ATOM_AREA, false));
+    EXPECT_REAL_EQ_TOL(2*M_PI*(1.5 + (dist - 0.5 + 2)*2), resultArea(), tolerance);
+    EXPECT_REAL_EQ_TOL(2*M_PI*1.5, atomArea(0), tolerance);
+    EXPECT_REAL_EQ_TOL(2*M_PI*(dist - 0.5 + 2)*2, atomArea(1), tolerance);
+}
+
+TEST_F(SurfaceAreaTest, SurfacePoints12)
+{
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    addSphere(0, 0, 0, 1);
+    ASSERT_NO_FATAL_FAILURE(calculate(12, FLAG_DOTS, false));
+    checkReference(&checker, "Surface", true);
+}
+
+TEST_F(SurfaceAreaTest, SurfacePoints32)
+{
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    addSphere(0, 0, 0, 1);
+    ASSERT_NO_FATAL_FAILURE(calculate(32, FLAG_DOTS, false));
+    checkReference(&checker, "Surface", true);
+}
+
+TEST_F(SurfaceAreaTest, SurfacePoints42)
+{
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    addSphere(0, 0, 0, 1);
+    ASSERT_NO_FATAL_FAILURE(calculate(42, FLAG_DOTS, false));
+    checkReference(&checker, "Surface", true);
+}
+
+TEST_F(SurfaceAreaTest, SurfacePoints122)
+{
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    addSphere(0, 0, 0, 1);
+    ASSERT_NO_FATAL_FAILURE(calculate(122, FLAG_DOTS, false));
+    checkReference(&checker, "Surface", true);
+}
+
+TEST_F(SurfaceAreaTest, Computes100Points)
+{
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    checker.setDefaultTolerance(gmx::test::absoluteTolerance(0.001));
+    box_[XX][XX] = 10.0;
+    box_[YY][YY] = 10.0;
+    box_[ZZ][ZZ] = 10.0;
+    generateRandomPositions(100);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, FLAG_VOLUME | FLAG_ATOM_AREA | FLAG_DOTS, false));
+    checkReference(&checker, "100Points", false);
+}
+
+TEST_F(SurfaceAreaTest, Computes100PointsWithRectangularPBC)
+{
+    // TODO: It would be nice to check that this produces the same result as
+    // without PBC, without duplicating the reference files.
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    checker.setDefaultTolerance(gmx::test::absoluteTolerance(0.001));
+    box_[XX][XX] = 10.0;
+    box_[YY][YY] = 10.0;
+    box_[ZZ][ZZ] = 10.0;
+    generateRandomPositions(100);
+    box_[XX][XX] = 20.0;
+    box_[YY][YY] = 20.0;
+    box_[ZZ][ZZ] = 20.0;
+    const int flags = FLAG_ATOM_AREA | FLAG_VOLUME | FLAG_DOTS;
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+
+    translatePoints(15.0, 0, 0);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+
+    translatePoints(-15.0, 15.0, 0);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+
+    translatePoints(0, -15.0, 15.0);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+}
+
+TEST_F(SurfaceAreaTest, Computes100PointsWithTriclinicPBC)
+{
+    // TODO: It would be nice to check that this produces the same result as
+    // without PBC, without duplicating the reference files.
+    gmx::test::TestReferenceChecker checker(data_.rootChecker());
+    checker.setDefaultTolerance(gmx::test::absoluteTolerance(0.001));
+    box_[XX][XX] = 10.0;
+    box_[YY][YY] = 10.0;
+    box_[ZZ][ZZ] = 10.0;
+    generateRandomPositions(100);
+    box_[XX][XX] = 20.0;
+    box_[YY][XX] = 10.0;
+    box_[YY][YY] = 10.0*sqrt(3.0);
+    box_[ZZ][XX] = 10.0;
+    box_[ZZ][YY] = 10.0*sqrt(1.0/3.0);
+    box_[ZZ][ZZ] = 20.0*sqrt(2.0/3.0);
+
+    const int flags = FLAG_ATOM_AREA | FLAG_VOLUME | FLAG_DOTS;
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+
+    translatePoints(15.0, 0, 0);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+
+    translatePoints(-15.0, box_[YY][YY] - 5.0, 0);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+
+    translatePoints(0, -(box_[YY][YY] - 5.0), 15.0);
+    ASSERT_NO_FATAL_FAILURE(calculate(24, flags, true));
+    checkReference(&checker, "100Points", false);
+}
+
+} // namespace
index de0ed428720c9a367f1424ab3c0129cfcffdd979..e8153b6e2e3af9a2e68b580fa2e38e9709387158 100644 (file)
@@ -38,6 +38,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_trajectoryanalysis
  */
+#include "gmxpre.h"
+
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/selection/selection.h"
index d2597a13e1a00030154955a18036647e0a1119c4..213f698280ab6760a42773a19d6d95e314bb8439 100644 (file)
  * The header file.h declares a gmx::File class for basic I/O support.
  *
  * The header path.h declares helpers for manipulating paths and for managing
- * directories (this has been moved to src/gromacs/fileio/ to wait for
- * resolution of #950).
+ * directories.
  *
  * The fate of these headers depends on what is decided in Redmine issue #950.
  *
  *
  * <H3>Implementation Helpers</H3>
  *
- * The header common.h implements a gmx::PrivateImplPointer template for easily
+ * The header basedefinitions.h contains common definitions and macros used
+ * throughout \Gromacs.  It includes fixed-width integer types (`gmx_int64_t`
+ * and friends), `gmx_bool` for C code, some macros for compiler-specific
+ * attributes, and ::GMX_UNUSED_VALUE and ::GMX_IGNORE_RETURN_VALUE for
+ * handling warnings about unused values.
+ *
+ * The header classhelpers.h implements a gmx::PrivateImplPointer template for easily
  * writing classes that use the private implementation idiom.  This header also
  * declares ::GMX_DISALLOW_COPY_AND_ASSIGN and ::GMX_DISALLOW_ASSIGN macros for
- * class declarations, and ::GMX_IGNORE_RETURN_VALUE for cleanly ignoring a
- * return value from a function.
+ * class declarations.
  *
  * The header flags.h implements a gmx::FlagsTemplate template for better type
  * safety when using bit flag fields.
  *
- * The header uniqueptr.h declares gmx::gmx_unique_ptr, which is intended for
- * declaring smart pointer types with unique ownership.
- *
  *
  * <H3>Other Functionality</H3>
  *
  * The header init.h declares gmx::init() and gmx::finalize() for initializing
- * and deinitializing the Gromacs library.
+ * and deinitializing the \Gromacs library.
  *
  * The header arrayref.h implements a gmx::ConstArrayRef class for exposing a
  * C array or part of a std::vector (basically, any continuous stretch of
  * The header messagestringcollector.h declares a gmx::MessageStringCollector
  * class for composing messages with context information.
  *
+ * The header sysinfo.h declares gmx_getpid() for getting the current process
+ * id.
+ *
  * The header programcontext.h declares a gmx::ProgramContextInterface that is
  * used to
  * initialize and access information about the running program, such as the
  * The header qsort_threadsafe.h provides a guaranteed threadsafe
  * implementation for qsort().
  *
+ * The header uniqueptr.h declares gmx::gmx_unique_ptr, which is intended for
+ * declaring smart pointer types with unique ownership.
+ *
  * \endif
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
 #ifndef GMX_UTILITY_H
 #define GMX_UTILITY_H
 
-#include "utility/errorcodes.h"
-#include "utility/exceptions.h"
-#include "utility/gmxassert.h"
-#include "utility/init.h"
-#include "utility/programcontext.h"
+#include "gromacs/utility/errorcodes.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/init.h"
+#include "gromacs/utility/programcontext.h"
 
 #endif
index bd574593cdb1731bdfafc49e788c146e2312e92c..c9b05c53b1e0109d4aa6d742de60eca2c89f0bd2 100644 (file)
@@ -1,2 +1 @@
 baseversion-gen.c
-gmx_header_config_gen.h
index ae59513caa0dca83540b68296f4f735f97699cdb..1933e660a6ce406932b430e016d7cb4439e5d129 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,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.
 file(GLOB UTILITY_SOURCES *.c *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
 
-set(GENERATED_HEADER_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/gmx_header_config_gen.h)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gmx_header_config_gen.h.cmakein
-               ${GENERATED_HEADER_CONFIG})
-
-set(UTILITY_PUBLIC_HEADERS
+gmx_install_headers(
     arrayref.h
+    basedefinitions.h
+    classhelpers.h
     cstringutil.h
-    common.h
+    datafilefinder.h
     errorcodes.h
     exceptions.h
+    fatalerror.h
     file.h
     flags.h
-    gmx_header_config.h
+    futil.h
     gmxassert.h
     init.h
     programcontext.h
+    real.h
     smalloc.h
     stringutil.h
-    uniqueptr.h)
-gmx_install_headers(utility ${UTILITY_PUBLIC_HEADERS})
-gmx_install_headers(utility ${GENERATED_HEADER_CONFIG})
+    )
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index 982c712b7d4128cdd72027290082d6d6e29fc467..d59a3548577305800b7836d5f6a7d1acc1ca58f5 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,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.
@@ -50,7 +50,7 @@
 #include <utility>
 #include <vector>
 
-#include "gmxassert.h"
+#include "gromacs/utility/gmxassert.h"
 
 namespace gmx
 {
@@ -153,6 +153,22 @@ class ArrayRef
         {
             GMX_ASSERT(end >= begin, "Invalid range");
         }
+        /*! \brief
+         * Constructs a reference to a whole vector.
+         *
+         * \param[in] v  Vector to reference.
+         *
+         * Passed vector must remain valid and not be reallocated for the
+         * lifetime of this object.
+         *
+         * This constructor is not explicit to allow directly passing
+         * std::vector 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)
+        {
+        }
         //! \cond
         // Doxygen 1.8.5 doesn't parse the declaration correctly...
         /*! \brief
@@ -393,6 +409,22 @@ class ConstArrayRef
         {
             GMX_ASSERT(end >= begin, "Invalid range");
         }
+        /*! \brief
+         * Constructs a reference to a whole vector.
+         *
+         * \param[in] v  Vector to reference.
+         *
+         * Passed vector must remain valid and not be reallocated for the
+         * lifetime of this object.
+         *
+         * This constructor is not explicit to allow directly passing
+         * std::vector 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)
+        {
+        }
         //! \cond
         // Doxygen 1.8.5 doesn't parse the declaration correctly...
         /*! \brief
diff --git a/src/gromacs/utility/basedefinitions.h b/src/gromacs/utility/basedefinitions.h
new file mode 100644 (file)
index 0000000..be20290
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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
+ * Basic types and macros used throughout \Gromacs.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_BASEDEFINITIONS_H
+#define GMX_UTILITY_BASEDEFINITIONS_H
+
+#include <stdint.h>
+#ifndef _MSC_VER
+#include <inttypes.h>
+#endif
+
+/*! \brief
+ * Boolean type for use in \Gromacs C code.
+ *
+ * There is no standard size for 'bool' in C++, so when
+ * we previously defined it to int for C code the data types
+ * (and structs) would have different size depending on your compiler,
+ * both at \Gromacs build time and when you use the library.
+ * The only way around this is to NOT assume anything about the C++ type,
+ * so we cannot use the name 'bool' in our C code anymore.
+ */
+typedef int gmx_bool;
+
+#ifndef FALSE
+/** False value for ::gmx_bool. */
+#  define FALSE   0
+#endif
+#ifndef TRUE
+/** True value for ::gmx_bool. */
+#  define TRUE    1
+#endif
+/** Number of gmx_bool values. */
+#define BOOL_NR 2
+
+/*! \name Fixed-width integer types
+ *
+ * These types and macros provide the equivalent of 32- and 64-bit integer
+ * types from C99 headers `stdint.h` and `inttypes.h`.  These headers are also
+ * there in C++11.  The types and macros from here should be used instead of
+ * `int32_t` etc.
+ * MSVC doesn't support these before Visual Studio 2013.
+ */
+/*! \{ */
+#ifdef _MSC_VER
+typedef __int32 gmx_int32_t;
+#define GMX_PRId32 "I32d"
+#define GMX_SCNd32 "I32d"
+
+typedef __int64 gmx_int64_t;
+#define GMX_PRId64 "I64d"
+#define GMX_SCNd64 "I64d"
+
+typedef unsigned __int32 gmx_uint32_t;
+#define GMX_PRIu32 "I32u"
+#define GMX_SCNu32 "I32u"
+
+typedef unsigned __int64 gmx_uint64_t;
+#define GMX_PRIu64 "I64u"
+#define GMX_SCNu64 "I64u"
+#else
+typedef int32_t gmx_int32_t;
+#define GMX_PRId32 PRId32
+#define GMX_SCNd32 SCNd32
+
+typedef int64_t gmx_int64_t;
+#define GMX_PRId64 PRId64
+#define GMX_SCNd64 SCNd64
+
+typedef uint32_t gmx_uint32_t;
+#define GMX_PRIu32 PRIu32
+#define GMX_SCNu32 SCNu32
+
+typedef uint64_t gmx_uint64_t;
+#define GMX_PRIu64 PRIu64
+#define GMX_SCNu64 SCNu64
+#endif
+
+#define GMX_INT32_MAX INT32_MAX
+#define GMX_INT32_MIN INT32_MIN
+
+#define GMX_INT64_MAX INT64_MAX
+#define GMX_INT64_MIN INT64_MIN
+
+#define GMX_UINT32_MAX UINT32_MAX
+#define GMX_UINT32_MIN UINT32_MIN
+
+#define GMX_UINT64_MAX UINT64_MAX
+#define GMX_UINT64_MIN UINT64_MIN
+/*! \} */
+
+/*! \def gmx_inline
+ * \brief
+ * Keyword to use in C code instead of C99 `inline`.
+ *
+ * Some of the C compilers we support do not recognize the C99 keyword
+ * `inline`.  This macro should be used in C code and in shared C/C++ headers
+ * to indicate a function is inlined.
+ * C++ code should use plain `inline`, as that is already in C++98.
+ */
+#if !defined __cplusplus && _MSC_VER
+#define gmx_inline __inline
+#else
+/* C++ or C99 */
+#define gmx_inline inline
+#endif
+
+/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
+ * Any other compiler can be added here. */
+/*! \brief
+ * Keyword to use in instead of C99 `restrict`.
+ *
+ * We cannot use `restrict` because it is only in C99, but not in C++.
+ * This macro should instead be used to allow easily supporting different
+ * compilers.
+ */
+#define gmx_restrict __restrict
+
+/*! \def gmx_cxx_const
+ * \brief
+ * Keyword to work around C/C++ differences in possible const keyword usage.
+ *
+ * Some functions that do not modify their input parameters cannot declare
+ * those parameters as `const` and compile warning/error-free on both C and C++
+ * compilers because of differences in `const` semantics.  This macro can be
+ * used in cases where C++ allows `const`, but C does not like it, to make the
+ * same declaration work for both.
+ */
+#ifdef __cplusplus
+#define gmx_cxx_const const
+#else
+#define gmx_cxx_const
+#endif
+
+/*! \def gmx_unused
+ * \brief
+ * Attribute to suppress compiler warnings about unused function parameters.
+ *
+ * This attribute suppresses compiler warnings about unused function arguments
+ * by marking them as possibly unused.  Some arguments are unused but
+ * have to be retained to preserve a function signature
+ * that must match that of another function.
+ * Some arguments are only used in *some* conditional compilation code paths
+ * (e.g. MPI).
+ */
+#ifndef gmx_unused
+#ifdef __GNUC__
+/* GCC, clang, and some ICC pretending to be GCC */
+#  define gmx_unused __attribute__ ((unused))
+#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && !defined(_MSC_VER)
+/* ICC on *nix */
+#  define gmx_unused __attribute__ ((unused))
+#elif defined(__PGI)
+/* Portland group compilers */
+#  define gmx_unused __attribute__ ((unused))
+#elif defined _MSC_VER
+/* MSVC */
+#  define gmx_unused /*@unused@*/
+#elif defined(__xlC__)
+/* IBM */
+#  define gmx_unused __attribute__ ((unused))
+#else
+#  define gmx_unused
+#endif
+#endif
+
+#ifndef __has_feature
+/** For compatibility with non-clang compilers. */
+#define __has_feature(x) 0
+#endif
+
+/*! \def gmx_noreturn
+ * \brief
+ * Indicate that a function is not expected to return.
+ */
+#ifndef gmx_noreturn
+#if defined(__GNUC__) || __has_feature(attribute_analyzer_noreturn)
+#define gmx_noreturn __attribute__((noreturn))
+#elif defined (_MSC_VER)
+#define gmx_noreturn __declspec(noreturn)
+#else
+#define gmx_noreturn
+#endif
+#endif
+
+/*! \brief
+ * Macro to explicitly ignore an unused value.
+ *
+ * \ingroup module_utility
+ */
+#define GMX_UNUSED_VALUE(value) (void)value
+
+#ifdef __cplusplus
+namespace gmx
+{
+namespace internal
+{
+/*! \cond internal */
+/*! \internal \brief
+ * Helper for ignoring values in macros.
+ *
+ * \ingroup module_utility
+ */
+template <typename T>
+static inline void ignoreValueHelper(const T &)
+{
+}
+//! \endcond
+}   // namespace internal
+}   // namespace gmx
+
+/*! \brief
+ * Macro to explicitly ignore a return value of a call.
+ *
+ * Mainly meant for ignoring values of functions declared with
+ * `__attribute__((warn_unused_return))`.  Makes it easy to find those places if
+ * they need to be fixed, and document the intent in cases where the return
+ * value really can be ignored.  It also makes it easy to adapt the approach so
+ * that they don't produce warnings.  A cast to void doesn't remove the warning
+ * in gcc, while adding a dummy variable can cause warnings about an unused
+ * variable.
+ *
+ * \ingroup module_utility
+ */
+#define GMX_IGNORE_RETURN_VALUE(call) \
+        ::gmx::internal::ignoreValueHelper(call)
+#endif
+
+#endif
diff --git a/src/gromacs/utility/basenetwork.cpp b/src/gromacs/utility/basenetwork.cpp
new file mode 100644 (file)
index 0000000..ce1197c
--- /dev/null
@@ -0,0 +1,253 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 "basenetwork.h"
+
+#include "config.h"
+
+#include <climits>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include <exception>
+
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/programcontext.h"
+
+gmx_bool gmx_mpi_initialized(void)
+{
+#ifndef GMX_MPI
+    return 0;
+#else
+    int n;
+    MPI_Initialized(&n);
+
+    return n;
+#endif
+}
+
+int gmx_node_num(void)
+{
+#ifndef GMX_MPI
+    return 1;
+#else
+#ifdef GMX_THREAD_MPI
+    if (!gmx_mpi_initialized())
+    {
+        return 1;
+    }
+#endif
+    int i;
+    (void) MPI_Comm_size(MPI_COMM_WORLD, &i);
+    return i;
+#endif
+}
+
+int gmx_node_rank(void)
+{
+#ifndef GMX_MPI
+    return 0;
+#else
+#ifdef GMX_THREAD_MPI
+    if (!gmx_mpi_initialized())
+    {
+        return 0;
+    }
+#endif
+    int i;
+    (void) MPI_Comm_rank(MPI_COMM_WORLD, &i);
+    return i;
+#endif
+}
+
+static int mpi_hostname_hash(void)
+{
+    int hash_int;
+
+#ifndef GMX_LIB_MPI
+    /* We have a single physical node */
+    hash_int = 0;
+#else
+    int  resultlen;
+    char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
+
+    /* This procedure can only differentiate nodes with different names.
+     * Architectures where different physical nodes have identical names,
+     * such as IBM Blue Gene, should use an architecture specific solution.
+     */
+    MPI_Get_processor_name(mpi_hostname, &resultlen);
+
+    /* The string hash function returns an unsigned int. We cast to an int.
+     * Negative numbers are converted to positive by setting the sign bit to 0.
+     * This makes the hash one bit smaller.
+     * A 63-bit hash (with 64-bit int) should be enough for unique node hashes,
+     * even on a million node machine. 31 bits might not be enough though!
+     */
+    hash_int =
+        (int)gmx_string_fullhash_func(mpi_hostname, gmx_string_hash_init);
+    if (hash_int < 0)
+    {
+        hash_int -= INT_MIN;
+    }
+#endif
+
+    return hash_int;
+}
+
+#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
+#ifdef __clang__
+/* IBM's declaration of this function in
+ * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/process.h
+ * erroneously fails to specify __INLINE__, despite
+ * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/cnk/process_impl.h
+ * specifiying __INLINE__, so bgclang thinks they are different enough
+ * to complain about. */
+static uint64_t Kernel_GetJobID();
+#endif
+#include <spi/include/kernel/location.h>
+
+static int bgq_nodenum(void)
+{
+    int           hostnum;
+    Personality_t personality;
+    Kernel_GetPersonality(&personality, sizeof(personality));
+    /* Each MPI rank has a unique coordinate in a 6-dimensional space
+       (A,B,C,D,E,T), with dimensions A-E corresponding to different
+       physical nodes, and T within each node. Each node has sixteen
+       physical cores, each of which can have up to four hardware
+       threads, so 0 <= T <= 63 (but the maximum value of T depends on
+       the confituration of ranks and OpenMP threads per
+       node). However, T is irrelevant for computing a suitable return
+       value for gmx_hostname_num().
+     */
+    hostnum  = personality.Network_Config.Acoord;
+    hostnum *= personality.Network_Config.Bnodes;
+    hostnum += personality.Network_Config.Bcoord;
+    hostnum *= personality.Network_Config.Cnodes;
+    hostnum += personality.Network_Config.Ccoord;
+    hostnum *= personality.Network_Config.Dnodes;
+    hostnum += personality.Network_Config.Dcoord;
+    hostnum *= personality.Network_Config.Enodes;
+    hostnum += personality.Network_Config.Ecoord;
+
+    if (debug)
+    {
+        std::fprintf(debug,
+                     "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\n"
+                     "Node ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
+                     personality.Network_Config.Acoord,
+                     personality.Network_Config.Anodes,
+                     personality.Network_Config.Bcoord,
+                     personality.Network_Config.Bnodes,
+                     personality.Network_Config.Ccoord,
+                     personality.Network_Config.Cnodes,
+                     personality.Network_Config.Dcoord,
+                     personality.Network_Config.Dnodes,
+                     personality.Network_Config.Ecoord,
+                     personality.Network_Config.Enodes,
+                     Kernel_ProcessorCoreID(),
+                     16,
+                     Kernel_ProcessorID(),
+                     64,
+                     Kernel_ProcessorThreadID(),
+                     4);
+    }
+    return hostnum;
+}
+#endif
+
+int gmx_physicalnode_id_hash(void)
+{
+    int hash;
+
+#ifndef GMX_MPI
+    hash = 0;
+#else
+#ifdef GMX_THREAD_MPI
+    /* thread-MPI currently puts the thread number in the process name,
+     * we might want to change this, as this is inconsistent with what
+     * most MPI implementations would do when running on a single node.
+     */
+    hash = 0;
+#else
+#ifdef GMX_TARGET_BGQ
+    hash = bgq_nodenum();
+#else
+    hash = mpi_hostname_hash();
+#endif
+#endif
+#endif
+
+    if (debug)
+    {
+        fprintf(debug, "In gmx_physicalnode_id_hash: hash %d\n", hash);
+    }
+
+    return hash;
+}
+
+#ifdef GMX_LIB_MPI
+void gmx_abort(int errorno)
+{
+    const char *programName = "GROMACS";
+    try
+    {
+        programName = gmx::getProgramContext().displayName();
+    }
+    catch (const std::exception &)
+    {
+    }
+    const int nnodes   = gmx_node_num();
+    const int noderank = gmx_node_rank();
+    if (nnodes > 1)
+    {
+        std::fprintf(stderr, "Halting parallel program %s on rank %d out of %d\n",
+                     programName, noderank, nnodes);
+    }
+    else
+    {
+        std::fprintf(stderr, "Halting program %s\n", programName);
+    }
+
+    MPI_Abort(MPI_COMM_WORLD, errorno);
+    std::exit(errorno);
+}
+#endif
diff --git a/src/gromacs/utility/basenetwork.h b/src/gromacs/utility/basenetwork.h
new file mode 100644 (file)
index 0000000..a03d6f6
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * 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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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
+ * Utility functions for basic MPI and network functionality.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_BASENETWORK_H
+#define GMX_UTILITY_BASENETWORK_H
+
+#include <stddef.h>
+
+#include "gromacs/utility/basedefinitions.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \brief
+ * Returns whether MPI has been initialized.
+ *
+ * The return value is `FALSE` if MPI_Init() has not been called, or if
+ * \Gromacs has been compiled without MPI support.
+ * For thread-MPI, returns `TRUE` when the threads have been started.
+ *
+ * Note that there is a lot of code in between MPI_Init() and the thread-MPI
+ * thread start where the return value is different depending on compilation
+ * options.
+ */
+gmx_bool gmx_mpi_initialized(void);
+
+/*! \brief
+ * Returns the number of nodes.
+ *
+ * For thread-MPI, returns one before the threads have been started.
+ * This allows code between the real MPI_Init() and the thread-MPI "init" to
+ * still use this function to check for serial/parallel status and work as
+ * expected: for thread-MPI, at that point they should behave as if the run was
+ * serial.
+ */
+int gmx_node_num(void);
+
+/*! \brief
+ * Returns the rank of the node.
+ *
+ * For thread-MPI, returns zero before the threads have been started.
+ * This allows code between the real MPI_Init() and the thread-MPI "init" to
+ * still use this function to check for master node work as expected:
+ * for thread-MPI, at that point the only thread of execution should behave as
+ * if it the master node.
+ */
+int gmx_node_rank(void);
+
+/*! \brief
+ * Return a non-negative hash that is, hopefully, unique for each physical
+ * node.
+ *
+ * This hash is useful for determining hardware locality.
+ */
+int gmx_physicalnode_id_hash(void);
+
+/*! \brief
+ * Returns an integer characteristic of and, hopefully, unique to each
+ * physical node in the MPI system.
+ *
+ * If the first part of the MPI hostname (up to the first dot) ends with a
+ * number, returns this number.  If the first part of the MPI hostname does not
+ * ends in a number (0-9 characters), returns 0.
+ *
+ * \todo
+ * This function should be fully replaced by gmx_physicalnode_id_hash().
+ */
+int gmx_hostname_num(void);
+
+/** Abort the parallel run */
+void gmx_abort(int errorno);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 77bb06e56830b305da4fa50ca53a78b3e4480460..7d12ce3db8c80f00e3c75a88b6f2e0e3d137b5ab 100644 (file)
@@ -34,6 +34,6 @@
  */
 #include "gromacs/utility/baseversion-gen.h"
 
-const char _gmx_ver_string[] = "VERSION @GMX_PROJECT_VERSION_STR@";
-const char _gmx_full_git_hash[] = "@GMX_GIT_HEAD_HASH@";
-const char _gmx_central_base_hash[] = "@GMX_GIT_REMOTE_HASH@";
+const char _gmx_ver_string[] = "VERSION @GMX_VERSION_STRING_FULL@";
+const char _gmx_full_git_hash[] = "@GMX_VERSION_FULL_HASH@";
+const char _gmx_central_base_hash[] = "@GMX_VERSION_CENTRAL_BASE_HASH@";
index 84315b7c4659b5665b1ae4cf93fa22df8ca44163..876dbeb5b10175a2d618c0a452d2234e695ff83e 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.
  */
+#include "gmxpre.h"
+
 #include "baseversion.h"
+
 #include "baseversion-gen.h"
 
 const char *gmx_version()
diff --git a/src/gromacs/utility/bitmask.h b/src/gromacs/utility/bitmask.h
new file mode 100644 (file)
index 0000000..e1c5989
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares gmx_bitmask_t and associated functions
+ *
+ * \author Roland Schulz <roland@utk.edu>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+
+#ifndef GMX_MDLIB_BITMASK_H
+#define GMX_MDLIB_BITMASK_H
+
+#include "config.h" /* for GMX_MAX_OPENMP_THREADS */
+
+#include <string.h>
+
+#include "gromacs/utility/basedefinitions.h"
+
+/*! \brief Size of bitmask. Has to be 32 or multiple of 64. */
+#ifndef BITMASK_SIZE
+#define BITMASK_SIZE GMX_OPENMP_MAX_THREADS
+#endif
+
+#if BITMASK_SIZE != 32 && BITMASK_SIZE%64 != 0
+#error BITMASK_SIZE has to be 32 or a multiple of 64.
+#endif
+
+#if BITMASK_SIZE <= 64 || defined DOXYGEN
+#if BITMASK_SIZE == 32
+typedef gmx_uint32_t gmx_bitmask_t;
+#else
+typedef gmx_uint64_t gmx_bitmask_t; /**< bitmask type */
+#endif
+
+/*! \brief Initialize all bits to 0 */
+gmx_inline static void bitmask_clear(gmx_bitmask_t* m)
+{
+    *m = 0;
+}
+
+/*! \brief Set bit at position b to 1. */
+gmx_inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
+{
+    *m |= ((gmx_bitmask_t)1 << b);
+}
+
+/*! \brief Initialize all bits: bit b to 1, others to 0 */
+gmx_inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
+{
+    *m = ((gmx_bitmask_t)1 << b);
+}
+
+/*! \brief Initialize all bits: all bits below b to 1, others to 0 */
+gmx_inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
+{
+    *m = ((gmx_bitmask_t)1 << b) - 1;
+}
+
+/*! \brief Test if bit b is set */
+gmx_inline static gmx_bool bitmask_is_set(gmx_bitmask_t m, int b)
+{
+    return (m & ((gmx_bitmask_t)1 << b)) != 0;
+}
+
+/*! \brief Test if both bitmasks have no common bits enabled */
+gmx_inline static gmx_bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
+{
+    return !(a & b);
+}
+
+/*! \brief Test if both bitmasks are equal */
+gmx_inline static gmx_bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
+{
+    return a == b;
+}
+
+/*! \brief Test if bitmask has no enabled bits */
+gmx_inline static gmx_bool bitmask_is_zero(gmx_bitmask_t m)
+{
+    return !m;
+}
+
+/*! \brief Set all bits enabled in either mask and write into a */
+gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
+{
+    *a |= b;
+}
+#else
+#define BITMASK_ALEN (BITMASK_SIZE/64)
+typedef gmx_uint64_t gmx_bitmask_t[BITMASK_ALEN];
+
+gmx_inline static void bitmask_clear(gmx_bitmask_t* m)
+{
+    memset(*m, 0, BITMASK_SIZE/8);
+}
+
+gmx_inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
+{
+    (*m)[b/64] |= ((gmx_uint64_t)1 << (b%64));
+}
+
+gmx_inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
+{
+    bitmask_clear(m);
+    (*m)[b/64] = ((gmx_uint64_t)1 << (b%64));
+}
+
+gmx_inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
+{
+    memset(*m, 255, b/64*8);
+    (*m)[b/64] = ((gmx_uint64_t)1 << (b%64)) - 1;
+    memset(&(*m)[b/64+1], 0, (BITMASK_ALEN-b/64-1)*8);
+}
+
+gmx_inline static gmx_bool bitmask_is_set(gmx_bitmask_t m, int b)
+{
+    return (m[b/64] & ((gmx_uint64_t)1 << (b%64))) != 0;
+}
+
+gmx_inline static gmx_bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
+{
+    int      i;
+    gmx_bool r = 1;
+    for (i = 0; i < BITMASK_ALEN; i++)
+    {
+        r = r && !(a[i] & b[i]);
+    }
+    return r;
+}
+
+gmx_inline static gmx_bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
+{
+    int      i;
+    gmx_bool r = 1;
+    for (i = 0; i < BITMASK_ALEN; i++)
+    {
+        r = r && (a[i] == b[i]);
+    }
+    return r;
+}
+
+gmx_inline static gmx_bool bitmask_is_zero(gmx_bitmask_t m)
+{
+    int      i;
+    gmx_bool r = 1;
+    for (i = 0; i < BITMASK_ALEN; i++)
+    {
+        r = r && !m[i];
+    }
+    return r;
+}
+
+gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
+{
+    int i;
+    for (i = 0; i < BITMASK_ALEN; i++)
+    {
+        (*a)[i] |= b[i];
+    }
+}
+#endif
+
+#endif
similarity index 82%
rename from src/gromacs/utility/common.h
rename to src/gromacs/utility/classhelpers.h
index 11b303ea9d56c3df5437a6330c92e69ae25fedfb..0c4ab5d1f6a254bb49492b5fe57dd7d9777d6834 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \inlibraryapi
  * \ingroup module_utility
  */
-#ifndef GMX_UTILITY_COMMON_H
-#define GMX_UTILITY_COMMON_H
+#ifndef GMX_UTILITY_CLASSHELPERS_H
+#define GMX_UTILITY_CLASSHELPERS_H
 
 #include <boost/scoped_ptr.hpp>
 
 namespace gmx
 {
-namespace internal
-{
-/*! \cond internal */
-/*! \internal \brief
- * Helper for ignoring values in macros.
- *
- * \ingroup module_utility
- */
-template <typename T>
-void inline ignoreValueHelper(const T &)
-{
-}
-//! \endcond
-}   // namespace internal
 
 /*! \brief
  * Macro to declare a class non-copyable and non-assignable.
@@ -87,27 +73,6 @@ void inline ignoreValueHelper(const T &)
 #define GMX_DISALLOW_ASSIGN(ClassName) \
     private: \
         ClassName &operator=(const ClassName &)
-/*! \brief
- * Macro to explicitly ignore a return value of a call.
- *
- * Mainly meant for ignoring values of functions declared with
- * `__attribute__((warn_unused_return))`.  Makes it easy to find those places if
- * they need to be fixed, and document the intent in cases where the return
- * value really can be ignored.  It also makes it easy to adapt the approach so
- * that they don't produce warnings.  A cast to void doesn't remove the warning
- * in gcc, while adding a dummy variable can cause warnings about an unused
- * variable.
- *
- * \ingroup module_utility
- */
-#define GMX_IGNORE_RETURN_VALUE(call) \
-        ::gmx::internal::ignoreValueHelper(call)
-/*! \brief
- * Macro to explicitly ignore an unused value.
- *
- * \ingroup module_utility
- */
-#define GMX_UNUSED_VALUE(value) (void)value
 
 /*! \brief
  * Helper class to manage a pointer to a private implementation class.
index d71419f70b3261596501c527be227a97a2eb6b87..438a232b9c39b248b35e46d918ee6c8afec09fc7 100644 (file)
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
-#include "cstringutil.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "cstringutil.h"
 
 #include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <time.h>
-
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/main.h"
-
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/sysinfo.h"
 
 int continuing(char *s)
 {
@@ -190,71 +175,28 @@ void trim (char *str)
     rtrim (str);
 }
 
-char *
-gmx_ctime_r(const time_t *clock, char *buf, int n)
+void nice_header(FILE *out, const char *fn)
 {
-#ifdef _MSC_VER
-    /* Windows */
-    ctime_s( buf, n, clock );
-#elif defined(GMX_NATIVE_WINDOWS)
-    char *tmpbuf = ctime( clock );
-    strncpy(buf, tmpbuf, n-1);
-    buf[n-1] = '\0';
-#elif (defined(__sun))
-    /*Solaris*/
-    ctime_r(clock, buf, n);
-#else
-    char tmpbuf[STRLEN];
-    ctime_r(clock, tmpbuf);
-    strncpy(buf, tmpbuf, n-1);
-    buf[n-1] = '\0';
-#endif
-    return buf;
-}
-
-void nice_header (FILE *out, const char *fn)
-{
-    const char    *unk = "onbekend";
-    time_t         clock;
-    const char    *user = unk;
-    int            gh;
-#ifdef HAVE_PWD_H
-    uid_t          uid;
-#else
     int            uid;
-#endif
-    char           buf[256] = "";
+    char           userbuf[256];
+    char           hostbuf[256];
     char           timebuf[STRLEN];
-#ifdef HAVE_PWD_H
-    struct passwd *pw;
-#endif
 
     /* Print a nice header above the file */
-    time(&clock);
-    fprintf (out, "%c\n", COMMENTSIGN);
-    fprintf (out, "%c\tFile '%s' was generated\n", COMMENTSIGN, fn ? fn : unk);
-
-#ifdef HAVE_PWD_H
-    uid  = getuid();
-    pw   = getpwuid(uid);
-    gh   = gmx_gethostname(buf, 255);
-    /* pw returns null on error (e.g. compute nodes lack /etc/passwd) */
-    user = pw ? pw->pw_name : unk;
-#else
-    uid = 0;
-    gh  = -1;
-#endif
-
-    gmx_ctime_r(&clock, timebuf, STRLEN);
-    fprintf (out, "%c\tBy user: %s (%d)\n", COMMENTSIGN,
-             user ? user : unk, (int) uid);
-    fprintf(out, "%c\tOn host: %s\n", COMMENTSIGN, (gh == 0) ? buf : unk);
-
-    fprintf (out, "%c\tAt date: %s", COMMENTSIGN, timebuf);
-    fprintf (out, "%c\n", COMMENTSIGN);
+    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;
@@ -589,6 +531,12 @@ str_to_int64_t(const char *str, char **endptr)
 #endif
 }
 
+char *gmx_step_str(gmx_int64_t i, char *buf)
+{
+    sprintf(buf, "%"GMX_PRId64, i);
+    return buf;
+}
+
 void parse_digits_from_plain_string(const char *digitstring, int *ndigits, int **digitlist)
 {
     int i;
index 8cba1a370ba72e093654ecad493318788812a77b..20605d0728d3f40cf06d20256f79961a03c5b966 100644 (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, by the GROMACS development team, led by
+ * 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.
 #define GMX_UTILITY_CSTRINGUTIL_H
 
 #include <stdio.h>
-#include <time.h>
 
-#include "../legacyheaders/types/simple.h"
-
-#include "gmx_header_config.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -61,6 +58,8 @@ extern "C" {
 #define CONTINUE    '\\'
 /** Comment sign to use. */
 #define COMMENTSIGN ';'
+/** Standard size for char* string buffers. */
+#define STRLEN 4096
 
 /*! \brief
  * Strip trailing spaces and if s ends with a ::CONTINUE remove that too.
@@ -93,9 +92,6 @@ void rtrim(char *str);
 /** Remove leading and trailing whitespace from a string. */
 void trim(char *str);
 
-/** Portable version of ctime_r. */
-char *gmx_ctime_r(const time_t *clock, char *buf, int n);
-
 /** Prints creation time stamp and user information into a file as comments. */
 void nice_header(FILE *out, const char *fn);
 
@@ -183,9 +179,17 @@ char *wrap_lines(const char *buf, int line_width, int indent,
  */
 gmx_int64_t str_to_int64_t(const char *str, char **endptr);
 
-#ifdef GMX_NATIVE_WINDOWS
-#define snprintf _snprintf
-#endif
+/** Minimum size of buffer to pass to gmx_step_str(). */
+#define STEPSTRSIZE 22
+
+/*! \brief
+ * Prints a gmx_int64_t value in buf and returns the pointer to buf.
+ *
+ * buf should be large enough to contain i: STEPSTRSIZE (22) chars.
+ * When multiple gmx_int64_t values are printed in the same printf call,
+ * be sure to call gmx_step_str with different buffers.
+ */
+char *gmx_step_str(gmx_int64_t i, char *buf);
 
 /*! \brief Construct an array of digits found in the input string
  *
diff --git a/src/gromacs/utility/datafilefinder.cpp b/src/gromacs/utility/datafilefinder.cpp
new file mode 100644 (file)
index 0000000..bdf673d
--- /dev/null
@@ -0,0 +1,271 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements gmx::DataFileFinder.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_utility
+ */
+#include "gmxpre.h"
+
+#include "datafilefinder.h"
+
+#include "config.h"
+
+#include <cstdlib>
+
+#include <string>
+#include <vector>
+
+#include "gromacs/utility/directoryenumerator.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+/********************************************************************
+ * DataFileFinder::Impl
+ */
+
+class DataFileFinder::Impl
+{
+    public:
+        static std::string getDefaultPath();
+
+        Impl() : envName_(NULL), bEnvIsSet_(false) {}
+
+        const char               *envName_;
+        bool                      bEnvIsSet_;
+        std::vector<std::string>  searchPath_;
+};
+
+std::string DataFileFinder::Impl::getDefaultPath()
+{
+    const InstallationPrefixInfo installPrefix
+        = getProgramContext().installationPrefix();
+    if (!isNullOrEmpty(installPrefix.path))
+    {
+        const char *const dataPath
+            = installPrefix.bSourceLayout ? "share" : DATA_INSTALL_DIR;
+        return Path::join(installPrefix.path, dataPath, "top");
+    }
+    return std::string();
+}
+
+/********************************************************************
+ * DataFileFinder
+ */
+
+DataFileFinder::DataFileFinder()
+    : impl_(NULL)
+{
+}
+
+DataFileFinder::~DataFileFinder()
+{
+}
+
+void DataFileFinder::setSearchPathFromEnv(const char *envVarName)
+{
+    if (!impl_.get())
+    {
+        impl_.reset(new Impl());
+    }
+    impl_->envName_ = envVarName;
+    const char *const lib = getenv(envVarName);
+    if (lib != NULL)
+    {
+        impl_->bEnvIsSet_ = true;
+        Path::splitPathEnvironment(lib, &impl_->searchPath_);
+    }
+}
+
+FILE *DataFileFinder::openFile(const DataFileOptions &options) const
+{
+    // TODO: There is a small race here, since there is some time between
+    // the exists() calls and actually opening the file.  It would be better
+    // to leave the file open after a successful exists() if the desire is to
+    // actually open the file.
+    std::string filename = findFile(options);
+    if (filename.empty())
+    {
+        return NULL;
+    }
+#if 0
+    if (debug)
+    {
+        fprintf(debug, "Opening library file %s\n", fn);
+    }
+#endif
+    return File::openRawHandle(filename, "r");
+}
+
+std::string DataFileFinder::findFile(const DataFileOptions &options) const
+{
+    if (options.bCurrentDir_ && Path::exists(options.filename_))
+    {
+        return options.filename_;
+    }
+    if (impl_.get())
+    {
+        std::vector<std::string>::const_iterator i;
+        for (i = impl_->searchPath_.begin(); i != impl_->searchPath_.end(); ++i)
+        {
+            // TODO: Deal with an empty search path entry more reasonably.
+            std::string testPath = Path::join(*i, options.filename_);
+            // TODO: Consider skipping directories.
+            if (Path::exists(testPath))
+            {
+                return testPath;
+            }
+        }
+    }
+    const std::string &defaultPath = Impl::getDefaultPath();
+    if (!defaultPath.empty())
+    {
+        std::string testPath = Path::join(defaultPath, options.filename_);
+        if (Path::exists(testPath))
+        {
+            return testPath;
+        }
+    }
+    if (options.bThrow_)
+    {
+        const char *const envName   = (impl_.get() ? impl_->envName_ : NULL);
+        const bool        bEnvIsSet = (impl_.get() ? impl_->bEnvIsSet_ : false);
+        std::string       message(
+                formatString("Library file '%s' not found", options.filename_));
+        if (options.bCurrentDir_)
+        {
+            message.append(" in current dir nor");
+        }
+        if (bEnvIsSet)
+        {
+            message.append(formatString(" in your %s path nor", envName));
+        }
+        message.append(" in the default directories.\nThe following paths were searched:");
+        if (options.bCurrentDir_)
+        {
+            message.append("\n  ");
+            message.append(Path::getWorkingDirectory());
+            message.append(" (current dir)");
+        }
+        if (impl_.get())
+        {
+            std::vector<std::string>::const_iterator i;
+            for (i = impl_->searchPath_.begin(); i != impl_->searchPath_.end(); ++i)
+            {
+                message.append("\n  ");
+                message.append(*i);
+            }
+        }
+        if (!defaultPath.empty())
+        {
+            message.append("\n  ");
+            message.append(defaultPath);
+            message.append(" (default)");
+        }
+        if (!bEnvIsSet && envName != NULL)
+        {
+            message.append(
+                    formatString("\nYou can set additional directories to search "
+                                 "with the %s path variable.", envName));
+        }
+        GMX_THROW(FileIOError(message));
+    }
+    return std::string();
+}
+
+std::vector<DataFileInfo>
+DataFileFinder::enumerateFiles(const DataFileOptions &options) const
+{
+    // TODO: Consider if not being able to list one of the directories should
+    // really be a fatal error. Or alternatively, check somewhere else that
+    // paths in GMXLIB are valid.
+    std::vector<DataFileInfo>                result;
+    std::vector<std::string>::const_iterator i;
+    if (options.bCurrentDir_)
+    {
+        std::vector<std::string> files
+            = DirectoryEnumerator::enumerateFilesWithExtension(
+                        ".", options.filename_, false);
+        for (i = files.begin(); i != files.end(); ++i)
+        {
+            result.push_back(DataFileInfo(".", *i, false));
+        }
+    }
+    if (impl_.get())
+    {
+        std::vector<std::string>::const_iterator j;
+        for (j = impl_->searchPath_.begin(); j != impl_->searchPath_.end(); ++j)
+        {
+            std::vector<std::string> files
+                = DirectoryEnumerator::enumerateFilesWithExtension(
+                            j->c_str(), options.filename_, false);
+            for (i = files.begin(); i != files.end(); ++i)
+            {
+                result.push_back(DataFileInfo(*j, *i, false));
+            }
+        }
+    }
+    const std::string &defaultPath = Impl::getDefaultPath();
+    if (!defaultPath.empty())
+    {
+        std::vector<std::string> files
+            = DirectoryEnumerator::enumerateFilesWithExtension(
+                        defaultPath.c_str(), options.filename_, false);
+        for (i = files.begin(); i != files.end(); ++i)
+        {
+            result.push_back(DataFileInfo(defaultPath, *i, true));
+        }
+    }
+    if (result.empty() && options.bThrow_)
+    {
+        // TODO: Print the search path as is done in findFile().
+        std::string message(
+                formatString("Could not find any files ending on '%s' in the "
+                             "current directory or the GROMACS library search path",
+                             options.filename_));
+        GMX_THROW(FileIOError(message));
+    }
+    return result;
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/datafilefinder.h b/src/gromacs/utility/datafilefinder.h
new file mode 100644 (file)
index 0000000..f675fce
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \file
+ * \brief
+ * Declares gmx::DataFileFinder and related classes.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_LIBFILEFINDER_H
+#define GMX_UTILITY_LIBFILEFINDER_H
+
+#include <cstdio>
+
+#include <string>
+#include <vector>
+
+#include "gromacs/utility/classhelpers.h"
+
+namespace gmx
+{
+
+class DataFileFinder;
+
+/*! \brief
+ * Search parameters for DataFileFinder.
+ *
+ * This class implements a named parameter idiom for DataFileFinder::findFile()
+ * and DataFileFinder::openFile() to support an easily readable and
+ * customizable way of searching data files.
+ *
+ * By default, the search first considers the current directory, followed by
+ * specified and default data directories, and an exception is thrown if the
+ * file could not be found.
+ * To skip searching in the current directory, use includeCurrentDir().
+ *
+ * Methods in this class do not throw.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+class DataFileOptions
+{
+    public:
+        /*! \brief
+         * Constructs default options for searching for a file with the
+         * specified name.
+         *
+         * \param[in] filename  File name to search for.
+         *
+         * This constructor is not explicit to allow passing a simple string to
+         * DataFileFinder methods to search for the string with the default
+         * parameters.
+         */
+        DataFileOptions(const char *filename)
+            : filename_(filename), bCurrentDir_(true), bThrow_(true)
+        {
+        }
+        //! \copydoc DataFileOptions(const char *)
+        DataFileOptions(const std::string &filename)
+            : filename_(filename.c_str()), bCurrentDir_(true), bThrow_(true)
+        {
+        }
+
+        //! Sets whether to search in the current (working) directory.
+        DataFileOptions &includeCurrentDir(bool bInclude)
+        {
+            bCurrentDir_ = bInclude;
+            return *this;
+        }
+        //! Sets whether an exception is thrown if the file could not be found.
+        DataFileOptions &throwIfNotFound(bool bThrow)
+        {
+            bThrow_ = bThrow;
+            return *this;
+        }
+
+    private:
+        const char *filename_;
+        bool        bCurrentDir_;
+        bool        bThrow_;
+
+        /*! \brief
+         * Needed to access the members without otherwise unnecessary accessors.
+         */
+        friend class DataFileFinder;
+};
+
+/*! \brief
+ * Information about a data file found by DataFileFinder::enumerateFiles().
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+struct DataFileInfo
+{
+    //! Initializes the structure with given values.
+    DataFileInfo(const std::string &dir, const std::string &name, bool bDefault)
+        : dir(dir), name(name), bFromDefaultDir(bDefault)
+    {
+    }
+
+    /*! \brief
+     * Directory from which the file was found.
+     *
+     * If the file was found from the current directory, this will be `"."`.
+     * In other cases, this will be a full path (except if the user-provided
+     * search path contains relative paths).
+     */
+    std::string dir;
+    /*! \brief
+     * Name of the file without any directory name.
+     */
+    std::string name;
+    /*! \brief
+     * Whether the file was found from the default directory.
+     *
+     * If `true`, the file was found from the default installation data
+     * directory, not from the current directory or any user-provided (through
+     * DataFileFinder::setSearchPathFromEnv()) location.
+     * \todo
+     * Consider replacing with an enum that identifies the source (current dir,
+     * GMXLIB, default).
+     */
+    bool        bFromDefaultDir;
+};
+
+/*! \brief
+ * Searches data files from a set of paths.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+class DataFileFinder
+{
+    public:
+        /*! \brief
+         * Constructs a default data file finder.
+         *
+         * The constructed finder searches only in the directory specified by
+         * the global program context (see ProgramContextInterface), and
+         * optionally in the current directory.
+         *
+         * Does not throw.
+         */
+        DataFileFinder();
+        ~DataFileFinder();
+
+        /*! \brief
+         * Adds search path from an environment variable.
+         *
+         * \param[in] envVarName  Name of the environment variable to use.
+         * \throws std::bad_alloc if out of memory.
+         *
+         * If the specified environment variable is set, it is interpreted like
+         * a `PATH` environment variable on the platform (split at appropriate
+         * separators), and each path found is added to the search path this
+         * finder searches.  The added paths take precedence over the default
+         * directory specified by the global program context, but the current
+         * directory is searched first.
+         */
+        void setSearchPathFromEnv(const char *envVarName);
+
+        /*! \brief
+         * Opens a data file if found.
+         *
+         * \param[in] options  Identifies the file to be searched for.
+         * \returns The opened file handle, or `NULL` if the file could not be
+         *     found and exceptions were turned off.
+         * \throws  std::bad_alloc if out of memory.
+         * \throws  FileIOError if
+         *   - no such file can be found, and \p options specifies that an
+         *     exception should be thrown, or
+         *   - there is an error opening the file (note that a file is skipped
+         *     during the search if the user does not have rights to open the
+         *     file at all).
+         *
+         * See findFile() for more details.
+         */
+        FILE *openFile(const DataFileOptions &options) const;
+        /*! \brief
+         * Finds a full path to a data file if found.
+         *
+         * \param[in] options  Identifies the file to be searched for.
+         * \returns Full path to the data file, or an empty string if the file
+         *     could not be found and exceptions were turned off.
+         * \throws  std::bad_alloc if out of memory.
+         * \throws  FileIOError if no such file can be found, and \p options
+         *     specifies that an exception should be thrown.
+         *
+         * Searches for a data file in the search paths configured for the
+         * finder, as well as in the current directory if so required.
+         * Returns the full path to the first file found.
+         */
+        std::string findFile(const DataFileOptions &options) const;
+        /*! \brief
+         * Enumerates files in the data directories.
+         *
+         * \param[in] options  Idenfies files to be searched for.
+         * \returns Information about each found file.
+         * \throws  std::bad_alloc if out of memory.
+         * \throws  FileIOError if no such file can be found, and \p options
+         *     specifies that an exception should be thrown.
+         *
+         * Enumerates all files in the data directories that have the
+         * extension/suffix specified by the file name in \p options.
+         * Unlike findFile() and openFile(), this only works on files that are
+         * in the actual data directories, not for any entry within
+         * subdirectories of those.
+         * See DataFileInfo for details on what is returned for each found
+         * file.
+         * Files from the same directory will be returned as a continuous block
+         * in the returned vector.
+         */
+        std::vector<DataFileInfo> enumerateFiles(const DataFileOptions &options) const;
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace gmx
+
+#endif
diff --git a/src/gromacs/utility/dir_separator.h b/src/gromacs/utility/dir_separator.h
new file mode 100644 (file)
index 0000000..d17aaae
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+/*! \libinternal \file
+ * \brief
+ * Provides OS-specific directory-name separator
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_DIR_SEPARATOR_H
+#define GMX_UTILITY_DIR_SEPARATOR_H
+
+#include "config.h"
+
+/*! \def DIR_SEPARATOR
+ * \brief
+ * Directory separator on this OS.
+ *
+ * Native Windows uses backslash path separators (but accepts also slashes).
+ * Cygwin and most other systems use slash.
+ *
+ * \todo Get rid of this (Redmine #950). It is not necessary for
+ * constructing paths on the systems that it currently supports, and
+ * is not reliable in parsing input paths either, since Windows needs
+ * to accept both instead of only DIR_SEPARATOR. At the very least, we
+ * should refactor the clients of this header so that they operate
+ * upon path objects rather than raw path strings.
+ */
+#ifdef GMX_NATIVE_WINDOWS
+#define DIR_SEPARATOR '\\'
+#else
+#define DIR_SEPARATOR '/'
+#endif
+
+#endif
diff --git a/src/gromacs/utility/directoryenumerator.cpp b/src/gromacs/utility/directoryenumerator.cpp
new file mode 100644 (file)
index 0000000..f6b34f9
--- /dev/null
@@ -0,0 +1,305 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2010,2011,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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements gmx::DirectoryEnumerator.
+ *
+ * \author Erik Lindahl (original C implementation)
+ * \author Teemu Murtola <teemu.murtola@gmail.com> (C++ wrapper + errno handling)
+ * \ingroup module_utility
+ */
+#include "gmxpre.h"
+
+#include "directoryenumerator.h"
+
+#include "config.h"
+
+#include <cerrno>
+#include <cstdio>
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef GMX_NATIVE_WINDOWS
+#include <io.h>
+#endif
+
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+/********************************************************************
+ * DirectoryEnumerator::Impl
+ */
+
+// TODO: Consider whether checking the return value of closing would be useful,
+// and what could we do if it fails?
+#if defined GMX_NATIVE_WINDOWS
+// TODO: Consider if Windows provides more error details through other APIs.
+class DirectoryEnumerator::Impl
+{
+    public:
+        static Impl *init(const char *dirname, bool bThrow)
+        {
+            std::string tmpname(dirname);
+            // Remove possible trailing directory separator.
+            // TODO: Use a method in gmx::Path instead.
+            if (tmpname.back() == '/' || tmpname.back() == '\\')
+            {
+                tmpname.pop_back();
+            }
+
+            // Add wildcard.
+            tmpname.append("/*");
+
+            errno = 0;
+            _finddata_t finddata;
+            intptr_t    handle = _findfirst(tmpname.c_str(), &finddata);
+            if (handle < 0L)
+            {
+                if (errno != ENOENT && bThrow)
+                {
+                    const int         code    = errno;
+                    const std::string message =
+                        formatString("Failed to list files in directory '%s'",
+                                     dirname);
+                    GMX_THROW_WITH_ERRNO(FileIOError(message), "_findfirst", code);
+                }
+                return NULL;
+            }
+            return new Impl(handle, finddata);
+        }
+        Impl(intptr_t handle, _finddata_t finddata)
+            : windows_handle(handle), finddata(finddata), bFirst_(true)
+        {
+        }
+        ~Impl()
+        {
+            _findclose(windows_handle);
+        }
+
+        bool nextFile(std::string *filename)
+        {
+            if (bFirst_)
+            {
+                *filename = finddata.name;
+                bFirst_   = false;
+                return true;
+            }
+            else
+            {
+                errno = 0;
+                if (_findnext(windows_handle, &finddata) != 0)
+                {
+                    if (errno == 0 || errno == ENOENT)
+                    {
+                        filename->clear();
+                        return false;
+                    }
+                    else
+                    {
+                        GMX_THROW_WITH_ERRNO(
+                                FileIOError("Failed to list files in a directory"),
+                                "_findnext", errno);
+                    }
+                }
+                *filename = finddata.name;
+                return true;
+            }
+        }
+
+    private:
+        intptr_t     windows_handle;
+        _finddata_t  finddata;
+        bool         bFirst_;
+};
+#elif defined HAVE_DIRENT_H
+class DirectoryEnumerator::Impl
+{
+    public:
+        static Impl *init(const char *dirname, bool bThrow)
+        {
+            errno       = 0;
+            DIR *handle = opendir(dirname);
+            if (handle == NULL)
+            {
+                if (bThrow)
+                {
+                    const int         code    = errno;
+                    const std::string message =
+                        formatString("Failed to list files in directory '%s'",
+                                     dirname);
+                    GMX_THROW_WITH_ERRNO(FileIOError(message), "opendir", code);
+                }
+                return NULL;
+            }
+            return new Impl(handle);
+        }
+        explicit Impl(DIR *handle) : dirent_handle(handle)
+        {
+            // TODO: Use memory allocation that throws, and handle
+            // exception safety (close handle) in such a case.
+            /* On some platforms no space is present for d_name in dirent.
+             * Since d_name is guaranteed to be the last entry, allocating
+             * extra space for dirent will allow more size for d_name.
+             * GMX_MAX_PATH should always be >= the max possible d_name.
+             */
+            smalloc(direntp_large, sizeof(*direntp_large) + GMX_PATH_MAX);
+        }
+        ~Impl()
+        {
+            sfree(direntp_large);
+            closedir(dirent_handle);
+        }
+
+        bool nextFile(std::string *filename)
+        {
+            errno = 0;
+            dirent *p;
+            int     rc = readdir_r(dirent_handle, direntp_large, &p);
+            if (p == NULL && rc == 0)
+            {
+                filename->clear();
+                return false;
+            }
+            else if (rc != 0)
+            {
+                GMX_THROW_WITH_ERRNO(
+                        FileIOError("Failed to list files in a directory"),
+                        "readdir_r", errno);
+            }
+            *filename = direntp_large->d_name;
+            return true;
+        }
+
+    private:
+        DIR    *dirent_handle;
+        dirent *direntp_large;
+};
+#else
+class DirectoryEnumerator::Impl
+{
+    public:
+        static Impl *init(const char * /*dirname*/, bool /*bThrow*/)
+        {
+            std::string message(
+                    "Source compiled without POSIX dirent or Windows support "
+                    "- cannot scan directories. In the very unlikely event "
+                    "this is not a compile-time mistake you could consider "
+                    "implementing support for your platform in "
+                    "directoryenumerator.cpp, but contact the developers "
+                    "to make sure it's really necessary!");
+            GMX_THROW(NotImplementedError(message));
+        }
+
+        bool nextFile(std::string * /*filename*/)
+        {
+            return false;
+        }
+};
+#endif
+
+/********************************************************************
+ * DirectoryEnumerator
+ */
+
+// static
+std::vector<std::string>
+DirectoryEnumerator::enumerateFilesWithExtension(
+        const char *dirname, const char *extension, bool bThrow)
+{
+    std::vector<std::string> result;
+    DirectoryEnumerator      dir(dirname, bThrow);
+    std::string              nextName;
+    while (dir.nextFile(&nextName))
+    {
+        if (debug)
+        {
+            std::fprintf(debug, "dir '%s' file '%s'\n",
+                         dirname, nextName.c_str());
+        }
+        // TODO: What about case sensitivity?
+        if (endsWith(nextName, extension))
+        {
+            result.push_back(nextName);
+        }
+    }
+
+    std::sort(result.begin(), result.end());
+    return result;
+}
+
+
+DirectoryEnumerator::DirectoryEnumerator(const char *dirname, bool bThrow)
+    : impl_(NULL)
+{
+    GMX_RELEASE_ASSERT(dirname != NULL && dirname[0] != '\0',
+                       "Attempted to open empty/null directory path");
+    impl_.reset(Impl::init(dirname, bThrow));
+}
+
+DirectoryEnumerator::DirectoryEnumerator(const std::string &dirname, bool bThrow)
+    : impl_(NULL)
+{
+    GMX_RELEASE_ASSERT(!dirname.empty(),
+                       "Attempted to open empty/null directory path");
+    impl_.reset(Impl::init(dirname.c_str(), bThrow));
+}
+
+DirectoryEnumerator::~DirectoryEnumerator()
+{
+}
+
+bool DirectoryEnumerator::nextFile(std::string *filename)
+{
+    if (!impl_.get())
+    {
+        filename->clear();
+        return false;
+    }
+    return impl_->nextFile(filename);
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/directoryenumerator.h b/src/gromacs/utility/directoryenumerator.h
new file mode 100644 (file)
index 0000000..2a3962c
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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::DirectoryEnumerator.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_DIRECTORYENUMERATOR_H
+#define GMX_UTILITY_DIRECTORYENUMERATOR_H
+
+#include <string>
+#include <vector>
+
+#include "gromacs/utility/classhelpers.h"
+
+namespace gmx
+{
+
+/*! \libinternal \brief
+ * Lists files in a directory.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+class DirectoryEnumerator
+{
+    public:
+        /*! \brief
+         * Convenience function to list files with certain extension from a
+         * directory.
+         *
+         * \param[in]  dirname   Path to the directory to list.
+         * \param[in]  extension List files with the given extension
+         *     (or suffix in file name).
+         * \param[in]  bThrow    Whether failure to open the directory should throw.
+         * \returns    List of files with the given extension in \p dirname.
+         * \throws std::bad_alloc if out of memory.
+         * \throws FileIOError if opening the directory fails and `bThrow == true`.
+         * \throws FileIOError if some other I/O error occurs.
+         */
+        static std::vector<std::string> enumerateFilesWithExtension(
+            const char *dirname, const char *extension, bool bThrow);
+
+        /*! \brief
+         * Opens a directory for listing.
+         *
+         * \param[in] dirname Path to the directory to list.
+         * \param[in] bThrow  Whether failure to open the directory should throw.
+         * \throws std::bad_alloc if out of memory.
+         * \throws FileIOError if opening the directory fails and `bThrow == true`
+         */
+        explicit DirectoryEnumerator(const char *dirname, bool bThrow = true);
+        //! \copydoc DirectoryEnumerator(const char *, bool)
+        explicit DirectoryEnumerator(const std::string &dirname, bool bThrow = true);
+        ~DirectoryEnumerator();
+
+        /*! \brief
+         * Gets next file in a directory.
+         *
+         * \param[out] filename  Name of the next file.
+         * \returns `false` if there were no more files.
+         * \throws  std::bad_alloc if out of memory.
+         * \throws  FileIOError if listing the next file fails.
+         *
+         * If all files from the directory have been returned (or there are no
+         * files in the directory and this is the first call), the method
+         * returns `false` and \p filename is cleared.
+         * Otherwise, the return value is `true` and the first/next file name
+         * is returned in \p filename.
+         * \p filename will not contain any path information, only the name of
+         * the file.
+         *
+         * If `bThrow` passed to the constructor was `false` and the directory
+         * was not successfully opened, the first call to this function will
+         * return `false`.
+         */
+        bool nextFile(std::string *filename);
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+} // namespace gmx
+
+#endif
index f03bf2d38b4dce265ea6dfbebcc9203167301e62..00c57aa67c4ac86d3f71fba0b1c96aaedf72d883 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
-#include "gromacs/utility/errorcodes.h"
+#include "gmxpre.h"
+
+#include "errorcodes.h"
 
 #include <cstdlib>
 
index 53e98d735c7c372917b102a542bb8b59589e7fea..a8f7159c296e910c5ee7c90380928a15ba1fda06 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "gmxpre.h"
 
 #include "errorformat.h"
 
+#include "config.h"
+
 #include <cctype>
 #include <cstdio>
 #include <cstring>
index 0f0d003696989cf3969e65dafcd5ad600d05b081..14fe155e434e892d378d644b6eecefa24b8e4377 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
+#include "gmxpre.h"
+
 #include "exceptions.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <cstring>
 
 #include <stdexcept>
 #include <typeinfo>
 
-#include <boost/exception/get_error_info.hpp>
 #include <boost/shared_ptr.hpp>
+#include <boost/exception/get_error_info.hpp>
 
 #include "thread_mpi/system_error.h"
 
-#include "gromacs/legacyheaders/network.h"
-
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/errorcodes.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
@@ -177,11 +176,15 @@ GromacsException::GromacsException(const ExceptionInitializer &details)
 const char *GromacsException::what() const throw()
 {
     const ErrorMessage *msg = boost::get_error_info<errinfo_message>(*this);
-    while (msg != NULL && msg->isContext())
+    if (msg == NULL)
+    {
+        return "No reason provided";
+    }
+    while (msg->isContext())
     {
         msg = &msg->child();
     }
-    return msg != NULL ? msg->text().c_str() : "No reason provided";
+    return msg->text().c_str();
 }
 
 void GromacsException::prependContext(const std::string &context)
@@ -378,6 +381,7 @@ void formatExceptionMessageInternal(MessageWriterInterface *writer,
         //                           funcPtr != NULL ? *funcPtr : "");
         // }
 
+        bool                bAnythingWritten = false;
         // TODO: Remove duplicate context if present in multiple nested exceptions.
         const ErrorMessage *msg = boost::get_error_info<errinfo_message>(*boostEx);
         if (msg != NULL)
@@ -391,11 +395,13 @@ void formatExceptionMessageInternal(MessageWriterInterface *writer,
             if (msg != NULL && !msg->text().empty())
             {
                 writer->writeLine(msg->text().c_str(), indent*2);
+                bAnythingWritten = true;
             }
         }
         else
         {
             writer->writeLine(ex.what(), indent*2);
+            bAnythingWritten = true;
         }
 
         const int *errorNumber
@@ -407,6 +413,7 @@ void formatExceptionMessageInternal(MessageWriterInterface *writer,
             writer->writeErrNoInfo(*errorNumber,
                                    funcName != NULL ? *funcName : NULL,
                                    (indent+1)*2);
+            bAnythingWritten = true;
         }
 
         // TODO: Treat also boost::nested_exception (not currently used, though)
@@ -424,7 +431,8 @@ void formatExceptionMessageInternal(MessageWriterInterface *writer,
                 }
                 catch (const std::exception &nestedEx)
                 {
-                    formatExceptionMessageInternal(writer, nestedEx, indent + 1);
+                    const int newIndent = indent + (bAnythingWritten ? 1 : 0);
+                    formatExceptionMessageInternal(writer, nestedEx, newIndent);
                 }
             }
         }
@@ -517,7 +525,7 @@ int processExceptionAtExit(const std::exception & /*ex*/)
 #ifdef GMX_LIB_MPI
     // TODO: Consider moving the output done in gmx_abort() into the message
     // printing routine above, so that this could become a simple MPI_Abort().
-    gmx_abort(gmx_node_rank(), gmx_node_num(), returnCode);
+    gmx_abort(returnCode);
 #endif
     return returnCode;
 }
index ace7b66224c830146d2d9bc503b8f3e840234987..36fdaceb7d567a6916087b2564887ef9029d6222 100644 (file)
 #include <vector>
 
 #include <boost/exception_ptr.hpp>
+#include <boost/throw_exception.hpp>
 #include <boost/exception/errinfo_api_function.hpp>
 #include <boost/exception/errinfo_errno.hpp>
 #include <boost/exception/exception.hpp>
 #include <boost/exception/info.hpp>
-#include <boost/throw_exception.hpp>
 
 namespace gmx
 {
@@ -398,6 +398,7 @@ class NotImplementedError : public APIError
         GMX_THROW((e) << boost::errinfo_errno(stored_errno_) \
                   << boost::errinfo_api_function(syscall)); \
     } while (0)
+//TODO: Add an equivalent macro for Windows GetLastError
 
 /*! \brief
  * Formats a standard fatal error message for reporting an exception.
similarity index 54%
rename from src/gromacs/gmxlib/gmx_fatal.c
rename to src/gromacs/utility/fatalerror.cpp
index 63353f1c41edad2dfcaf99263fca17e3a0bc944e..c2b040d51625b24d1b98041c4f9798cd647c10a8 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.
  */
-#include "gmx_fatal.h"
-#include "gmx_fatal_collective.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "fatalerror.h"
 
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <string.h>
+#include "config.h"
 
-#include "thread_mpi/threads.h"
+#include <cerrno>
+#include <cstddef>
+#include <cstdlib>
+#include <cstring>
+
+#include <exception>
 
-#include "main.h"
-#include "types/commrec.h"
-#include "network.h"
-#include "copyrite.h"
-#include "macros.h"
+#include "thread_mpi/threads.h"
 
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/programcontext.h"
+
+#ifdef GMX_MPI
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/gmxmpi.h"
-#include "gromacs/utility/smalloc.h"
+#endif
 
-static gmx_bool            bDebug         = FALSE;
-static FILE               *log_file       = NULL;
+static bool                bDebug         = false;
+static tMPI_Thread_mutex_t where_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
 
-static tMPI_Thread_mutex_t debug_mutex     = TMPI_THREAD_MUTEX_INITIALIZER;
-static tMPI_Thread_mutex_t where_mutex     = TMPI_THREAD_MUTEX_INITIALIZER;
+FILE                      *debug          = NULL;
+gmx_bool                   gmx_debug_at   = FALSE;
 
-gmx_bool bDebugMode(void)
+static FILE               *log_file       = NULL;
+static tMPI_Thread_mutex_t error_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
+static const char *const   gmxuser
+    = "Please report this to the mailing list (gmx-users@gromacs.org)";
+
+void gmx_init_debug(const int dbglevel, const char *dbgfile)
 {
-    gmx_bool ret;
-#if 0
-    tMPI_Thread_mutex_lock(&debug_mutex);
-#endif
-    ret = bDebug;
-#if 0
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-#endif
-    return bDebug;
+    if (!bDebug)
+    {
+        gmx_disable_file_buffering();
+        debug  = gmx_ffopen(dbgfile, "w+");
+        bDebug = true;
+        if (dbglevel >= 2)
+        {
+            gmx_debug_at = TRUE;
+        }
+    }
 }
 
-void gmx_fatal_set_log_file(FILE *fp)
+gmx_bool bDebugMode(void)
 {
-    log_file = fp;
+    return bDebug;
 }
 
 void _where(const char *file, int line)
@@ -126,11 +132,16 @@ void _where(const char *file, int line)
     }
 }
 
+void gmx_fatal_set_log_file(FILE *fp)
+{
+    log_file = fp;
+}
+
 static int fatal_errno = 0;
 
-static void quit_gmx(const char *msg)
+static void default_error_handler(const char *msg)
 {
-    tMPI_Thread_mutex_lock(&debug_mutex);
+    tMPI_Thread_mutex_lock(&error_mutex);
     if (fatal_errno == 0)
     {
         if (log_file)
@@ -150,212 +161,127 @@ static void quit_gmx(const char *msg)
         }
         perror(msg);
     }
+    tMPI_Thread_mutex_unlock(&error_mutex);
+}
 
-#ifdef GMX_LIB_MPI
-    if (gmx_mpi_initialized())
-    {
-        int  nnodes;
-        int  noderank;
-
-        nnodes   = gmx_node_num();
-        noderank = gmx_node_rank();
-
-        if (nnodes > 1)
-        {
-            fprintf(stderr, "Error on rank %d, will try to stop all ranks\n",
-                    noderank);
-        }
-        gmx_abort(noderank, nnodes, -1);
-    }
-#endif
-
-    if (debug)
-    {
-        fflush(debug);
-    }
-    if (bDebugMode())
-    {
-        fprintf(stderr, "dump core (y/n):");
-        fflush(stderr);
-        if (toupper(getc(stdin)) != 'N')
-        {
-            (void) abort();
-        }
-    }
+static void (*gmx_error_handler)(const char *msg) = default_error_handler;
 
-    exit(fatal_errno);
-    tMPI_Thread_mutex_unlock(&debug_mutex);
+void set_gmx_error_handler(void (*func)(const char *msg))
+{
+    // TODO: Either this is unnecessary, or also reads to the handler should be
+    // protected by a mutex.
+    tMPI_Thread_mutex_lock(&error_mutex);
+    gmx_error_handler = func;
+    tMPI_Thread_mutex_unlock(&error_mutex);
 }
 
-/* The function below should be identical to quit_gmx,
- * except that is does not actually quit and call gmx_abort.
- */
-static void quit_gmx_noquit(const char *msg)
+static void call_error_handler(const char *key, const char *file, int line, const char *msg)
 {
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    if (!fatal_errno)
-    {
-        if (log_file)
-        {
-            fprintf(log_file, "%s\n", msg);
-        }
-        fprintf(stderr, "%s\n", msg);
-        /* we set it to no-zero because if this function is called, something
-           has gone wrong */
-        fatal_errno = 255;
-    }
-    else
+    char        buf[10240], errerrbuf[1024];
+    const char *llines = "-------------------------------------------------------";
+    char       *strerr;
+
+    if (msg == NULL)
     {
-        if (fatal_errno != -1)
-        {
-            errno = fatal_errno;
-        }
-        perror(msg);
+        sprintf(errerrbuf, "Empty fatal_error message. %s", gmxuser);
     }
-
-#ifndef GMX_LIB_MPI
-    if (debug)
+    // In case ProgramInfo is not initialized and there is an issue with the
+    // initialization, fall back to "GROMACS".
+    const char *programName = "GROMACS";
+    try
     {
-        fflush(debug);
+        programName = gmx::getProgramContext().displayName();
     }
-    if (bDebugMode())
+    catch (const std::exception &)
     {
-        fprintf(stderr, "dump core (y/n):");
-        fflush(stderr);
-        if (toupper(getc(stdin)) != 'N')
-        {
-            (void) abort();
-        }
     }
-#endif
 
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-}
-
-void gmx_fatal(int f_errno, const char *file, int line, const char *fmt, ...)
-{
-    va_list ap;
-    char    msg[STRLEN];
-
-    va_start(ap, fmt);
-    vsprintf(msg, fmt, ap);
-    va_end(ap);
-
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    fatal_errno = f_errno;
-    tMPI_Thread_mutex_unlock(&debug_mutex);
+    strerr = gmx_strerror(key);
+    sprintf(buf, "\n%s\nProgram %s, %s\n"
+            "Source code file: %s, line: %d\n\n"
+            "%s:\n%s\nFor more information and tips for troubleshooting, please check the GROMACS\n"
+            "website at http://www.gromacs.org/Documentation/Errors\n%s\n",
+            llines, programName, gmx_version(), file, line,
+            strerr, msg ? msg : errerrbuf, llines);
+    free(strerr);
 
-    _gmx_error("fatal", msg, file, line);
+    gmx_error_handler(buf);
 }
 
-void gmx_fatal_collective(int f_errno, const char *file, int line,
-                          const t_commrec *cr, gmx_domdec_t *dd,
-                          const char *fmt, ...)
+gmx_noreturn static void do_exit(bool bMaster, bool bFinalize)
 {
-    gmx_bool    bFinalize;
-    va_list     ap;
-    char        msg[STRLEN];
-#ifdef GMX_MPI
-    int         result;
-#endif
-
-    bFinalize = TRUE;
-
-#ifdef GMX_MPI
-    /* Check if we are calling on all processes in MPI_COMM_WORLD */
-    if (cr != NULL)
-    {
-        MPI_Comm_compare(cr->mpi_comm_mysim, MPI_COMM_WORLD, &result);
-    }
-    else
+    if (debug)
     {
-        MPI_Comm_compare(dd->mpi_comm_all, MPI_COMM_WORLD, &result);
+        fflush(debug);
     }
-    /* Any result except MPI_UNEQUAL allows us to call MPI_Finalize */
-    bFinalize = (result != MPI_UNEQUAL);
-#endif
 
-    if ((cr != NULL && MASTER(cr)  ) ||
-        (dd != NULL && DDMASTER(dd)))
+#ifdef GMX_MPI
+    if (gmx_mpi_initialized())
     {
-        va_start(ap, fmt);
-        vsprintf(msg, fmt, ap);
-        va_end(ap);
-
-        tMPI_Thread_mutex_lock(&debug_mutex);
-        fatal_errno = f_errno;
-        tMPI_Thread_mutex_unlock(&debug_mutex);
-
         if (bFinalize)
         {
-            /* Use an error handler that does not quit */
-            set_gmx_error_handler(quit_gmx_noquit);
+            /* Broadcast the fatal error number possibly modified
+             * on the master process, in case the user would like
+             * to use the return status on a non-master process.
+             * The master process in cr and dd always has global rank 0.
+             */
+            MPI_Bcast(&fatal_errno, sizeof(fatal_errno), MPI_BYTE,
+                      0, MPI_COMM_WORLD);
+
+            /* Finalize nicely instead of aborting */
+            MPI_Finalize();
+        }
+        else if (bMaster)
+        {
+#ifdef GMX_LIB_MPI
+            gmx_abort(1);
+#endif
+        }
+        else
+        {
+            /* Let all other processes wait till the master has printed
+             * the error message and issued MPI_Abort.
+             */
+            MPI_Barrier(MPI_COMM_WORLD);
         }
-
-        _gmx_error("fatal", msg, file, line);
     }
+#else
+    GMX_UNUSED_VALUE(bMaster);
+    GMX_UNUSED_VALUE(bFinalize);
+#endif
 
-#ifdef GMX_MPI
-    if (bFinalize)
-    {
-        /* Broadcast the fatal error number possibly modified
-         * on the master process, in case the user would like
-         * to use the return status on a non-master process.
-         * The master process in cr and dd always has global rank 0.
-         */
-        MPI_Bcast(&fatal_errno, sizeof(fatal_errno), MPI_BYTE,
-                  0, MPI_COMM_WORLD);
-
-        /* Finalize nicely instead of aborting */
-        MPI_Finalize();
-    }
-    else
+    if (bDebugMode())
     {
-        /* Let all other processes wait till the master has printed
-         * the error message and issued MPI_Abort.
-         */
-        MPI_Barrier(MPI_COMM_WORLD);
+        std::abort();
     }
-#endif
-
-    exit(fatal_errno);
+    std::exit(1);
 }
 
-/*
- * These files are global variables in the gromacs preprocessor
- * Every routine in a file that includes gmx_fatal.h can write to these
- * debug channels. Depending on the debuglevel used
- * 0 to 3 of these filed are redirected to /dev/null
- *
- */
-FILE    *debug           = NULL;
-gmx_bool gmx_debug_at    = FALSE;
-
-void init_debug(const int dbglevel, const char *dbgfile)
+void gmx_fatal_mpi_va(int f_errno, const char *file, int line,
+                      gmx_bool bMaster, gmx_bool bFinalize,
+                      const char *fmt, va_list ap)
 {
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    if (!bDebug) /* another thread hasn't already run this*/
+    if (bMaster)
     {
-        no_buffers();
-        debug  = gmx_fio_fopen(dbgfile, "w+");
-        bDebug = TRUE;
-        if (dbglevel >= 2)
-        {
-            gmx_debug_at = TRUE;
-        }
-    }
-    tMPI_Thread_mutex_unlock(&debug_mutex);
-}
+        char msg[STRLEN];
+        vsprintf(msg, fmt, ap);
+
+        tMPI_Thread_mutex_lock(&error_mutex);
+        fatal_errno = f_errno;
+        tMPI_Thread_mutex_unlock(&error_mutex);
 
-static const char *gmxuser = "Please report this to the mailing list (gmx-users@gromacs.org)";
+        call_error_handler("fatal", file, line, msg);
+    }
 
-static void        (*gmx_error_handler)(const char *msg) = quit_gmx;
+    do_exit(bMaster, bFinalize);
+}
 
-void set_gmx_error_handler(void (*func)(const char *msg))
+void gmx_fatal(int f_errno, const char *file, int line, const char *fmt, ...)
 {
-    tMPI_Thread_mutex_lock(&debug_mutex);
-    gmx_error_handler = func;
-    tMPI_Thread_mutex_unlock(&debug_mutex);
+    va_list ap;
+    va_start(ap, fmt);
+    gmx_fatal_mpi_va(f_errno, file, line, TRUE, FALSE, fmt, ap);
+    va_end(ap);
 }
 
 char *gmx_strerror(const char *key)
@@ -375,11 +301,9 @@ char *gmx_strerror(const char *key)
         { "input",  "Input error or input inconsistency" },
         { "mem",    "Memory allocation/freeing error" },
         { "open",   "Can not open file" },
-        { "range",  "Range checking error" }
+        { "range",  "Range checking error" },
+        { NULL,     NULL}
     };
-#define NMSG asize(msg)
-    char        buf[1024];
-    size_t      i;
 
     if (key == NULL)
     {
@@ -387,49 +311,24 @@ char *gmx_strerror(const char *key)
     }
     else
     {
-        for (i = 0; (i < NMSG); i++)
+        for (size_t i = 0; msg[i].key != NULL; ++i)
         {
             if (strcmp(key, msg[i].key) == 0)
             {
-                break;
+                return strdup(msg[i].msg);
             }
         }
-        if (i == NMSG)
-        {
-            sprintf(buf, "No error message associated with key %s\n%s", key, gmxuser);
-            return strdup(buf);
-        }
-        else
-        {
-            return strdup(msg[i].msg);
-        }
+        char buf[1024];
+        sprintf(buf, "No error message associated with key %s\n%s", key, gmxuser);
+        return strdup(buf);
     }
 }
 
 
 void _gmx_error(const char *key, const char *msg, const char *file, int line)
 {
-    char        buf[10240], errerrbuf[1024];
-    const char *llines = "-------------------------------------------------------";
-    char       *strerr;
-
-    /* protect the audience from suggestive discussions */
-
-    if (msg == NULL)
-    {
-        sprintf(errerrbuf, "Empty fatal_error message. %s", gmxuser);
-    }
-
-    strerr = gmx_strerror(key);
-    sprintf(buf, "\n%s\nProgram %s, %s\n"
-            "Source code file: %s, line: %d\n\n"
-            "%s:\n%s\nFor more information and tips for troubleshooting, please check the GROMACS\n"
-            "website at http://www.gromacs.org/Documentation/Errors\n%s\n",
-            llines, ShortProgram(), GromacsVersion(), file, line,
-            strerr, msg ? msg : errerrbuf, llines);
-    free(strerr);
-
-    gmx_error_handler(buf);
+    call_error_handler(key, file, line, msg);
+    do_exit(true, false);
 }
 
 void _range_check(int n, int n_min, int n_max, const char *warn_str,
similarity index 78%
rename from src/gromacs/legacyheaders/gmx_fatal.h
rename to src/gromacs/utility/fatalerror.h
index 8bf145b35e8f997bbbf0e83dbcc9639ce92891d9..1dd4cff339c1fe4cc1333c72c4f72a590e16f720 100644 (file)
  * Declares fatal error handling and debugging routines for C code.
  *
  * \inpublicapi
+ * \ingroup module_utility
  */
-#ifndef _fatal_h
-#define _fatal_h
+#ifndef GMX_UTILITY_FATALERROR_H
+#define GMX_UTILITY_FATALERROR_H
 
+#include <stdarg.h>
 #include <stdio.h>
 
-#include "types/simple.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef __has_feature
-/** For compatibility with non-clang compilers. */
-#define __has_feature(x) 0
-#endif
+/*! \brief
+ * Debug log file.
+ *
+ * Functions can write to this file for debug info.
+ * Before writing to it, it should be checked whether the file is not NULL:
+ * \code
+   if (debug)
+   {
+       fprintf(debug, "%s", "Debug text");
+   }
+   \endcode
+ */
+extern FILE    *debug;
+/** Whether extra debugging is enabled. */
+extern gmx_bool gmx_debug_at;
 
-/*! \def GMX_ATTRIBUTE_NORETURN
- * \brief
- * Indicate that a function is not expected to return.
+/*! \brief
+ * Initializes debugging variables.
  *
- * \todo
- * There are functions outside this header that need the same attribute.
- * This could be moved to a generic header and made it affect also compiler
- * code generation.
+ * This function is not threadsafe.  It should be called as part of
+ * initializing \Gromacs, before any other thread accesses the library.
+ * For command line programs, gmx::CommandLineModuleManager takes care
+ * of this if the user requests debugging.
  */
-#ifndef GMX_ATTRIBUTE_NORETURN
-#if __has_feature(attribute_analyzer_noreturn)
-#define GMX_ATTRIBUTE_NORETURN __attribute__((analyzer_noreturn))
-#else
-#define GMX_ATTRIBUTE_NORETURN
-#endif
-#endif
+void gmx_init_debug(const int dbglevel, const char *dbgfile);
+
+/** Returns TRUE when the program was started in debug mode */
+gmx_bool bDebugMode(void);
 
 /** Implementation for where(). */
 void
@@ -79,6 +88,40 @@ _where(const char *file, int line);
 /** Prints filename and line to stdlog. */
 #define where() _where(__FILE__, __LINE__)
 
+/** Sets the log file for printing error messages. */
+void
+gmx_fatal_set_log_file(FILE *fp);
+
+/*! \brief
+ * Sets an error handler for gmx_fatal() and other fatal error routines.
+ *
+ * The default handler prints the message.
+ * \Gromacs will terminate the program after the error handler returns.
+ * To make gmx_fatal_collective() work, the error handler should not terminate
+ * the program, as it cannot know what is the desired way of termination.
+ * The string passed to the handler may be a multi-line string.
+ *
+ * \see gmx_fatal()
+ */
+void
+set_gmx_error_handler(void (*func)(const char *msg));
+
+/*! \brief
+ * Low-level fatal error reporting routine for collective MPI errors.
+ *
+ * This function works as gmx_fatal(), but provides additional control for
+ * cases where it is known that the same error occurs on multiple MPI ranks.
+ * The error handler is called only if \p bMaster is `TRUE`, and MPI_Finalize()
+ * is called instead of MPI_Abort() in MPI-enabled \Gromacs if \p bFinalize is
+ * `TRUE`.
+ *
+ * This is used to implement gmx_fatal_collective() (which cannot be declared
+ * here, since it would bring with it mdrun-specific dependencies).
+ */
+gmx_noreturn void
+gmx_fatal_mpi_va(int fatal_errno, const char *file, int line, gmx_bool bMaster,
+                 gmx_bool bFinalize, const char *fmt, va_list ap);
+
 /*! \brief
  * Fatal error reporting routine for \Gromacs.
  *
@@ -92,7 +135,7 @@ _where(const char *file, int line);
  * The format of \p fmt uses printf()-like formatting.
  *
  * In case all MPI processes want to stop with the same fatal error,
- * use gmx_fatal_collective(), declared in gmx_fatal_collective.h,
+ * use gmx_fatal_collective(), declared in network.h,
  * to avoid having as many error messages as processes.
  *
  * The first three parameters can be provided through ::FARGS:
@@ -100,61 +143,11 @@ _where(const char *file, int line);
    gmx_fatal(FARGS, fmt, ...);
    \endcode
  */
-void
-gmx_fatal(int fatal_errno, const char *file, int line, const char *fmt, ...) GMX_ATTRIBUTE_NORETURN;
+gmx_noreturn void
+gmx_fatal(int fatal_errno, const char *file, int line, const char *fmt, ...);
 /** Helper macro to pass first three parameters to gmx_fatal(). */
 #define FARGS 0, __FILE__, __LINE__
 
-/** Sets the log file for printing error messages. */
-void
-gmx_fatal_set_log_file(FILE *fp);
-
-/*! \brief
- * Debug log file.
- *
- * Functions can write to this file for debug info.
- * Before writing to it, it should be checked whether the file is not NULL:
- * \code
-   if (debug)
-   {
-       fprintf(debug, "%s", "Debug text");
-   }
-   \endcode
- */
-extern FILE    *debug;
-/** Whether extra debugging is enabled. */
-extern gmx_bool gmx_debug_at;
-
-/** Initializes debugging variables */
-void init_debug(const int dbglevel, const char *dbgfile);
-
-/** Returns TRUE when the program was started in debug mode */
-gmx_bool bDebugMode(void);
-
-/*! \brief
- * Implementation for range_check() and range_check_mesg().
- *
- * \p warn_str can be NULL.
- */
-void _range_check(int n, int n_min, int n_max, const char *warn_str,
-                  const char *var,
-                  const char *file, int line);
-
-/*! \brief
- * Checks that a variable is within a range.
- *
- * If \p n is not in range [n_min, n_max), a fatal error is raised.
- * \p n_min is inclusive, but \p n_max is not.
- */
-#define range_check_mesg(n, n_min, n_max, str) _range_check(n, n_min, n_max, str,#n, __FILE__, __LINE__)
-
-/*! \brief
- * Checks that a variable is within a range.
- *
- * This works as range_check_mesg(), but with a default error message.
- */
-#define range_check(n, n_min, n_max) _range_check(n, n_min, n_max, NULL,#n, __FILE__, __LINE__)
-
 /*! \brief
  * Returns error message corresponding to a string key.
  *
@@ -164,7 +157,7 @@ void _range_check(int n, int n_min, int n_max, const char *warn_str,
 char *gmx_strerror(const char *key);
 
 /** Implementation for gmx_error(). */
-void _gmx_error(const char *key, const char *msg, const char *file, int line) GMX_ATTRIBUTE_NORETURN;
+gmx_noreturn void _gmx_error(const char *key, const char *msg, const char *file, int line);
 /*! \brief
  * Alternative fatal error routine with canned messages.
  *
@@ -194,18 +187,28 @@ void _gmx_error(const char *key, const char *msg, const char *file, int line) GM
 /*! \} */
 
 /*! \brief
- * Sets an error handler for gmx_fatal() and other fatal error routines.
+ * Implementation for range_check() and range_check_mesg().
  *
- * The default handler prints the message and aborts the program.
- * If you set a custom handler, it must also abort the program, otherwise
- * \Gromacs will behave unpredictably (most likely, it crashes shortly after
- * the fatal error).
- * The string passed to the handler may be a multi-line string.
+ * \p warn_str can be NULL.
+ */
+void _range_check(int n, int n_min, int n_max, const char *warn_str,
+                  const char *var,
+                  const char *file, int line);
+
+/*! \brief
+ * Checks that a variable is within a range.
  *
- * \see gmx_fatal()
+ * If \p n is not in range [n_min, n_max), a fatal error is raised.
+ * \p n_min is inclusive, but \p n_max is not.
  */
-void
-set_gmx_error_handler(void (*func)(const char *msg));
+#define range_check_mesg(n, n_min, n_max, str) _range_check(n, n_min, n_max, str,#n, __FILE__, __LINE__)
+
+/*! \brief
+ * Checks that a variable is within a range.
+ *
+ * This works as range_check_mesg(), but with a default error message.
+ */
+#define range_check(n, n_min, n_max) _range_check(n, n_min, n_max, NULL,#n, __FILE__, __LINE__)
 
 /*! \brief
  * Prints a warning message to stderr.
index 787cb72c5ab33702d54f68ba192bf17752712157..dbd809c38b2bf5a4f1c56737c9a8e88ab8c14871 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
+#include "gmxpre.h"
+
 #include "file.h"
 
+#include "config.h"
+
 #include <cerrno>
 #include <cstdio>
 #include <cstring>
@@ -49,9 +53,8 @@
 #include <string>
 #include <vector>
 
-#include "config.h"
-
 #include <sys/stat.h>
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -106,6 +109,25 @@ File::Impl::~Impl()
     }
 }
 
+// static
+FILE *File::openRawHandle(const char *filename, const char *mode)
+{
+    FILE *fp = fopen(filename, mode);
+    if (fp == NULL)
+    {
+        GMX_THROW_WITH_ERRNO(
+                FileIOError(formatString("Could not open file '%s'", filename)),
+                "fopen", errno);
+    }
+    return fp;
+}
+
+// static
+FILE *File::openRawHandle(const std::string &filename, const char *mode)
+{
+    return openRawHandle(filename.c_str(), mode);
+}
+
 File::File(const char *filename, const char *mode)
     : impl_(new Impl(NULL, true))
 {
@@ -132,13 +154,7 @@ void File::open(const char *filename, const char *mode)
     GMX_RELEASE_ASSERT(impl_->fp_ == NULL,
                        "Attempted to open the same file object twice");
     // TODO: Port all necessary functionality from gmx_ffopen() here.
-    impl_->fp_ = fopen(filename, mode);
-    if (impl_->fp_ == NULL)
-    {
-        GMX_THROW_WITH_ERRNO(
-                FileIOError(formatString("Could not open file '%s'", filename)),
-                "fopen", errno);
-    }
+    impl_->fp_ = openRawHandle(filename, mode);
 }
 
 void File::open(const std::string &filename, const char *mode)
@@ -374,6 +390,7 @@ void File::writeFileFromString(const std::string &filename,
 {
     File file(filename, "w");
     file.writeString(text);
+    file.close();
 }
 
 } // namespace gmx
index 15b48d16a559533fcb7507d625e3e008df17a6d2..d1f354c9a44b20745ae3c68587fbe96c35e208cd 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,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.
@@ -47,7 +47,7 @@
 
 #include <string>
 
-#include "common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -64,6 +64,19 @@ namespace gmx
 class File
 {
     public:
+        /*! \brief
+         * Opens a file and returns a `FILE` handle.
+         *
+         * \param[in] filename  Path of the file to open.
+         * \param[in] mode      Mode to open the file in (for fopen()).
+         * \throws    FileIOError on any I/O error.
+         *
+         * Instead of returning `NULL` on errors, throws an exception with
+         * additional details (including the file name and `errno`).
+         */
+        static FILE *openRawHandle(const char *filename, const char *mode);
+        //! \copydoc openRawHandle(const char *, const char *)
+        static FILE *openRawHandle(const std::string &filename, const char *mode);
         /*! \brief
          * Creates a file object and opens a file.
          *
similarity index 61%
rename from src/gromacs/fileio/futil.cpp
rename to src/gromacs/utility/futil.cpp
index a93bf6f1f0a6a55ddda9693fb51e426c874d15a1..535c7e93f1ef816f44b2882b1efa2c7d0bfa2771 100644 (file)
@@ -3,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,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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
+#include "gmxpre.h"
+
+#include "futil.h"
+
 #include "config.h"
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
-
-#ifdef HAVE_DIRENT_H
-/* POSIX */
-#include <dirent.h>
-#endif
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-
 #ifdef GMX_NATIVE_WINDOWS
-#include <windows.h>
-#include <direct.h>
+#include <direct.h>   // For _chdir() and _getcwd()
 #include <io.h>
-#endif
-
-/* Windows file stuff, only necessary for visual studio */
-#ifdef _MSC_VER
 #include <windows.h>
 #endif
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/types/commrec.h"
-#include "gromacs/legacyheaders/network.h"
-
-#include "gromacs/fileio/futil.h"
-#include "gromacs/fileio/path.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/path.h"
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
@@ -89,16 +78,68 @@ typedef struct t_pstack {
     struct t_pstack *prev;
 } t_pstack;
 
-static t_pstack    *pstack      = NULL;
-static gmx_bool     bUnbuffered = FALSE;
+static t_pstack    *pstack           = NULL;
+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;
 
-void no_buffers(void)
+namespace gmx
 {
-    bUnbuffered = TRUE;
+namespace
+{
+//! Global library file finder; stores the object set with setLibraryFileFinder().
+const DataFileFinder *g_libFileFinder;
+//! Default library file finder if nothing is set.
+const DataFileFinder  g_defaultLibFileFinder;
+}   // namespace
+
+const DataFileFinder &getLibraryFileFinder()
+{
+    if (g_libFileFinder != NULL)
+    {
+        return *g_libFileFinder;
+    }
+    return g_defaultLibFileFinder;
+}
+
+void setLibraryFileFinder(const DataFileFinder *finder)
+{
+    g_libFileFinder = finder;
+}
+
+} // namespace gmx
+
+void gmx_disable_file_buffering(void)
+{
+    bUnbuffered = true;
+}
+
+void gmx_set_max_backup_count(int count)
+{
+    if (count < 0)
+    {
+        const char *env = getenv("GMX_MAXBACKUP");
+        if (env != NULL)
+        {
+            // TODO: Check that the value is converted properly.
+            count = strtol(env, NULL, 10);
+            if (count < 0)
+            {
+                count = 0;
+            }
+        }
+        else
+        {
+            // Use a reasonably low value for countmax; we might
+            // generate 4-5 files in each round, and we don't
+            // want to hit directory limits of 1024 or 2048 files.
+            count = 99;
+        }
+    }
+    s_maxBackupCount = count;
 }
 
 void push_ps(FILE *fp)
@@ -199,10 +240,6 @@ int gmx_ffclose(FILE *fp)
 }
 
 
-#ifdef rewind
-#undef rewind
-#endif
-
 void frewind(FILE *fp)
 {
     tMPI_Thread_mutex_lock(&pstack_mutex);
@@ -252,26 +289,26 @@ gmx_off_t gmx_ftell(FILE *stream)
 #endif
 }
 
-
-gmx_bool is_pipe(FILE *fp)
+int gmx_truncate(const char *filename, gmx_off_t length)
 {
-    tMPI_Thread_mutex_lock(&pstack_mutex);
-
-    t_pstack *ps = pstack;
-    while (ps != NULL)
+#ifdef GMX_NATIVE_WINDOWS
+    FILE *fp = fopen(filename, "rb+");
+    if (fp == NULL)
     {
-        if (ps->fp == fp)
-        {
-            tMPI_Thread_mutex_unlock(&pstack_mutex);
-            return TRUE;
-        }
-        ps = ps->prev;
+        return -1;
     }
-    tMPI_Thread_mutex_unlock(&pstack_mutex);
-    return FALSE;
+#ifdef _MSC_VER
+    int rc = _chsize_s(fileno(fp), length);
+#else
+    int rc = _chsize(fileno(fp), length);
+#endif
+    fclose(fp);
+    return rc;
+#else
+    return truncate(filename, length);
+#endif
 }
 
-
 static FILE *uncompress(const char *fn, const char *mode)
 {
     FILE *fp;
@@ -330,57 +367,12 @@ gmx_bool gmx_fexist(const char *fname)
     }
 }
 
-
-gmx_bool gmx_fexist_master(const char *fname, t_commrec *cr)
-{
-    gmx_bool bExist;
-
-    if (SIMMASTER(cr))
-    {
-        bExist = gmx_fexist(fname);
-    }
-    if (PAR(cr))
-    {
-        gmx_bcast(sizeof(bExist), &bExist, cr);
-    }
-    return bExist;
-}
-
-gmx_bool gmx_eof(FILE *fp)
-{
-    char     data[4];
-    gmx_bool beof;
-
-    if (is_pipe(fp))
-    {
-        return feof(fp);
-    }
-    else
-    {
-        if ((beof = fread(data, 1, 1, fp)) == 1)
-        {
-            gmx_fseek(fp, -1, SEEK_CUR);
-        }
-        return !beof;
-    }
-}
-
-static char *backup_fn(const char *file, int count_max)
+static char *backup_fn(const char *file)
 {
-    /* Use a reasonably low value for countmax; we might
-     * generate 4-5 files in each round, and we dont
-     * want to hit directory limits of 1024 or 2048 files.
-     */
-#define COUNTMAX 99
     int          i, count = 1;
     char        *directory, *fn;
     char        *buf;
 
-    if (count_max == -1)
-    {
-        count_max = COUNTMAX;
-    }
-
     smalloc(buf, GMX_PATH_MAX);
 
     for (i = strlen(file)-1; ((i > 0) && (file[i] != DIR_SEPARATOR)); i--)
@@ -407,14 +399,16 @@ static char *backup_fn(const char *file, int count_max)
         sprintf(buf, "%s/#%s.%d#", directory, fn, count);
         count++;
     }
-    while ((count <= count_max) && gmx_fexist(buf));
+    while ((count <= s_maxBackupCount) && gmx_fexist(buf));
 
     /* Arbitrarily bail out */
-    if (count > count_max)
+    if (count > s_maxBackupCount)
     {
+        /* TODO: The error message is only accurate for code that starts with
+         * Gromacs command-line interface. */
         gmx_fatal(FARGS, "Won't make more than %d backups of %s for you.\n"
                   "The env.var. GMX_MAXBACKUP controls this maximum, -1 disables backups.",
-                  count_max, fn);
+                  s_maxBackupCount, fn);
     }
 
     sfree(directory);
@@ -423,34 +417,15 @@ static char *backup_fn(const char *file, int count_max)
     return buf;
 }
 
-gmx_bool make_backup(const char * name)
+void make_backup(const char *name)
 {
-    char * env;
-    int    count_max;
-    char * backup;
-
-#ifdef GMX_FAHCORE
-    return FALSE; /* skip making backups */
-#else
-
+    if (s_maxBackupCount <= 0)
+    {
+        return;
+    }
     if (gmx_fexist(name))
     {
-        env = getenv("GMX_MAXBACKUP");
-        if (env != NULL)
-        {
-            count_max = strtol(env, NULL, 10);
-            if (count_max == -1)
-            {
-                /* Do not make backups and possibly overwrite old files */
-                return TRUE;
-            }
-        }
-        else
-        {
-            /* Use the default maximum */
-            count_max = -1;
-        }
-        backup = backup_fn(name, count_max);
+        char *backup = backup_fn(name);
         if (rename(name, backup) == 0)
         {
             fprintf(stderr, "\nBack Off! I just backed up %s to %s\n",
@@ -458,13 +433,10 @@ gmx_bool make_backup(const char * name)
         }
         else
         {
-            fprintf(stderr, "Sorry couldn't backup %s to %s\n", name, backup);
-            return FALSE;
+            fprintf(stderr, "\nSorry couldn't backup %s to %s\n", name, backup);
         }
         sfree(backup);
     }
-    return TRUE;
-#endif
 }
 
 FILE *gmx_ffopen(const char *file, const char *mode)
@@ -550,274 +522,38 @@ FILE *gmx_ffopen(const char *file, const char *mode)
 #endif
 }
 
-/* Our own implementation of dirent-like functionality to scan directories. */
-struct gmx_directory
-{
-#if defined(GMX_NATIVE_WINDOWS)
-    intptr_t             windows_handle;
-    struct _finddata_t   finddata;
-    int                  first;
-#elif defined(HAVE_DIRENT_H)
-    DIR  *               dirent_handle;
-#else
-    int                  dummy;
-#endif
-};
-
-
-int
-gmx_directory_open(gmx_directory_t *p_gmxdir, const char *dirname)
-{
-    struct gmx_directory *  gmxdir;
-    int                     rc;
-
-    snew(gmxdir, 1);
-
-    *p_gmxdir = gmxdir;
-
-#if defined(GMX_NATIVE_WINDOWS)
-    if (dirname != NULL && strlen(dirname) > 0)
-    {
-        char *     tmpname;
-        int        len;
-
-        len = strlen(dirname);
-        snew(tmpname, len+3);
-
-        strncpy(tmpname, dirname, len+1);
-
-        /* Remove possible trailing directory separator */
-        if (tmpname[len] == '/' || tmpname[len] == '\\')
-        {
-            tmpname[len] = '\0';
-        }
-
-        /* Add wildcard */
-        strcat(tmpname, "/*");
-
-        gmxdir->first = 1;
-        if ( (gmxdir->windows_handle = _findfirst(tmpname, &gmxdir->finddata)) > 0L)
-        {
-            rc = 0;
-        }
-        else
-        {
-            if (errno == EINVAL)
-            {
-                sfree(gmxdir);
-                *p_gmxdir = NULL;
-                rc        = EINVAL;
-            }
-            else
-            {
-                rc        = 0;
-            }
-        }
-    }
-    else
-    {
-        rc = EINVAL;
-    }
-#elif defined(HAVE_DIRENT_H)
-    if ( (gmxdir->dirent_handle = opendir(dirname)) != NULL)
-    {
-        rc = 0;
-    }
-    else
-    {
-        sfree(gmxdir);
-        *p_gmxdir = NULL;
-        rc        = EINVAL;
-    }
-#else
-    gmx_fatal(FARGS,
-              "Source compiled without POSIX dirent or windows support - cannot scan directories.\n"
-              "In the very unlikely event this is not a compile-time mistake you could consider\n"
-              "implementing support for your platform in futil.c, but contact the developers\n"
-              "to make sure it's really necessary!\n");
-    rc = -1;
-#endif
-    return rc;
-}
-
-
-int
-gmx_directory_nextfile(gmx_directory_t gmxdir, char *name, int maxlength_name)
-{
-    int                     rc;
-
-#if defined(GMX_NATIVE_WINDOWS)
-    if (gmxdir != NULL)
-    {
-        if (gmxdir->windows_handle <= 0)
-        {
-
-            name[0] = '\0';
-            rc      = ENOENT;
-        }
-        else if (gmxdir->first == 1)
-        {
-            strncpy(name, gmxdir->finddata.name, maxlength_name);
-            rc            = 0;
-            gmxdir->first = 0;
-        }
-        else
-        {
-            if (_findnext(gmxdir->windows_handle, &gmxdir->finddata) == 0)
-            {
-                strncpy(name, gmxdir->finddata.name, maxlength_name);
-                rc      = 0;
-            }
-            else
-            {
-                name[0] = '\0';
-                rc      = ENOENT;
-            }
-        }
-    }
-    else
-    {
-        name[0] = '\0';
-        rc      = EINVAL;
-    }
-#elif defined(HAVE_DIRENT_H)
-    struct dirent *         direntp_large;
-    struct dirent *         p;
-
-
-    if (gmxdir != NULL && gmxdir->dirent_handle != NULL)
-    {
-        /* On some platforms no space is present for d_name in dirent.
-         * Since d_name is guaranteed to be the last entry, allocating
-         * extra space for dirent will allow more size for d_name.
-         * GMX_MAX_PATH should always be >= the max possible d_name.
-         */
-        smalloc(direntp_large, sizeof(*direntp_large) + GMX_PATH_MAX);
-        rc = readdir_r(gmxdir->dirent_handle, direntp_large, &p);
-
-        if (p != NULL && rc == 0)
-        {
-            strncpy(name, direntp_large->d_name, maxlength_name);
-        }
-        else
-        {
-            name[0] = '\0';
-            rc      = ENOENT;
-        }
-        sfree(direntp_large);
-    }
-    else
-    {
-        name[0] = '\0';
-        rc      = EINVAL;
-    }
-#else
-    gmx_fatal(FARGS,
-              "Source compiled without POSIX dirent or windows support - cannot scan directories.\n");
-    rc = -1;
-#endif
-    return rc;
-}
-
-
-int
-gmx_directory_close(gmx_directory_t gmxdir)
-{
-    int                     rc;
-#if defined(GMX_NATIVE_WINDOWS)
-    rc = (gmxdir != NULL) ? _findclose(gmxdir->windows_handle) : EINVAL;
-#elif defined(HAVE_DIRENT_H)
-    rc = (gmxdir != NULL) ? closedir(gmxdir->dirent_handle) : EINVAL;
-#else
-    gmx_fatal(FARGS,
-              "Source compiled without POSIX dirent or windows support - cannot scan directories.\n");
-    rc = -1;
-#endif
-
-    sfree(gmxdir);
-    return rc;
-}
-
 
 char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal)
 {
-    bool bEnvIsSet = false;
     try
     {
-        if (bAddCWD && gmx_fexist(file))
+        const gmx::DataFileFinder &finder = gmx::getLibraryFileFinder();
+        std::string                result =
+            finder.findFile(gmx::DataFileOptions(file)
+                                .includeCurrentDir(bAddCWD)
+                                .throwIfNotFound(bFatal));
+        if (!result.empty())
         {
-            return gmx_strdup(file);
-        }
-        else
-        {
-            std::string  libpath;
-            // GMXLIB can be a path.
-            const char  *lib = getenv("GMXLIB");
-            if (lib != NULL)
-            {
-                bEnvIsSet = true;
-                libpath   = lib;
-            }
-            else
-            {
-                libpath = gmx::getProgramContext().defaultLibraryDataPath();
-            }
-
-            std::vector<std::string>                 pathEntries;
-            gmx::Path::splitPathEnvironment(libpath, &pathEntries);
-            std::vector<std::string>::const_iterator i;
-            for (i = pathEntries.begin(); i != pathEntries.end(); ++i)
-            {
-                std::string testPath = gmx::Path::join(*i, file);
-                if (gmx::Path::exists(testPath))
-                {
-                    return gmx_strdup(testPath.c_str());
-                }
-            }
+            return gmx_strdup(result.c_str());
         }
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-    if (bFatal)
-    {
-        if (bEnvIsSet)
-        {
-            gmx_fatal(FARGS,
-                      "Library file %s not found %sin your GMXLIB path.",
-                      file, bAddCWD ? "in current dir nor " : "");
-        }
-        else
-        {
-            gmx_fatal(FARGS,
-                      "Library file %s not found %sin default directories.\n"
-                      "(You can set the directories to search with the GMXLIB path variable)",
-                      file, bAddCWD ? "in current dir nor " : "");
-        }
-    }
     return NULL;
 }
 
 FILE *low_libopen(const char *file, gmx_bool bFatal)
 {
-    FILE *ff;
-    char *fn;
-
-    fn = low_gmxlibfn(file, TRUE, bFatal);
-
-    if (fn == NULL)
-    {
-        ff = NULL;
-    }
-    else
+    try
     {
-        if (debug)
-        {
-            fprintf(debug, "Opening library file %s\n", fn);
-        }
-        ff = fopen(fn, "r");
+        const gmx::DataFileFinder &finder = gmx::getLibraryFileFinder();
+        FILE *fp =
+            finder.openFile(gmx::DataFileOptions(file)
+                                .includeCurrentDir(true)
+                                .throwIfNotFound(bFatal));
+        return fp;
     }
-    sfree(fn);
-
-    return ff;
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+    return NULL;
 }
 
 char *gmxlibfn(const char *file)
@@ -870,28 +606,6 @@ void gmx_tmpnam(char *buf)
     /* name in Buf should now be OK */
 }
 
-int gmx_truncatefile(char *path, gmx_off_t length)
-{
-#ifdef GMX_NATIVE_WINDOWS
-    /* Microsoft visual studio does not have "truncate" */
-    HANDLE        fh;
-    LARGE_INTEGER win_length;
-
-    win_length.QuadPart = length;
-
-    fh = CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL,
-                    OPEN_EXISTING, 0, NULL);
-    SetFilePointerEx(fh, win_length, NULL, FILE_BEGIN);
-    SetEndOfFile(fh);
-    CloseHandle(fh);
-
-    return 0;
-#else
-    return truncate(path, length);
-#endif
-}
-
-
 int gmx_file_rename(const char *oldname, const char *newname)
 {
 #ifndef GMX_NATIVE_WINDOWS
@@ -994,13 +708,15 @@ int gmx_fsync(FILE *fp)
     rc = fah_fsync(fp);
 #else /* GMX_FAHCORE */
     {
-        int fn = -1;
+        int fn;
 
         /* get the file number */
 #if defined(HAVE_FILENO)
         fn = fileno(fp);
 #elif defined(HAVE__FILENO)
         fn = _fileno(fp);
+#else
+        fn = -1;
 #endif
 
         /* do the actual fsync */
diff --git a/src/gromacs/utility/futil.h b/src/gromacs/utility/futil.h
new file mode 100644 (file)
index 0000000..e213c5d
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * 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.
+ */
+/*! \file
+ * \brief
+ * Low-level wrappers for OS-specific file handling with some \Gromacs
+ * customizations.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_FUTIL_H
+#define GMX_UTILITY_FUTIL_H
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "gromacs/utility/basedefinitions.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if 0
+}
+#endif
+
+/*! \def GMX_PATH_MAX
+ * \brief
+ * Maximum path length, if the OS provides one, otherwise a fixed constant.
+ */
+#ifdef PATH_MAX
+#  define GMX_PATH_MAX PATH_MAX
+#elif defined MAX_PATH
+#  define GMX_PATH_MAX MAX_PATH
+#else
+#  define GMX_PATH_MAX 4096
+#endif
+
+/** \Gromacs definition to use instead of `off_t`. */
+typedef gmx_int64_t    gmx_off_t;
+
+/*! \brief
+ * Turn off buffering for output files (which is default) for debugging
+ * purposes.
+ *
+ * This only has effect on files opened with gmx_ffopen().
+ */
+void gmx_disable_file_buffering(void);
+
+/*! \brief
+ * Enables backups with the specified number of maximum backups.
+ *
+ * If \p count == 0, disables backups.  If not called, this is the default.
+ * If \p count == -1, reads the count from an environment variable.
+ *
+ * This is not currently thread-safe, as it is only called during
+ * initialization code.
+ */
+void gmx_set_max_backup_count(int count);
+
+/*! \brief
+ * Check whether a path exists.
+ *
+ * \returns `TRUE` when \p fname exists.
+ *
+ * Note that this returns `TRUE` even if \p fname is a directory instead of a
+ * file.
+ */
+gmx_bool gmx_fexist(const char *fname);
+
+/*! \brief
+ * Makes a backup of file if the file exists.
+ */
+void make_backup(const char *file);
+
+/*! \brief
+ * Opens a file, with \Gromacs-specific additions.
+ *
+ * If the file is in compressed format, opens a pipe which uncompresses the
+ * file on the fly.  For this to work, gmx_ffclose() and frewind() should
+ * always be used for files opened with gmx_ffopen() instead of fclose() and
+ * rewind().  For compressed files, the \p file parameter should be passed
+ * without the compressed extension; if that file is not found, then a few
+ * compression extensions are tried.
+ * Creates a backup if a file opened for writing already exists before
+ * overwriting it.
+ * A fatal error results if the file cannot be opened, for whatever reason.
+ */
+FILE *gmx_ffopen(const char *file, const char *mode);
+
+/** Closes a file opened with gmx_ffopen(). */
+int gmx_ffclose(FILE *fp);
+
+/*! \brief
+ * Wraps rewind() for files opened with gmx_ffopen().
+ *
+ * A fatal error results if this function is called for a pipe (a compressed
+ * input file).
+ */
+void frewind(FILE *fp);
+
+/** OS-independent 64-bit fseek(). */
+int gmx_fseek(FILE *stream, gmx_off_t offset, int whence);
+
+/** OS-independent 64-bit ftell(). */
+gmx_off_t gmx_ftell(FILE *stream);
+
+/** OS-independent truncate(). */
+int gmx_truncate(const char *filename, gmx_off_t length);
+
+/*! \brief
+ * Finds full path for a library file.
+ *
+ * Searches first in the current directory, and then in the configured library
+ * directories.
+ * Fatal error results if the file is not found in any location.
+ * The caller is responsible of freeing the returned string.
+ */
+char *gmxlibfn(const char *file);
+
+/*! \brief
+ * Opens a library file for reading.
+ *
+ * Works as gmxlibfn(), except that it opens the file and returns a file
+ * handle.
+ */
+FILE *libopen(const char *file);
+
+/*! \brief
+ * More flexible gmxlibfn().
+ *
+ * Works as gmxlibfn(), but provides control whether the current working
+ * directory is searched or not, and whether a missing file is a fatal error or
+ * not.
+ */
+char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal);
+
+/*! \brief
+ * Alternative for libopen() that optionally does not exit.
+ *
+ * Works as libopen(), but provides control whether a missing file is a fatal
+ * error or not.
+ */
+FILE *low_libopen(const char *file, gmx_bool bFatal);
+
+
+/*! \brief
+ * Creates unique name for temp file (wrapper around mkstemp).
+ *
+ * \p buf should be at least 7 bytes long
+ */
+void gmx_tmpnam(char *buf);
+
+/*! \brief
+ * OS-independent rename().
+ *
+ * Renames/moves a file atomically, if the OS makes that available.
+ */
+int gmx_file_rename(const char *oldname, const char *newname);
+
+/*! \brief
+ * Copies a file (data only) oldname to newname.
+ *
+ * If \p copy_if_empty is `FALSE`, the file won't be copied if it's empty.
+ */
+int gmx_file_copy(const char *oldname, const char *newname, gmx_bool copy_if_empty);
+
+/*! \brief
+ * OS-independent fsync().
+ *
+ * Only use this during checkpointing!
+ */
+int gmx_fsync(FILE *fp);
+
+/*! \brief
+ * OS-independent chdir().
+ *
+ * Exits with a fatal error if changing the directory fails.
+ */
+void gmx_chdir(const char *directory);
+/*! \brief
+ * OS-independent getcwd().
+ *
+ * Exits with a fatal error if the call fails.
+ */
+void gmx_getcwd(char *buffer, size_t size);
+
+#ifdef __cplusplus
+}
+
+namespace gmx
+{
+
+class DataFileFinder;
+
+/*! \brief
+ * Gets a finder for locating data files from share/top/.
+ *
+ * \returns Finder set with setLibraryFileFinder(), or a default finder.
+ *
+ * If setLibraryFileFinder() has not been called (or a `NULL` finder has been
+ * set), a default finder is returned.
+ * The default finder searches data files from the directory identified by the
+ * global program context; it does not respect GMXLIB environment variable.
+ * Calling initForCommandLine() sets a finder that respects GMXLIB.
+ *
+ * Does not throw.
+ *
+ * See setLibraryFileFinder() for thread safety.
+ *
+ * \ingroup module_utility
+ */
+const DataFileFinder &getLibraryFileFinder();
+/*! \brief
+ * Sets a finder for location data files from share/top/.
+ *
+ * \param[in] finder  finder to set
+ *     (can be NULL to restore the default finder).
+ *
+ * The library does not take ownership of \p finder.
+ * The provided object must remain valid until the global instance is changed
+ * by another call to setLibraryFileFinder().
+ *
+ * The global instance is used by gmxlibfn() and libopen().
+ *
+ * This method is not thread-safe.  See setProgramContext(); the same
+ * constraints apply here as well.
+ *
+ * Does not throw.
+ */
+void setLibraryFileFinder(const DataFileFinder *finder);
+
+} // namespace gmx
+#endif
+
+#endif
index eba0f964eb73c5c0784fc2dc17cc71aaa7b1c58c..ef61240a7635b0e648ac5dd56029894efcc91e2e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
+#include "gmxpre.h"
+
 #include "gmxassert.h"
 
 #include <cstdio>
index 941faaeaa43ba1a73fc4f7355dd643fccbcb2284..a919080d3259d00b214cf8c37ebb1057f83ae636 100644 (file)
@@ -45,6 +45,8 @@
 
 #include <boost/current_function.hpp>
 
+#include "gromacs/utility/basedefinitions.h"
+
 //! \addtogroup module_utility
 //! \{
 
@@ -99,11 +101,7 @@ namespace internal
  *
  * \ingroup module_utility
  */
-#if defined(_MSC_VER)
-__declspec(noreturn)
-#elif defined(__GNUC__)
-__attribute__((__noreturn__))
-#endif
+gmx_noreturn
 void assertHandler(const char *condition, const char *msg,
                    const char *func, const char *file, int line);
 
index dea8c9fdae17d742b7685534d2ffac81727673bc..aef668910f07da5135e11bcff5dc5415562534c8 100644 (file)
@@ -49,9 +49,7 @@
 #ifndef GMX_UTILITY_GMXMPI_H
 #define GMX_UTILITY_GMXMPI_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 /*! \cond */
 #ifdef GMX_LIB_MPI
@@ -75,8 +73,8 @@
 #endif /*MPI_INT64_T*/
 #else
 #ifdef GMX_THREAD_MPI
-#include "thread_mpi/tmpi.h"
-#include "thread_mpi/mpi_bindings.h"
+#include "thread_mpi/mpi_bindings.h" /* IWYU pragma: export */
+#include "thread_mpi/tmpi.h"         /* IWYU pragma: export */
 #else
 typedef void* MPI_Comm;
 typedef void* MPI_Request;
index 9e6469b3a442fb02d6400a33ab106a586e7d7fb8..eb9607d01ed09399457ee01d90e4a1e33a487daa 100644 (file)
  *
  * \ingroup module_utility
  */
-#include "gromacs/utility/gmxomp.h"
+#include "gmxpre.h"
+
+#include "gmxomp.h"
 
 #include "config.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #ifdef GMX_OPENMP
 #include <omp.h>
 #endif
 
-#include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
-#include "gromacs/legacyheaders/md_logging.h"
-
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/programcontext.h"
+#include "gromacs/utility/stringutil.h"
 
 int gmx_omp_get_max_threads(void)
 {
@@ -91,58 +94,41 @@ void gmx_omp_set_num_threads(int num_threads)
 #endif
 }
 
-/*!
- * Thread affinity set by the OpenMP library can conflict with the GROMACS
- * internal affinity setting.
- *
- * While GNU OpenMP does not set affinity by default, the Intel OpenMP library
- * does. This conflicts with the internal affinity (especially thread-MPI)
- * setting, results in incorrectly locked threads, and causes dreadful performance.
- *
- * The KMP_AFFINITY environment variable is used by Intel, GOMP_CPU_AFFINITY
- * by the GNU compilers (Intel also honors it well). If any of the variables
- * is set, we honor it, disable the internal pinning, and warn the user.
- * When using Intel OpenMP, we will disable affinity if the user did not set it
- * anually through one of the aforementioned environment variables.
- *
- * Note that the Intel OpenMP affinity disabling iwll only take effect if this
- * function is called before the OpenMP library gets initialized which happens
- * when the first call is made into a compilation unit that contains OpenMP
- * pragmas.
- */
-void gmx_omp_check_thread_affinity(FILE            *fplog,
-                                   const t_commrec *cr,
-                                   gmx_hw_opt_t    *hw_opt)
+gmx_bool gmx_omp_check_thread_affinity(char **message)
 {
-    /* no need to worry if internal thread pinning is turned off */
-    if (hw_opt->thread_affinity == threadaffOFF)
-    {
-        return;
-    }
+    bool shouldSetAffinity = true;
 
-#ifndef GMX_OPENMP
-    GMX_UNUSED_VALUE(fplog);
-    GMX_UNUSED_VALUE(cr);
-#else
+    *message = NULL;
+#ifdef 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
      * will only get a warning. */
 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
+    const char *programName;
+    try
+    {
+        programName = gmx::getProgramContext().displayName();
+    }
+    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+
     const char *const gomp_env            = getenv("GOMP_CPU_AFFINITY");
     const bool        bGompCpuAffinitySet = (gomp_env != NULL);
 
     /* turn off internal pinning if GOMP_CPU_AFFINITY is set & non-empty */
     if (bGompCpuAffinitySet && *gomp_env != '\0')
     {
-        /* TODO: with -pin auto we should only warn when using all cores */
-        md_print_warn(cr, fplog,
-                      "NOTE: GOMP_CPU_AFFINITY set, will turn off %s internal affinity\n"
-                      "      setting as the two can conflict and cause performance degradation.\n"
-                      "      To keep using the %s internal affinity setting, unset the\n"
-                      "      GOMP_CPU_AFFINITY environment variable.",
-                      ShortProgram(), ShortProgram());
-
-        hw_opt->thread_affinity = threadaffOFF;
+        try
+        {
+            std::string buf = gmx::formatString(
+                        "NOTE: GOMP_CPU_AFFINITY set, will turn off %s internal affinity\n"
+                        "      setting as the two can conflict and cause performance degradation.\n"
+                        "      To keep using the %s internal affinity setting, unset the\n"
+                        "      GOMP_CPU_AFFINITY environment variable.",
+                        programName, programName);
+            *message = gmx_strdup(buf.c_str());
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+        shouldSetAffinity = false;
     }
 #endif /* __GNUC__ || __INTEL_COMPILER */
 
@@ -178,17 +164,21 @@ void gmx_omp_check_thread_affinity(FILE            *fplog,
     /* turn off internal pinning KMP_AFFINITY != "disabled" */
     if (bKmpAffinitySet && (gmx_strncasecmp(kmp_env, "disabled", 8) != 0))
     {
-        /* TODO: with -pin auto we should only warn when using all cores */
-        md_print_warn(cr, fplog,
-                      "NOTE: KMP_AFFINITY set, will turn off %s internal affinity\n"
-                      "      setting as the two can conflict and cause performance degradation.\n"
-                      "      To keep using the %s internal affinity setting, set the\n"
-                      "      KMP_AFFINITY=disabled environment variable.",
-                      ShortProgram(), ShortProgram());
-
-        hw_opt->thread_affinity = threadaffOFF;
+        try
+        {
+            std::string buf = gmx::formatString(
+                        "NOTE: KMP_AFFINITY set, will turn off %s internal affinity\n"
+                        "      setting as the two can conflict and cause performance degradation.\n"
+                        "      To keep using the %s internal affinity setting, set the\n"
+                        "      KMP_AFFINITY=disabled environment variable.",
+                        programName, programName);
+            *message = gmx_strdup(buf.c_str());
+        }
+        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
+        shouldSetAffinity = false;
     }
 #endif /* __INTEL_COMPILER */
 
 #endif /* GMX_OPENMP */
+    return shouldSetAffinity;
 }
index 276aee8c13540b3055289c1e6d79fc14b9f0d0e4..553eadc09294483bc5555c83eecbb11e7f4bed7c 100644 (file)
@@ -49,9 +49,9 @@
 #ifndef GMX_UTILITY_OMP_H
 #define GMX_UTILITY_OMP_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
+
+#include <stdio.h>
 
 #ifndef GMX_NATIVE_WINDOWS
 /* Ugly hack because the openmp implementation below hacks into the SIMD
@@ -67,8 +67,7 @@
 #include <windows.h>
 #endif
 
-#include "types/commrec.h"
-#include "mdrun.h"
+#include "gromacs/utility/basedefinitions.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -113,9 +112,31 @@ void gmx_omp_set_num_threads(int num_threads);
 /*! \brief
  * Check for externally set thread affinity to avoid conflicts with \Gromacs
  * internal setting.
+ *
+ * \param[out] message  Receives the message to be shown to the user.
+ * \returns `true` if we can set thread affinity ourselves.
+ *
+ * While GNU OpenMP does not set affinity by default, the Intel OpenMP library
+ * does.  This conflicts with the internal affinity (especially thread-MPI)
+ * setting, results in incorrectly locked threads, and causes dreadful performance.
+ *
+ * The KMP_AFFINITY environment variable is used by Intel, GOMP_CPU_AFFINITY
+ * by the GNU compilers (Intel also honors it well).  If any of the variables
+ * is set, we should honor it and disable the internal pinning.
+ * When using Intel OpenMP, we will disable affinity if the user did not set it
+ * manually through one of the aforementioned environment variables.
+ *
+ * Note that the Intel OpenMP affinity disabling will only take effect if this
+ * function is called before the OpenMP library gets initialized, which happens
+ * when the first call is made into a compilation unit that contains OpenMP
+ * pragmas.
+ *
+ * If this function returns `false`, the caller is responsible to disable the
+ * pinning, show the message from \p *message to the user, and free the memory
+ * allocated for \p *message.
+ * If the return value is `true`, \p *message is NULL.
  */
-void gmx_omp_check_thread_affinity(FILE *fplog, const t_commrec *cr,
-                                   gmx_hw_opt_t *hw_opt);
+gmx_bool gmx_omp_check_thread_affinity(char **message);
 
 /*! \brief
  * Pause for use in a spin-wait loop.
index e6b0ce5c8c8128c69071849c6567e8b249c1a69d..81efa86870b212326be4bf1c1623354bf26efa3d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
+#include "gmxpre.h"
+
 #include "gmxregex.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #if defined(HAVE_POSIX_REGEX)
-// old Mac needs sys/types.h before regex.h
 #include <sys/types.h>
+// old Mac needs sys/types.h before regex.h
 #include <regex.h>
 #define USE_POSIX_REGEX
 #elif defined(HAVE_CXX11_REGEX)
@@ -55,8 +55,8 @@
 #define USE_CXX11_REGEX
 #endif
 
-#include "exceptions.h"
-#include "stringutil.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/stringutil.h"
 
 namespace gmx
 {
index a80f523beeb616cf151b7bb74db229f1661f3b13..9e2c1677e33b22193446102aa92ca6aa7448fb06 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,7 +45,7 @@
 
 #include <string>
 
-#include "common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index fbb56e1d21d88589fbbac7e7a11038260b4838f0..a33ada5df0976bde44d282ac8460cb32ae6fc074 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
-#include "gromacs/utility/init.h"
+#include "gmxpre.h"
+
+#include "init.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxassert.h"
 #ifdef GMX_LIB_MPI
 #include "gromacs/utility/gmxmpi.h"
 #endif
 
-#include "gromacs/utility/common.h"
-#include "gromacs/utility/gmxassert.h"
-
 namespace gmx
 {
 
index 5bc53b8a2ec8bec4a5e01ddbc1071385939d05fc..937bb541cb99510b665d0426b72a066b5ff73321 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
-#include "gromacs/utility/messagestringcollector.h"
+#include "gmxpre.h"
+
+#include "messagestringcollector.h"
 
 #include <vector>
 
index aca59a33b19ceaa93905a4b710a2eb3a5755c017..c0131f52e485c0d05cdd8ec9e7bec41da046e1c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,7 +45,7 @@
 
 #include <string>
 
-#include "../utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
similarity index 58%
rename from src/gromacs/fileio/path.cpp
rename to src/gromacs/utility/path.cpp
index b9db04d7a1be0c6450de5d45c180a8f8e99b43a3..d6aa17140d65db27cd77cd0f31ef291dd0a6903a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,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.
  * Implements functions in path.h.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \ingroup module_fileio
+ * \ingroup module_utility
  */
+#include "gmxpre.h"
+
 #include "path.h"
 
+#include "config.h"
+
 #include <cctype>
 #include <cerrno>
 #include <cstdlib>
 
 #include <algorithm>
 
-#include "config.h"
-
 #include <sys/stat.h>
+
 #ifdef GMX_NATIVE_WINDOWS
+#include <Windows.h>
 #include <direct.h>
 #else
 #ifdef HAVE_UNISTD_H
@@ -59,7 +63,9 @@
 #endif
 #endif
 
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/stringutil.h"
 
 namespace
@@ -124,9 +130,123 @@ bool Path::isAbsolute(const std::string &path)
     return isAbsolute(path.c_str());
 }
 
-bool Path::startsWith(const std::string &path, const std::string &prefix)
+#ifdef GMX_NATIVE_WINDOWS
+namespace
+{
+struct handle_wrapper
 {
-    return gmx::startsWith(normalize(path), normalize(prefix));
+    HANDLE handle;
+    handle_wrapper(HANDLE h)
+        : handle(h){}
+    ~handle_wrapper()
+    {
+        if (handle != INVALID_HANDLE_VALUE)
+        {
+            ::CloseHandle(handle);
+        }
+    }
+};
+}
+#endif
+
+bool Path::isEquivalent(const std::string &path1, const std::string &path2)
+{
+    //based on boost_1_56_0/libs/filesystem/src/operations.cpp under BSL
+#ifdef GMX_NATIVE_WINDOWS
+    // Note well: Physical location on external media is part of the
+    // equivalence criteria. If there are no open handles, physical location
+    // can change due to defragmentation or other relocations. Thus handles
+    // must be held open until location information for both paths has
+    // been retrieved.
+
+    // p2 is done first, so any error reported is for p1
+    // FixME: #1635
+    handle_wrapper h2(
+            CreateFile(
+                    path2.c_str(),
+                    0,
+                    FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+                    0,
+                    OPEN_EXISTING,
+                    FILE_FLAG_BACKUP_SEMANTICS,
+                    0));
+
+    handle_wrapper h1(
+            CreateFile(
+                    path1.c_str(),
+                    0,
+                    FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+                    0,
+                    OPEN_EXISTING,
+                    FILE_FLAG_BACKUP_SEMANTICS,
+                    0));
+
+    if (h1.handle == INVALID_HANDLE_VALUE
+        || h2.handle == INVALID_HANDLE_VALUE)
+    {
+        // if one is invalid and the other isn't, then they aren't equivalent,
+        // but if both are invalid then it is an error
+        if (h1.handle == INVALID_HANDLE_VALUE
+            && h2.handle == INVALID_HANDLE_VALUE)
+        {
+            GMX_THROW(FileIOError("Path::isEquivalent called with two invalid files"));
+        }
+
+        return false;
+    }
+
+    // at this point, both handles are known to be valid
+
+    BY_HANDLE_FILE_INFORMATION info1, info2;
+
+    if (!GetFileInformationByHandle(h1.handle, &info1))
+    {
+        GMX_THROW(FileIOError("Path::isEquivalent: GetFileInformationByHandle failed"));
+    }
+
+    if (!GetFileInformationByHandle(h2.handle, &info2))
+    {
+        GMX_THROW(FileIOError("Path::isEquivalent: GetFileInformationByHandle failed"));
+    }
+
+    // In theory, volume serial numbers are sufficient to distinguish between
+    // devices, but in practice VSN's are sometimes duplicated, so last write
+    // time and file size are also checked.
+    return
+        info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber
+        && info1.nFileIndexHigh == info2.nFileIndexHigh
+        && info1.nFileIndexLow == info2.nFileIndexLow
+        && info1.nFileSizeHigh == info2.nFileSizeHigh
+        && info1.nFileSizeLow == info2.nFileSizeLow
+        && info1.ftLastWriteTime.dwLowDateTime
+        == info2.ftLastWriteTime.dwLowDateTime
+        && info1.ftLastWriteTime.dwHighDateTime
+        == info2.ftLastWriteTime.dwHighDateTime;
+#else
+    struct stat s1, s2;
+    int         e2 = stat(path2.c_str(), &s2);
+    int         e1 = stat(path1.c_str(), &s1);
+
+    if (e1 != 0 || e2 != 0)
+    {
+        // if one is invalid and the other isn't then they aren't equivalent,
+        // but if both are invalid then it is an error.
+        if (e1 != 0 && e2 != 0)
+        {
+            GMX_THROW_WITH_ERRNO(
+                    FileIOError("Path::isEquivalent called with two invalid files"),
+                    "stat", errno);
+        }
+        return false;
+    }
+
+    // both stats now known to be valid
+    return s1.st_dev == s2.st_dev && s1.st_ino == s2.st_ino
+           // According to the POSIX stat specs, "The st_ino and st_dev fields
+           // taken together uniquely identify the file within the system."
+           // Just to be sure, size and mod time are also checked.
+           && s1.st_size == s2.st_size && s1.st_mtime == s2.st_mtime;
+#endif
 }
 
 std::string Path::join(const std::string &path1,
@@ -147,6 +267,8 @@ std::string Path::join(const std::string &path1,
 
 std::string Path::getParentPath(const std::string &path)
 {
+    /* Expects that the path doesn't contain "." or "..". If used on a path for
+     * which this isn't guaranteed realpath needs to be called first. */
     size_t pos = path.find_last_of(cDirSeparators);
     if (pos == std::string::npos)
     {
@@ -165,20 +287,30 @@ std::string Path::getFilename(const std::string &path)
     return path.substr(pos+1);
 }
 
+bool Path::hasExtension(const std::string &path)
+{
+    return getFilename(path).find('.') != std::string::npos;
+}
+
+std::string Path::stripExtension(const std::string &path)
+{
+    size_t dirSeparatorPos = path.find_last_of(cDirSeparators);
+    size_t extPos          = path.find_last_of('.');
+    if (extPos == std::string::npos
+        || (dirSeparatorPos != std::string::npos && extPos < dirSeparatorPos))
+    {
+        return path;
+    }
+    return path.substr(0, extPos);
+}
+
 std::string Path::normalize(const std::string &path)
 {
     std::string result(path);
-    // TODO: Remove . and .. entries.
     if (DIR_SEPARATOR != '/')
     {
         std::replace(result.begin(), result.end(), '/', DIR_SEPARATOR);
     }
-#ifdef GMX_NATIVE_WINDOWS
-    if (std::isalpha(result[0]) && result[1] == ':')
-    {
-        result[0] = std::toupper(result[0]);
-    }
-#endif
     return result;
 }
 
@@ -231,6 +363,9 @@ std::vector<std::string> Path::getExecutablePaths()
 
 std::string Path::resolveSymlinks(const std::string &path)
 {
+    /* Does not fully resolve the path like realpath/boost::canonical would.
+     * It doesn't resolve path elements (including "." or ".."), but only
+     * resolves the entire path (it does that recursively). */
     std::string result(path);
 #ifndef GMX_NATIVE_WINDOWS
     char        buf[GMX_PATH_MAX];
similarity index 91%
rename from src/gromacs/fileio/path.h
rename to src/gromacs/utility/path.h
index b900676d73687b261a04a4f1281523264ca65876..4fd6bf97acdec12f96821e0cc97c0ad42624796e 100644 (file)
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
- * \ingroup module_fileio
+ * \ingroup module_utility
  */
-#ifndef GMX_FILEIO_PATH_H
-#define GMX_FILEIO_PATH_H
+#ifndef GMX_UTILITY_PATH_H
+#define GMX_UTILITY_PATH_H
 
 #include <string>
 #include <utility>
@@ -56,8 +56,8 @@ class Path
         static bool containsDirectory(const std::string &path);
         static bool isAbsolute(const char *path);
         static bool isAbsolute(const std::string &path);
-        static bool startsWith(const std::string &path,
-                               const std::string &prefix);
+        static bool isEquivalent(const std::string &path1,
+                                 const std::string &path2);
 
         static std::string join(const std::string &path1,
                                 const std::string &path2);
@@ -67,6 +67,8 @@ class Path
         static std::string normalize(const std::string &path);
         static std::string getParentPath(const std::string &path);
         static std::string getFilename(const std::string &path);
+        static bool hasExtension(const std::string &path);
+        static std::string stripExtension(const std::string &path);
 
         static bool exists(const char *path);
         static bool exists(const std::string &path);
index 5af68f142406b7c2209e67c79d913f120e72e14d..5edf9aa284c57da018f13e3315e523b61ccd7803 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,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.
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
-#include "gromacs/utility/programcontext.h"
+#include "gmxpre.h"
+
+#include "programcontext.h"
 
 #include <cstddef>
 
@@ -68,7 +70,10 @@ class DefaultProgramContext : public ProgramContextInterface
         virtual const char *programName() const { return "GROMACS"; }
         virtual const char *displayName() const { return "GROMACS"; }
         virtual const char *fullBinaryPath() const { return ""; }
-        virtual const char *defaultLibraryDataPath() const { return ""; }
+        virtual InstallationPrefixInfo installationPrefix() const
+        {
+            return InstallationPrefixInfo("", false);
+        }
         virtual const char *commandLine() const { return ""; }
 };
 
index 82d349a2a473c14823a833ce766263f20d3f2726..d7aede1988c088f43f50e618ee4ccde90c25cac8 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,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.
@@ -49,6 +49,41 @@ namespace gmx
 //! \addtogroup module_utility
 //! \{
 
+/*! \brief
+ * Provides information about installation prefix (see
+ * ProgramContextInterface::installationPrefix()).
+ *
+ * \inpublicapi
+ */
+struct InstallationPrefixInfo
+{
+    //! Initializes the structure with given values.
+    InstallationPrefixInfo(const char *path, bool bSource)
+        : path(path), bSourceLayout(bSource)
+    {
+    }
+
+    /*! \brief
+     * Path to the installation prefix of the current \Gromacs instance.
+     *
+     * If this is `NULL` or empty, data files cannot be looked up from the
+     * install tree and \Gromacs functions that access such files may fail.
+     * This can also contain a path to the source tree (see \a bSourceLayout).
+     */
+    const char *const path;
+    /*! \brief
+     * Whether \a path points to a source tree -like layout.
+     *
+     * For testing, it is useful to read data files from the source tree.
+     * For such cases, the program context can return the source tree root path
+     * in \a path, and set this to `true` to indicate that the data files
+     * should be searched using the layout of the source tree instead of the
+     * installation.
+     */
+    const bool        bSourceLayout;
+};
+
+
 /*! \brief
  * Provides context information about the program that is calling the library.
  *
@@ -107,15 +142,19 @@ class ProgramContextInterface
          */
         virtual const char *fullBinaryPath() const = 0;
         /*! \brief
-         * Returns the default path for \Gromacs data files.
+         * Returns the installation prefix for \Gromacs.
          *
          * This path is used to locate the data files that are in `share/top/`
          * in the source directory.
          * The implementation can provide an empty string if the path is not
          * available; in such a case, functions that require data files may
          * fail.
+         *
+         * The returned structure also contains a flag to indicate whether the
+         * prefix actually points to the source tree.  This is used for tests
+         * and to support running binaries directly from the build tree.
          */
-        virtual const char *defaultLibraryDataPath() const = 0;
+        virtual InstallationPrefixInfo installationPrefix() const = 0;
         /*! \brief
          * Returns the full command line used to invoke the binary.
          *
index 347080bfe7a5741905217c8959f6cebea251b7d5..0f0849076d9d86296102516e970934c9d7c2b5d7 100644 (file)
@@ -32,6 +32,8 @@
  * 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 "qsort_threadsafe.h"
 
 #include <stdlib.h>
diff --git a/src/gromacs/utility/real.h b/src/gromacs/utility/real.h
new file mode 100644 (file)
index 0000000..e8a3ae1
--- /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, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and 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 `real` and related constants.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_REAL_H
+#define GMX_UTILITY_REAL_H
+
+/*! \brief Double precision accuracy */
+#define GMX_DOUBLE_EPS   2.2204460492503131e-16
+
+/*! \brief Maximum double precision value - reduced 1 unit in last digit for MSVC */
+#define GMX_DOUBLE_MAX   1.7976931348623157e+308
+
+/*! \brief Minimum double precision value */
+#define GMX_DOUBLE_MIN   2.2250738585072014e-308
+
+/*! \brief Single precision accuracy */
+#define GMX_FLOAT_EPS    1.19209290e-07F
+
+/*! \brief Maximum single precision value - reduced 1 unit in last digit for MSVC */
+#define GMX_FLOAT_MAX    3.40282346E+38F
+
+/*! \brief Minimum single precision value */
+#define GMX_FLOAT_MIN    1.175494351E-38F
+
+#ifdef __PGI
+/* The portland group x86 C/C++ compilers do not treat negative zero initializers
+ * correctly, but "optimizes" them to positive zero, so we implement it explicitly.
+ * These constructs are optimized to simple loads at compile time. If you want to
+ * use them on other compilers those have to support gcc preprocessor extensions.
+ * Note: These initializers might be sensitive to the endianness (which can
+ * be different for byte and word order), so check that it works for your platform
+ * and add a separate section if necessary before adding to the ifdef above.
+ */
+#    define GMX_DOUBLE_NEGZERO  ({ const union { int  di[2]; double d; } _gmx_dzero = {0, -2147483648}; _gmx_dzero.d; })
+#    define GMX_FLOAT_NEGZERO   ({ const union { int  fi; float f; } _gmx_fzero = {-2147483648}; _gmx_fzero.f; })
+#else
+/*! \brief Negative zero in double */
+#    define GMX_DOUBLE_NEGZERO  (-0.0)
+
+/*! \brief Negative zero in float */
+#    define GMX_FLOAT_NEGZERO   (-0.0f)
+#endif
+
+/*! \typedef real
+ * \brief Precision-dependent \Gromacs floating-point type.
+ */
+/*! \def HAVE_REAL
+ * \brief Used to check whether `real` is already defined.
+ */
+/*! \def GMX_MPI_REAL
+ * \brief MPI data type for `real`.
+ */
+/*! \def GMX_REAL_EPS
+ * \brief Accuracy for `real`.
+ */
+/*! \def GMX_REAL_MIN
+ * \brief Smallest non-zero value for `real`.
+ */
+/*! \def GMX_REAL_MAX
+ * \brief Largest finite value for `real`.
+ */
+/*! \def GMX_REAL_NEGZERO
+ * \brief Negative zero for `real`.
+ */
+/*! \def gmx_real_fullprecision_pfmt
+ * \brief Format string for full `real` precision.
+ */
+#ifdef GMX_DOUBLE
+
+#ifndef HAVE_REAL
+typedef double      real;
+#define HAVE_REAL
+#endif
+
+#define GMX_MPI_REAL      MPI_DOUBLE
+#define GMX_REAL_EPS      GMX_DOUBLE_EPS
+#define GMX_REAL_MIN      GMX_DOUBLE_MIN
+#define GMX_REAL_MAX      GMX_DOUBLE_MAX
+#define GMX_REAL_NEGZERO  GMX_DOUBLE_NEGZERO
+#define gmx_real_fullprecision_pfmt "%21.14e"
+
+#else /* GMX_DOUBLE */
+
+#ifndef HAVE_REAL
+typedef float           real;
+#define HAVE_REAL
+#endif
+
+#define GMX_MPI_REAL      MPI_FLOAT
+#define GMX_REAL_EPS      GMX_FLOAT_EPS
+#define GMX_REAL_MIN      GMX_FLOAT_MIN
+#define GMX_REAL_MAX      GMX_FLOAT_MAX
+#define GMX_REAL_NEGZERO  GMX_FLOAT_NEGZERO
+#define gmx_real_fullprecision_pfmt "%14.7e"
+
+#endif /* GMX_DOUBLE */
+
+#endif
similarity index 60%
rename from src/gromacs/utility/scoped_ptr_sfree.h
rename to src/gromacs/utility/scoped_cptr.h
index 3c1077ccaea4f97b63fcf114a972ed4ad3f0fe7b..1e7909ed31309803793c699d6582b10d2fa0d014 100644 (file)
@@ -34,7 +34,7 @@
  */
 /*! \libinternal \file
  * \brief
- * Declares gmx::scoped_ptr_sfree.
+ * Declares gmx::scoped_cptr and gmx::scoped_guard_sfree.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
 #ifndef GMX_UTILITY_SCOPED_PTR_SFREE_H
 #define GMX_UTILITY_SCOPED_PTR_SFREE_H
 
-#include "common.h"
+#include "config.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().
+ * Stripped-down version of scoped_ptr that uses sfree() or custom deleter.
  *
- * Currently only implements constructor from a pointer value and destructor;
- * other operations can be added if they become necessary.
+ * 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 very basic guard/smart pointer for C pointers.
- * Currently, boost::shared_ptr is used in a few locations that require more
- * flexibility, but is not suitable for all cases either.  A scoped_ptr with
- * deleter support would be a general enough implementation for all uses.
- * C++11 unique_ptr has this, but for non-C++11 support we need something else.
+ * This class provides a basic guard/smart pointer for C pointers.
  *
  * Methods in this class do not throw.
  *
  * \inlibraryapi
  * \ingroup module_utility
  */
-class scoped_ptr_sfree
+template <class T, void D(T *) = sfree_wrapper>
+class scoped_cptr
 {
     public:
         /*! \brief
@@ -74,16 +83,30 @@ class scoped_ptr_sfree
          *
          * \param[in] ptr  Pointer to use for initialization.
          */
-        explicit scoped_ptr_sfree(void *ptr) : ptr_(ptr) {}
+        explicit scoped_cptr(T *ptr = NULL) : ptr_(ptr) {}
         //! Frees the pointer passed to the constructor.
-        ~scoped_ptr_sfree() { sfree(ptr_); }
+        ~scoped_cptr() { D(ptr_); }
+        //! Returns the stored pointer.
+        T *get() const { return ptr_; }
+        //! Check for non-null pointer in boolean context.
+#ifdef GMX_CXX11
+        explicit
+#endif
+        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:
-        void                   *ptr_;
+                           *ptr_;
 
-        GMX_DISALLOW_COPY_AND_ASSIGN(scoped_ptr_sfree);
+        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 7d8e85c029b9cce1cdda8986077a3d4a0fe95ba8..876675ecd440ad17f2346181bbed9b69c810e053 100644 (file)
@@ -3,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,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.
  * 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/utility/smalloc.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "smalloc.h"
+
+#include "config.h"
 
 #include <errno.h>
 #include <stdio.h>
 #include <malloc.h>
 #endif
 
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "thread_mpi/threads.h"
 
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
 #ifdef PRINT_ALLOC_KB
-#include "gromacs/legacyheaders/network.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/gmxmpi.h"
 #endif
 
-#ifdef DEBUG
-#include "thread_mpi/threads.h"
+static gmx_bool            g_bOverAllocDD     = FALSE;
+static tMPI_Thread_mutex_t g_over_alloc_mutex = TMPI_THREAD_MUTEX_INITIALIZER;
 
+#ifdef DEBUG
 static void log_action(int bMal, const char *what, const char *file, int line,
                        int nelem, int size, void *ptr)
 {
@@ -290,7 +293,6 @@ void *save_malloc_aligned(const char *name, const char *file, int line,
         }
 #endif
 
-        allocate_fail = FALSE; /* stop compiler warnings */
 #ifdef HAVE_POSIX_MEMALIGN
         allocate_fail = (0 != posix_memalign(&malloced, alignment, nelem*elsize));
 #elif defined HAVE_MEMALIGN
@@ -359,3 +361,24 @@ void save_free_aligned(const char gmx_unused *name, const char gmx_unused *file,
 #endif
     }
 }
+
+void set_over_alloc_dd(gmx_bool set)
+{
+    tMPI_Thread_mutex_lock(&g_over_alloc_mutex);
+    /* we just make sure that we don't set this at the same time.
+       We don't worry too much about reading this rarely-set variable */
+    g_bOverAllocDD = set;
+    tMPI_Thread_mutex_unlock(&g_over_alloc_mutex);
+}
+
+int over_alloc_dd(int n)
+{
+    if (g_bOverAllocDD)
+    {
+        return OVER_ALLOC_FAC*n + 100;
+    }
+    else
+    {
+        return n;
+    }
+}
index 0d1aa3aaed042c91c9cd19a63b34a6d88dbbceaa..74d71a558642b28d2863554eec754883e0e0d723 100644 (file)
@@ -73,6 +73,8 @@
 
 #include <stddef.h>
 
+#include "gromacs/utility/basedefinitions.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -328,6 +330,10 @@ void gmx_snew_aligned_impl(const char *name, const char *file, int line,
 
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*! \brief
  * Frees memory referenced by \p ptr.
  *
@@ -347,4 +353,47 @@ void gmx_snew_aligned_impl(const char *name, const char *file, int line,
  */
 #define sfree_aligned(ptr) save_free_aligned(#ptr, __FILE__, __LINE__, (ptr))
 
+/*! \brief
+ * Over allocation factor for memory allocations.
+ *
+ * Memory (re)allocation can be VERY slow, especially with some
+ * MPI libraries that replace the standard malloc and realloc calls.
+ * To avoid slow memory allocation we use over_alloc to set the memory
+ * allocation size for large data blocks. Since this scales the size
+ * with a factor, we use log(n) realloc calls instead of n.
+ * This can reduce allocation times from minutes to seconds.
+ *
+ * This factor leads to 4 realloc calls to double the array size.
+ */
+#define OVER_ALLOC_FAC 1.19
+
+/*! \brief
+ * Turns over allocation for variable size atoms/cg/top arrays on or off,
+ * default is off.
+ *
+ * \todo
+ * This is mdrun-specific, so it might be better to put this and
+ * over_alloc_dd() much higher up.
+ */
+void set_over_alloc_dd(gmx_bool set);
+
+/*! \brief
+ * Returns new allocation count for domain decomposition allocations.
+ *
+ * Returns n when domain decomposition over allocation is off.
+ * Returns OVER_ALLOC_FAC*n + 100 when over allocation in on.
+ * This is to avoid frequent reallocation during domain decomposition in mdrun.
+ */
+int over_alloc_dd(int n);
+
+/** Over allocation for small data types: int, real etc. */
+#define over_alloc_small(n) (int)(OVER_ALLOC_FAC*(n) + 8000)
+
+/** Over allocation for large data types: complex structs */
+#define over_alloc_large(n) (int)(OVER_ALLOC_FAC*(n) + 1000)
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
similarity index 78%
rename from src/gromacs/legacyheaders/shift.h
rename to src/gromacs/utility/snprintf.h
index 08488454e887d7e2a54f5a255245a87319f02179..21343465186eeca3d73b8dc5f5b74c9616ccdf31 100644 (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, by the GROMACS development team, led by
+ * 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.
  * 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 Provide snprintf symbol on all OS (for internal Gromacs use)
+ *
+ * \todo When all callers of snprintf compile as C++, perhaps use
+ * gmx::formatString() everywhere instead of snprintf.
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_SNPRINTF_H
+#define GMX_UTILITY_SNPRINTF_H
 
-#ifndef _shift_h
-#define _shift_h
+#include "config.h"
 
-#include "typedefs.h"
+#include <stdio.h>
 
-#ifdef __cplusplus
-extern "C" {
+#ifdef GMX_NATIVE_WINDOWS
+#define snprintf _snprintf
 #endif
 
-real *mk_shift_tab(int n, real r1, real rc, real dr, real *sfac);
-/* Return a table of length n, containing the parabolic
- * shift function from HJC Berendsen
- */
-
-#ifdef __cplusplus
-}
 #endif
-
-#endif  /* _shift_h */
index 6104225d3f174876a601a25c5e3c0e4c2719ddc5..5b2c725017a6e585b14e9d6d3832f76a58571d8a 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
+#include "gmxpre.h"
+
 #include "stringutil.h"
 
 #include <cctype>
-#include <cstdio>
 #include <cstdarg>
+#include <cstdio>
 #include <cstring>
 
 #include <algorithm>
index b799608de6a009e38a975844ffaecb412cdd6fd7..e74d6c990532d0224f000322e9c0306daa9e4bf6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,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.
@@ -54,6 +54,16 @@ namespace gmx
 //! \addtogroup module_utility
 //! \{
 
+/*! \brief
+ * Tests whether a string is null or empty.
+ *
+ * Does not throw.
+ */
+bool inline isNullOrEmpty(const char *str)
+{
+    return str == NULL || str[0] == '\0';
+}
+
 /*! \brief
  * Tests whether a string starts with another string.
  *
@@ -118,18 +128,88 @@ std::string stripString(const std::string &str);
  */
 std::string formatString(const char *fmt, ...);
 
-/*! \brief
- * Splits a string to whitespace separated tokens.
+/*! \brief Function object that wraps a call to formatString() that
+ * expects a single conversion argument, for use with algorithms. */
+class StringFormatter
+{
+    public:
+        /*! \brief Constructor
+         *
+         * \param[in] format The printf-style format string that will
+         *     be applied to convert values of type T to
+         *     string. Exactly one argument to the conversion
+         *     specification(s) in `format` is supported. */
+        explicit StringFormatter(const char *format) : format_(format)
+        {
+        }
+
+        //! Implements the formatting functionality
+        template <typename T>
+        std::string operator()(const T &value) const
+        {
+            return formatString(format_, value);
+        }
+
+    private:
+        //! Format string to use
+        const char *format_;
+};
+
+/*! \brief Function object to implement the same interface as
+ * `StringFormatter` to use with strings that should not be formatted
+ * further. */
+class IdentityFormatter
+{
+    public:
+        //! Implements the formatting non-functionality
+        std::string operator()(const std::string &value) const
+        {
+            return value;
+        }
+};
+
+/*! \brief Formats all the range as strings, and then joins them with
+ * a separator in between.
  *
- * \param[in] str  String to process.
- * \returns   \p str split into tokens at each whitespace sequence.
+ * \param[in] begin      Iterator the beginning of the range to join.
+ * \param[in] end        Iterator the end of the range to join.
+ * \param[in] separator  String to put in between the joined strings.
+ * \param[in] formatter  Function object to format the objects in
+ *     `container` as strings
+ * \returns   All objects in the range from `begin` to `end` formatted
+ *     as strings and concatenated with `separator` between each pair.
  * \throws    std::bad_alloc if out of memory.
+ */
+template <typename InputIterator, typename FormatterType>
+std::string formatAndJoin(InputIterator begin, InputIterator end, const char *separator, const FormatterType &formatter)
+{
+    std::string result;
+    const char *currentSeparator = "";
+    for (InputIterator i = begin; i != end; ++i)
+    {
+        result.append(currentSeparator);
+        result.append(formatter(*i));
+        currentSeparator = separator;
+    }
+    return result;
+}
+
+/*! \brief Formats all elements of the container as strings, and then
+ * joins them with a separator in between.
  *
- * This function works like `split` in Python, i.e., leading and trailing
- * whitespace is ignored, and consecutive whitespaces are treated as a single
- * separator.
+ * \param[in] container  Objects to join.
+ * \param[in] separator  String to put in between the joined strings.
+ * \param[in] formatter  Function object to format the objects in
+ *     `container` as strings
+ * \returns   All objects from `container` formatted as strings and
+ *     concatenated with `separator` between each pair.
+ * \throws    std::bad_alloc if out of memory.
  */
-std::vector<std::string> splitString(const std::string &str);
+template <typename ContainerType, typename FormatterType>
+std::string formatAndJoin(const ContainerType &container, const char *separator, const FormatterType &formatter)
+{
+    return formatAndJoin(container.begin(), container.end(), separator, formatter);
+}
 
 /*! \brief
  * Joins strings from a range with a separator in between.
@@ -145,16 +225,9 @@ template <typename InputIterator>
 std::string joinStrings(InputIterator begin, InputIterator end,
                         const char *separator)
 {
-    std::string result;
-    const char *currentSeparator = "";
-    for (InputIterator i = begin; i != end; ++i)
-    {
-        result.append(currentSeparator);
-        result.append(*i);
-        currentSeparator = separator;
-    }
-    return result;
+    return formatAndJoin(begin, end, separator, IdentityFormatter());
 }
+
 /*! \brief
  * Joins strings from a container with a separator in between.
  *
@@ -201,6 +274,19 @@ std::string concatenateStrings(const char * const (&sarray)[count])
     return concatenateStrings(sarray, count);
 }
 
+/*! \brief
+ * Splits a string to whitespace separated tokens.
+ *
+ * \param[in] str  String to process.
+ * \returns   \p str split into tokens at each whitespace sequence.
+ * \throws    std::bad_alloc if out of memory.
+ *
+ * This function works like `split` in Python, i.e., leading and trailing
+ * whitespace is ignored, and consecutive whitespaces are treated as a single
+ * separator.
+ */
+std::vector<std::string> splitString(const std::string &str);
+
 /*! \brief
  * Replace all occurrences of a string with another string.
  *
diff --git a/src/gromacs/utility/sysinfo.cpp b/src/gromacs/utility/sysinfo.cpp
new file mode 100644 (file)
index 0000000..0166582
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Implements functions from sysinfo.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_utility
+ */
+#include "gmxpre.h"
+
+#include "sysinfo.h"
+
+#include "config.h"
+
+#include <string.h>
+#include <time.h>
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef GMX_NATIVE_WINDOWS
+#include <Windows.h>
+#include <process.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxassert.h"
+
+namespace
+{
+//! Static return value for cases when a string value is not available.
+const char c_unknown[] = "unknown";
+} // namespace
+
+int gmx_gethostname(char *buf, size_t len)
+{
+    GMX_RELEASE_ASSERT(len >= 8, "Input buffer is too short");
+#ifdef GMX_NATIVE_WINDOWS
+    DWORD  dlen = len;
+    if (GetComputerName(buf, &dlen))
+    {
+        return 0;
+    }
+#elif defined(HAVE_UNISTD_H) && !defined(__native_client__)
+    if (gethostname(buf, len-1) == 0)
+    {
+        buf[len-1] = '\0';
+        return 0;
+    }
+#endif
+    strcpy(buf, c_unknown);
+    return -1;
+}
+
+int gmx_getpid()
+{
+#ifdef GMX_NATIVE_WINDOWS
+    return _getpid();
+#else
+    return getpid();
+#endif
+}
+
+int gmx_getuid()
+{
+#if defined(HAVE_UNISTD_H) && !defined(__MINGW32__)
+    return getuid();
+#else
+    return -1;
+#endif
+}
+
+int gmx_getusername(char *buf, size_t len)
+{
+    GMX_RELEASE_ASSERT(len >= 8, "Input buffer is too short");
+    // TODO: nice_header() used getpwuid() instead; consider using getpwuid_r()
+    // here.  If not, get rid of HAVE_PWD_H completely.
+#ifdef GMX_NATIVE_WINDOWS
+    DWORD  dlen = len;
+    if (GetUserName(buf, &dlen))
+    {
+        return 0;
+    }
+#elif defined(HAVE_UNISTD_H) && !__has_feature(memory_sanitizer) //MSAN Issue 83
+    if (!getlogin_r(buf, len))
+    {
+        buf[len-1] = '\0';
+        return 0;
+    }
+#endif
+    strcpy(buf, c_unknown);
+    return -1;
+}
+
+char *
+gmx_ctime_r(const time_t *clock, char *buf, size_t len)
+{
+#ifdef _MSC_VER
+    /* Windows */
+    ctime_s(buf, len, clock);
+#elif defined(GMX_NATIVE_WINDOWS)
+    char *tmpbuf = ctime(clock);
+    strncpy(buf, tmpbuf, len-1);
+    buf[len-1] = '\0';
+#elif (defined(__sun))
+    /*Solaris*/
+    ctime_r(clock, buf, len);
+#else
+    char tmpbuf[30];
+    ctime_r(clock, tmpbuf);
+    strncpy(buf, tmpbuf, len-1);
+    buf[len-1] = '\0';
+#endif
+    return buf;
+}
+
+void gmx_format_current_time(char *buf, size_t len)
+{
+    time_t clock = time(NULL);
+    gmx_ctime_r(&clock, buf, len);
+}
+
+int gmx_set_nice(int level)
+{
+#ifdef GMX_USE_NICE
+    // TODO: This may not be reliable, but currently the return value is not
+    // used.
+    if (nice(level) != -1)
+    {
+        return 0;
+    }
+#else
+    GMX_UNUSED_VALUE(level);
+#endif
+    return -1;
+}
diff --git a/src/gromacs/utility/sysinfo.h b/src/gromacs/utility/sysinfo.h
new file mode 100644 (file)
index 0000000..3b3c50a
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Declares functions for obtaining information about the operating environment
+ * and the current process.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_SYSINFO_H
+#define GMX_UTILITY_SYSINFO_H
+
+#include <stddef.h>
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! \addtogroup module_utility
+ * \{
+ */
+
+/*! \brief
+ * Gets the hostname as given by gethostname(), if available.
+ *
+ * \param[out] buf  Buffer to receive the hostname.
+ * \param[in]  len  Length of buffer \p buf (must be >= 8).
+ * \returns 0 on success, -1 on error.
+ *
+ * If the value is not available, "unknown" is returned.
+ * \p name should have at least size \p len.
+ *
+ * Does not throw.
+ */
+int gmx_gethostname(char *buf, size_t len);
+
+/*! \brief
+ * Returns the process ID of the current process.
+ *
+ * Does not throw.
+ */
+int gmx_getpid(void);
+/*! \brief
+ * Returns the current user ID, or -1 if not available.
+ *
+ * Does not throw.
+ */
+int gmx_getuid(void);
+/*! \brief
+ * Gets the current user name, if available.
+ *
+ * \param[out] buf  Buffer to receive the username.
+ * \param[in]  len  Length of buffer \p buf (must be >= 8).
+ * \returns 0 on success, -1 on error.
+ *
+ * Does not throw.
+ */
+int gmx_getusername(char *buf, size_t len);
+
+/*! \brief
+ * Portable version of ctime_r.
+ *
+ * Does not throw.
+ */
+char *gmx_ctime_r(const time_t *clock, char *buf, size_t len);
+/*! \brief
+ * Gets the current time as a string.
+ *
+ * \param[out] buf  Buffer to receive the string.
+ * \param[in]  len  Length of buffer \p buf (26 characters should be sufficient).
+ *
+ * Does not throw.
+ */
+void gmx_format_current_time(char *buf, size_t len);
+
+/*! \brief
+ * Wrapper for nice().
+ *
+ * Does not throw.
+ */
+int gmx_set_nice(int level);
+
+/*! \} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 49c752b85754a07da183634c918a999619783aca..9024e56ea608d12acd0320e8af4243ba0b88c705 100644 (file)
@@ -33,4 +33,5 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 gmx_add_unit_test(UtilityUnitTests utility-test
+                  bitmask32.cpp bitmask64.cpp bitmask128.cpp
                   stringutil.cpp)
diff --git a/src/gromacs/utility/tests/bitmask.h b/src/gromacs/utility/tests/bitmask.h
new file mode 100644 (file)
index 0000000..3cc5376
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for bitmask functionality.
+ *
+ * These tests check the functionality of bitmask.h
+
+ * \author Roland Schulz <roland@rschulz.eu>
+ * \ingroup module_utility
+ */
+#include <gtest/gtest.h>
+
+#include "gromacs/utility/bitmask.h"
+
+//! Implemenation of BITMASK_CLASSNAME
+#define BITMASK_CLASSNAME_(S) BitmaskTest ## S
+//! Returns name of Bitmask test fixture class
+#define BITMASK_CLASSNAME(S) BITMASK_CLASSNAME_(S)
+//! Implementation of BITMASK_TEST_P
+#define BITMASK_TEST_P_(C, T) TEST_P(C, T)
+//! Defines a parameterized bitmask test
+#define BITMASK_TEST_P(T) BITMASK_TEST_P_(BITMASK_CLASSNAME(BITMASK_SIZE), T)
+
+class BITMASK_CLASSNAME(BITMASK_SIZE) : public ::testing::TestWithParam<int>
+{
+};
+
+BITMASK_TEST_P(SetAndClear)
+{
+    gmx_bitmask_t m;
+    int           i = GetParam();
+    bitmask_clear(&m);
+    EXPECT_TRUE(bitmask_is_zero(m));
+    EXPECT_FALSE(bitmask_is_set(m, i));
+    bitmask_set_bit(&m, i);
+    for (int j = 0; j < BITMASK_SIZE; j++)
+    {
+        EXPECT_EQ(bitmask_is_set(m, j), j == i);
+    }
+    bitmask_clear(&m);
+    EXPECT_TRUE(bitmask_is_zero(m));
+}
+
+BITMASK_TEST_P(InitBit)
+{
+    gmx_bitmask_t m1, m2;
+    int           i = GetParam();
+    bitmask_init_bit(&m1, i);
+    bitmask_clear(&m2);
+    EXPECT_FALSE(bitmask_is_equal(m1, m2));
+    bitmask_set_bit(&m2, i);
+    EXPECT_TRUE(bitmask_is_equal(m1, m2));
+}
+
+BITMASK_TEST_P(InitLowBits)
+{
+    gmx_bitmask_t m;
+    int           i = GetParam();
+    bitmask_init_low_bits(&m, i);
+    for (int j = 0; j < BITMASK_SIZE; j++)
+    {
+        EXPECT_EQ(bitmask_is_set(m, j), j < i);
+    }
+}
+
+BITMASK_TEST_P(Disjoint)
+{
+    gmx_bitmask_t m1, m2;
+    int           i = GetParam();
+    bitmask_init_bit(&m1, i);
+    bitmask_init_bit(&m2, i);
+    EXPECT_FALSE(bitmask_is_disjoint(m1, m2));
+    bitmask_init_low_bits(&m2, i);
+    EXPECT_TRUE(bitmask_is_disjoint(m1, m2));
+}
+
+BITMASK_TEST_P(Union)
+{
+    gmx_bitmask_t m1, m2;
+    int           i = GetParam();
+    int           j = (i + BITMASK_SIZE/2)%BITMASK_SIZE;
+    bitmask_init_bit(&m1, i);
+    bitmask_init_bit(&m2, j);
+    bitmask_union(&m1, m2);
+    for (int k = 0; k < BITMASK_SIZE; k++)
+    {
+        EXPECT_EQ(bitmask_is_set(m1, k), k == i || k == j);
+    }
+
+    bitmask_init_bit(&m1, i);
+    bitmask_clear(&m2);
+    bitmask_union(&m1, m2);
+    bitmask_init_bit(&m2, i);
+    EXPECT_TRUE(bitmask_is_equal(m1, m2));
+
+    bitmask_clear(&m1);
+    bitmask_init_bit(&m2, i);
+    bitmask_union(&m1, m2);
+    EXPECT_TRUE(bitmask_is_equal(m1, m2));
+}
similarity index 80%
rename from src/gromacs/gmxlib/physics_test.c
rename to src/gromacs/utility/tests/bitmask128.cpp
index 7382cd2e71241f4d6221156f45d45ab9265a8497..b6024dbf8d119130b8eb21f34a62ea6172d25252 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 <stdio.h>
-#include "physics.h"
+#include "gmxpre.h"
 
-int main(int argc, char *argv[])
-{
-    int    i;
-    double x, y, z;
+#define BITMASK_SIZE 128
+#include "bitmask.h"
 
-    x = 3.25;
-    for (i = 0; (i < eg2cNR); i++)
-    {
-        y = gmx2convert(x, i);
-        z = convert2gmx(y, i);
-        printf("Converted %g [type %d] to %g and back to %g. Diff %g\n",
-               x, i, y, z, x-z);
-    }
-}
+INSTANTIATE_TEST_CASE_P(BitmaskTest128_9_78, BitmaskTest128, ::testing::Values(9, 78));
similarity index 76%
rename from src/gromacs/legacyheaders/types/symtab.h
rename to src/gromacs/utility/tests/bitmask32.cpp
index 19d4d04fd0477b745dbf2f2ae5b79e1a39f3cb38..a2bddef98a8e7a8343cee7c29f4a61a0eda3d89f 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) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 _types_symtab_h
-#define _types_symtab_h
+#include "gmxpre.h"
 
+#define BITMASK_SIZE 32
+#include "bitmask.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct symbuf {
-    int            bufsize;
-    char         **buf;
-    struct symbuf *next;
-} t_symbuf;
-
-typedef struct
-{
-    int       nr;
-    t_symbuf *symbuf;
-} t_symtab;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+INSTANTIATE_TEST_CASE_P(BitmaskTest32_11, BitmaskTest32, ::testing::Values(11));
diff --git a/src/gromacs/utility/tests/bitmask64.cpp b/src/gromacs/utility/tests/bitmask64.cpp
new file mode 100644 (file)
index 0000000..1807efd
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#include "gmxpre.h"
+
+#define BITMASK_SIZE 64
+#include "bitmask.h"
+
+INSTANTIATE_TEST_CASE_P(BitmaskTest64_10_42, BitmaskTest64, ::testing::Values(10, 42));
index 348ffa8964563198fca18852c8edffd34a0e10b6..068df9246845c5e86be08216470f59bcb261f4f1 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_utility
  */
+#include "gmxpre.h"
+
+#include "gromacs/utility/stringutil.h"
+
 #include <string>
 #include <vector>
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
-#include "gromacs/utility/stringutil.h"
+#include "gromacs/utility/arrayref.h"
 
 #include "testutils/refdata.h"
 #include "testutils/stringtest.h"
@@ -138,6 +142,45 @@ TEST(FormatStringTest, HandlesLongStrings)
     EXPECT_EQ("x10", longString.substr(1999));
 }
 
+/********************************************************************
+ * Tests for StringFormatter
+ */
+
+TEST(StringFormatterTest, HandlesBasicFormatting)
+{
+    int value = 103;
+    EXPECT_EQ("103", gmx::StringFormatter("%d") (value));
+    EXPECT_EQ("null", gmx::StringFormatter("null") (value));
+}
+
+/********************************************************************
+ * Tests for formatAndJoin
+ */
+
+TEST(formatAndJoinTest, Works)
+{
+    const char * const words[] = { "The", "quick", "brown", "fox" };
+    EXPECT_EQ("The       .quick     .brown     .fox       ",
+              gmx::formatAndJoin(gmx::ConstArrayRef<const char *>(words), ".",
+                                 gmx::StringFormatter("%-10s")));
+
+    const int values[] = { 0, 1, 4 };
+    EXPECT_EQ("0,1,4", gmx::formatAndJoin(gmx::ConstArrayRef<int>(values), ",",
+                                          gmx::StringFormatter("%d")));
+}
+
+/********************************************************************
+ * Tests for joinStrings
+ */
+
+TEST(JoinStringsTest, Works)
+{
+    const char * const               words[] = { "The", "quick", "brown", "fox" };
+    gmx::ConstArrayRef<const char *> refToWords(words);
+    EXPECT_EQ("The; quick; brown; fox", gmx::joinStrings(refToWords.begin(), refToWords.end(), "; "));
+    EXPECT_EQ("The-quick-brown-fox", gmx::joinStrings(refToWords, "-"));
+}
+
 /********************************************************************
  * Tests for concatenateStrings()
  */
index c9157f9755c05247aedc972280a90b45b0de2032..330f04b53832e8e090c33ce9762495bb5d44daf9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -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.
  */
-/*! \file
+/*! \libinternal \file
  * \brief
  * Declares gmx::gmx_unique_ptr and supporting functionality.
  *
 #ifndef GMX_UTILITY_UNIQUEPTR_H
 #define GMX_UTILITY_UNIQUEPTR_H
 
-#include "gmx_header_config.h"
+#include "config.h"
 
-#ifdef GMX_CXX11 // C++11 Compiler
-#include <memory>
-#include <utility>
-#else      // C++03 Compiler
+#ifdef GMX_CXX11   // C++11 Compiler
+#include <memory>  // IWYU pragma: export
+#include <utility> // IWYU pragma: export
+#else              // C++03 Compiler
 #include <boost/shared_ptr.hpp>
 #endif
 
 namespace gmx
 {
 
-/*! \class gmx_unique_ptr
+//! \cond libapi
+/*! \libinternal \class gmx_unique_ptr
  * \brief
  * Smart pointer for unique ownership.
  *
@@ -73,7 +74,7 @@ namespace gmx
  * \ingroup module_utility
  * \inlibraryapi
  */
-/*! \typedef gmx_unique_ptr::type
+/*! \libinternal \typedef gmx_unique_ptr::type
  * \brief The smart pointer type.
  * Work-around for the non-existence of template typedefs in C++03.
  */
@@ -105,6 +106,7 @@ struct gmx_unique_ptr
     typedef boost::shared_ptr<T> type;
 };
 #endif
+//! \endcond
 
 } // namespace gmx
 
index 179457e8f3abf326a762c799712dee6662dd00a5..667ca1399155cf726d8460b65778c850755f99ef 100644 (file)
@@ -92,7 +92,7 @@
  * For 4.6 and 5.0 (and likely for some time in the future as well), this
  * tracks the exact \Gromacs version.
  */
-#define GMX_API_VERSION @API_VERSION@
+#define GMX_API_VERSION @GMX_API_VERSION@
 
 /*! \brief
  * Exact \Gromacs version of this set of headers.
  * This specifies the version number of the actual \Gromacs library that
  * installed these headers.
  */
-#define GMX_VERSION @NUM_VERSION@
+#define GMX_VERSION @GMX_VERSION_NUMERIC@
 
 #endif
diff --git a/src/programs/BuildCompletions.cmake b/src/programs/BuildCompletions.cmake
new file mode 100644 (file)
index 0000000..cea5ea1
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+if (NOT DEFINED GMX_EXECUTABLE)
+    message(FATAL_ERROR "Required input parameter not set")
+endif()
+
+file(MAKE_DIRECTORY completion)
+execute_process(
+    COMMAND ${GMX_EXECUTABLE} -quiet help -export completion
+    WORKING_DIRECTORY completion
+    RESULT_VARIABLE exitcode)
+if (exitcode)
+    # Ensure that no partial output is left behind.
+    file(REMOVE_RECURSE completion)
+    if (ERRORS_ARE_FATAL)
+        message(FATAL_ERROR
+            "Failed to generate shell completions. "
+            "Set GMX_BUILD_HELP=OFF if you want to skip the completions.\n"
+            "Error/exit code: ${exitcode}")
+    else()
+        message(
+            "Failed to generate shell completions, will build GROMACS without. "
+            "Set GMX_BUILD_HELP=OFF if you want to skip this notification and "
+            "warnings during installation.")
+    endif()
+endif()
index 6d907b88e92326c24d1ef236d406c42596bd36f0..b6d6d44cbc074c97520f69ce0bd2ee6ceb9c7fe7 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,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.
@@ -79,23 +79,21 @@ else()
     ########################
     # Completion generation
 
+    include(gmxCustomCommandUtilities)
+
     set(COMPLETION_DIR ${CMAKE_CURRENT_SOURCE_DIR}/completion)
-    if(SOURCE_IS_SOURCE_DISTRIBUTION)
-        # Make sure source package contains the completions.
-        if(NOT EXISTS "${COMPLETION_DIR}/gmx-completion.bash")
-            message(FATAL_ERROR "Shell completions are missing from source package.")
-        endif()
-    endif()
-    file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/completion)
-    add_custom_target(completion
-        gmx -quiet help -export completion
-        COMMENT "Generating command-line completions for programs"
-        WORKING_DIRECTORY completion
-        VERBATIM)
     # Using GMX_BUILD_HELP here is somewhat confusing, but the conditions when
     # this can be done are exactly the same (ability to run the compiled
     # binaries).
     if (GMX_BUILD_HELP)
+        gmx_add_custom_output_target(completion OUTPUT STAMP
+            COMMAND ${CMAKE_COMMAND}
+                -D GMX_EXECUTABLE=$<TARGET_FILE:gmx>
+                -D ERRORS_ARE_FATAL=${GMX_BUILD_HELP_FORCE}
+                -P ${CMAKE_CURRENT_SOURCE_DIR}/BuildCompletions.cmake
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+            DEPENDS gmx ${CMAKE_CURRENT_SOURCE_DIR}/BuildCompletions.cmake
+            COMMENT "Generating command-line completions for programs")
         set_target_properties(completion PROPERTIES EXCLUDE_FROM_ALL OFF)
         set_directory_properties(PROPERTIES
             ADDITIONAL_MAKE_CLEAN_FILES "completion")
@@ -103,18 +101,13 @@ else()
     endif()
     if (SOURCE_IS_SOURCE_DISTRIBUTION OR GMX_BUILD_HELP)
         install(DIRECTORY ${COMPLETION_DIR}/
-                DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+                DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime OPTIONAL)
         file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
              "complete -o nospace -F _gmx_compl ${BINARY_NAME}")
         install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
                 DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
     endif()
-
-    if (GMX_SYMLINK_OLD_BINARY_NAMES)
-        configure_file(CreateLinks.cmake.cmakein CreateLinks.cmake @ONLY)
-        set(CREATE_LINKS_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateLinks.cmake)
-        install(SCRIPT ${CREATE_LINKS_SCRIPT} COMPONENT links)
-    endif()
+    gmx_cpack_add_generated_source_directory(completion)
 
     if(BUILD_TESTING)
         add_subdirectory(mdrun/tests)
diff --git a/src/programs/CreateLinks.cmake.cmakein b/src/programs/CreateLinks.cmake.cmakein
deleted file mode 100644 (file)
index 04a4905..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# TODO: It would be nicer to have the list generated from the binary,
-# but this has some complications.  As the same list is also needed for
-# man page generation, this can wait for now.
-set(SYMLINK_NAMES
-    mdrun
-    gmxcheck
-    gmxdump
-    grompp
-    pdb2gmx
-    tpbconv
-    g_protonate
-    g_x2top
-    do_dssp
-    editconf
-    eneconv
-    genbox
-    genconf
-    genion
-    genrestr
-    make_edi
-    make_ndx
-    mk_angndx
-    trjcat
-    trjconv
-    trjorder
-    xpm2ps
-    g_anadock
-    g_anaeig
-    g_analyze
-    g_angle
-    g_bar
-    g_bond
-    g_bundle
-    g_chi
-    g_cluster
-    g_clustsize
-    g_confrms
-    g_covar
-    g_current
-    g_density
-    g_densmap
-    g_densorder
-    g_dielectric
-    g_dipoles
-    g_disre
-    g_dist
-    g_dos
-    g_dyecoupl
-    g_dyndom
-    g_enemat
-    g_energy
-    g_filter
-    g_gyrate
-    g_h2order
-    g_hbond
-    g_helix
-    g_helixorient
-    g_hydorder
-    g_lie
-    g_mdmat
-    g_mindist
-    g_morph
-    g_msd
-    g_nmeig
-    g_nmens
-    g_nmtraj
-    g_options
-    g_order
-    g_pme_error
-    g_polystat
-    g_potential
-    g_principal
-    g_rama
-    g_rdf
-    g_rms
-    g_rmsdist
-    g_rmsf
-    g_rotacf
-    g_rotmat
-    g_saltbr
-    g_sans
-    g_sas
-    g_saxs
-    g_select
-    g_sgangle
-    g_sham
-    g_sigeps
-    g_sorient
-    g_spatial
-    g_spol
-    g_tcaf
-    g_traj
-    g_tune_pme
-    g_vanhove
-    g_velacc
-    g_wham
-    g_wheel
-    )
-
-if (NOT DEFINED BINARY_DIRECTORY)
-    set(BINARY_DIRECTORY "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@BIN_INSTALL_DIR@")
-endif ()
-set(BINARY_SUFFIX "@GMX_BINARY_SUFFIX@@CMAKE_EXECUTABLE_SUFFIX@")
-set(GMX_NATIVE_WINDOWS "@GMX_NATIVE_WINDOWS@")
-
-foreach (linkname ${SYMLINK_NAMES})
-    set(linkpath ${BINARY_DIRECTORY}/${linkname}${BINARY_SUFFIX})
-    # Based on documentation, CMake only supports symbolic links on Unix,
-    # although NTFS also has those (since Windows Vista; they require admin
-    # permissions to create).
-    if (GMX_NATIVE_WINDOWS)
-        if (NOT QUIETLY)
-            message(STATUS "Installing: Creating alias binary ${linkpath}")
-        endif ()
-        execute_process(
-            COMMAND ${CMAKE_COMMAND} -E copy_if_different
-                ${BINARY_DIRECTORY}/gmx${BINARY_SUFFIX} ${linkpath})
-    else()
-        if (NOT QUIETLY)
-            message(STATUS "Installing: Creating symbolic link ${linkpath}")
-        endif ()
-        if (EXISTS ${linkpath})
-            FILE(REMOVE ${linkpath})
-        endif ()
-        execute_process(
-            COMMAND ${CMAKE_COMMAND} -E create_symlink
-                gmx${BINARY_SUFFIX} ${linkpath})
-    endif()
-endforeach ()
index 68ff5408e7f2c47644ed470b431b4a4c0bda599a..94a668eadb5d45e1ff0990dcf9deb890d2ece3b4 100644 (file)
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  */
-#include "gromacs/commandline/cmdlinemodulemanager.h"
+#include "gmxpre.h"
+
 #include "gromacs/commandline/cmdlineinit.h"
-#include "gromacs/selection/selectioncollection.h"
+#include "gromacs/commandline/cmdlinemodulemanager.h"
+#include "gromacs/selection/selhelp.h"
 #include "gromacs/trajectoryanalysis/modules.h"
 #include "gromacs/utility/exceptions.h"
 
@@ -54,7 +56,7 @@ main(int argc, char *argv[])
         gmx::CommandLineModuleManager manager("gmx", &context);
         registerTrajectoryAnalysisModules(&manager);
         registerLegacyModules(&manager);
-        manager.addHelpTopic(gmx::SelectionCollection::createDefaultHelpTopic());
+        manager.addHelpTopic(gmx::createSelectionHelpTopic());
         int rc = manager.run(argc, argv);
         gmx::finalizeForCommandLine();
         return rc;
@@ -62,6 +64,6 @@ main(int argc, char *argv[])
     catch (const std::exception &ex)
     {
         gmx::printFatalErrorMessage(stderr, ex);
-        return gmx::processExceptionAtExit(ex);
+        return gmx::processExceptionAtExitForCommandLine(ex);
     }
 }
index 11c1097edc2e02525a80b6bd188183042eac7008..8bd53d39db270ec0f09be530c155b181cb566215 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,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.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  */
+#include "gmxpre.h"
+
 #include "legacymodules.h"
 
 #include <cstdio>
 
 #include "gromacs/commandline/cmdlinemodule.h"
 #include "gromacs/commandline/cmdlinemodulemanager.h"
-
+#include "gromacs/commandline/cmdlineoptionsmodule.h"
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/gmxpreprocess/genconf.h"
 #include "gromacs/gmxpreprocess/grompp.h"
@@ -86,6 +88,9 @@ class ObsoleteToolModule : public gmx::CommandLineModuleInterface
             return NULL;
         }
 
+        virtual void init(gmx::CommandLineModuleSettings * /*settings*/)
+        {
+        }
         virtual int run(int /*argc*/, char * /*argv*/[])
         {
             printMessage();
@@ -107,7 +112,58 @@ class ObsoleteToolModule : public gmx::CommandLineModuleInterface
         }
 
         const char             *name_;
+};
+
+// TODO: Consider removing duplication with CMainCommandLineModule from
+// cmdlinemodulemanager.cpp.
+class NoNiceModule : public gmx::CommandLineModuleInterface
+{
+    public:
+        //! \copydoc gmx::CommandLineModuleManager::CMainFunction
+        typedef gmx::CommandLineModuleManager::CMainFunction CMainFunction;
+
+        /*! \brief
+         * Creates a wrapper module for the given main function.
+         *
+         * \param[in] name             Name for the module.
+         * \param[in] shortDescription One-line description for the module.
+         * \param[in] mainFunction     Main function to wrap.
+         *
+         * Does not throw.
+         */
+        NoNiceModule(const char *name, const char *shortDescription,
+                     CMainFunction mainFunction)
+            : name_(name), shortDescription_(shortDescription),
+              mainFunction_(mainFunction)
+        {
+        }
+
+        virtual const char *name() const
+        {
+            return name_;
+        }
+        virtual const char *shortDescription() const
+        {
+            return shortDescription_;
+        }
+
+        virtual void init(gmx::CommandLineModuleSettings *settings)
+        {
+            settings->setDefaultNiceLevel(0);
+        }
+        virtual int run(int argc, char *argv[])
+        {
+            return mainFunction_(argc, argv);
+        }
+        virtual void writeHelp(const gmx::CommandLineHelpContext &context) const
+        {
+            writeCommandLineHelpCMain(context, name_, mainFunction_);
+        }
 
+    private:
+        const char             *name_;
+        const char             *shortDescription_;
+        CMainFunction           mainFunction_;
 };
 
 /*! \brief
@@ -125,6 +181,24 @@ void registerModule(gmx::CommandLineModuleManager                *manager,
     manager->addModuleCMain(name, shortDescription, mainFunction);
 }
 
+/*! \brief
+ * Convenience function for creating and registering a module that defaults to
+ * -nice 0.
+ *
+ * \param[in] manager          Module manager to which to register the module.
+ * \param[in] mainFunction     Main function to wrap.
+ * \param[in] name             Name for the new module.
+ * \param[in] shortDescription One-line description for the new module.
+ */
+void registerModuleNoNice(gmx::CommandLineModuleManager                *manager,
+                          gmx::CommandLineModuleManager::CMainFunction  mainFunction,
+                          const char *name, const char *shortDescription)
+{
+    gmx::CommandLineModulePointer module(
+            new NoNiceModule(name, shortDescription, mainFunction));
+    manager->addModule(move(module));
+}
+
 /*! \brief
  * Convenience function for registering a module for an obsolete tool.
  *
@@ -160,8 +234,13 @@ void registerLegacyModules(gmx::CommandLineModuleManager *manager)
     registerModule(manager, &gmx_x2top, "x2top",
                    "Generate a primitive topology from coordinates");
 
-    registerModule(manager, &gmx_mdrun, "mdrun",
-                   "Perform a simulation, do a normal mode analysis or an energy minimization");
+    registerModuleNoNice(manager, &gmx_mdrun, "mdrun",
+                         "Perform a simulation, do a normal mode analysis or an energy minimization");
+
+    gmx::CommandLineOptionsModuleInterface::registerModule(
+            manager, gmx::InsertMoleculesInfo::name,
+            gmx::InsertMoleculesInfo::shortDescription,
+            &gmx::InsertMoleculesInfo::create);
 
     // Modules from gmx_ana.h.
     registerModule(manager, &gmx_do_dssp, "do_dssp",
@@ -172,8 +251,6 @@ void registerLegacyModules(gmx::CommandLineModuleManager *manager)
                    "Convert energy files");
     registerModule(manager, &gmx_solvate, "solvate",
                    "Solvate a system");
-    registerModule(manager, &gmx_insert_molecules, "insert-molecules",
-                   "Insert molecules into existing vacancies");
     registerObsoleteTool(manager, "genbox");
     registerModule(manager, &gmx_genconf, "genconf",
                    "Multiply a conformation in 'random' orientations");
@@ -277,7 +354,6 @@ void registerLegacyModules(gmx::CommandLineModuleManager *manager)
                    "Generate an ensemble of structures from the normal modes");
     registerModule(manager, &gmx_nmtraj, "nmtraj",
                    "Generate a virtual oscillating trajectory from an eigenvector");
-    registerModule(manager, &gmx_options, "options", NULL);
     registerModule(manager, &gmx_order, "order",
                    "Compute the order parameter per atom for carbon tails");
     registerModule(manager, &gmx_pme_error, "pme_error",
@@ -290,8 +366,6 @@ void registerLegacyModules(gmx::CommandLineModuleManager *manager)
                    "Calculate principal axes of inertia for a group of atoms");
     registerModule(manager, &gmx_rama, "rama",
                    "Compute Ramachandran plots");
-    registerModule(manager, &gmx_rdf, "rdf",
-                   "Calculate radial distribution functions");
     registerModule(manager, &gmx_rms, "rms",
                    "Calculate RMSDs with a reference structure and RMSD matrices");
     registerModule(manager, &gmx_rmsdist, "rmsdist",
@@ -332,8 +406,8 @@ void registerLegacyModules(gmx::CommandLineModuleManager *manager)
                    "Perform weighted histogram analysis after umbrella sampling");
     registerModule(manager, &gmx_wheel, "wheel",
                    "Plot helical wheels");
-    registerModule(manager, &gmx_view, "view",
-                   "View a trajectory on an X-Windows terminal");
+    registerModuleNoNice(manager, &gmx_view, "view",
+                         "View a trajectory on an X-Windows terminal");
 
     {
         gmx::CommandLineModuleGroup group =
index d2106f1cb1f7757e503f9bf387c1872b048e36e0..2cc61dcd3d99a8abe48103d22a12b69b97807078 100644 (file)
@@ -38,6 +38,9 @@
 
 #include "thread_mpi/threads.h"
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
similarity index 86%
rename from src/programs/mdrun/md.c
rename to src/programs/mdrun/md.cpp
index 73cc2103e6192901a09bc7f38a54a1eab4809231..c708faf628d2bef95e04af7c78d58a38e9c2e552 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "vec.h"
-#include "vcm.h"
-#include "mdebin.h"
-#include "nrnb.h"
-#include "calcmu.h"
-#include "index.h"
-#include "vsite.h"
-#include "update.h"
-#include "ns.h"
-#include "mdrun.h"
-#include "md_support.h"
-#include "md_logging.h"
-#include "network.h"
-#include "xvgr.h"
-#include "physics.h"
-#include "names.h"
-#include "force.h"
-#include "disre.h"
-#include "orires.h"
-#include "pme.h"
-#include "mdatoms.h"
-#include "repl_ex.h"
-#include "deform.h"
-#include "qmmm.h"
-#include "domdec.h"
-#include "domdec_network.h"
-#include "gromacs/gmxlib/topsort.h"
-#include "coulomb.h"
-#include "constr.h"
-#include "shellfc.h"
-#include "gromacs/gmxpreprocess/compute_io.h"
-#include "checkpoint.h"
-#include "mtop_util.h"
-#include "sighandler.h"
-#include "txtdump.h"
-#include "gromacs/utility/cstringutil.h"
-#include "pme_loadbal.h"
-#include "bondf.h"
-#include "membed.h"
-#include "types/nlistheuristics.h"
-#include "types/iteratedconstraints.h"
-#include "nbnxn_cuda_data_mgmt.h"
+#include "config.h"
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "thread_mpi/threads.h"
 
-#include "gromacs/utility/gmxmpi.h"
-#include "gromacs/fileio/confio.h"
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/domdec/domdec_network.h"
+#include "gromacs/ewald/pme-load-balancing.h"
+#include "gromacs/ewald/pme.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/fileio/mdoutf.h"
 #include "gromacs/fileio/trajectory_writing.h"
-#include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/xtcio.h"
-#include "gromacs/timing/wallcycle.h"
-#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/gmxpreprocess/compute_io.h"
+#include "gromacs/imd/imd.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/ebin.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/md_support.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdebin.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/legacyheaders/shellfc.h"
+#include "gromacs/legacyheaders/sighandler.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/update.h"
+#include "gromacs/legacyheaders/vcm.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/fcdata.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/globsig.h"
+#include "gromacs/legacyheaders/types/group.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/membedt.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/listed-forces/manage-threading.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/swap/swapcoords.h"
-#include "gromacs/imd/imd.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "deform.h"
+#include "membed.h"
+#include "repl_ex.h"
 
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
@@ -105,7 +125,7 @@ static void reset_all_counters(FILE *fplog, t_commrec *cr,
                                gmx_int64_t *step_rel, t_inputrec *ir,
                                gmx_wallcycle_t wcycle, t_nrnb *nrnb,
                                gmx_walltime_accounting_t walltime_accounting,
-                               nbnxn_cuda_ptr_t cu_nbv)
+                               struct nonbonded_verlet_t *nbv)
 {
     char sbuf[STEPSTRSIZE];
 
@@ -113,10 +133,7 @@ static void reset_all_counters(FILE *fplog, t_commrec *cr,
     md_print_warn(cr, fplog, "step %s: resetting all time and cycle counters\n",
                   gmx_step_str(step, sbuf));
 
-    if (cu_nbv)
-    {
-        nbnxn_cuda_reset_timings(cu_nbv);
-    }
+    nbnxn_cuda_reset_timings(nbv);
 
     wallcycle_stop(wcycle, ewcRUN);
     wallcycle_reset_all(wcycle);
@@ -169,9 +186,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     t_trxstatus      *status;
     rvec              mu_tot;
     t_vcm            *vcm;
-    t_state          *bufstate = NULL;
-    matrix           *scale_tot, pcoupl_mu, M, ebox;
-    gmx_nlheur_t      nlh;
+    matrix            pcoupl_mu, M;
     t_trxframe        rerun_fr;
     gmx_repl_ex_t     repl_ex = NULL;
     int               nchkpt  = 1;
@@ -189,32 +204,26 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     gmx_ekindata_t   *ekind, *ekind_save;
     gmx_shellfc_t     shellfc;
     int               count, nconverged = 0;
-    real              timestep   = 0;
-    double            tcount     = 0;
-    gmx_bool          bConverged = TRUE, bOK, bSumEkinhOld, bDoReplEx, bExchanged, bNeedRepartition;
-    gmx_bool          bAppend;
+    double            tcount                 = 0;
+    gmx_bool          bConverged             = TRUE, bSumEkinhOld, bDoReplEx, bExchanged, bNeedRepartition;
     gmx_bool          bResetCountersHalfMaxH = FALSE;
-    gmx_bool          bVV, bIterativeCase, bFirstIterate, bTemp, bPres, bTrotter;
+    gmx_bool          bVV, bTemp, bPres, bTrotter;
     gmx_bool          bUpdateDoLR;
     real              dvdl_constr;
     rvec             *cbuf        = NULL;
     int               cbuf_nalloc = 0;
     matrix            lastbox;
-    real              veta_save, scalevir, tracevir;
-    real              vetanew = 0;
     int               lamnew  = 0;
     /* for FEP */
     int               nstfep;
     double            cycles;
     real              saved_conserved_quantity = 0;
     real              last_ekin                = 0;
-    int               iter_i;
     t_extmass         MassQ;
     int             **trotter_seq;
     char              sbuf[STEPSTRSIZE], sbuf2[STEPSTRSIZE];
     int               handled_stop_condition = gmx_stop_cond_none; /* compare to get_stop_condition*/
-    gmx_iterate_t     iterate;
-    gmx_int64_t       multisim_nsteps = -1;                        /* number of steps to do  before first multisim
+    gmx_int64_t       multisim_nsteps        = -1;                 /* number of steps to do  before first multisim
                                                                           simulation stops. If equal to zero, don't
                                                                           communicate any more between multisims.*/
     /* PME load balancing data for GPU kernels */
@@ -232,7 +241,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
     /* Check for special mdrun options */
     bRerunMD = (Flags & MD_RERUN);
-    bAppend  = (Flags & MD_APPENDFILES);
     if (Flags & MD_RESETCOUNTERSHALFWAY)
     {
         if (ir->nsteps > 0)
@@ -247,13 +255,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     /* md-vv uses averaged full step velocities for T-control
        md-vv-avek uses averaged half step velocities for T-control (but full step ekin for P control)
        md uses averaged half step kinetic energies to determine temperature unless defined otherwise by GMX_EKIN_AVE_VEL; */
-    bVV = EI_VV(ir->eI);
-    /* all the iteratative cases - only if there are constraints */
-    bIterativeCase = ((IR_NPH_TROTTER(ir) || IR_NPT_TROTTER(ir)) && (constr) && (!bRerunMD));
-    gmx_iterate_init(&iterate, FALSE); /* The default value of iterate->bIterationActive is set to
-                                          false in this step.  The correct value, true or false,
-                                          is set at each step, as it depends on the frequency of temperature
-                                          and pressure control.*/
+    bVV      = EI_VV(ir->eI);
     bTrotter = (bVV && (IR_NPT_TROTTER(ir) || IR_NPH_TROTTER(ir) || IR_NVT_TROTTER(ir)));
 
     if (bRerunMD)
@@ -350,7 +352,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         gmx_fatal(FARGS, "Normal Mode analysis is not supported with virtual sites.\nIf you'd like to help with adding support, we have an open discussion at http://redmine.gromacs.org/issues/879\n");
     }
 
-    if (bRerunMD && fr->cutoff_scheme == ecutsVERLET && ir->opts.ngener > 1 && fr->nbv && fr->nbv->bUseGPU)
+    if (bRerunMD && fr->cutoff_scheme == ecutsVERLET && ir->opts.ngener > 1 && usingGpu(fr->nbv))
     {
         gmx_fatal(FARGS, "The Verlet scheme on GPUs does not support energy groups, so your rerun should probably use a .tpr file without energy groups, or mdrun -nb auto");
     }
@@ -485,7 +487,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
      */
     if ((Flags & MD_TUNEPME) &&
         EEL_PME(fr->eeltype) &&
-        ( (fr->cutoff_scheme == ecutsVERLET && fr->nbv->bUseGPU) || !(cr->duty & DUTY_PME)) &&
+        ( use_GPU(fr->nbv) || !(cr->duty & DUTY_PME)) &&
         !bRerunMD)
     {
         pme_loadbal_init(&pme_loadbal, ir, state->box, fr->ic, fr->pmedata);
@@ -590,12 +592,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                                      and there is no previous step */
     }
 
-    /* if using an iterative algorithm, we need to create a working directory for the state. */
-    if (bIterativeCase)
-    {
-        bufstate = init_bufstate(state);
-    }
-
     /* need to make an initiation call to get the Trotter variables set, as well as other constants for non-trotter
        temperature control */
     trotter_seq = init_npt_vars(ir, state, &MassQ, bTrotter);
@@ -728,9 +724,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     bStateFromTPX    = !bStateFromCP;
     bInitStep        = bFirstStep && (bStateFromTPX || bVV);
     bStartingFromCpt = (Flags & MD_STARTFROMCPT) && bInitStep;
-    bLastStep        = FALSE;
     bSumEkinhOld     = FALSE;
-    bDoReplEx        = FALSE;
     bExchanged       = FALSE;
     bNeedRepartition = FALSE;
 
@@ -739,11 +733,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     step     = ir->init_step;
     step_rel = 0;
 
-    if (ir->nstlist == -1)
-    {
-        init_nlistheuristics(&nlh, bGStatEveryStep, step);
-    }
-
     if (MULTISIM(cr) && (repl_ex_nst <= 0 ))
     {
         /* check how many steps are left in other sims */
@@ -873,13 +862,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             /* Determine whether or not to do Neighbour Searching and LR */
             bNStList = (ir->nstlist > 0  && step % ir->nstlist == 0);
 
-            bNS = (bFirstStep || bExchanged || bNeedRepartition || bNStList || bDoFEP ||
-                   (ir->nstlist == -1 && nlh.nabnsb > 0));
-
-            if (bNS && ir->nstlist == -1)
-            {
-                set_nlistheuristics(&nlh, bFirstStep || bExchanged || bNeedRepartition || bDoFEP, step);
-            }
+            bNS = (bFirstStep || bExchanged || bNeedRepartition || bNStList || bDoFEP);
         }
 
         /* check whether we should stop because another simulation has
@@ -1020,8 +1003,8 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
 
         /* Do we need global communication ? */
         bGStat = (bCalcVir || bCalcEner || bStopCM ||
-                  do_per_step(step, nstglobalcomm) || (bVV && IR_NVT_TROTTER(ir) && do_per_step(step-1, nstglobalcomm)) ||
-                  (ir->nstlist == -1 && !bRerunMD && step >= nlh.step_nscheck));
+                  do_per_step(step, nstglobalcomm) ||
+                  (bVV && IR_NVT_TROTTER(ir) && do_per_step(step-1, nstglobalcomm)));
 
         do_ene = (do_per_step(step, ir->nstenergy) || bLastStep);
 
@@ -1128,66 +1111,22 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                           ekind, M, upd, bInitStep, etrtVELOCITY1,
                           cr, nrnb, constr, &top->idef);
 
-            if (bIterativeCase && do_per_step(step-1, ir->nstpcouple) && !bInitStep)
-            {
-                gmx_iterate_init(&iterate, TRUE);
-            }
-            /* for iterations, we save these vectors, as we will be self-consistently iterating
-               the calculations */
-
-            /*#### UPDATE EXTENDED VARIABLES IN TROTTER FORMULATION */
-
-            /* save the state */
-            if (iterate.bIterationActive)
-            {
-                copy_coupling_state(state, bufstate, ekind, ekind_save, &(ir->opts));
-            }
-
-            bFirstIterate = TRUE;
-            while (bFirstIterate || iterate.bIterationActive)
+            /* TODO remove the brace below, once iteration is removed */
             {
-                if (iterate.bIterationActive)
-                {
-                    copy_coupling_state(bufstate, state, ekind_save, ekind, &(ir->opts));
-                    if (bFirstIterate && bTrotter)
-                    {
-                        /* The first time through, we need a decent first estimate
-                           of veta(t+dt) to compute the constraints.  Do
-                           this by computing the box volume part of the
-                           trotter integration at this time. Nothing else
-                           should be changed by this routine here.  If
-                           !(first time), we start with the previous value
-                           of veta.  */
-
-                        veta_save = state->veta;
-                        trotter_update(ir, step, ekind, enerd, state, total_vir, mdatoms, &MassQ, trotter_seq, ettTSEQ0);
-                        vetanew     = state->veta;
-                        state->veta = veta_save;
-                    }
-                }
-
-                bOK = TRUE;
                 if (!bRerunMD || rerun_fr.bV || bForceUpdate)     /* Why is rerun_fr.bV here?  Unclear. */
                 {
                     wallcycle_stop(wcycle, ewcUPDATE);
-                    update_constraints(fplog, step, NULL, ir, ekind, mdatoms,
+                    update_constraints(fplog, step, NULL, ir, mdatoms,
                                        state, fr->bMolPBC, graph, f,
                                        &top->idef, shake_vir,
                                        cr, nrnb, wcycle, upd, constr,
-                                       TRUE, bCalcVir, vetanew);
+                                       TRUE, bCalcVir);
                     wallcycle_start(wcycle, ewcUPDATE);
-
                     if (bCalcVir && bUpdateDoLR && ir->nstcalclr > 1)
                     {
                         /* Correct the virial for multiple time stepping */
                         m_sub(shake_vir, fr->vir_twin_constr, shake_vir);
                     }
-
-                    if (!bOK)
-                    {
-                        gmx_fatal(FARGS, "Constraint error: Shake, Lincs or Settle could not solve the constrains");
-                    }
-
                 }
                 else if (graph)
                 {
@@ -1195,7 +1134,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                        called in the previous step */
                     unshift_self(graph, state->box, state->x);
                 }
-
                 /* if VV, compute the pressure and constraints */
                 /* For VV2, we strictly only need this if using pressure
                  * control, but we really would like to have accurate pressures
@@ -1207,7 +1145,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                 /*bTemp = ((ir->eI==eiVV &&(!bInitStep)) || (ir->eI==eiVVAK && IR_NPT_TROTTER(ir)));*/
                 bPres = TRUE;
                 bTemp = ((ir->eI == eiVV && (!bInitStep)) || (ir->eI == eiVVAK));
-                if (bCalcEner && ir->eI == eiVVAK)  /*MRS:  7/9/2010 -- this still doesn't fix it?*/
+                if (bCalcEner && ir->eI == eiVVAK)
                 {
                     bSumEkinhOld = TRUE;
                 }
@@ -1225,8 +1163,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                                     | (bTemp ? CGLO_TEMPERATURE : 0)
                                     | (bPres ? CGLO_PRESSURE : 0)
                                     | (bPres ? CGLO_CONSTRAINT : 0)
-                                    | ((iterate.bIterationActive) ? CGLO_ITERATE : 0)
-                                    | (bFirstIterate ? CGLO_FIRSTITERATE : 0)
                                     | CGLO_SCALEEKIN
                                     );
                     /* explanation of above:
@@ -1263,16 +1199,8 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                         }
                     }
                 }
-
-                if (iterate.bIterationActive &&
-                    done_iterating(cr, fplog, step, &iterate, bFirstIterate,
-                                   state->veta, &vetanew))
-                {
-                    break;
-                }
-                bFirstIterate = FALSE;
             }
-
+            /* TODO remove the brace above, once iteration is removed */
             if (bTrotter && !bInitStep)
             {
                 copy_mat(shake_vir, state->svir_prev);
@@ -1293,7 +1221,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             wallcycle_stop(wcycle, ewcUPDATE);
         }
 
-        /* MRS -- now done iterating -- compute the conserved quantity */
+        /* compute the conserved quantity */
         if (bVV)
         {
             saved_conserved_quantity = compute_conserved_from_auxiliary(ir, state, &MassQ);
@@ -1401,31 +1329,6 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
             gs.sig[eglsRESETCOUNTERS] = 1;
         }
 
-        if (ir->nstlist == -1 && !bRerunMD)
-        {
-            /* When bGStatEveryStep=FALSE, global_stat is only called
-             * when we check the atom displacements, not at NS steps.
-             * This means that also the bonded interaction count check is not
-             * performed immediately after NS. Therefore a few MD steps could
-             * be performed with missing interactions.
-             * But wrong energies are never written to file,
-             * since energies are only written after global_stat
-             * has been called.
-             */
-            if (step >= nlh.step_nscheck)
-            {
-                nlh.nabnsb = natoms_beyond_ns_buffer(ir, fr, &top->cgs,
-                                                     nlh.scale_tot, state->x);
-            }
-            else
-            {
-                /* This is not necessarily true,
-                 * but step_nscheck is determined quite conservatively.
-                 */
-                nlh.nabnsb = 0;
-            }
-        }
-
         /* In parallel we only have to check for checkpointing in steps
          * where we do global communication,
          *  otherwise the other nodes don't know.
@@ -1453,34 +1356,16 @@ double 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, ekind, mdatoms,
+                    update_constraints(fplog, step, NULL, ir, mdatoms,
                                        state, fr->bMolPBC, graph, f,
                                        &top->idef, tmp_vir,
                                        cr, nrnb, wcycle, upd, constr,
-                                       TRUE, bCalcVir, vetanew);
+                                       TRUE, bCalcVir);
                 }
             }
         }
-
-        if (bIterativeCase && do_per_step(step, ir->nstpcouple))
-        {
-            gmx_iterate_init(&iterate, TRUE);
-            /* for iterations, we save these vectors, as we will be redoing the calculations */
-            copy_coupling_state(state, bufstate, ekind, ekind_save, &(ir->opts));
-        }
-
-        bFirstIterate = TRUE;
-        while (bFirstIterate || iterate.bIterationActive)
+        /* TODO remove the brace below, once iteration is removed */
         {
-            /* We now restore these vectors to redo the calculation with improved extended variables */
-            if (iterate.bIterationActive)
-            {
-                copy_coupling_state(bufstate, state, ekind_save, ekind, &(ir->opts));
-            }
-
-            /* We make the decision to break or not -after- the calculation of Ekin and Pressure,
-               so scroll down for that logic */
-
             /* #########   START SECOND UPDATE STEP ################# */
             /* Box is changed in update() when we do pressure coupling,
              * but we should still use the old box for energy corrections and when
@@ -1489,30 +1374,14 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
              */
             copy_mat(state->box, lastbox);
 
-            bOK         = TRUE;
             dvdl_constr = 0;
 
-            if (!(bRerunMD && !rerun_fr.bV && !bForceUpdate))
+            if (!bRerunMD || rerun_fr.bV || bForceUpdate)
             {
                 wallcycle_start(wcycle, ewcUPDATE);
                 /* UPDATE PRESSURE VARIABLES IN TROTTER FORMULATION WITH CONSTRAINTS */
                 if (bTrotter)
                 {
-                    if (iterate.bIterationActive)
-                    {
-                        if (bFirstIterate)
-                        {
-                            scalevir = 1;
-                        }
-                        else
-                        {
-                            /* we use a new value of scalevir to converge the iterations faster */
-                            scalevir = tracevir/trace(shake_vir);
-                        }
-                        msmul(shake_vir, scalevir, shake_vir);
-                        m_add(force_vir, shake_vir, total_vir);
-                        clear_mat(shake_vir);
-                    }
                     trotter_update(ir, step, ekind, enerd, state, total_vir, mdatoms, &MassQ, trotter_seq, ettTSEQ3);
                     /* We can only do Berendsen coupling after we have summed
                      * the kinetic energy or virial. Since the happens
@@ -1559,11 +1428,11 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                               ekind, M, upd, bInitStep, etrtPOSITION, cr, nrnb, constr, &top->idef);
                 wallcycle_stop(wcycle, ewcUPDATE);
 
-                update_constraints(fplog, step, &dvdl_constr, ir, ekind, mdatoms, state,
+                update_constraints(fplog, step, &dvdl_constr, ir, mdatoms, state,
                                    fr->bMolPBC, graph, f,
                                    &top->idef, shake_vir,
                                    cr, nrnb, wcycle, upd, constr,
-                                   FALSE, bCalcVir, state->veta);
+                                   FALSE, bCalcVir);
 
                 if (bCalcVir && bUpdateDoLR && ir->nstcalclr > 1)
                 {
@@ -1598,21 +1467,11 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                      * 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, ekind, mdatoms,
+                    update_constraints(fplog, step, NULL, ir, mdatoms,
                                        state, fr->bMolPBC, graph, f,
                                        &top->idef, tmp_vir,
                                        cr, nrnb, wcycle, upd, NULL,
-                                       FALSE, bCalcVir,
-                                       state->veta);
-                }
-                if (!bOK)
-                {
-                    gmx_fatal(FARGS, "Constraint error: Shake, Lincs or Settle could not solve the constrains");
-                }
-
-                if (fr->bSepDVDL && fplog && do_log)
-                {
-                    gmx_print_sepdvdl(fplog, "Constraint dV/dl", 0.0, dvdl_constr);
+                                       FALSE, bCalcVir);
                 }
                 if (bVV)
                 {
@@ -1668,14 +1527,9 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
              */
             if (bGStat || (!EI_VV(ir->eI) && do_per_step(step+1, nstglobalcomm)))
             {
-                if (ir->nstlist == -1 && bFirstIterate)
-                {
-                    gs.sig[eglsNABNSB] = nlh.nabnsb;
-                }
                 compute_globals(fplog, gstat, cr, ir, fr, ekind, state, state_global, mdatoms, nrnb, vcm,
                                 wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
-                                constr,
-                                bFirstIterate ? &gs : NULL,
+                                constr, &gs,
                                 (step_rel % gs.nstms == 0) &&
                                 (multisim_nsteps < 0 || (step_rel < multisim_nsteps)),
                                 lastbox,
@@ -1685,40 +1539,27 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                                 | (!EI_VV(ir->eI) && bStopCM ? CGLO_STOPCM : 0)
                                 | (!EI_VV(ir->eI) ? CGLO_TEMPERATURE : 0)
                                 | (!EI_VV(ir->eI) || bRerunMD ? CGLO_PRESSURE : 0)
-                                | (iterate.bIterationActive ? CGLO_ITERATE : 0)
-                                | (bFirstIterate ? CGLO_FIRSTITERATE : 0)
                                 | CGLO_CONSTRAINT
                                 );
-                if (ir->nstlist == -1 && bFirstIterate)
-                {
-                    nlh.nabnsb         = gs.set[eglsNABNSB];
-                    gs.set[eglsNABNSB] = 0;
-                }
             }
-            /* bIterate is set to keep it from eliminating the old ekin kinetic energy terms */
+
             /* #############  END CALC EKIN AND PRESSURE ################# */
 
             /* Note: this is OK, but there are some numerical precision issues with using the convergence of
                the virial that should probably be addressed eventually. state->veta has better properies,
                but what we actually need entering the new cycle is the new shake_vir value. Ideally, we could
                generate the new shake_vir, but test the veta value for convergence.  This will take some thought. */
-
-            if (iterate.bIterationActive &&
-                done_iterating(cr, fplog, step, &iterate, bFirstIterate,
-                               trace(shake_vir), &tracevir))
-            {
-                break;
-            }
-            bFirstIterate = FALSE;
         }
+        /* TODO remove the brace above, once iteration is removed */
 
         if (!bVV || bRerunMD)
         {
-            /* sum up the foreign energy and dhdl terms for md and sd. currently done every step so that dhdl is correct in the .edr */
+            /* Sum up the foreign energy and dhdl terms for md and sd.
+               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,
-                   ir->nstlist == -1 ? &nlh.scale_tot : NULL, pcoupl_mu, nrnb, upd);
+                   pcoupl_mu, nrnb, upd);
 
         /* ################# END UPDATE STEP 2 ################# */
         /* #### We now have r(t+dt) and v(t+dt/2)  ############# */
@@ -1922,7 +1763,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                     dd_bcast(cr->dd, sizeof(gmx_bool), &bPMETuneRunning);
 
                     if (bPMETuneRunning &&
-                        fr->nbv->bUseGPU && DOMAINDECOMP(cr) &&
+                        use_GPU(fr->nbv) && DOMAINDECOMP(cr) &&
                         !(cr->duty & DUTY_PME))
                     {
                         /* Lock DLB=auto to off (does nothing when DLB=yes/no).
@@ -1986,7 +1827,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         {
             /* Reset all the counters related to performance over the run */
             reset_all_counters(fplog, cr, step, &step_rel, ir, wcycle, nrnb, walltime_accounting,
-                               fr->nbv != NULL && fr->nbv->bUseGPU ? fr->nbv->cu_nbv : NULL);
+                               use_GPU(fr->nbv) ? fr->nbv : NULL);
             wcycle_set_reset_counters(wcycle, -1);
             if (!(cr->duty & DUTY_PME))
             {
@@ -2036,16 +1877,10 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
     done_mdoutf(outf);
     debug_gmx();
 
-    if (ir->nstlist == -1 && nlh.nns > 0 && fplog)
-    {
-        fprintf(fplog, "Average neighborlist lifetime: %.1f steps, std.dev.: %.1f steps\n", nlh.s1/nlh.nns, sqrt(nlh.s2/nlh.nns - sqr(nlh.s1/nlh.nns)));
-        fprintf(fplog, "Average number of atoms that crossed the half buffer length: %.1f\n\n", nlh.ab/nlh.nns);
-    }
-
     if (pme_loadbal != NULL)
     {
         pme_loadbal_done(pme_loadbal, cr, fplog,
-                         fr->nbv != NULL && fr->nbv->bUseGPU);
+                         use_GPU(fr->nbv));
     }
 
     if (shellfc && fplog)
index 6bac3f08e7e6709a81be1606711027302cc034f8..cb2457a7784773a0dc5f369b140daae6badf0b1e 100644 (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, by the GROMACS development team, led by
+ * Copyright (c) 2011,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.
  * 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 "mdrun_main.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdio.h>
+#include <string.h>
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/filenm.h"
 #include "gromacs/legacyheaders/checkpoint.h"
 #include "gromacs/legacyheaders/copyrite.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
 #include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/main.h"
 #include "gromacs/legacyheaders/mdrun.h"
 #include "gromacs/legacyheaders/readinp.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/utility/fatalerror.h"
 
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/filenm.h"
+#include "mdrun_main.h"
+
+static bool is_multisim_option_set(int argc, const char *const argv[])
+{
+    for (int i = 0; i < argc; ++i)
+    {
+        if (strcmp(argv[i], "-multi") == 0 || strcmp(argv[i], "-multidir") == 0)
+        {
+            return true;
+        }
+    }
+    return false;
+}
 
 int gmx_mdrun(int argc, char *argv[])
 {
@@ -71,8 +83,7 @@ int gmx_mdrun(int argc, char *argv[])
         "The [TT]mdrun[tt] program reads the run input file ([TT]-s[tt])",
         "and distributes the topology over ranks if needed.",
         "[TT]mdrun[tt] produces at least four output files.",
-        "A single log file ([TT]-g[tt]) is written, unless the option",
-        "[TT]-seppot[tt] is used, in which case each rank writes a log file.",
+        "A single log file ([TT]-g[tt]) is written.",
         "The trajectory file ([TT]-o[tt]), contains coordinates, velocities and",
         "optionally forces.",
         "The structure file ([TT]-c[tt]) contains the coordinates and",
@@ -83,195 +94,10 @@ int gmx_mdrun(int argc, char *argv[])
         "([TT]-x[tt]).[PAR]",
         "The option [TT]-dhdl[tt] is only used when free energy calculation is",
         "turned on.[PAR]",
-        "A simulation can be run in parallel using two different parallelization",
-        "schemes: MPI parallelization and/or OpenMP thread parallelization.",
-        "The MPI parallelization uses multiple processes when [TT]mdrun[tt] is",
-        "compiled with a normal MPI library or threads when [TT]mdrun[tt] is",
-        "compiled with the GROMACS built-in thread-MPI library. OpenMP threads",
-        "are supported when [TT]mdrun[tt] is compiled with OpenMP. Full OpenMP support",
-        "is only available with the Verlet cut-off scheme, with the (older)",
-        "group scheme only PME-only ranks can use OpenMP parallelization.",
-        "In all cases [TT]mdrun[tt] will by default try to use all the available",
-        "hardware resources. With a normal MPI library only the options",
-        "[TT]-ntomp[tt] (with the Verlet cut-off scheme) and [TT]-ntomp_pme[tt],",
-        "for PME-only ranks, can be used to control the number of threads.",
-        "With thread-MPI there are additional options [TT]-nt[tt], which sets",
-        "the total number of threads, and [TT]-ntmpi[tt], which sets the number",
-        "of thread-MPI threads.",
-        "The number of OpenMP threads used by [TT]mdrun[tt] can also be set with",
-        "the standard environment variable, [TT]OMP_NUM_THREADS[tt].",
-        "The [TT]GMX_PME_NUM_THREADS[tt] environment variable can be used to specify",
-        "the number of threads used by the PME-only ranks.[PAR]",
-        "Note that combined MPI+OpenMP parallelization is in many cases",
-        "slower than either on its own. However, at high parallelization, using the",
-        "combination is often beneficial as it reduces the number of domains and/or",
-        "the number of MPI ranks. (Less and larger domains can improve scaling,",
-        "with separate PME ranks, using fewer MPI ranks reduces communication costs.)",
-        "OpenMP-only parallelization is typically faster than MPI-only parallelization",
-        "on a single CPU(-die). Since we currently don't have proper hardware",
-        "topology detection, [TT]mdrun[tt] compiled with thread-MPI will only",
-        "automatically use OpenMP-only parallelization when you use up to 4",
-        "threads, up to 12 threads with Intel Nehalem/Westmere, or up to 16",
-        "threads with Intel Sandy Bridge or newer CPUs. Otherwise MPI-only",
-        "parallelization is used (except with GPUs, see below).",
-        "[PAR]",
-        "To quickly test the performance of the new Verlet cut-off scheme",
-        "with old [TT].tpr[tt] files, either on CPUs or CPUs+GPUs, you can use",
-        "the [TT]-testverlet[tt] option. This should not be used for production,",
-        "since it can slightly modify potentials and it will remove charge groups",
-        "making analysis difficult, as the [TT].tpr[tt] file will still contain",
-        "charge groups. For production simulations it is highly recommended",
-        "to specify [TT]cutoff-scheme = Verlet[tt] in the [TT].mdp[tt] file.",
-        "[PAR]",
-        "With GPUs (only supported with the Verlet cut-off scheme), the number",
-        "of GPUs should match the number of particle-particle ranks, i.e.",
-        "excluding PME-only ranks. With thread-MPI, unless set on the command line, the number",
-        "of MPI threads will automatically be set to the number of GPUs detected.",
-        "To use a subset of the available GPUs, or to manually provide a mapping of",
-        "GPUs to PP ranks, you can use the [TT]-gpu_id[tt] option. The argument of [TT]-gpu_id[tt] is",
-        "a string of digits (without delimiter) representing device id-s of the GPUs to be used.",
-        "For example, \"[TT]02[tt]\" specifies using GPUs 0 and 2 in the first and second PP ranks per compute node",
-        "respectively. To select different sets of GPU-s",
-        "on different nodes of a compute cluster, use the [TT]GMX_GPU_ID[tt] environment",
-        "variable instead. The format for [TT]GMX_GPU_ID[tt] is identical to ",
-        "[TT]-gpu_id[tt], with the difference that an environment variable can have",
-        "different values on different compute nodes. Multiple MPI ranks on each node",
-        "can share GPUs. This is accomplished by specifying the id(s) of the GPU(s)",
-        "multiple times, e.g. \"[TT]0011[tt]\" for four ranks sharing two GPUs in this node.",
-        "This works within a single simulation, or a multi-simulation, with any form of MPI.",
-        "[PAR]",
-        "With the Verlet cut-off scheme and verlet-buffer-tolerance set,",
-        "the pair-list update interval nstlist can be chosen freely with",
-        "the option [TT]-nstlist[tt]. [TT]mdrun[tt] will then adjust",
-        "the pair-list cut-off to maintain accuracy, and not adjust nstlist.",
-        "Otherwise, by default, [TT]mdrun[tt] will try to increase the",
-        "value of nstlist set in the [TT].mdp[tt] file to improve the",
-        "performance. For CPU-only runs, nstlist might increase to 20, for",
-        "GPU runs up to 40. For medium to high parallelization or with",
-        "fast GPUs, a (user-supplied) larger nstlist value can give much",
-        "better performance.",
-        "[PAR]",
-        "When using PME with separate PME ranks or with a GPU, the two major",
-        "compute tasks, the non-bonded force calculation and the PME calculation",
-        "run on different compute resources. If this load is not balanced,",
-        "some of the resources will be idle part of time. With the Verlet",
-        "cut-off scheme this load is automatically balanced when the PME load",
-        "is too high (but not when it is too low). This is done by scaling",
-        "the Coulomb cut-off and PME grid spacing by the same amount. In the first",
-        "few hundred steps different settings are tried and the fastest is chosen",
-        "for the rest of the simulation. This does not affect the accuracy of",
-        "the results, but it does affect the decomposition of the Coulomb energy",
-        "into particle and mesh contributions. The auto-tuning can be turned off",
-        "with the option [TT]-notunepme[tt].",
-        "[PAR]",
-        "[TT]mdrun[tt] pins (sets affinity of) threads to specific cores,",
-        "when all (logical) cores on a compute node are used by [TT]mdrun[tt],",
-        "even when no multi-threading is used,",
-        "as this usually results in significantly better performance.",
-        "If the queuing systems or the OpenMP library pinned threads, we honor",
-        "this and don't pin again, even though the layout may be sub-optimal.",
-        "If you want to have [TT]mdrun[tt] override an already set thread affinity",
-        "or pin threads when using less cores, use [TT]-pin on[tt].",
-        "With SMT (simultaneous multithreading), e.g. Intel Hyper-Threading,",
-        "there are multiple logical cores per physical core.",
-        "The option [TT]-pinstride[tt] sets the stride in logical cores for",
-        "pinning consecutive threads. Without SMT, 1 is usually the best choice.",
-        "With Intel Hyper-Threading 2 is best when using half or less of the",
-        "logical cores, 1 otherwise. The default value of 0 do exactly that:",
-        "it minimizes the threads per logical core, to optimize performance.",
-        "If you want to run multiple [TT]mdrun[tt] jobs on the same physical node,"
-        "you should set [TT]-pinstride[tt] to 1 when using all logical cores.",
-        "When running multiple [TT]mdrun[tt] (or other) simulations on the same physical",
-        "node, some simulations need to start pinning from a non-zero core",
-        "to avoid overloading cores; with [TT]-pinoffset[tt] you can specify",
-        "the offset in logical cores for pinning.",
-        "[PAR]",
-        "When [TT]mdrun[tt] is started with more than 1 rank,",
-        "parallelization with domain decomposition is used.",
-        "[PAR]",
-        "With domain decomposition, the spatial decomposition can be set",
-        "with option [TT]-dd[tt]. By default [TT]mdrun[tt] selects a good decomposition.",
-        "The user only needs to change this when the system is very inhomogeneous.",
-        "Dynamic load balancing is set with the option [TT]-dlb[tt],",
-        "which can give a significant performance improvement,",
-        "especially for inhomogeneous systems. The only disadvantage of",
-        "dynamic load balancing is that runs are no longer binary reproducible,",
-        "but in most cases this is not important.",
-        "By default the dynamic load balancing is automatically turned on",
-        "when the measured performance loss due to load imbalance is 5% or more.",
-        "At low parallelization these are the only important options",
-        "for domain decomposition.",
-        "At high parallelization the options in the next two sections",
-        "could be important for increasing the performace.",
-        "[PAR]",
-        "When PME is used with domain decomposition, separate ranks can",
-        "be assigned to do only the PME mesh calculation;",
-        "this is computationally more efficient starting at about 12 ranks,",
-        "or even fewer when OpenMP parallelization is used.",
-        "The number of PME ranks is set with option [TT]-npme[tt],",
-        "but this cannot be more than half of the ranks.",
-        "By default [TT]mdrun[tt] makes a guess for the number of PME",
-        "ranks when the number of ranks is larger than 16. With GPUs,",
-        "using separate PME ranks is not selected automatically,",
-        "since the optimal setup depends very much on the details",
-        "of the hardware. In all cases, you might gain performance",
-        "by optimizing [TT]-npme[tt]. Performance statistics on this issue",
-        "are written at the end of the log file.",
-        "For good load balancing at high parallelization, the PME grid x and y",
-        "dimensions should be divisible by the number of PME ranks",
-        "(the simulation will run correctly also when this is not the case).",
-        "[PAR]",
-        "This section lists all options that affect the domain decomposition.",
-        "[PAR]",
-        "Option [TT]-rdd[tt] can be used to set the required maximum distance",
-        "for inter charge-group bonded interactions.",
-        "Communication for two-body bonded interactions below the non-bonded",
-        "cut-off distance always comes for free with the non-bonded communication.",
-        "Atoms beyond the non-bonded cut-off are only communicated when they have",
-        "missing bonded interactions; this means that the extra cost is minor",
-        "and nearly indepedent of the value of [TT]-rdd[tt].",
-        "With dynamic load balancing option [TT]-rdd[tt] also sets",
-        "the lower limit for the domain decomposition cell sizes.",
-        "By default [TT]-rdd[tt] is determined by [TT]mdrun[tt] based on",
-        "the initial coordinates. The chosen value will be a balance",
-        "between interaction range and communication cost.",
-        "[PAR]",
-        "When inter charge-group bonded interactions are beyond",
-        "the bonded cut-off distance, [TT]mdrun[tt] terminates with an error message.",
-        "For pair interactions and tabulated bonds",
-        "that do not generate exclusions, this check can be turned off",
-        "with the option [TT]-noddcheck[tt].",
-        "[PAR]",
-        "When constraints are present, option [TT]-rcon[tt] influences",
-        "the cell size limit as well.",
-        "Atoms connected by NC constraints, where NC is the LINCS order plus 1,",
-        "should not be beyond the smallest cell size. A error message is",
-        "generated when this happens and the user should change the decomposition",
-        "or decrease the LINCS order and increase the number of LINCS iterations.",
-        "By default [TT]mdrun[tt] estimates the minimum cell size required for P-LINCS",
-        "in a conservative fashion. For high parallelization it can be useful",
-        "to set the distance required for P-LINCS with the option [TT]-rcon[tt].",
-        "[PAR]",
-        "The [TT]-dds[tt] option sets the minimum allowed x, y and/or z scaling",
-        "of the cells with dynamic load balancing. [TT]mdrun[tt] will ensure that",
-        "the cells can scale down by at least this factor. This option is used",
-        "for the automated spatial decomposition (when not using [TT]-dd[tt])",
-        "as well as for determining the number of grid pulses, which in turn",
-        "sets the minimum allowed cell size. Under certain circumstances",
-        "the value of [TT]-dds[tt] might need to be adjusted to account for",
-        "high or low spatial inhomogeneity of the system.",
-        "[PAR]",
-        "The option [TT]-gcom[tt] can be used to only do global communication",
-        "every n steps.",
-        "This can improve performance for highly parallel simulations",
-        "where this global communication step becomes the bottleneck.",
-        "For a global thermostat and/or barostat the temperature",
-        "and/or pressure will also only be updated every [TT]-gcom[tt] steps.",
-        "By default it is set to the minimum of nstcalcenergy and nstlist.[PAR]",
-        "With [TT]-rerun[tt] an input trajectory can be given for which ",
-        "forces and energies will be (re)calculated. Neighbor searching will be",
-        "performed for every frame, unless [TT]nstlist[tt] is zero",
-        "(see the [TT].mdp[tt] file).[PAR]",
+        "Running mdrun efficiently in parallel is a complex topic topic,",
+        "many aspects of which are covered in the online User Guide. You",
+        "should look there for practical advice on using many of the options",
+        "available in mdrun.[PAR]",
         "ED (essential dynamics) sampling and/or additional flooding potentials",
         "are switched on by using the [TT]-ei[tt] flag followed by an [TT].edi[tt]",
         "file. The [TT].edi[tt] file can be produced with the [TT]make_edi[tt] tool",
@@ -297,28 +123,6 @@ int gmx_mdrun(int argc, char *argv[])
         "The options [TT]-px[tt] and [TT]-pf[tt] are used for writing pull COM",
         "coordinates and forces when pulling is selected",
         "in the [TT].mdp[tt] file.[PAR]",
-        "With [TT]-multi[tt] or [TT]-multidir[tt], multiple systems can be ",
-        "simulated in parallel.",
-        "As many input files/directories are required as the number of systems. ",
-        "The [TT]-multidir[tt] option takes a list of directories (one for each ",
-        "system) and runs in each of them, using the input/output file names, ",
-        "such as specified by e.g. the [TT]-s[tt] option, relative to these ",
-        "directories.",
-        "With [TT]-multi[tt], the system number is appended to the run input ",
-        "and each output filename, for instance [TT]topol.tpr[tt] becomes",
-        "[TT]topol0.tpr[tt], [TT]topol1.tpr[tt] etc.",
-        "The number of ranks per system is the total number of ranks",
-        "divided by the number of systems.",
-        "One use of this option is for NMR refinement: when distance",
-        "or orientation restraints are present these can be ensemble averaged",
-        "over all the systems.[PAR]",
-        "With [TT]-replex[tt] replica exchange is attempted every given number",
-        "of steps. The number of replicas is set with the [TT]-multi[tt] or ",
-        "[TT]-multidir[tt] option, described above.",
-        "All run input files should use a different coupling temperature,",
-        "the order of the files is not important. The random seed is set with",
-        "[TT]-reseed[tt]. The velocities are scaled and neighbor searching",
-        "is performed after every exchange.[PAR]",
         "Finally some experimental algorithms can be tested when the",
         "appropriate options have been given. Currently under",
         "investigation are: polarizability.",
@@ -374,7 +178,11 @@ int gmx_mdrun(int argc, char *argv[])
         "[PAR]",
         "With option [TT]-maxh[tt] a simulation is terminated and a checkpoint",
         "file is written at the first neighbor search step where the run time",
-        "exceeds [TT]-maxh[tt]*0.99 hours.",
+        "exceeds [TT]-maxh[tt]*0.99 hours. This option is particularly useful in",
+        "combination with setting [TT]nsteps[tt] to -1 either in the mdp or using the",
+        "similarly named command line option. This results in an infinite run,",
+        "terminated only when the time limit set by [TT]-maxh[tt] is reached (if any)"
+        "or upon receiving a signal."
         "[PAR]",
         "When [TT]mdrun[tt] receives a TERM signal, it will set nsteps to the current",
         "step plus one. When [TT]mdrun[tt] receives an INT signal (e.g. when ctrl+C is",
@@ -398,10 +206,10 @@ int gmx_mdrun(int argc, char *argv[])
     };
     t_commrec    *cr;
     t_filenm      fnm[] = {
-        { efTPX, NULL,      NULL,       ffREAD },
+        { efTPR, NULL,      NULL,       ffREAD },
         { efTRN, "-o",      NULL,       ffWRITE },
         { efCOMPRESSED, "-x", NULL,     ffOPTWR },
-        { efCPT, "-cpi",    NULL,       ffOPTRD },
+        { efCPT, "-cpi",    NULL,       ffOPTRD | ffALLOW_MISSING },
         { efCPT, "-cpo",    NULL,       ffOPTWR },
         { efSTO, "-c",      "confout",  ffWRITE },
         { efEDR, "-e",      "ener",     ffWRITE },
@@ -440,10 +248,8 @@ int gmx_mdrun(int argc, char *argv[])
     gmx_bool        bDDBondCheck  = TRUE;
     gmx_bool        bDDBondComm   = TRUE;
     gmx_bool        bTunePME      = TRUE;
-    gmx_bool        bTestVerlet   = FALSE;
     gmx_bool        bVerbose      = FALSE;
     gmx_bool        bCompact      = TRUE;
-    gmx_bool        bSepPot       = FALSE;
     gmx_bool        bRerunVSite   = FALSE;
     gmx_bool        bConfout      = TRUE;
     gmx_bool        bReproducible = FALSE;
@@ -507,9 +313,9 @@ int gmx_mdrun(int argc, char *argv[])
         { "-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},
-          "Set thread affinities" },
+          "Whether mdrun should try to set thread affinities" },
         { "-pinoffset", FALSE, etINT, {&hw_opt.core_pinning_offset},
-          "The starting logical core number for pinning to cores; used to avoid pinning threads from different mdrun instances to the same core" },
+          "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},
@@ -547,14 +353,10 @@ int gmx_mdrun(int argc, char *argv[])
           "Set nstlist when using a Verlet buffer tolerance (0 is guess)" },
         { "-tunepme", FALSE, etBOOL, {&bTunePME},
           "Optimize PME load between PP/PME ranks or GPU/CPU" },
-        { "-testverlet", FALSE, etBOOL, {&bTestVerlet},
-          "Test the Verlet non-bonded scheme" },
         { "-v",       FALSE, etBOOL, {&bVerbose},
           "Be loud and noisy" },
         { "-compact", FALSE, etBOOL, {&bCompact},
           "Write a compact log file" },
-        { "-seppot",  FALSE, etBOOL, {&bSepPot},
-          "Write separate V and dVdl terms for each interaction type and rank to the log file(s)" },
         { "-pforce",  FALSE, etREAL, {&pforce},
           "Print all forces larger than this (kJ/mol nm)" },
         { "-reprod",  FALSE, etBOOL, {&bReproducible},
@@ -566,7 +368,7 @@ int gmx_mdrun(int argc, char *argv[])
         { "-append",  FALSE, etBOOL, {&bAppendFiles},
           "Append to previous output files when continuing from checkpoint instead of adding the simulation part number to all file names" },
         { "-nsteps",  FALSE, etINT64, {&nsteps},
-          "Run this number of steps, overrides .mdp file option" },
+          "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},
           "Terminate after 0.99 times this time (hours)" },
         { "-multi",   FALSE, etINT, {&nmultisim},
@@ -596,7 +398,7 @@ int gmx_mdrun(int argc, char *argv[])
         { "-resethway", FALSE, etBOOL, {&bResetCountersHalfWay},
           "HIDDENReset the cycle counters after half the number of steps or halfway [TT]-maxh[tt]" }
     };
-    unsigned long   Flags, PCA_Flags;
+    unsigned long   Flags;
     ivec            ddxyz;
     int             dd_node_order;
     gmx_bool        bAddPart;
@@ -607,10 +409,17 @@ int gmx_mdrun(int argc, char *argv[])
     int             rc;
     char          **multidir = NULL;
 
-
     cr = init_commrec();
 
-    PCA_Flags = (PCA_CAN_SET_DEFFNM | (MASTER(cr) ? 0 : PCA_QUIET));
+    unsigned long PCA_Flags = PCA_CAN_SET_DEFFNM;
+    // With -multi or -multidir, the file names are going to get processed
+    // further (or the working directory changed), so we can't check for their
+    // existence during parsing.  It isn't useful to do any completion based on
+    // file system contents, either.
+    if (is_multisim_option_set(argc, argv))
+    {
+        PCA_Flags |= PCA_DISABLE_INPUT_FILE_CHECKING;
+    }
 
     /* Comment this in to do fexist calls only on master
      * works not with rerun or tables at the moment
@@ -679,11 +488,6 @@ int gmx_mdrun(int argc, char *argv[])
     sim_part_fn = sim_part;
     if (opt2bSet("-cpi", NFILE, fnm))
     {
-        if (bSepPot && bAppendFiles)
-        {
-            gmx_fatal(FARGS, "Output file appending is not supported with -seppot");
-        }
-
         bAppendFiles =
             read_checkpoint_simulation_part(opt2fn_master("-cpi", NFILE,
                                                           fnm, cr),
@@ -738,11 +542,9 @@ int gmx_mdrun(int argc, char *argv[])
     }
 
     Flags = opt2bSet("-rerun", NFILE, fnm) ? MD_RERUN : 0;
-    Flags = Flags | (bSepPot       ? MD_SEPPOT       : 0);
     Flags = Flags | (bDDBondCheck  ? MD_DDBONDCHECK  : 0);
     Flags = Flags | (bDDBondComm   ? MD_DDBONDCOMM   : 0);
     Flags = Flags | (bTunePME      ? MD_TUNEPME      : 0);
-    Flags = Flags | (bTestVerlet   ? MD_TESTVERLET   : 0);
     Flags = Flags | (bConfout      ? MD_CONFOUT      : 0);
     Flags = Flags | (bRerunVSite   ? MD_RERUN_VSITE  : 0);
     Flags = Flags | (bReproducible ? MD_REPRODUCIBLE : 0);
@@ -758,19 +560,15 @@ int gmx_mdrun(int argc, char *argv[])
     /* 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) || bSepPot) && !bAppendFiles)
+    if (MASTER(cr) && !bAppendFiles)
     {
         gmx_log_open(ftp2fn(efLOG, NFILE, fnm), cr,
-                     !bSepPot, Flags & MD_APPENDFILES, &fplog);
+                     Flags & MD_APPENDFILES, &fplog);
         please_cite(fplog, "Hess2008b");
         please_cite(fplog, "Spoel2005a");
         please_cite(fplog, "Lindahl2001a");
         please_cite(fplog, "Berendsen95a");
     }
-    else if (!MASTER(cr) && bSepPot)
-    {
-        gmx_log_open(ftp2fn(efLOG, NFILE, fnm), cr, !bSepPot, Flags, &fplog);
-    }
     else
     {
         fplog = NULL;
index cf83ce57b58c02cf477638d3a33036295337b1a4..cef61ffb3d38ae580263b7bee1bc5acf814be74b 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "membed.h"
 
 #include <signal.h>
 #include <stdlib.h>
-#include "typedefs.h"
-#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "vec.h"
-#include "macros.h"
-#include "main.h"
-#include "gromacs/fileio/futil.h"
+
 #include "gromacs/essentialdynamics/edsam.h"
-#include "index.h"
-#include "physics.h"
-#include "names.h"
-#include "mtop_util.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/utility/cstringutil.h"
-#include "membed.h"
-#include "pbc.h"
-#include "readinp.h"
 #include "gromacs/gmxpreprocess/readir.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 /* information about scaling center */
 typedef struct {
@@ -1039,7 +1036,7 @@ gmx_membed_t init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop_
         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);
 
-        tpr_version = get_tpr_version(ftp2fn(efTPX, nfile, fnm));
+        tpr_version = get_tpr_version(ftp2fn(efTPR, nfile, fnm));
         if (tpr_version < membed_version)
         {
             gmx_fatal(FARGS, "Version of *.tpr file to old (%d). "
index b4206046761090dc410b5a2ec4baba95d672a8d6..7face206df382496bc3f44d17d67517bce64d9e1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -36,8 +36,9 @@
 #ifndef _gmx_membed_h
 #define _gmx_membed_h
 
-#include "typedefs.h"
-#include "types/membedt.h"
+#include "gromacs/fileio/filenm.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/membedt.h"
 
 #ifdef __cplusplus
 extern "C" {
similarity index 98%
rename from src/programs/mdrun/repl_ex.c
rename to src/programs/mdrun/repl_ex.cpp
index 46a9bc0113cd1cd6755cca7903cc71128c2386f4..a85216beab4e592526333a745961210f507b63f5 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
 
-#include <math.h>
+#include "gmxpre.h"
+
 #include "repl_ex.h"
-#include "network.h"
+
+#include "config.h"
+
+#include <math.h>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "copyrite.h"
-#include "macros.h"
-#include "vec.h"
-#include "names.h"
-#include "domdec.h"
-#include "gromacs/random/random.h"
 
 #define PROBABILITYCUTOFF 100
 /* we don't bother evaluating if events are more rare than exp(-100) = 3.7x10^-44 */
@@ -106,7 +108,7 @@ static gmx_bool repl_quantity(const gmx_multisim_t *ms,
 {
     real    *qall;
     gmx_bool bDiff;
-    int      i, s;
+    int      s;
 
     snew(qall, ms->nsim);
     qall[re->repl] = q;
@@ -142,7 +144,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
                                     const t_inputrec *ir,
                                     int nst, int nex, int init_seed)
 {
-    real                temp, pres;
+    real                pres;
     int                 i, j, k;
     struct gmx_repl_ex *re;
     gmx_bool            bTemp;
@@ -897,7 +899,7 @@ test_for_replica_exchange(FILE                 *fplog,
                           real                  time)
 {
     int       m, i, j, a, b, ap, bp, i0, i1, tmp;
-    real      ediff = 0, delta = 0, dpV = 0;
+    real      delta = 0;
     gmx_bool  bPrint, bMultiEx;
     gmx_bool *bEx      = re->bEx;
     real     *prob     = re->prob;
@@ -905,10 +907,9 @@ test_for_replica_exchange(FILE                 *fplog,
     gmx_bool  bEpot    = FALSE;
     gmx_bool  bDLambda = FALSE;
     gmx_bool  bVol     = FALSE;
-    gmx_rng_t rng;
 
     bMultiEx = (re->nex > 1);  /* multiple exchanges at each state */
-    fprintf(fplog, "Replica exchange at step " "%"GMX_PRId64 " time %.5f\n", step, time);
+    fprintf(fplog, "Replica exchange at step %" GMX_PRId64 " time %.5f\n", step, time);
 
     if (re->bNPT)
     {
@@ -1306,7 +1307,7 @@ gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *
                           t_state *state, gmx_enerdata_t *enerd,
                           t_state *state_local, gmx_int64_t step, real time)
 {
-    int i, j;
+    int j;
     int replica_id = 0;
     int exchange_partner;
     int maxswap = 0;
index ec6c6ee23c7bffe641abce65e7dcc2824dcf3ded..ffedd2305f626acdec1086a2aaa0169a029548f8 100644 (file)
 #ifndef _repl_ex_h
 #define _repl_ex_h
 
-#include "typedefs.h"
-#include "types/commrec.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Abstract type for replica exchange */
 typedef struct gmx_repl_ex *gmx_repl_ex_t;
@@ -68,4 +72,8 @@ extern gmx_bool replica_exchange(FILE *fplog,
 extern void print_replica_exchange_statistics(FILE *fplog, gmx_repl_ex_t re);
 /* Should only be called on the master nodes */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif  /* _repl_ex_h */
similarity index 86%
rename from src/programs/mdrun/runner.c
rename to src/programs/mdrun/runner.cpp
index c87a06497ec9ea1a91bb0ad101c5367dab951be1..d9d2fd26776360f0ef83431cb852d9e380d75940 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "gmxpre.h"
+
+#include "config.h"
+
+#include <assert.h>
 #include <signal.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 #include <string.h>
-#include <assert.h>
 
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "copyrite.h"
-#include "force.h"
-#include "mdrun.h"
-#include "md_logging.h"
-#include "md_support.h"
-#include "network.h"
-#include "names.h"
-#include "disre.h"
-#include "orires.h"
-#include "pme.h"
-#include "mdatoms.h"
-#include "repl_ex.h"
-#include "deform.h"
-#include "qmmm.h"
-#include "domdec.h"
-#include "coulomb.h"
-#include "constr.h"
-#include "mvdata.h"
-#include "checkpoint.h"
-#include "mtop_util.h"
-#include "sighandler.h"
-#include "txtdump.h"
-#include "gmx_detect_hardware.h"
-#include "gmx_omp_nthreads.h"
-#include "gromacs/gmxpreprocess/calc_verletbuf.h"
-#include "gmx_fatal_collective.h"
-#include "membed.h"
-#include "macros.h"
-#include "gmx_thread_affinity.h"
-#include "inputrec.h"
+#include <algorithm>
 
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/tpxio.h"
-#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/gmxpreprocess/calc_verletbuf.h"
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_detect_hardware.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/gmx_thread_affinity.h"
+#include "gromacs/legacyheaders/inputrec.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/md_logging.h"
+#include "gromacs/legacyheaders/md_support.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/oenv.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/qmmm.h"
+#include "gromacs/legacyheaders/sighandler.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/calculate-ewald-splitting-coefficient.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/mdlib/nbnxn_consts.h"
-#include "gromacs/timing/wallcycle.h"
-#include "gromacs/utility/gmxmpi.h"
-#include "gromacs/utility/gmxomp.h"
-#include "gromacs/swap/swapcoords.h"
-#include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/mdlib/nbnxn_search.h"
+#include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
 #include "gromacs/pulling/pull_rotation.h"
+#include "gromacs/swap/swapcoords.h"
+#include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "deform.h"
+#include "membed.h"
+#include "repl_ex.h"
 
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
 #endif
 
-#include "gpu_utils.h"
-#include "nbnxn_cuda_data_mgmt.h"
+#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
 
 typedef struct {
     gmx_integrator_t *func;
@@ -295,7 +294,7 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
     else if (hw_opt->nthreads_omp > 0)
     {
         /* Here we could oversubscribe, when we do, we issue a warning later */
-        nthreads_tmpi = max(1, nthreads_tot/hw_opt->nthreads_omp);
+        nthreads_tmpi = std::max(1, nthreads_tot/hw_opt->nthreads_omp);
     }
     else
     {
@@ -314,8 +313,6 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
         const int nthreads_omp_always_faster             =  4;
         const int nthreads_omp_always_faster_Nehalem     = 12;
         const int nthreads_omp_always_faster_SandyBridge = 16;
-        const int first_model_Nehalem                    = 0x1A;
-        const int first_model_SandyBridge                = 0x2A;
         gmx_bool  bIntel_Family6;
 
         bIntel_Family6 =
@@ -356,8 +353,6 @@ static int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
 {
     int      nthreads_hw, nthreads_tot_max, nthreads_tmpi, nthreads_new, ngpu;
     int      min_atoms_per_mpi_thread;
-    char    *env;
-    char     sbuf[STRLEN];
     gmx_bool bCanUseGPU;
 
     if (hw_opt->nthreads_tmpi > 0)
@@ -432,7 +427,7 @@ static int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
     {
         /* the thread number was chosen automatically, but there are too many
            threads (too few atoms per thread) */
-        nthreads_new = max(1, mtop->natoms/min_atoms_per_mpi_thread);
+        nthreads_new = std::max(1, mtop->natoms/min_atoms_per_mpi_thread);
 
         /* Avoid partial use of Hyper-Threading */
         if (gmx_cpuid_x86_smt(hwinfo->cpuid_info) == GMX_CPUID_X86_SMT_ENABLED &&
@@ -480,7 +475,7 @@ static int get_nthreads_mpi(const gmx_hw_info_t *hwinfo,
 /* 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    nbnxn_reference_nstlist = 10;
+static const int    nbnxnReferenceNstlist = 10;
 /* The values to try when switching  */
 const int           nstlist_try[] = { 20, 25, 40 };
 #define NNSTL  sizeof(nstlist_try)/sizeof(nstlist_try[0])
@@ -509,9 +504,9 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
     float                  listfac_ok, listfac_max;
     int                    nstlist_orig, nstlist_prev;
     verletbuf_list_setup_t ls;
-    real                   rlist_nstlist10, rlist_inc, rlist_ok, rlist_max;
+    real                   rlistWithReferenceNstlist, rlist_inc, rlist_ok, rlist_max;
     real                   rlist_new, rlist_prev;
-    int                    nstlist_ind = 0;
+    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";
@@ -520,6 +515,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
     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];
+    const float            oneThird = 1.0f / 3.0f;
 
     if (nstlist_cmdline <= 0)
     {
@@ -605,19 +601,19 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
     verletbuf_get_list_setup(bGPU, &ls);
 
     /* Allow rlist to make the list a given factor larger than the list
-     * would be with nstlist=10.
+     * would be with the reference value for nstlist (10).
      */
     nstlist_prev = ir->nstlist;
-    ir->nstlist  = 10;
+    ir->nstlist  = nbnxnReferenceNstlist;
     calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL,
-                            &rlist_nstlist10);
+                            &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  = (rlist_nstlist10 + rlist_inc)*pow(listfac_ok, 1.0/3.0) - rlist_inc;
-    rlist_max = (rlist_nstlist10 + rlist_inc)*pow(listfac_max, 1.0/3.0) - rlist_inc;
+    rlist_ok  = (rlistWithReferenceNstlist + rlist_inc)*pow(listfac_ok, oneThird) - rlist_inc;
+    rlist_max = (rlistWithReferenceNstlist + rlist_inc)*pow(listfac_max, oneThird) - rlist_inc;
     if (debug)
     {
         fprintf(debug, "nstlist tuning: rlist_inc %.3f rlist_ok %.3f rlist_max %.3f\n",
@@ -757,99 +753,6 @@ static void prepare_verlet_scheme(FILE                           *fplog,
     }
 }
 
-static void convert_to_verlet_scheme(FILE *fplog,
-                                     t_inputrec *ir,
-                                     gmx_mtop_t *mtop, real box_vol)
-{
-    char *conv_mesg = "Converting input file with group cut-off scheme to the Verlet cut-off scheme";
-
-    md_print_warn(NULL, fplog, "%s\n", conv_mesg);
-
-    ir->cutoff_scheme = ecutsVERLET;
-    ir->verletbuf_tol = 0.005;
-
-    if (ir->rcoulomb != ir->rvdw)
-    {
-        gmx_fatal(FARGS, "The VdW and Coulomb cut-offs are different, whereas the Verlet scheme only supports equal cut-offs");
-    }
-
-    if (ir->vdwtype == evdwUSER || EEL_USER(ir->coulombtype))
-    {
-        gmx_fatal(FARGS, "User non-bonded potentials are not (yet) supported with the Verlet scheme");
-    }
-    else if (ir_vdw_switched(ir) || ir_coulomb_switched(ir))
-    {
-        if (ir_vdw_switched(ir) && ir->vdw_modifier == eintmodNONE)
-        {
-            ir->vdwtype = evdwCUT;
-
-            switch (ir->vdwtype)
-            {
-                case evdwSHIFT:  ir->vdw_modifier = eintmodFORCESWITCH; break;
-                case evdwSWITCH: ir->vdw_modifier = eintmodPOTSWITCH; break;
-                default: gmx_fatal(FARGS, "The Verlet scheme does not support Van der Waals interactions of type '%s'", evdw_names[ir->vdwtype]);
-            }
-        }
-        if (ir_coulomb_switched(ir) && ir->coulomb_modifier == eintmodNONE)
-        {
-            if (EEL_FULL(ir->coulombtype))
-            {
-                /* With full electrostatic only PME can be switched */
-                ir->coulombtype      = eelPME;
-                ir->coulomb_modifier = eintmodPOTSHIFT;
-            }
-            else
-            {
-                md_print_warn(NULL, fplog, "NOTE: Replacing %s electrostatics with reaction-field with epsilon-rf=inf\n", eel_names[ir->coulombtype]);
-                ir->coulombtype      = eelRF;
-                ir->epsilon_rf       = 0.0;
-                ir->coulomb_modifier = eintmodPOTSHIFT;
-            }
-        }
-
-        /* We set the pair energy error tolerance to a small number.
-         * Note that this is only for testing. For production the user
-         * should think about this and set the mdp options.
-         */
-        ir->verletbuf_tol = 1e-4;
-    }
-
-    if (inputrec2nboundeddim(ir) != 3)
-    {
-        gmx_fatal(FARGS, "Can only convert old tpr files to the Verlet cut-off scheme with 3D pbc");
-    }
-
-    if (ir->efep != efepNO || ir->implicit_solvent != eisNO)
-    {
-        gmx_fatal(FARGS, "Will not convert old tpr files to the Verlet cut-off scheme with free-energy calculations or implicit solvent");
-    }
-
-    if (EI_DYNAMICS(ir->eI) && !(EI_MD(ir->eI) && ir->etc == etcNO))
-    {
-        verletbuf_list_setup_t ls;
-
-        verletbuf_get_list_setup(FALSE, &ls);
-        calc_verlet_buffer_size(mtop, box_vol, ir, -1, &ls, NULL, &ir->rlist);
-    }
-    else
-    {
-        real rlist_fac;
-
-        if (EI_MD(ir->eI))
-        {
-            rlist_fac       = 1 + verlet_buffer_ratio_NVE_T0;
-        }
-        else
-        {
-            rlist_fac       = 1 + verlet_buffer_ratio_nodynamics;
-        }
-        ir->verletbuf_tol   = -1;
-        ir->rlist           = rlist_fac*max(ir->rvdw, ir->rcoulomb);
-    }
-
-    gmx_mtop_remove_chargegroups(mtop);
-}
-
 static void print_hw_opt(FILE *fp, const gmx_hw_opt_t *hw_opt)
 {
     fprintf(fp, "hw_opt: nt %d ntmpi %d ntomp %d ntomp_pme %d gpu_id '%s'\n",
@@ -1011,72 +914,36 @@ static void override_nsteps_cmdline(FILE            *fplog,
                                     t_inputrec      *ir,
                                     const t_commrec *cr)
 {
-    char sbuf[STEPSTRSIZE];
-
     assert(ir);
     assert(cr);
 
     /* override with anything else than the default -2 */
     if (nsteps_cmdline > -2)
     {
-        char stmp[STRLEN];
+        char sbuf_steps[STEPSTRSIZE];
+        char sbuf_msg[STRLEN];
 
         ir->nsteps = nsteps_cmdline;
         if (EI_DYNAMICS(ir->eI) && nsteps_cmdline != -1)
         {
-            sprintf(stmp, "Overriding nsteps with value passed on the command line: %s steps, %.3g ps",
-                    gmx_step_str(nsteps_cmdline, sbuf),
+            sprintf(sbuf_msg, "Overriding nsteps with value passed on the command line: %s steps, %.3g ps",
+                    gmx_step_str(nsteps_cmdline, sbuf_steps),
                     fabs(nsteps_cmdline*ir->delta_t));
         }
         else
         {
-            sprintf(stmp, "Overriding nsteps with value passed on the command line: %s steps",
-                    gmx_step_str(nsteps_cmdline, sbuf));
+            sprintf(sbuf_msg, "Overriding nsteps with value passed on the command line: %s steps",
+                    gmx_step_str(nsteps_cmdline, sbuf_steps));
         }
 
-        md_print_warn(cr, fplog, "%s\n", stmp);
+        md_print_warn(cr, fplog, "%s\n", sbuf_msg);
     }
-}
-
-/* Frees GPU memory and destroys the CUDA context.
- *
- * Note that this function needs to be called even if GPUs are not used
- * 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.
- */
-static void free_gpu_resources(const t_forcerec *fr,
-                               const t_commrec  *cr)
-{
-    gmx_bool bIsPPrankUsingGPU;
-    char     gpu_err_str[STRLEN];
-
-    bIsPPrankUsingGPU = (cr->duty & DUTY_PP) && fr->nbv != NULL && fr->nbv->bUseGPU;
-
-    if (bIsPPrankUsingGPU)
+    else if (nsteps_cmdline < -2)
     {
-        /* free nbnxn data in GPU memory */
-        nbnxn_cuda_free(fr->nbv->cu_nbv);
-
-        /* With tMPI we need to wait for all ranks to finish deallocation before
-         * destroying the context in free_gpu() as some ranks may be sharing
-         * GPU and context.
-         * Note: as only PP ranks need to free GPU resources, so it is safe to
-         * not call the barrier on PME ranks.
-         */
-#ifdef GMX_THREAD_MPI
-        if (PAR(cr))
-        {
-            gmx_barrier(cr);
-        }
-#endif  /* GMX_THREAD_MPI */
-
-        /* uninitialize GPU (by destroying the context) */
-        if (!free_gpu(gpu_err_str))
-        {
-            gmx_warning("On rank %d failed to free GPU #%d: %s",
-                        cr->nodeid, get_current_gpu_device_id(), gpu_err_str);
-        }
+        gmx_fatal(FARGS, "Invalid nsteps value passed on the command line: %d",
+                  nsteps_cmdline);
     }
+    /* Do nothing if nsteps_cmdline == -2 */
 }
 
 int mdrunner(gmx_hw_opt_t *hw_opt,
@@ -1093,13 +960,11 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
              const char *deviceOptions, int imdport, unsigned long Flags)
 {
     gmx_bool                  bForceUseGPU, bTryUseGPU, bRerunMD, bCantUseGPU;
-    double                    nodetime = 0, realtime;
     t_inputrec               *inputrec;
     t_state                  *state = NULL;
     matrix                    box;
     gmx_ddbox_t               ddbox = {0};
     int                       npme_major, npme_minor;
-    real                      tmpr1, tmpr2;
     t_nrnb                   *nrnb;
     gmx_mtop_t               *mtop          = NULL;
     t_mdatoms                *mdatoms       = NULL;
@@ -1110,16 +975,13 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     gmx_pme_t                *pmedata       = NULL;
     gmx_vsite_t              *vsite         = NULL;
     gmx_constr_t              constr;
-    int                       i, m, nChargePerturbed = -1, nTypePerturbed = 0, status, nalloc;
-    char                     *gro;
+    int                       nChargePerturbed = -1, nTypePerturbed = 0, status;
     gmx_wallcycle_t           wcycle;
     gmx_bool                  bReadEkin;
-    int                       list;
     gmx_walltime_accounting_t walltime_accounting = NULL;
     int                       rc;
     gmx_int64_t               reset_counters;
     gmx_edsam_t               ed           = NULL;
-    t_commrec                *cr_old       = cr;
     int                       nthreads_pme = 1;
     int                       nthreads_pp  = 1;
     gmx_membed_t              membed       = NULL;
@@ -1161,13 +1023,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     if (SIMMASTER(cr))
     {
         /* Read (nearly) all data required for the simulation */
-        read_tpx_state(ftp2fn(efTPX, nfile, fnm), inputrec, state, NULL, mtop);
-
-        if (inputrec->cutoff_scheme != ecutsVERLET &&
-            ((Flags & MD_TESTVERLET) || getenv("GMX_VERLET_SCHEME") != NULL))
-        {
-            convert_to_verlet_scheme(fplog, inputrec, mtop, det(state->box));
-        }
+        read_tpx_state(ftp2fn(efTPR, nfile, fnm), inputrec, state, NULL, mtop);
 
         if (inputrec->cutoff_scheme == ecutsVERLET)
         {
@@ -1206,8 +1062,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
             {
                 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"
-                              "      (for quick performance testing you can use the -testverlet option)\n");
+                              "      To use a GPU, set the mdp option: cutoff-scheme = Verlet\n");
             }
 
             if (bForceUseGPU)
@@ -1232,29 +1087,14 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         }
     }
 
-    /* Check for externally set OpenMP affinity and turn off internal
-     * pinning if any is found. We need to do this check early to tell
-     * thread-MPI whether it should do pinning when spawning threads.
-     * TODO: the above no longer holds, we should move these checks down
-     */
-    gmx_omp_check_thread_affinity(fplog, cr, hw_opt);
-
     /* Check and update the hardware options for internal consistency */
     check_and_update_hw_opt_1(hw_opt, SIMMASTER(cr));
 
+    /* Early check for externally set process affinity. */
+    gmx_check_thread_affinity_set(fplog, cr,
+                                  hw_opt, hwinfo->nthreads_hw_avail, FALSE);
     if (SIMMASTER(cr))
     {
-#ifdef GMX_THREAD_MPI
-        /* Early check for externally set process affinity.
-         * With thread-MPI this is needed as pinning might get turned off,
-         * which needs to be known before starting thread-MPI.
-         * With thread-MPI hw_opt is processed here on the master rank
-         * and passed to the other ranks later, so we only do this on master.
-         */
-        gmx_check_thread_affinity_set(fplog,
-                                      NULL,
-                                      hw_opt, hwinfo->nthreads_hw_avail, FALSE);
-#endif
 
 #ifdef GMX_THREAD_MPI
         if (cr->npmenodes > 0 && hw_opt->nthreads_tmpi <= 0)
@@ -1291,6 +1131,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
         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, bCompact, nstglobalcomm,
@@ -1353,7 +1194,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                   "but %s was not started through mpirun/mpiexec or only one rank was requested through mpirun/mpiexec"
 #endif
 #endif
-                  , ShortProgram()
+                  , output_env_get_program_display_name(oenv)
                   );
     }
 
@@ -1444,16 +1285,9 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         }
     }
 
-    if (((MASTER(cr) || (Flags & MD_SEPPOT)) && (Flags & MD_APPENDFILES))
-#ifdef GMX_THREAD_MPI
-        /* With thread MPI only the master node/thread exists in mdrun.c,
-         * therefore non-master nodes need to open the "seppot" log file here.
-         */
-        || (!MASTER(cr) && (Flags & MD_SEPPOT))
-#endif
-        )
+    if (MASTER(cr) && (Flags & MD_APPENDFILES))
     {
-        gmx_log_open(ftp2fn(efLOG, nfile, fnm), cr, !(Flags & MD_SEPPOT),
+        gmx_log_open(ftp2fn(efLOG, nfile, fnm), cr,
                      Flags, &fplog);
     }
 
@@ -1547,6 +1381,13 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                           (cr->duty & DUTY_PP) == 0,
                           inputrec->cutoff_scheme == ecutsVERLET);
 
+#ifndef NDEBUG
+    if (integrator[inputrec->eI].func != do_tpi &&
+        inputrec->cutoff_scheme == ecutsVERLET)
+    {
+        gmx_feenableexcept();
+    }
+#endif
     if (PAR(cr))
     {
         /* The master rank decided on the use of GPUs,
@@ -1626,7 +1467,6 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         /*init_forcerec(fplog,fr,fcd,inputrec,mtop,cr,box,FALSE,
            "nofile","nofile","nofile","nofile",FALSE,pforce);
          */
-        fr->bSepDVDL = ((Flags & MD_SEPPOT) == MD_SEPPOT);
 
         /* Initialize QM-MM */
         if (fr->bQMMM)
@@ -1774,6 +1614,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
         if (DOMAINDECOMP(cr))
         {
+            GMX_RELEASE_ASSERT(fr, "fr was NULL while cr->duty was DUTY_PP");
             dd_init_bondeds(fplog, cr->dd, mtop, vsite, inputrec,
                             Flags & MD_DDBONDCHECK, fr->cginfo_mb);
 
@@ -1811,6 +1652,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     }
     else
     {
+        GMX_RELEASE_ASSERT(pmedata, "pmedata was NULL while cr->duty was not DUTY_PP");
         /* do PME only */
         walltime_accounting = walltime_accounting_init(gmx_omp_nthreads_get(emntPME));
         gmx_pmeonly(*pmedata, cr, nrnb, wcycle, walltime_accounting, ewaldcoeff_q, ewaldcoeff_lj, inputrec);
@@ -1823,13 +1665,12 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
      */
     finish_run(fplog, cr,
                inputrec, nrnb, wcycle, walltime_accounting,
-               fr != NULL && fr->nbv != NULL && fr->nbv->bUseGPU ?
-               nbnxn_cuda_get_timings(fr->nbv->cu_nbv) : NULL,
+               fr ? fr->nbv : NULL,
                EI_DYNAMICS(inputrec->eI) && !MULTISIM(cr));
 
 
     /* Free GPU memory and context */
-    free_gpu_resources(fr, cr);
+    free_gpu_resources(fr, cr, &hwinfo->gpu_info, fr ? fr->gpu_opt : NULL);
 
     if (opt2bSet("-membed", nfile, fnm))
     {
@@ -1850,6 +1691,8 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
     rc = (int)gmx_get_stop_condition();
 
+    done_ed(&ed);
+
 #ifdef 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 bfaf6b8cf5b82084f422f1074db1c9e5adb09c7e..4cc1b106f26cde0fc4a50afdf355b58fe27b6876 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
-#include "moduletest.h"
-#include <gtest/gtest.h>
+#include "gmxpre.h"
+
 #include <string>
+
+#include <gtest/gtest.h>
+
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/tools/check.h"
+
 #include "testutils/cmdlinetest.h"
 
+#include "moduletest.h"
+
 namespace
 {
 
@@ -63,16 +69,16 @@ TEST_P(CompressedXOutputTest, ExitsNormally)
                         "nsteps = 1\n"
                         "nstxout-compressed = 1\n");
     mdpFile += GetParam();
-    useStringAsMdpFile(mdpFile.c_str());
-    useTopGroAndNdxFromDatabase("spc2");
-    ASSERT_EQ(0, callGrompp());
+    runner_.useStringAsMdpFile(mdpFile.c_str());
+    runner_.useTopGroAndNdxFromDatabase("spc2");
+    ASSERT_EQ(0, runner_.callGrompp());
 
-    reducedPrecisionTrajectoryFileName = fileManager_.getTemporaryFilePath(".xtc");
-    ASSERT_EQ(0, callMdrun());
+    runner_.reducedPrecisionTrajectoryFileName_ = fileManager_.getTemporaryFilePath(".xtc");
+    ASSERT_EQ(0, runner_.callMdrun());
 
     ::gmx::test::CommandLine checkCaller;
     checkCaller.append("check");
-    checkCaller.addOption("-f", reducedPrecisionTrajectoryFileName);
+    checkCaller.addOption("-f", runner_.reducedPrecisionTrajectoryFileName_);
     ASSERT_EQ(0, gmx_check(checkCaller.argc(), checkCaller.argv()));
 }
 
index bb610a7a170be822caa5a97cf1d0e4e1f3fba496..a4b7b3dfe6130896dfbe5751cebd0298ab140ae7 100644 (file)
@@ -40,6 +40,8 @@
  * \author Carsten Kutzner <ckutzne@gwdg.de>
  * \ingroup module_mdrun
  */
+#include "gmxpre.h"
+
 #include "moduletest.h"
 
 namespace gmx
@@ -75,10 +77,10 @@ typedef gmx::test::ImdTestFixture ImdTest;
 TEST_F(ImdTest, ImdCanRun)
 {
     std::string name = "spc2";
-    useTopGroAndNdxFromDatabase(name.c_str());
-    mdpInputFileName = fileManager_.getInputFilePath((name + "-IMD.mdp").c_str());
+    runner_.useTopGroAndNdxFromDatabase(name.c_str());
+    runner_.mdpInputFileName_ = fileManager_.getInputFilePath((name + "-IMD.mdp").c_str());
 
-    EXPECT_EQ(0, callGrompp());
+    EXPECT_EQ(0, runner_.callGrompp());
 
     ::gmx::test::CommandLine imdCaller;
     imdCaller.append("mdrun");
@@ -89,7 +91,7 @@ TEST_F(ImdTest, ImdCanRun)
     imdCaller.append("-noimdterm");
 
     // Do an mdrun with IMD enabled
-    ASSERT_EQ(0, callMdrun(imdCaller));
+    ASSERT_EQ(0, runner_.callMdrun(imdCaller));
 }
 
 
index c0f12bdb494af9db2b7c4499a061f4870ca0c735..1e8a6373c5530d0c502e3910693e79ecef50440b 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
+#include "gmxpre.h"
+
 #include "moduletest.h"
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "config.h"
 
-#include "testutils/integrationtests.h"
-#include "testutils/testoptions.h"
-#include "testutils/cmdlinetest.h"
-#include "gromacs/options/options.h"
+#include "gromacs/gmxpreprocess/grompp.h"
 #include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/file.h"
-#include "gromacs/legacyheaders/network.h"
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/gmxpreprocess/grompp.h"
 #include "programs/mdrun/mdrun_main.h"
 
+#include "testutils/cmdlinetest.h"
+#include "testutils/integrationtests.h"
+#include "testutils/testoptions.h"
+
 namespace gmx
 {
 namespace test
@@ -82,92 +83,89 @@ GMX_TEST_OPTIONS(MdrunTestOptions, options)
     GMX_UNUSED_VALUE(options);
 #ifdef GMX_THREAD_MPI
     options->addOption(IntegerOption("nt").store(&g_numThreads)
-                           .description("Number of thread-MPI threads/ranks for child mdrun call"));
+                           .description("Number of thread-MPI threads/ranks for child mdrun calls"));
 #endif
 #ifdef GMX_OPENMP
     options->addOption(IntegerOption("nt_omp").store(&g_numOpenMPThreads)
-                           .description("Number of OpenMP threads for child mdrun call"));
+                           .description("Number of OpenMP threads for child mdrun calls"));
 #endif
 }
 //! \endcond
 
 }
 
-MdrunTestFixture::MdrunTestFixture() :
-    topFileName(),
-    groFileName(),
-    fullPrecisionTrajectoryFileName(),
-    ndxFileName(),
-    mdpInputFileName(fileManager_.getTemporaryFilePath("input.mdp")),
-    mdpOutputFileName(fileManager_.getTemporaryFilePath("output.mdp")),
-    tprFileName(fileManager_.getTemporaryFilePath(".tpr")),
-    logFileName(fileManager_.getTemporaryFilePath(".log")),
-    edrFileName(fileManager_.getTemporaryFilePath(".edr")),
-    nsteps(-2)
+SimulationRunner::SimulationRunner(IntegrationTestFixture *fixture) :
+    fixture_(fixture),
+    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)
 {
 #ifdef GMX_LIB_MPI
     GMX_RELEASE_ASSERT(gmx_mpi_initialized(), "MPI system not initialized for mdrun tests");
 #endif
 }
 
-MdrunTestFixture::~MdrunTestFixture()
-{
-}
-
 // TODO The combination of defaulting to Verlet cut-off scheme, NVE,
 // 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.
 void
-MdrunTestFixture::useEmptyMdpFile()
+SimulationRunner::useEmptyMdpFile()
 {
     useStringAsMdpFile("cutoff-scheme = Group\n");
 }
 
 void
-MdrunTestFixture::useStringAsMdpFile(const char *mdpString)
+SimulationRunner::useStringAsMdpFile(const char *mdpString)
 {
     useStringAsMdpFile(std::string(mdpString));
 }
 
 void
-MdrunTestFixture::useStringAsMdpFile(const std::string &mdpString)
+SimulationRunner::useStringAsMdpFile(const std::string &mdpString)
 {
-    gmx::File::writeFileFromString(mdpInputFileName, mdpString);
+    gmx::File::writeFileFromString(mdpInputFileName_, mdpString);
 }
 
 void
-MdrunTestFixture::useStringAsNdxFile(const char *ndxString)
+SimulationRunner::useStringAsNdxFile(const char *ndxString)
 {
-    gmx::File::writeFileFromString(ndxFileName, ndxString);
+    gmx::File::writeFileFromString(ndxFileName_, ndxString);
 }
 
 void
-MdrunTestFixture::useTopGroAndNdxFromDatabase(const char *name)
+SimulationRunner::useTopGroAndNdxFromDatabase(const char *name)
 {
-    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());
+    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());
 }
 
 int
-MdrunTestFixture::callGromppOnThisRank()
+SimulationRunner::callGromppOnThisRank()
 {
     CommandLine caller;
     caller.append("grompp");
-    caller.addOption("-f", mdpInputFileName);
-    caller.addOption("-n", ndxFileName);
-    caller.addOption("-p", topFileName);
-    caller.addOption("-c", groFileName);
+    caller.addOption("-f", mdpInputFileName_);
+    caller.addOption("-n", ndxFileName_);
+    caller.addOption("-p", topFileName_);
+    caller.addOption("-c", groFileName_);
 
-    caller.addOption("-po", mdpOutputFileName);
-    caller.addOption("-o", tprFileName);
+    caller.addOption("-po", mdpOutputFileName_);
+    caller.addOption("-o", tprFileName_);
 
     return gmx_grompp(caller.argc(), caller.argv());
 }
 
 int
-MdrunTestFixture::callGrompp()
+SimulationRunner::callGrompp()
 {
 #ifdef GMX_LIB_MPI
     // When compiled with external MPI, only call one instance of the
@@ -181,25 +179,25 @@ MdrunTestFixture::callGrompp()
 }
 
 int
-MdrunTestFixture::callMdrun(const CommandLine &callerRef)
+SimulationRunner::callMdrun(const CommandLine &callerRef)
 {
     /* Conforming to style guide by not passing a non-const reference
        to this function. Passing a non-const reference might make it
        easier to write code that incorrectly re-uses callerRef after
        the call to this function. */
     CommandLine caller(callerRef);
-    caller.addOption("-s", tprFileName);
+    caller.addOption("-s", tprFileName_);
 
-    caller.addOption("-g", logFileName);
-    caller.addOption("-e", edrFileName);
-    caller.addOption("-o", fullPrecisionTrajectoryFileName);
-    caller.addOption("-x", reducedPrecisionTrajectoryFileName);
+    caller.addOption("-g", logFileName_);
+    caller.addOption("-e", edrFileName_);
+    caller.addOption("-o", fullPrecisionTrajectoryFileName_);
+    caller.addOption("-x", reducedPrecisionTrajectoryFileName_);
 
-    caller.addOption("-deffnm", fileManager_.getTemporaryFilePath("state"));
+    caller.addOption("-deffnm", fixture_->fileManager_.getTemporaryFilePath("state"));
 
-    if (nsteps > -2)
+    if (nsteps_ > -2)
     {
-        caller.addOption("-nsteps", nsteps);
+        caller.addOption("-nsteps", nsteps_);
     }
 
 #ifdef GMX_THREAD_MPI
@@ -213,12 +211,35 @@ MdrunTestFixture::callMdrun(const CommandLine &callerRef)
 }
 
 int
-MdrunTestFixture::callMdrun()
+SimulationRunner::callMdrun()
 {
     CommandLine caller;
     caller.append("mdrun");
     return callMdrun(caller);
 }
 
+// ====
+
+MdrunTestFixtureBase::MdrunTestFixtureBase()
+{
+#ifdef GMX_LIB_MPI
+    GMX_RELEASE_ASSERT(gmx_mpi_initialized(), "MPI system not initialized for mdrun tests");
+#endif
+}
+
+MdrunTestFixtureBase::~MdrunTestFixtureBase()
+{
+}
+
+// ====
+
+MdrunTestFixture::MdrunTestFixture() : runner_(this)
+{
+}
+
+MdrunTestFixture::~MdrunTestFixture()
+{
+}
+
 } // namespace test
 } // namespace gmx
index 1b50fb67142288d592a2a538f42c5ab90d6fb15f..d021dc862180227bd8e4bb69ace3a993a0b70e14 100644 (file)
 #ifndef GMX_MDRUN_TESTS_MODULETEST_H
 #define GMX_MDRUN_TESTS_MODULETEST_H
 
-#include "testutils/integrationtests.h"
-
 #include <gtest/gtest.h>
+
 #include "testutils/cmdlinetest.h"
+#include "testutils/integrationtests.h"
 
 namespace gmx
 {
@@ -52,41 +52,30 @@ namespace gmx
 namespace test
 {
 
-/*! \libinternal \brief Declares test fixture for integration tests of
- * mdrun functionality
+/*! \libinternal \brief Helper object for running grompp and mdrun in
+ * integration tests of mdrun functionality
  *
- * Derived fixture classes (or individual test cases) that might have
- * specific requirements should assert that behaviour, rather than
- * hard-code the requirements. A test that (for example) can't run
- * with more than one thread should report that as a diagnostic, so the
- * person running the test (or designing the test harness) can get
- * feedback on what tests need what conditions without having to read
- * the code of lots of tests.
+ * Objects of this class are intended to be owned by
+ * IntegrationTestFixture objects, and an IntegrationTestFixture
+ * object might own more than one SimulationRunner.
  *
  * The setup phase creates various temporary files for input and
  * output that are common for mdrun tests, using the file manager
- * object of the parent class. Individual tests should create any
- * extra filenames similarly, so that the test users's current working
- * directory does not get littered with files left over from all
- * manner of tests.
- *
- * Specifying the execution context (such as numbers of threads and
- * processors) is normally sensible to specify from the test harness
- * (i.e. when CMake/CTest/the user runs a test executable), because
- * only there is information about the hardware available. The default
- * values for such context provided in test fixtures for mdrun should
- * mirror the defaults for mdrun, but currently mdrun.c hard-codes
- * those in a gmx_hw_opt_t.
+ * object of the fixture that owns this object. Individual tests
+ * should create any extra filenames similarly, so that the test
+ * users's current working directory does not get littered with files
+ * left over from tests.
  *
  * Any method in this class may throw std::bad_alloc if out of memory.
  *
  * \ingroup module_mdrun_integration_tests
  */
-class MdrunTestFixture : public IntegrationTestFixture
+class SimulationRunner
 {
-    protected:
-        MdrunTestFixture();
-        virtual ~MdrunTestFixture();
+    public:
+        /*! \brief Constructor, which establishes the fixture that
+         * will own each object */
+        explicit SimulationRunner(IntegrationTestFixture *fixture_);
 
         //! Use an empty .mdp file as input to grompp
         void useEmptyMdpFile();
@@ -108,6 +97,10 @@ class MdrunTestFixture : public IntegrationTestFixture
          * 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
          *
@@ -119,23 +112,70 @@ class MdrunTestFixture : public IntegrationTestFixture
          * in a temporary directory and (by default behaviour of
          * TestFileManager) deleted when the test is complete.
          */
-        std::string topFileName;
-        std::string groFileName;
-        std::string fullPrecisionTrajectoryFileName;
-        std::string reducedPrecisionTrajectoryFileName;
-        std::string groOutputFileName;
-        std::string ndxFileName;
-        std::string mdpInputFileName;
-        std::string mdpOutputFileName;
-        std::string tprFileName;
-        std::string logFileName;
-        std::string edrFileName;
-        std::string cptFileName;
-        std::string swapFileName;
-        int         nsteps;
+        std::string topFileName_;
+        std::string groFileName_;
+        std::string fullPrecisionTrajectoryFileName_;
+        std::string reducedPrecisionTrajectoryFileName_;
+        std::string groOutputFileName_;
+        std::string ndxFileName_;
+        std::string mdpInputFileName_;
+        std::string mdpOutputFileName_;
+        std::string tprFileName_;
+        std::string logFileName_;
+        std::string edrFileName_;
+        std::string cptFileName_;
+        std::string swapFileName_;
+        int         nsteps_;
         //@}
 };
 
+/*! \libinternal \brief Declares test fixture base class for
+ * integration tests of mdrun functionality
+ *
+ * Derived fixture classes (or individual test cases) that might have
+ * specific requirements should assert that behaviour, rather than
+ * hard-code the requirements. A test that (for example) can't run
+ * with more than one thread should report that as a diagnostic, so the
+ * person running the test (or designing the test harness) can get
+ * feedback on what tests need what conditions without having to read
+ * the code of lots of tests.
+ *
+ * Specifying the execution context (such as numbers of threads and
+ * processors) is normally sensible to specify from the test harness
+ * (i.e. when CMake/CTest/the user runs a test executable), because
+ * only there is information about the hardware available. The default
+ * values for such context provided in test fixtures for mdrun should
+ * mirror the defaults for mdrun, but currently mdrun.c hard-codes
+ * those in a gmx_hw_opt_t.
+ *
+ * Any method in this class may throw std::bad_alloc if out of memory.
+ *
+ * \ingroup module_mdrun_integration_tests
+ */
+class MdrunTestFixtureBase : public IntegrationTestFixture
+{
+    public:
+        MdrunTestFixtureBase();
+        virtual ~MdrunTestFixtureBase();
+};
+
+/*! \libinternal \brief Declares test fixture class for integration
+ * tests of mdrun functionality that use a single call of mdrun
+ *
+ * Any method in this class may throw std::bad_alloc if out of memory.
+ *
+ * \ingroup module_mdrun_integration_tests
+ */
+class MdrunTestFixture : public IntegrationTestFixture
+{
+    public:
+        MdrunTestFixture();
+        virtual ~MdrunTestFixture();
+
+        //! Helper object to manage the preparation for and call of mdrun
+        SimulationRunner runner_;
+};
+
 /*! \libinternal \brief
  * Parameterized test fixture for mdrun integration tests
  */
index 3cd40eac2b06c0f164a3565a27451fe0f43aac3a..37d9e02c124b3288e4772dc4145eabdc28a930a2 100644 (file)
@@ -40,7 +40,9 @@
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
-#include "moduletest.h"
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 
 #include <gtest/gtest.h>
 
-#include "gromacs/legacyheaders/network.h"
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/fileio/path.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/stringutil.h"
-
-#include "../mdrun_main.h"
+#include "programs/mdrun/mdrun_main.h"
 
 #include "testutils/cmdlinetest.h"
 
+#include "moduletest.h"
+
 namespace
 {
 
@@ -102,9 +105,9 @@ class ReplicaExchangeTest : public gmx::test::ParameterizedMdrunTestFixture
 
             /* Prepare grompp output filenames inside the new
                temporary directory */
-            mdpInputFileName  = fileManager_.getTemporaryFilePath("input.mdp");
-            mdpOutputFileName = fileManager_.getTemporaryFilePath("output.mdp");
-            tprFileName       = fileManager_.getTemporaryFilePath(".tpr");
+            runner_.mdpInputFileName_  = fileManager_.getTemporaryFilePath("input.mdp");
+            runner_.mdpOutputFileName_ = fileManager_.getTemporaryFilePath("output.mdp");
+            runner_.tprFileName_       = fileManager_.getTemporaryFilePath(".tpr");
 
             mdrunCaller.addOption("-deffnm", fileManager_.getTestSpecificFileNameRoot());
         }
@@ -148,7 +151,7 @@ class ReplicaExchangeTest : public gmx::test::ParameterizedMdrunTestFixture
                        occur. */
                     std::max(baseTemperature - 10 * rank, real(0)),
                     controlVariable);
-            useStringAsMdpFile(mdpFileContents);
+            runner_.useStringAsMdpFile(mdpFileContents);
         }
 
         //! MPI process set size
@@ -180,10 +183,10 @@ TEST_P(ReplicaExchangeTest, ExitsNormally)
     organizeMultidir();
     const char *pcoupl = GetParam();
     organizeMdpFile(pcoupl);
-    useTopGroAndNdxFromDatabase("spc2");
+    runner_.useTopGroAndNdxFromDatabase("spc2");
     /* Call grompp on every rank - the standard callGrompp() only runs
        grompp on rank 0. */
-    EXPECT_EQ(0, callGromppOnThisRank());
+    EXPECT_EQ(0, runner_.callGromppOnThisRank());
 
     mdrunCaller.addOption("-replex", 1);
     ASSERT_EQ(0, gmx_mdrun(mdrunCaller.argc(), mdrunCaller.argv()));
index 0558f9a622a1d2c48b2471edfee61938a4bf748f..a73f2623be7afd3f8f6325378aef60254897b97a 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
+#include "gmxpre.h"
+
+#include "config.h"
+
 #include <gtest/gtest.h>
-#include "moduletest.h"
+
 #include "gromacs/options/filenameoption.h"
+
 #include "testutils/cmdlinetest.h"
 
-#include "config.h"
+#include "moduletest.h"
 
 namespace
 {
@@ -59,16 +64,16 @@ class MdrunRerun : public gmx::test::MdrunTestFixture,
 /* Among other things, this test ensures mdrun can read a trajectory. */
 TEST_P(MdrunRerun, WithDifferentInputFormats)
 {
-    useEmptyMdpFile();
-    useTopGroAndNdxFromDatabase("spc2");
-    EXPECT_EQ(0, callGrompp());
+    runner_.useEmptyMdpFile();
+    runner_.useTopGroAndNdxFromDatabase("spc2");
+    EXPECT_EQ(0, runner_.callGrompp());
 
     std::string rerunFileName = fileManager_.getInputFilePath(GetParam());
 
     ::gmx::test::CommandLine rerunCaller;
     rerunCaller.append("mdrun");
     rerunCaller.addOption("-rerun", rerunFileName);
-    ASSERT_EQ(0, callMdrun(rerunCaller));
+    ASSERT_EQ(0, runner_.callMdrun(rerunCaller));
 }
 
 /*! \brief Helper array of input files present in the source repo
index d1d199ac6c12303bbe5ea6149241a397dade96b3..ac43152206629f9ce99050335086a71eafb09cbd 100644 (file)
@@ -40,6 +40,8 @@
  * \author Carsten Kutzner <ckutzne@gwdg.de>
  * \ingroup module_mdrun
  */
+#include "gmxpre.h"
+
 #include "moduletest.h"
 
 namespace gmx
@@ -75,29 +77,29 @@ typedef gmx::test::SwapTestFixture CompelTest;
 TEST_F(CompelTest, SwapCanRun)
 {
     std::string name = "OctaneSandwich";
-    useTopGroAndNdxFromDatabase(name.c_str());
-    mdpInputFileName = fileManager_.getInputFilePath((name + ".mdp").c_str());
+    runner_.useTopGroAndNdxFromDatabase(name.c_str());
+    runner_.mdpInputFileName_ = fileManager_.getInputFilePath((name + ".mdp").c_str());
 
-    EXPECT_EQ(0, callGrompp());
+    EXPECT_EQ(0, runner_.callGrompp());
 
-    cptFileName       = fileManager_.getTemporaryFilePath(".cpt");
-    groOutputFileName = fileManager_.getTemporaryFilePath(".gro");
-    swapFileName      = fileManager_.getTemporaryFilePath("swap.xvg");
+    runner_.cptFileName_       = fileManager_.getTemporaryFilePath(".cpt");
+    runner_.groOutputFileName_ = fileManager_.getTemporaryFilePath(".gro");
+    runner_.swapFileName_      = fileManager_.getTemporaryFilePath("swap.xvg");
 
     ::gmx::test::CommandLine swapCaller;
     swapCaller.append("mdrun");
-    swapCaller.addOption("-c", groOutputFileName);
-    swapCaller.addOption("-swap", swapFileName);
+    swapCaller.addOption("-c", runner_.groOutputFileName_);
+    swapCaller.addOption("-swap", runner_.swapFileName_);
 
     // Do an initial mdrun that writes a checkpoint file
     ::gmx::test::CommandLine firstCaller(swapCaller);
-    firstCaller.addOption("-cpo", cptFileName);
-    ASSERT_EQ(0, callMdrun(firstCaller));
+    firstCaller.addOption("-cpo", runner_.cptFileName_);
+    ASSERT_EQ(0, runner_.callMdrun(firstCaller));
     // Continue mdrun from that checkpoint file
     ::gmx::test::CommandLine secondCaller(swapCaller);
-    secondCaller.addOption("-cpi", cptFileName);
-    nsteps = 2;
-    ASSERT_EQ(0, callMdrun(secondCaller));
+    secondCaller.addOption("-cpi", runner_.cptFileName_);
+    runner_.nsteps_ = 2;
+    ASSERT_EQ(0, runner_.callMdrun(secondCaller));
 }
 
 
index e9784d7edee9ea9f9c6f5233cde71216832ff693..fafb1c3f929e8da53a230dab84ee291146b1bedb 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
+#include "gmxpre.h"
+
+#include "config.h"
+
 #include <gtest/gtest.h>
-#include "moduletest.h"
+
 #include "gromacs/options/filenameoption.h"
 #include "gromacs/utility/stringutil.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "moduletest.h"
 
 namespace
 {
@@ -67,13 +69,13 @@ class TrajectoryWritingTest :
         //! Execute the trajectory writing test
         void runTest()
         {
-            useStringAsMdpFile(theMdpFile);
-            useTopGroAndNdxFromDatabase("spc-and-methanol");
-            EXPECT_EQ(0, callGrompp());
+            runner_.useStringAsMdpFile(theMdpFile);
+            runner_.useTopGroAndNdxFromDatabase("spc-and-methanol");
+            EXPECT_EQ(0, runner_.callGrompp());
 
-            fullPrecisionTrajectoryFileName    = fileManager_.getTemporaryFilePath("spc-and-methanol.tng");
-            reducedPrecisionTrajectoryFileName = fileManager_.getTemporaryFilePath("spc-and-methanol-reduced.tng");
-            ASSERT_EQ(0, callMdrun());
+            runner_.fullPrecisionTrajectoryFileName_    = fileManager_.getTemporaryFilePath("spc-and-methanol.tng");
+            runner_.reducedPrecisionTrajectoryFileName_ = fileManager_.getTemporaryFilePath("spc-and-methanol-reduced.tng");
+            ASSERT_EQ(0, runner_.callMdrun());
             // TODO When there is a way to sense something like the
             // output of gmx check, compare the result with that from
             // writing .trr and .xtc and assert the behaviour is
index 17d4b708fd512fa5ac46d6aa8320a83a8919a10e..e6b694d123dd4bd0cffbee8e4c300fb01d77cb81 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 "mdrun/mdrun_main.h"
+#include "gmxpre.h"
 
 #include "gromacs/commandline/cmdlinemodulemanager.h"
 
+#include "mdrun/mdrun_main.h"
+
 int main(int argc, char *argv[])
 {
     return gmx::CommandLineModuleManager::runAsMainCMain(argc, argv, &gmx_mdrun);
similarity index 51%
rename from src/gromacs/math/3dview.c
rename to src/programs/view/3dview.cpp
index 5e8a06c41e7f1ad8d8926caef273ae9f596fdb13..01cc064241b80c1f97345a4ffa8cf4cafc940b70 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.
  */
-#include "gromacs/math/3dview.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "3dview.h"
 
 #include <math.h>
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "physics.h"
-#include "pbc.h"
-#include "vec.h"
-
-#include "gmx_fatal.h"
 
-#define N 4
-
-void m4_op(mat4 m, rvec x, vec4 v)
-{
-    int i;
-
-    for (i = 0; (i < N); i++)
-    {
-        v[i] = m[XX][i]*x[XX]+m[YY][i]*x[YY]+m[ZZ][i]*x[ZZ]+m[WW][i];
-    }
-}
-
-void unity_m4(mat4 m)
-{
-    int i, j;
-
-    for (i = 0; (i < N); i++)
-    {
-        for (j = 0; (j < N); j++)
-        {
-            if (i == j)
-            {
-                m[i][j] = 1.0;
-            }
-            else
-            {
-                m[i][j] = 0.0;
-            }
-        }
-    }
-}
-
-void print_m4(FILE *fp, const char *s, mat4 A)
-{
-    int i, j;
-
-    if (fp)
-    {
-        fprintf(fp, "%s: ", s);
-        for (i = 0; i < N; i++)
-        {
-            fprintf(fp, "\t");
-            for (j = 0; j < N; j++)
-            {
-                fprintf(fp, "%10.5f", A[i][j]);
-            }
-            fprintf(fp, "\n");
-        }
-    }
-}
-
-void print_v4(FILE *fp, char *s, int dim, real *a)
-{
-    int j;
-
-    if (fp)
-    {
-        fprintf(fp, "%s: ", s);
-        for (j = 0; j < dim; j++)
-        {
-            fprintf(fp, "%10.5f", a[j]);
-        }
-        fprintf(fp, "\n");
-    }
-}
+#include <algorithm>
 
-void mult_matrix(mat4 A, mat4 B, mat4 C)
-{
-    int i, j, k;
-
-    for (i = 0; i < N; i++)
-    {
-        for (j = 0; j < N; j++)
-        {
-            A[i][j] = 0;
-            for (k = 0; (k < N); k++)
-            {
-                A[i][j] += B[i][k]*C[k][j];
-            }
-        }
-    }
-}
-
-void rotate(int axis, real angle, mat4 A)
-{
-    unity_m4(A);
-
-    switch (axis)
-    {
-        case XX:
-            A[YY][YY] =  cos(angle);
-            A[YY][ZZ] = -sin(angle);
-            A[ZZ][YY] =  sin(angle);
-            A[ZZ][ZZ] =  cos(angle);
-            break;
-        case YY:
-            A[XX][XX] =  cos(angle);
-            A[XX][ZZ] =  sin(angle);
-            A[ZZ][XX] = -sin(angle);
-            A[ZZ][ZZ] =  cos(angle);
-            break;
-        case ZZ:
-            A[XX][XX] =  cos(angle);
-            A[XX][YY] = -sin(angle);
-            A[YY][XX] =  sin(angle);
-            A[YY][YY] =  cos(angle);
-            break;
-        default:
-            gmx_fatal(FARGS, "Error: invalid axis: %d", axis);
-    }
-}
-
-void translate(real tx, real ty, real tz, mat4 A)
-{
-    unity_m4(A);
-    A[3][XX] = tx;
-    A[3][YY] = ty;
-    A[3][ZZ] = tz;
-}
+#include "gromacs/math/3dtransforms.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 static void set_scale(t_3dview *view, real sx, real sy)
 {
@@ -176,7 +55,7 @@ static void set_scale(t_3dview *view, real sx, real sy)
     view->sc_y = sy;
 }
 
-void calculate_view(t_3dview *view)
+static void calculate_view(t_3dview *view)
 {
 #define SMALL 1e-6
     mat4 To, Te, T1, T2, T3, T4, T5, N1, D1, D2, D3, D4, D5;
@@ -189,54 +68,52 @@ void calculate_view(t_3dview *view)
     l  = sqrt(dx*dx+dy*dy+dz*dz);
     r  = sqrt(dx*dx+dy*dy);
 #ifdef DEBUG
-    print_v4(debug, "eye", N, view->eye);
+    gmx_vec4_print(debug, "eye", view->eye);
     printf("del: %10.5f%10.5f%10.5f l: %10.5f, r: %10.5f\n", dx, dy, dz, l, r);
 #endif
     if (l < SMALL)
     {
         gmx_fatal(FARGS, "Error: Zero Length Vector - No View Specified");
     }
-    translate((real)(-view->origin[XX]),
-              (real)(-view->origin[YY]), (real)(-view->origin[ZZ]), To);
-    translate((real)(-view->eye[XX]),
-              (real)(-view->eye[YY]), (real)(-view->eye[ZZ]), Te);
+    gmx_mat4_init_translation(-view->origin[XX], -view->origin[YY], -view->origin[ZZ], To);
+    gmx_mat4_init_translation(-view->eye[XX], -view->eye[YY], -view->eye[ZZ], Te);
 
-    unity_m4(T2);
+    gmx_mat4_init_unity(T2);
     T2[YY][YY] = 0, T2[YY][ZZ] = -1, T2[ZZ][YY] = 1, T2[ZZ][ZZ] = 0;
 
-    unity_m4(T3);
+    gmx_mat4_init_unity(T3);
     if (r > 0)
     {
         T3[XX][XX] = -dy/r, T3[XX][ZZ] = dx/r, T3[ZZ][XX] = -dx/r, T3[ZZ][ZZ] = -dy/r;
     }
 
-    unity_m4(T4);
+    gmx_mat4_init_unity(T4);
     T4[YY][YY] = r/l, T4[YY][ZZ] = dz/l, T4[ZZ][YY] = -dz/l, T4[ZZ][ZZ] = r/l;
 
-    unity_m4(T5);
+    gmx_mat4_init_unity(T5);
     T5[ZZ][ZZ] = -1;
 
-    unity_m4(N1);
+    gmx_mat4_init_unity(N1);
     /* N1[XX][XX]=4,N1[YY][YY]=4; */
 
-    mult_matrix(T1, To, view->Rot);
-    mult_matrix(D1, Te, T2);
-    mult_matrix(D2, T3, T4);
-    mult_matrix(D3, T5, N1);
-    mult_matrix(D4, T1, D1);
-    mult_matrix(D5, D2, D3);
+    gmx_mat4_mmul(T1, To, view->Rot);
+    gmx_mat4_mmul(D1, Te, T2);
+    gmx_mat4_mmul(D2, T3, T4);
+    gmx_mat4_mmul(D3, T5, N1);
+    gmx_mat4_mmul(D4, T1, D1);
+    gmx_mat4_mmul(D5, D2, D3);
 
-    mult_matrix(view->proj, D4, D5);
+    gmx_mat4_mmul(view->proj, D4, D5);
 
 #ifdef DEBUG
-    print_m4(debug, "T1", T1);
-    print_m4(debug, "T2", T2);
-    print_m4(debug, "T3", T3);
-    print_m4(debug, "T4", T4);
-    print_m4(debug, "T5", T5);
-    print_m4(debug, "N1", N1);
-    print_m4(debug, "Rot", view->Rot);
-    print_m4(debug, "Proj", view->proj);
+    gmx_mat4_print(debug, "T1", T1);
+    gmx_mat4_print(debug, "T2", T2);
+    gmx_mat4_print(debug, "T3", T3);
+    gmx_mat4_print(debug, "T4", T4);
+    gmx_mat4_print(debug, "T5", T5);
+    gmx_mat4_print(debug, "N1", N1);
+    gmx_mat4_print(debug, "Rot", view->Rot);
+    gmx_mat4_print(debug, "Proj", view->proj);
 #endif
 }
 
@@ -255,7 +132,7 @@ gmx_bool zoom_3d(t_3dview *view, real fac)
     dr1 = sqrt(dr2);
     if (fac < 1)
     {
-        bm = max(norm(view->box[XX]), max(norm(view->box[YY]), norm(view->box[ZZ])));
+        bm = std::max(norm(view->box[XX]), std::max(norm(view->box[YY]), norm(view->box[ZZ])));
         if (dr1*fac < 1.1*bm) /* Don't come to close */
         {
             return FALSE;
@@ -270,18 +147,19 @@ gmx_bool zoom_3d(t_3dview *view, real fac)
     return TRUE;
 }
 
-void init_rotate_3d(t_3dview *view)
+/* Initiates the state of 3d rotation matrices in the structure */
+static void init_rotate_3d(t_3dview *view)
 {
     real rot = DEG2RAD*15;
     int  i;
 
     for (i = 0; (i < DIM); i++)
     {
-        rotate(i,        rot, view->RotP[i]);
-        rotate(i, (real)(-rot), view->RotM[i]);
+        gmx_mat4_init_rotation(i,  rot, view->RotP[i]);
+        gmx_mat4_init_rotation(i, -rot, view->RotM[i]);
 #ifdef DEBUG
-        print_m4(debug, "RotP", view->RotP[i]);
-        print_m4(debug, "RotM", view->RotM[i]);
+        gmx_mat4_print(debug, "RotP", view->RotP[i]);
+        gmx_mat4_print(debug, "RotM", view->RotM[i]);
 #endif
     }
 }
@@ -289,25 +167,17 @@ void init_rotate_3d(t_3dview *view)
 
 void rotate_3d(t_3dview *view, int axis, gmx_bool bPositive)
 {
-    int  i, j;
     mat4 m4;
 
     if (bPositive)
     {
-        mult_matrix(m4, view->Rot, view->RotP[axis]);
+        gmx_mat4_mmul(m4, view->Rot, view->RotP[axis]);
     }
     else
     {
-        mult_matrix(m4, view->Rot, view->RotM[axis]);
-    }
-    for (i = 0; (i < N); i++)
-    {
-        for (j = 0; (j < N); j++)
-        {
-            view->Rot[i][j] = m4[i][j];
-        }
+        gmx_mat4_mmul(m4, view->Rot, view->RotM[axis]);
     }
-
+    gmx_mat4_copy(m4, view->Rot);
     calculate_view(view);
 }
 
@@ -329,20 +199,18 @@ void translate_view(t_3dview *view, int axis, gmx_bool bPositive)
 
 void reset_view(t_3dview *view)
 {
-    int  i;
-
 #ifdef DEBUG
     printf("Reset view called\n");
 #endif
     set_scale(view, 4.0, 4.0);
     clear_rvec(view->eye);
     calc_box_center(view->ecenter, view->box, view->origin);
-    view->eye[ZZ] = 3.0*max(view->box[XX][XX], view->box[YY][YY]);
+    view->eye[ZZ] = 3.0*std::max(view->box[XX][XX], view->box[YY][YY]);
     zoom_3d(view, 1.0);
     view->eye[WW] = view->origin[WW] = 0.0;
 
     /* Initiate the matrix */
-    unity_m4(view->Rot);
+    gmx_mat4_init_unity(view->Rot);
     calculate_view(view);
 
     init_rotate_3d(view);
@@ -351,21 +219,10 @@ void reset_view(t_3dview *view)
 t_3dview *init_view(matrix box)
 {
     t_3dview *view;
-    int       i, j;
 
     snew(view, 1);
-
-    /* Copy parameters into variables */
-    for (i = 0; (i < DIM); i++)
-    {
-        for (j = 0; (j < DIM); j++)
-        {
-            view->box[i][j] = box[i][j];
-        }
-    }
-
+    copy_mat(box, view->box);
     view->ecenter = ecenterDEF;
-
     reset_view(view);
 
     return view;
similarity index 63%
rename from src/gromacs/math/3dview.h
rename to src/programs/view/3dview.h
index 65c3358c9af435160754a1236ef1fe68c46071d3..774d447cd49ddb9370fb8f36cde7d5982d3ed1da 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_3DVIEW_H
-#define GMX_MATH_3DVIEW_H
+#ifndef GMX_VIEW_3DVIEW_H
+#define GMX_VIEW_3DVIEW_H
 
-#include <stdio.h>
-
-#include "../legacyheaders/types/simple.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define WW 3
-
-typedef real vec4[4];
-
-typedef real mat4[4][4];
+#include "gromacs/math/3dtransforms.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 typedef int  iv2[2];
 
 typedef struct {
     matrix box;
-    int    ecenter;     /* enum for centering, see pbc.h        */
-    vec4   eye, origin; /* The eye and origin position         */
-    mat4   proj;        /* Projection matrix            */
-    mat4   Rot;         /* Total rotation matrix                */
-    real   sc_x, sc_y;  /* Scaling for aspect ratio            */
-    mat4   RotP[DIM];   /* state for 3d rotations  */
+    int    ecenter;     /* enum for centering, see pbc.h */
+    vec4   eye, origin; /* The eye and origin position   */
+    mat4   proj;        /* Projection matrix             */
+    mat4   Rot;         /* Total rotation matrix         */
+    real   sc_x, sc_y;  /* Scaling for aspect ratio      */
+    mat4   RotP[DIM];   /* state for 3d rotations        */
     mat4   RotM[DIM];
 } t_3dview;
 
-extern void print_m4(FILE *fp, const char *s, mat4 A);
-
-extern void print_v4(FILE *fp, char *s, int dim, real *a);
-
-extern void m4_op(mat4 m, rvec x, vec4 v);
-
-extern void unity_m4(mat4 m);
-
-extern void mult_matrix(mat4 A, mat4 B, mat4 C);
-
-extern void rotate(int axis, real angle, mat4 A);
-
-extern void translate(real tx, real ty, real tz, mat4 A);
-
-extern void m4_op(mat4 m, rvec x, vec4 v);
-
-extern void calculate_view(t_3dview *view);
-
-extern t_3dview *init_view(matrix box);
+t_3dview *init_view(matrix box);
 /* Generate the view matrix from the eye pos and the origin,
  * applying also the scaling for the aspect ration.
  * There is no accompanying done_view routine: the struct can simply
@@ -95,25 +68,18 @@ extern t_3dview *init_view(matrix box);
  * reset the view
  */
 
-extern gmx_bool zoom_3d(t_3dview *view, real fac);
+gmx_bool zoom_3d(t_3dview *view, real fac);
 /* Zoom in or out with factor fac, returns TRUE when zoom successful,
  * FALSE otherwise.
  */
 
-extern void init_rotate_3d(t_3dview *view);
-/* Initiates the state of 3d rotation matrices in the structure */
-
-extern void rotate_3d(t_3dview *view, int axis, gmx_bool bPositive);
+void rotate_3d(t_3dview *view, int axis, gmx_bool bPositive);
 /* Rotate the eye around the center of the box, around axis */
 
-extern void translate_view(t_3dview *view, int axis, gmx_bool bPositive);
+void translate_view(t_3dview *view, int axis, gmx_bool bPositive);
 /* Translate the origin at which one is looking */
 
-extern void reset_view(t_3dview *view);
+void reset_view(t_3dview *view);
 /* Reset the viewing to the initial view */
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 1c587077e1599e266af3b40ae77fa5a37d03c01a..f5439d8d942c81c7e9bb71f68a098b1b49f98b51 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #endif
 
 #include <X11/Xlib.h>
+#include <X11/Xresource.h>
 #include <X11/Xutil.h>
-#include <X11/keysym.h>
 #include <X11/cursorfont.h>
-#include <X11/Xresource.h>
+#include <X11/keysym.h>
 
 #ifdef _acc_
 typedef unsigned char bmchar;
index 3d5d76145c9cfeaa411bbe90a196d16fa6c12317..e5157ffe424cfefdeb159617893821b62654af7e 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "buttons.h"
+
+#include <stdlib.h>
 #include <string.h>
 
 #include <algorithm>
 
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-
-#include "x11.h"
-#include "xutil.h"
-#include "buttons.h"
 
-#include "stop_ani.bm"
-#include "play.bm"
 #include "ff.bm"
+#include "play.bm"
 #include "rewind.bm"
+#include "stop_ani.bm"
+#include "x11.h"
+#include "xutil.h"
 
 static void move_bbox(t_x11 *x11, t_butbox *bbox)
 {
@@ -118,7 +117,7 @@ static bool VBCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
 void set_vbtime(t_x11 *x11, t_butbox *vbox, char *text)
 {
     sfree(vbox->wd.text);
-    vbox->wd.text = strdup(text);
+    vbox->wd.text = gmx_strdup(text);
     ExposeWin(x11->disp, vbox->wd.self);
 }
 
index e4ba670a4c7127e398949bc854aa0039c9837cf7..4f69d7a4a81b6cd0438b339d60813c7e8367de37 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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
+#include <stdlib.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h> // for fork()
 #endif
 
-#include "gromacs/utility/smalloc.h"
-#include "sysstuff.h"
-#include "macros.h"
+#include "dialogs.h"
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "manager.h"
+#include "nmol.h"
 #include "x11.h"
 #include "xdlghi.h"
 #include "xmb.h"
-#include "dialogs.h"
-#include "names.h"
-#include "nmol.h"
-#include "manager.h"
-#include "gromacs/fileio/futil.h"
-#include "gmx_fatal.h"
 
 #define MBFLAGS /* MB_APPLMODAL | */ MB_DONTSHOW
 
@@ -104,15 +107,10 @@ static void shell_comm(const char *title, const char *script, int nsleep)
     fprintf(stderr, "command: %s\n", command);
 #endif
 
-#ifdef GMX_NO_SYSTEM
-    printf("Warning-- No calls to system(3) supported on this platform.");
-    printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
-#else
     if (0 != system(command))
     {
         gmx_fatal(FARGS, "Failed to execute command: %s", command);
     }
-#endif
 
 #ifdef DEBUG
     unlink(tmp)
index 0f306a134c34032d4fcde4412a50c3c30e0f647e..3e69058142152857ac179bb68f84a4f6c9859e65 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _dialogs_h
 #define _dialogs_h
 
-#include "xdlg.h"
-#include "pulldown.h"
-#include "manager.h"
 #include "logo.h"
+#include "manager.h"
+#include "pulldown.h"
+#include "xdlg.h"
 
 typedef struct {
     bool      bMapped;
index 55a44a7fb8c11c73c73247d8b8ca1037f5dbeab9..12491724250834930f6b8b0031d8f26f91165d85 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include "fgrid.h"
+
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
+
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "fgrid.h"
-#include "gromacs/fileio/futil.h"
 
 static const char *type[] = {
     "button", "radiobuttons", "groupbox", "checkbox",
@@ -102,9 +102,10 @@ void ReadDlgError(const char *infile, eDLGERR err, const char *s,
 static void ReadAccOpen(const char *infile, FILE *in)
 {
     char buf[STRLEN];
+    int  result;
 
-    fscanf(in, "%4s", buf);
-    if (strcmp(buf, "{") != 0)
+    result = fscanf(in, "%4s", buf);
+    if ((1 != result) || strcmp(buf, "{") != 0)
     {
         ReadDlgErr(infile, eACCOEXP, buf);
     }
@@ -113,9 +114,10 @@ static void ReadAccOpen(const char *infile, FILE *in)
 static void ReadAccClose(const char *infile, FILE *in)
 {
     char buf[STRLEN];
+    int  result;
 
-    fscanf(in, "%4s", buf);
-    if (strcmp(buf, "}") != 0)
+    result = fscanf(in, "%4s", buf);
+    if ((1 != result) || strcmp(buf, "}") != 0)
     {
         ReadDlgErr(infile, eACCCEXP, buf);
     }
@@ -201,7 +203,7 @@ static t_fsimple *NewFSimple(void)
 static void AddFItemName(t_fitem *fitem, char *name)
 {
     srenew(fitem->name, ++fitem->nname);
-    fitem->name[fitem->nname-1] = strdup(name);
+    fitem->name[fitem->nname-1] = gmx_strdup(name);
 }
 
 static t_fgroup *NewFGroup(void)
@@ -356,10 +358,10 @@ static t_fitem *ScanFItem(const char *infile, FILE *in, char *buf)
     ReadQuoteString(infile, in, get);
     ReadQuoteString(infile, in, def);
     ReadQuoteString(infile, in, help);
-    fitem->set  = strdup(set);
-    fitem->get  = strdup(get);
-    fitem->def  = strdup(def);
-    fitem->help = strdup(help);
+    fitem->set  = gmx_strdup(set);
+    fitem->get  = gmx_strdup(get);
+    fitem->def  = gmx_strdup(def);
+    fitem->help = gmx_strdup(help);
 
     return fitem;
 }
@@ -368,15 +370,16 @@ t_fgrid *FGridFromFile(const char *infile)
 {
     FILE      *in;
     char       buf[STRLEN];
+    int        result;
 
     t_fgrid   *fgrid;
     t_fgroup  *fgroup;
     t_fsimple *fsimple;
     int        gridx, gridy;
 
-    in = libopen(infile);
-    fscanf(in, "%6s", buf);
-    if (strcmp(buf, "grid") != 0)
+    in     = libopen(infile);
+    result = fscanf(in, "%6s", buf);
+    if ((1 != result) || strcmp(buf, "grid") != 0)
     {
         ReadDlgErr(infile, eGRIDEXP, buf);
     }
@@ -388,14 +391,14 @@ t_fgrid *FGridFromFile(const char *infile)
     fgrid->w = gridx;
     fgrid->h = gridy;
     ReadAccOpen(infile, in);
-    fscanf(in, "%15s", buf);
-    while (bNotAccClose(buf))
+    result = fscanf(in, "%15s", buf);
+    while ((1 == result) && bNotAccClose(buf))
     {
         if (strcmp(buf, "group") == 0)
         {
             fgroup = AddFGridFGroup(fgrid);
             ReadQuoteString(infile, in, buf);
-            fgroup->name = strdup(buf);
+            fgroup->name = gmx_strdup(buf);
             if ((fscanf(in, "%5d%5d%5d%5d", &fgroup->x, &fgroup->y, &fgroup->w, &fgroup->h)) != 4)
             {
                 ReadDlgErr(infile, eNOVALS, "group x,y,w,h");
@@ -409,11 +412,11 @@ t_fgrid *FGridFromFile(const char *infile)
                 ReadDlgErr(infile, eTOOHIGH, buf);
             }
             ReadAccOpen(infile, in);
-            fscanf(in, "%15s", buf);
-            while (bNotAccClose(buf))
+            result = fscanf(in, "%15s", buf);
+            while ((1 == result) && bNotAccClose(buf))
             {
                 AddFGroupFItem(fgroup, ScanFItem(infile, in, buf));
-                fscanf(in, "%15s", buf);
+                result = fscanf(in, "%15s", buf);
             }
         }
         else if (strcmp(buf, "simple") == 0)
@@ -432,13 +435,26 @@ t_fgrid *FGridFromFile(const char *infile)
                 ReadDlgErr(infile, eTOOHIGH, "simple");
             }
             ReadAccOpen(infile, in);
-            fscanf(in, "%15s", buf);
-            fsimple->fitem = ScanFItem(infile, in, buf);
-            ReadAccClose(infile, in);
+            result = fscanf(in, "%15s", buf);
+            if (1 == result)
+            {
+                fsimple->fitem = ScanFItem(infile, in, buf);
+                ReadAccClose(infile, in);
+            }
+        }
+        if (1 == result)
+        {
+            result = fscanf(in, "%15s", buf);
         }
-        fscanf(in, "%15s", buf);
     }
     gmx_ffclose(in);
+    /* Since we always read one variable at a time the result from
+     * fscanf should always be 1.
+     */
+    if (1 != result)
+    {
+        ReadDlgErr(infile, eNOVALS, "fgrid");
+    }
 
     return fgrid;
 }
index 1acaa8c42bad028d95ddb069292e39c5f60dc865..84a7df32fc75eb20c38f421ece5376bfabf18086 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, by the GROMACS development team, led by
+ * 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <string.h>
 
 #include <algorithm>
 
-#include "sysstuff.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/dir_separator.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "index.h"
-#include "xdlghi.h"
+
 #include "dialogs.h"
-#include "index.h"
-#include "gmx_fatal.h"
+#include "xdlghi.h"
 
 t_filter *init_filter(t_atoms *atoms, const char *fn, int natom_trx)
 {
index 8c56da42d3d41549f78500923a89983cc6886ef1..ee182e2e235eff32d4c960064fd7523a17ca3fc5 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "sysstuff.h"
-#include "macros.h"
-#include "xutil.h"
-#include "Xstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "copyrite.h"
 #include "logo.h"
 
+#include <stdlib.h>
+
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/real.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "Xstuff.h"
+#include "xutil.h"
+
 typedef struct {
     int            x, y, rad;
     unsigned long *col;
@@ -111,7 +113,6 @@ static bool LogoCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     };
 #define NMESS asize(Mess)
     int             i;
-    real            wfac, hfac;
     t_logo         *logo;
     t_windata      *wd;
 
@@ -119,8 +120,8 @@ static bool LogoCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     wd   = &(logo->wd);
     if (bFirst)
     {
-        wfac = wd->width/110.0;
-        hfac = wd->height/110.0;
+        const real wfac = wd->width/110.0;
+        const real hfac = wd->height/110.0;
         for (i = 0; (i < asize(c)); i++)
         {
             c[i].x *= wfac;
index eae974e53a7b6ceaef58e02ba96a1bc9411fd90d..c77acc18466db37b02142cd41eb7e291b0e0f9de 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h> // for usleep()
 #endif
 
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "atomprop.h"
-#include "names.h"
 #include "manager.h"
-#include "pbc.h"
-#include "nmol.h"
-#include "copyrite.h"
-#include "vec.h"
-#include "gromacs/utility/cstringutil.h"
 
-#include "gromacs/fileio/futil.h"
 #include "gromacs/fileio/tpxio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/math/utilities.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+
+#include "3dview.h"
+#include "nmol.h"
 
 static void add_object(t_manager *man, eObject eO, atom_id ai, atom_id aj)
 {
@@ -230,7 +232,7 @@ void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
     man->natom =
         read_first_x(man->oenv, &man->status, trajectory, &(man->time), &(man->x),
                      man->box);
-    man->trajfile = strdup(trajectory);
+    man->trajfile = gmx_strdup(trajectory);
     if (man->natom > man->top.atoms.nr)
     {
         gmx_fatal(FARGS, "Topology %s (%d atoms) and trajectory %s (%d atoms) "
@@ -240,7 +242,7 @@ void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
 
     cool_quote(quote, 255, NULL);
     sprintf(buf, "%s: %s", *man->top.name, quote);
-    man->title.text = strdup(buf);
+    man->title.text = gmx_strdup(buf);
     man->view       = init_view(man->box);
     at              = &(man->top.atoms);
     aps             = gmx_atomprop_init();
index d6ce4c2c5cff6ecf7b35255c41a52b75f91e6369..1f48651beb59c018195d245213444f4b854b2b39 100644 (file)
 #define _manager_h
 
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/pbcutil/rmpbc.h"
+
+#include "3dview.h"
+#include "buttons.h"
+#include "nleg.h"
 #include "x11.h"
 #include "xutil.h"
-#include "gromacs/math/3dview.h"
-#include "nleg.h"
-#include "buttons.h"
-#include "rmpbc.h"
-#include "gromacs/fileio/trxio.h"
 
 /* Some window sizes */
 #define EWIDTH      200
index c6ba93966a7054bd9ab0f1b5cb15c3642ce5e07a..977d3ae0b43537adf84fcca1a35cbe522320b193 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
-#include "sysstuff.h"
+#include <stdlib.h>
 #include <string.h>
+
+#include "gromacs/fileio/writeps.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "xutil.h"
+
+#include "3dview.h"
 #include "buttons.h"
 #include "manager.h"
-#include "nmol.h"
 #include "nleg.h"
-
-#include "gromacs/fileio/writeps.h"
-#include "gromacs/math/3dview.h"
+#include "nmol.h"
+#include "xutil.h"
 
 #define MSIZE 4
 
@@ -196,7 +195,7 @@ static void draw_box(t_psdata ps, t_3dview *view, matrix box,
         {
             corner[i][j] = ivec[i][j]*box[j][j];
         }
-        m4_op(view->proj, corner[i], x4);
+        gmx_mat4_transform_point(view->proj, corner[i], x4);
         v4_to_iv2(x4, vec2[i], x0, y0, sx, sy);
     }
     ps_color(ps, 0, 0, 0.5);
@@ -240,7 +239,7 @@ void ps_draw_mol(t_psdata ps, t_manager *man)
     {
         if (man->bVis[i])
         {
-            m4_op(view->proj, man->x[i], x4);
+            gmx_mat4_transform_point(view->proj, man->x[i], x4);
             man->zz[i] = x4[ZZ];
             v4_to_iv2(x4, vec2[i], x0, y0, sx, sy);
         }
index 61a643610fa751a1ccba2fe397e3988c9eda19a0..3c1669d40bf86084b06941cf14b0d84490c8d143 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nleg.h"
 
 #include <string.h>
 
 #include <algorithm>
 
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/rgb.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "buttons.h"
-#include "nleg.h"
 
 typedef struct {
     const char    *tp;
index 7a48fb842cac07c901a16c3b4f5336c58e68615e..d4ad63d3825d75b355a16e262270f6eba02a44db 100644 (file)
@@ -38,6 +38,8 @@
 #ifndef _nleg_h
 #define _nleg_h
 
+#include "gromacs/legacyheaders/types/rgb.h"
+
 #include "x11.h"
 #include "xutil.h"
 
index 5a6866fff4de98517d193ea23c2011a2f06b35c0..cca9b5fbdda791904a6a4eb5e4653a8fe45f0db7 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "nmol.h"
 
 #include <math.h>
-#include "sysstuff.h"
+#include <stdlib.h>
 #include <string.h>
+
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "xutil.h"
-#include "gromacs/math/3dview.h"
-#include "gmx_fatal.h"
+
+#include "3dview.h"
 #include "buttons.h"
 #include "manager.h"
-#include "nmol.h"
-#include "vec.h"
-#include "txtdump.h"
-#include "pbc.h"
+#include "xutil.h"
 
 #define MSIZE 4
 
@@ -459,7 +460,7 @@ static void draw_box(t_x11 *x11, Window w, t_3dview *view, matrix box,
 
         for (i = 0; (i < NCUCEDGE); i++)
         {
-            m4_op(view->proj, corner[i], x4);
+            gmx_mat4_transform_point(view->proj, corner[i], x4);
             v4_to_iv2(x4, vec2[i], x0, y0, sx, sy);
         }
         XSetForeground(x11->disp, x11->gc, YELLOW);
@@ -508,7 +509,7 @@ static void draw_box(t_x11 *x11, Window w, t_3dview *view, matrix box,
                 }
             }
             rvec_inc(corner[i], box_center);
-            m4_op(view->proj, corner[i], x4);
+            gmx_mat4_transform_point(view->proj, corner[i], x4);
             v4_to_iv2(x4, vec2[i], x0, y0, sx, sy);
         }
         if (debug)
@@ -572,7 +573,7 @@ void draw_mol(t_x11 *x11, t_manager *man)
     {
         if (man->bVis[i])
         {
-            m4_op(view->proj, man->x[i], x4);
+            gmx_mat4_transform_point(view->proj, man->x[i], x4);
             man->zz[i] = x4[ZZ];
             v4_to_iv2(x4, vec2[i], x0, y0, sx, sy);
         }
index fe66bb5b399fe8fb3aa35d57197bce1bb4425d90..65cfed300294a6762434241d4dcf165a98e30da0 100644 (file)
@@ -38,6 +38,7 @@
 #ifndef _nmol_h
 #define _nmol_h
 
+#include "manager.h"
 #include "x11.h"
 #include "xutil.h"
 
index 0f5ec8cd6c1ff523dd86fdf9e1e28591d819c2d6..5c8114129fd361fa62e72b919562a3ab5995acb4 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "popup.h"
 
 #include <math.h>
 #include <string.h>
 
 #include <algorithm>
 
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "x11.h"
 #include "xutil.h"
-#include "popup.h"
 
 bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
 {
index 4034e6ae2937272f534e57512e508892153f3dbd..5dd48058764902987c995e31b833c16db5b15b76 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "pulldown.h"
 
 #include <string.h>
 
 #include <algorithm>
 
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
 
-#include "x11.h"
 #include "popup.h"
-#include "pulldown.h"
+#include "x11.h"
 
 static bool PDCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
 {
index aec59937e6fa56932dddddb9100ac924b267e7ad..567b522564a2568129b439c9cabc51db3f843aa1 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <stdio.h>
 #include <string.h>
 
-#include "sysstuff.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gmx_fatal.h"
-#include "typedefs.h"
 #include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/tpxio.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #ifdef GMX_X11
 
 #include "gromacs/fileio/writeps.h"
 
 #include "Xstuff.h"
-#include "gromacs.bm"
-#include "xutil.h"
 #include "dialogs.h"
+#include "gromacs.bm"
 #include "molps.h"
 #include "nmol.h"
+#include "xutil.h"
 
 static void dump_it(t_manager *man)
 {
@@ -310,7 +309,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     snew(gmx, 1);
     snew(gmx->wd, 1);
 
-    ePBC = read_tpx_top(ftp2fn(efTPX, nfile, fnm),
+    ePBC = read_tpx_top(ftp2fn(efTPR, nfile, fnm),
                         NULL, box, &natom, NULL, NULL, NULL, &top);
 
     read_first_frame(oenv, &status, ftp2fn(efTRX, nfile, fnm), &fr, TRX_DONT_SKIP);
@@ -366,7 +365,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     init_dlgs(x11, gmx);
 
     /* Now do file operations */
-    set_file(x11, gmx->man, ftp2fn(efTRX, nfile, fnm), ftp2fn(efTPX, nfile, fnm));
+    set_file(x11, gmx->man, ftp2fn(efTRX, nfile, fnm), ftp2fn(efTPR, nfile, fnm));
 
     ShowDlg(gmx->dlgs[edFilter]);
 }
@@ -398,7 +397,7 @@ int gmx_view(int argc, char *argv[])
     output_env_t oenv;
     t_filenm     fnm[] = {
         { efTRX, "-f", NULL, ffREAD },
-        { efTPX, NULL, NULL, ffREAD },
+        { efTPR, NULL, NULL, ffREAD },
         { efNDX, NULL, NULL, ffOPTRD }
     };
 #define NFILE asize(fnm)
index 14ac665f03b647edb23585bbf05c0a6a8625d16d..cf3eb241bb91228781dfc702c55b1782397a612c 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "x11.h"
 
+#include <stdlib.h>
 #include <string.h>
-#include "typedefs.h"
-#include "sysstuff.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
+
 #include "Xstuff.h"
-#include "x11.h"
 
 /* These colours will be mapped to black on a monochrome screen */
 unsigned long BLACK, BLUE, GREEN, CYAN, RED, BROWN, GREY, DARKGREY;
@@ -319,7 +321,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     bool            bVerbose = false;
     int             i;
 
-    title = strdup(argv[0]);
+    title = gmx_strdup(argv[0]);
 
     /* First check environment */
     fontname = getenv("GMX_FONT");
@@ -356,7 +358,7 @@ t_x11 *GetX11(int *argc, char *argv[])
                             break;
                         case 't':
                             sfree(title);
-                            title = strdup(argv[++i]);
+                            title = gmx_strdup(argv[++i]);
                             break;
                         case 'v':
                             bVerbose = true;
@@ -482,7 +484,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     {
         x11->bg = LIGHTGREY;
     }
-    x11->title = strdup(title);
+    x11->title = gmx_strdup(title);
     sfree(title);
     x11->wlist              = NULL;
     x11->GetNamedColor      = &GetNamedColor;
index 759aaacc1dad953b64b41025e9f8b30e1c5f8d1e..6267b356e4dce310610789b989da25bad9b5f572 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,7 +39,9 @@
 #define _x11_h
 
 #include <stdio.h>
-#include "typedefs.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+
 #include "Xstuff.h"
 
 /* These colours will be mapped to black on a monochrome screen */
index dc4e0b6e4e661970ce433a0570e590e1adae7985..2719c42b80a95fef1b21a0f76e638639ca677f4a 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "xdlg.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "macros.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
+
 #include "Xstuff.h"
-#include "xutil.h"
-#include "xdlg.h"
 #include "xmb.h"
-#include "gmx_fatal.h"
+#include "xutil.h"
 /*****************************
  *
  * Helpful routines
@@ -407,11 +408,14 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
         if (gmx_strcasecmp(buf, "nok") == 0)
         {
             /* An error occurred */
-            for (i = 0; (i < nlines); i++)
+            if (lines)
             {
-                sfree(lines[i]);
+                for (i = 0; (i < nlines); i++)
+                {
+                    sfree(lines[i]);
+                }
+                sfree(lines);
             }
-            sfree(lines);
             NoHelp(dlg);
             return;
         }
@@ -421,7 +425,7 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
             if (bCont)
             {
                 srenew(lines, ++nlines);
-                lines[nlines-1] = strdup(buf);
+                lines[nlines-1] = gmx_strdup(buf);
             }
         }
     }
@@ -776,7 +780,7 @@ t_dlg *CreateDlg(t_x11 *x11, Window Parent, const char *title,
     dlg->data = data;
     if (title)
     {
-        dlg->title = strdup(title);
+        dlg->title = gmx_strdup(title);
     }
     else
     {
index 5d280fc75d32db67fac7cb661943bc4f51d146cc..7d79e3b8ccc50d6451731e2cff51675620a2c4ef 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "xdlghi.h"
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <algorithm>
 
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/utility/cstringutil.h"
-#include "sysstuff.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "xutil.h"
-#include "xdlghi.h"
+
 #include "fgrid.h"
+#include "xutil.h"
 
 t_dlgitem **CreateRadioButtonGroup(t_x11 *x11, char *szTitle,
                                    t_id GroupID, int nrb, t_id rb[],
index 91e10e1485e0b49148a4bb1a2c521d69093fdb2c..d97764842a40aaf0e51d5c7142af879aebb20b5a 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -39,6 +39,7 @@
 #define _xdlghi_h
 
 #include <stdarg.h>
+
 #include "Xstuff.h"
 #include "x11.h"
 #include "xdlg.h"
index 590bf733240a7e36d2c6167af45cc258f0730a7c..2660ea31fb7c7b1ccb05c206f569128e4311e989 100644 (file)
@@ -34,9 +34,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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "xdlgitem.h"
 
 #include <ctype.h>
 #include <stdio.h>
 
 #include <algorithm>
 
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
-#include "macros.h"
+
 #include "Xstuff.h"
-#include "xdlgitem.h"
 
 #define BUFSIZE 16
 
@@ -420,7 +421,7 @@ static int WndProcET(t_x11 *x11, t_dlgitem *dlgitem, XEvent *event)
         case ButtonPress:
             /* Calculate new position for caret */
             et->pos = strlen(et->buf);
-            bp      = strdup(et->buf);
+            bp      = gmx_strdup(et->buf);
             xp      = event->xbutton.x-XTextWidth(x11->font, win->text, strlen(win->text))-
                 XCARET;
             while ((et->pos > 0) && (XTextWidth(x11->font, bp, strlen(bp)) > xp))
@@ -571,7 +572,7 @@ t_dlgitem *CreateButton(t_x11 *x11,
     }
     else
     {
-        lab = strdup(szLab);
+        lab = gmx_strdup(szLab);
     }
     InitWin(&(dlgitem->win), x0, y0, w, h, bw, szLab);
     sfree(lab);
@@ -709,7 +710,7 @@ t_dlgitem *CreateStaticText(t_x11 *x11,
     snew(dlgitem->u.statictext.lines, nlines);
     for (i = 0; (i < nlines); i++)
     {
-        dlgitem->u.statictext.lines[i] = strdup(lines[i]);
+        dlgitem->u.statictext.lines[i] = gmx_strdup(lines[i]);
     }
     dlgitem->WndProc = WndProcST;
 
@@ -755,7 +756,7 @@ t_dlgitem *CreateEditText(t_x11 *x11,
     return dlgitem;
 }
 
-#define SC(src) (strlen(src) ? strdup(src) : NULL)
+#define SC(src) (strlen(src) ? gmx_strdup(src) : NULL)
 
 void SetDlgitemOpts(t_dlgitem *dlgitem, bool bUseMon,
                     char *set, char *get, char *help)
index e270b72e2c0df5c32f01c0d288b150a4de7c2f9a..8bf04120d0f14d79e973b3a5424b1fdd6d41e23c 100644 (file)
@@ -39,8 +39,8 @@
 #define _xdlgitem_h
 
 #include "Xstuff.h"
-#include "xutil.h"
 #include "x11.h"
+#include "xutil.h"
 
 typedef enum {
     edlgBN, edlgRB, edlgGB, edlgCB, edlgPM, edlgST, edlgET, edlgNR
index 2b747ded6d549f7b208634ac52288d8dc6aec6bc..4999c431cde0c5cde0e49ff59519ea427c26ed25 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, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "xmb.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#include "typedefs.h"
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/fatalerror.h"
+
 #include "Xstuff.h"
-#include "x11.h"
-#include "xutil.h"
-#include "xdlg.h"
-#include "xmb.h"
-#include "gmx_fatal.h"
+#include "alert.bm"
 #include "gromacs.bm"
-#include "stop.bm"
 #include "info.bm"
-#include "alert.bm"
+#include "stop.bm"
+#include "x11.h"
+#include "xdlg.h"
+#include "xutil.h"
 
 #define ID_BOX     -3
 #define ID_ICON    -2
index 00675dbbcec464c35b26d8eb797a7c284159227f..ccb5fa28df16cb938f08bab9d0724f7bc7bf1b64 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef _xmb_h
 #define _xmb_h
 
+#include "manager.h"
 #include "x11.h"
+#include "xdlg.h"
+#include "xmb.h"
 
 #define MB_OK              1
 #define MB_CANCEL          (1<<1)
index 6402306be9ce42a6d90d06bf92856e3c40e0c85e..8d11f70bf097a329285c1b88e8ed4db209880c9f 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.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+
+#include "xutil.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "xutil.h"
+
 #include "Xstuff.h"
 
 int CheckWin(Window win, const char *file, int line)
@@ -167,7 +169,7 @@ void InitWin(t_windata *win, int x0, int y0, int w, int h, int bw, const char *t
     win->cursor = 0;
     if (text)
     {
-        win->text = strdup(text);
+        win->text = gmx_strdup(text);
     }
     else
     {
index a49e50e869c7a84f254d6afc6da18d2950e78a54..d7d5a338356bcd516730cc28f0a85913dae5d28f 100644 (file)
@@ -38,7 +38,7 @@
 #ifndef _xutil_h
 #define _xutil_h
 
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 /* TODO: This include is needed here, because this header reuses eXPos and
  * eYPos.  It has nothing to do with PostScript output. */
 #include "gromacs/fileio/writeps.h"
index b3acdbefd16539468521696d034ef14e18d7900b..4f438dd08ba2affc61f9cd57265513ae31b58fc1 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2011,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.
@@ -46,13 +46,15 @@ function (gmx_build_unit_test NAME EXENAME)
         add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS} ${ARGN} ${TESTUTILS_DIR}/unittest_main.cpp)
         set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS}")
         target_link_libraries(${EXENAME} ${TESTUTILS_LIBS} libgromacs ${GMOCK_LIBRARIES} ${GMX_EXE_LINKER_FLAGS})
+        file(RELATIVE_PATH _input_files_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
         set(_temporary_files_path "${CMAKE_CURRENT_BINARY_DIR}/Testing/Temporary")
         file(MAKE_DIRECTORY ${_temporary_files_path})
-
         # Note that the quotation marks in the next line form part of
         # the defined symbol, so that the macro replacement in the
         # source file is as a string.
-        set(EXTRA_COMPILE_DEFINITIONS TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}" TEST_TEMP_PATH="${_temporary_files_path}")
+        set(EXTRA_COMPILE_DEFINITIONS
+            TEST_DATA_PATH="${_input_files_path}"
+            TEST_TEMP_PATH="${_temporary_files_path}")
 
         set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_DEFINITIONS "${EXTRA_COMPILE_DEFINITIONS}")
     endif()
index a848d330d0fea3eca6db26b603474f8cad2ec3cc..3d5a956fca8c09fd79a121b81dddc618572cb3f8 100644 (file)
  */
 /*! \internal \file
  * \brief
- * Implements gmx::test::CommandLine.
+ * Implements classes from cmdlinetest.h.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include "cmdlinetest.h"
 
 #include <cstdlib>
 #include <cstring>
-#include <sstream>
 
 #include <new>
+#include <sstream>
 #include <vector>
 
+#include <boost/scoped_ptr.hpp>
+
+#include "gromacs/commandline/cmdlineoptionsmodule.h"
 #include "gromacs/commandline/cmdlineprogramcontext.h"
 #include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/file.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/refdata.h"
+#include "testutils/testfilemanager.h"
 
 namespace gmx
 {
@@ -157,35 +167,41 @@ std::string value2string(T value)
     return ss.str();
 }
 
-}
+}       // namespace
 
-void CommandLine::addOption(const char *name,
-                            const char *value)
+void CommandLine::addOption(const char *name, const char *value)
 {
     append(name);
     append(value);
 }
 
-void CommandLine::addOption(const char        *name,
-                            const std::string &value)
+void CommandLine::addOption(const char *name, const std::string &value)
 {
     addOption(name, value.c_str());
 }
 
-void CommandLine::addOption(const char *name,
-                            int         value)
+void CommandLine::addOption(const char *name, int value)
 {
     append(name);
     append(value2string(value));
 }
 
-void CommandLine::addOption(const char *name,
-                            double      value)
+void CommandLine::addOption(const char *name, double value)
 {
     append(name);
     append(value2string(value));
 }
 
+void CommandLine::merge(const CommandLine &args)
+{
+    // Skip first argument if it is the module name.
+    const int firstArg = (args.arg(0)[0] == '-' ? 0 : 1);
+    for (int i = firstArg; i < args.argc(); ++i)
+    {
+        append(args.arg(i));
+    }
+}
+
 int &CommandLine::argc()
 {
     return impl_->argc_;
@@ -212,5 +228,212 @@ std::string CommandLine::toString() const
     return CommandLineProgramContext(argc(), argv()).commandLine();
 }
 
+/********************************************************************
+ * CommandLineTestHelper::Impl
+ */
+
+class CommandLineTestHelper::Impl
+{
+    public:
+        struct OutputFileInfo
+        {
+            OutputFileInfo(const char *option, const std::string &path)
+                : option(option), path(path)
+            {
+            }
+
+            std::string         option;
+            std::string         path;
+        };
+
+        typedef std::vector<OutputFileInfo>        OutputFileList;
+
+        explicit Impl(TestFileManager *fileManager)
+            : fileManager_(*fileManager)
+        {
+        }
+
+        TestFileManager &fileManager_;
+        OutputFileList   outputFiles_;
+};
+
+/********************************************************************
+ * CommandLineTestHelper
+ */
+
+// static
+int CommandLineTestHelper::runModule(
+        CommandLineModuleInterface *module, CommandLine *commandLine)
+{
+    CommandLineModuleSettings settings;
+    module->init(&settings);
+    return module->run(commandLine->argc(), commandLine->argv());
+}
+
+// static
+int CommandLineTestHelper::runModule(
+        CommandLineOptionsModuleInterface::FactoryMethod  factory,
+        CommandLine                                      *commandLine)
+{
+    // The name and description are not used in the tests, so they can be NULL.
+    boost::scoped_ptr<CommandLineModuleInterface> module(
+            CommandLineOptionsModuleInterface::createModule(NULL, NULL, factory));
+    return runModule(module.get(), commandLine);
+}
+
+CommandLineTestHelper::CommandLineTestHelper(TestFileManager *fileManager)
+    : impl_(new Impl(fileManager))
+{
+}
+
+CommandLineTestHelper::~CommandLineTestHelper()
+{
+}
+
+void CommandLineTestHelper::setInputFileContents(
+        CommandLine *args, const char *option, const char *extension,
+        const std::string &contents)
+{
+    GMX_ASSERT(extension[0] != '.', "Extension should not contain a dot");
+    std::string fullFilename = impl_->fileManager_.getTemporaryFilePath(
+                formatString("%d.%s", args->argc(), extension));
+    File::writeFileFromString(fullFilename, contents);
+    args->addOption(option, fullFilename);
+}
+
+void CommandLineTestHelper::setInputFileContents(
+        CommandLine *args, const char *option, const char *extension,
+        const ConstArrayRef<const char *> &contents)
+{
+    GMX_ASSERT(extension[0] != '.', "Extension should not contain a dot");
+    std::string fullFilename = impl_->fileManager_.getTemporaryFilePath(
+                formatString("%d.%s", args->argc(), extension));
+    File        file(fullFilename, "w");
+    ConstArrayRef<const char *>::const_iterator i;
+    for (i = contents.begin(); i != contents.end(); ++i)
+    {
+        file.writeLine(*i);
+    }
+    file.close();
+    args->addOption(option, fullFilename);
+}
+
+void CommandLineTestHelper::setOutputFile(
+        CommandLine *args, const char *option, const char *filename)
+{
+    std::string fullFilename = impl_->fileManager_.getTemporaryFilePath(filename);
+    args->addOption(option, fullFilename);
+    impl_->outputFiles_.push_back(Impl::OutputFileInfo(option, fullFilename));
+}
+
+void CommandLineTestHelper::setOutputFileNoTest(
+        CommandLine *args, const char *option, const char *extension)
+{
+    std::string fullFilename = impl_->fileManager_.getTemporaryFilePath(
+                formatString("%d.%s", args->argc(), extension));
+    args->addOption(option, fullFilename);
+}
+
+void CommandLineTestHelper::checkOutputFiles(TestReferenceChecker checker) const
+{
+    if (!impl_->outputFiles_.empty())
+    {
+        TestReferenceChecker                 outputChecker(
+                checker.checkCompound("OutputFiles", "Files"));
+        Impl::OutputFileList::const_iterator outfile;
+        for (outfile = impl_->outputFiles_.begin();
+             outfile != impl_->outputFiles_.end();
+             ++outfile)
+        {
+            std::string output = File::readToString(outfile->path);
+            outputChecker.checkStringBlock(output, outfile->option.c_str());
+        }
+    }
+}
+
+/********************************************************************
+ * CommandLineTestBase::Impl
+ */
+
+class CommandLineTestBase::Impl
+{
+    public:
+        Impl() : helper_(&tempFiles_)
+        {
+            cmdline_.append("module");
+        }
+
+        TestReferenceData     data_;
+        TestFileManager       tempFiles_;
+        CommandLineTestHelper helper_;
+        CommandLine           cmdline_;
+};
+
+/********************************************************************
+ * CommandLineTestBase
+ */
+
+CommandLineTestBase::CommandLineTestBase()
+    : impl_(new Impl)
+{
+}
+
+CommandLineTestBase::~CommandLineTestBase()
+{
+}
+
+void CommandLineTestBase::setInputFile(
+        const char *option, const char *filename)
+{
+    impl_->cmdline_.addOption(option, TestFileManager::getInputFilePath(filename));
+}
+
+void CommandLineTestBase::setInputFileContents(
+        const char *option, const char *extension, const std::string &contents)
+{
+    impl_->helper_.setInputFileContents(&impl_->cmdline_, option, extension,
+                                        contents);
+}
+
+void CommandLineTestBase::setInputFileContents(
+        const char *option, const char *extension,
+        const ConstArrayRef<const char *> &contents)
+{
+    impl_->helper_.setInputFileContents(&impl_->cmdline_, option, extension,
+                                        contents);
+}
+
+void CommandLineTestBase::setOutputFile(
+        const char *option, const char *filename)
+{
+    impl_->helper_.setOutputFile(&impl_->cmdline_, option, filename);
+}
+
+void CommandLineTestBase::setOutputFileNoTest(
+        const char *option, const char *extension)
+{
+    impl_->helper_.setOutputFileNoTest(&impl_->cmdline_, option, extension);
+}
+
+CommandLine &CommandLineTestBase::commandLine()
+{
+    return impl_->cmdline_;
+}
+
+TestFileManager &CommandLineTestBase::fileManager()
+{
+    return impl_->tempFiles_;
+}
+
+TestReferenceChecker CommandLineTestBase::rootChecker()
+{
+    return impl_->data_.rootChecker();
+}
+
+void CommandLineTestBase::checkOutputFiles()
+{
+    impl_->helper_.checkOutputFiles(rootChecker());
+}
+
 } // namespace test
 } // namespace gmx
index d29e75be5bdad4a3ae112aa056136b76a21b5d2b..519911f16e75b342f3a0444a0bf1335c3c8777ec 100644 (file)
@@ -34,7 +34,7 @@
  */
 /*! \libinternal \file
  * \brief
- * Declares gmx::test::CommandLine.
+ * Declares utilities testing command-line programs.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
 
 #include <string>
 
+#include <gtest/gtest.h>
+
 // arrayref.h is not strictly necessary for this header, but nearly all
 // callers will need it to use the constructor that takes ConstArrayRef.
 #include "gromacs/utility/arrayref.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
+
+class CommandLineModuleInterface;
+class CommandLineOptionsModuleInterface;
+
 namespace test
 {
 
+class TestFileManager;
+class TestReferenceChecker;
+
 /*! \libinternal \brief
- * Helper class for tests that check command-line handling.
+ * Helper class for tests that need to construct command lines.
  *
  * This class helps in writing tests for command-line handling.
  * The constructor method takes an array of const char pointers, specifying the
@@ -72,6 +81,10 @@ namespace test
  * parameters are actually modified.  Reading the command line is possible
  * afterwards, but modification is not.
  *
+ * If you need to construct command lines that refer to files on the file
+ * system, see CommandLineTestHelper and CommandLineTestBase for additional
+ * convenience utilities.
+ *
  * All constructors and methods that modify this class may throw an
  * std::bad_alloc.  Const methods and accessors do not throw.
  *
@@ -115,7 +128,7 @@ class CommandLine
         void initFromArray(const ConstArrayRef<const char *> &cmdline);
 
         /*! \brief
-         * Append an argument to the command line.
+         * Appends an argument to the command line.
          *
          * \param[in] arg  Argument to append.
          *
@@ -125,7 +138,7 @@ class CommandLine
         //! Convenience overload taking a std::string.
         void append(const std::string &arg) { append(arg.c_str()); }
         /*! \brief
-         * Add an option-value pair to the command line.
+         * Adds an option-value pair to the command line.
          *
          * \param[in] name   Name of the option to append, which
          *                   should start with "-".
@@ -138,6 +151,14 @@ class CommandLine
         void addOption(const char *name, int value);
         //! Overload taking a double.
         void addOption(const char *name, double value);
+        /*! \brief
+         * Appends all arguments from \p args to the command line.
+         *
+         * If the first argument of \p args does not start with a `-`, it is
+         * skipped.
+         */
+        void merge(const CommandLine &args);
+
         //! Returns argc for passing into C-style command-line handling.
         int &argc();
         //! Returns argv for passing into C-style command-line handling.
@@ -158,6 +179,270 @@ class CommandLine
         PrivateImplPointer<Impl> impl_;
 };
 
+/*! \libinternal \brief
+ * Helper class for tests that construct command lines that need to reference
+ * existing files.
+ *
+ * This class provides helper methods for:
+ *
+ *   1. Adding input files to a CommandLine instance by generating them from a
+ *      string provided in the test (setInputFileContents()).
+ *   2. Adding output files to a CommandLine instance (setOutputFile() and
+ *      setOutputFileNoTest()).
+ *   3. Checking the contents of some of the output files using
+ *      TestReferenceData (setOutputFile() and checkOutputFiles()).
+ *   4. Static methods for easily executing command-line modules
+ *      (various overloads of runModule()).
+ *
+ * All files created during the test are cleaned up at the end of the test.
+ *
+ * All methods can throw std::bad_alloc.
+ *
+ * \see TestFileManager
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class CommandLineTestHelper
+{
+    public:
+        /*! \brief
+         * Runs a command-line program that implements CommandLineModuleInterface.
+         *
+         * \param[in,out] module       Module to run.
+         *     The function does not take ownership.
+         * \param[in,out] commandLine  Command line parameters to pass.
+         *     This is only modified if \p module modifies it.
+         * \returns The return value of the module.
+         * \throws  unspecified  Any exception thrown by the module.
+         */
+        static int
+        runModule(CommandLineModuleInterface *module, CommandLine *commandLine);
+        /*! \brief
+         * Runs a command-line program that implements
+         * CommandLineOptionsModuleInterface.
+         *
+         * \param[in] factory          Factory method for the module to run.
+         * \param[in,out] commandLine  Command line parameters to pass.
+         *     This is only modified if the module modifies it.
+         * \returns The return value of the module.
+         * \throws  unspecified  Any exception thrown by the factory or the
+         *     module.
+         */
+        static int
+        runModule(CommandLineOptionsModuleInterface *(*factory)(),
+                  CommandLine                      *commandLine);
+
+        /*! \brief
+         * Initializes an instance.
+         *
+         * \param  fileManager  File manager to use for generating temporary
+         *     file names and to track temporary files.
+         */
+        explicit CommandLineTestHelper(TestFileManager *fileManager);
+        ~CommandLineTestHelper();
+
+        /*! \brief
+         * Generates and sets an input file.
+         *
+         * \param[in,out] args      CommandLine to which to add the option.
+         * \param[in]     option    Option to set.
+         * \param[in]     extension Extension for the file to create.
+         * \param[in]     contents  Text to write to the input file.
+         *
+         * Creates a temporary file with contents from \p contents, and adds
+         * \p option to \p args with a value that points to the generated file.
+         */
+        void setInputFileContents(CommandLine *args, const char *option,
+                                  const char *extension,
+                                  const std::string &contents);
+        /*! \brief
+         * Generates and sets an input file.
+         *
+         * \param[in,out] args      CommandLine to which to add the option.
+         * \param[in]     option    Option to set.
+         * \param[in]     extension Extension for the file to create.
+         * \param[in]     contents  Text to write to the input file.
+         *
+         * Creates a temporary file with contents from \p contents (each array
+         * entry on its own line), and adds \p option to \p args with a value
+         * that points to the generated file.
+         */
+        void setInputFileContents(CommandLine *args, const char *option,
+                                  const char *extension,
+                                  const ConstArrayRef<const char *> &contents);
+        /*! \brief
+         * Sets an output file parameter and adds it to the set of tested files.
+         *
+         * \param[in,out] args      CommandLine to which to add the option.
+         * \param[in]     option    Option to set.
+         * \param[in]     filename  Name of the output file.
+         *
+         * This method:
+         *  - Adds \p option to \p args to point a temporary file name
+         *    constructed from \p filename.
+         *  - Makes checkOutputFiles() to check the contents of the file
+         *    against reference data.
+         *  - Marks the temporary file for removal at test teardown.
+         *
+         * \p filename is given to TestTemporaryFileManager to make a unique
+         * filename for the temporary file, but is not otherwise used.
+         *
+         * Currently, this method should not be called for an XVG file, because
+         * the comments in the beginning of the file contain timestamps and
+         * other variable information, causing the test to fail.  Best used
+         * only for custom data formats.
+         */
+        void setOutputFile(CommandLine *args, const char *option,
+                           const char *filename);
+        /*! \brief
+         * Sets an output file parameter.
+         *
+         * \param[in,out] args      CommandLine to which to add the option.
+         * \param[in]     option    Option to set.
+         * \param[in]     extension Extension for the file to create.
+         *
+         * This method:
+         *  - Adds \p option to \p args to point to a temporary file name with
+         *    extension \p extension.
+         *  - Marks the temporary file for removal at test teardown.
+         *
+         * This method provides the mechanism to set output files that are
+         * required to trigger computation of values that are required for
+         * the test.  The contents of the output file are not tested.
+         *
+         * Another use case is to mark files that are unconditionally produced
+         * by the code under test, but do not need to be tested.  This method
+         * makes the test code aware of those files such that it can remove
+         * them at the end of the test.
+         */
+        void setOutputFileNoTest(CommandLine *args, const char *option,
+                                 const char *extension);
+
+        /*! \brief
+         * Checks output files added with setOutputFile() against reference
+         * data.
+         *
+         * \param     checker  Reference data root location where the reference
+         *     data is stored.
+         *
+         * The file contents are tested verbatim, using direct string
+         * comparison.  The text can be found verbatim in the reference data
+         * XML files for manual inspection.
+         *
+         * Generates non-fatal test failures if some output file contents do
+         * not match the reference data.
+         */
+        void checkOutputFiles(TestReferenceChecker checker) const;
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
+/*! \libinternal \brief
+ * Test fixture for tests that call a single command-line program with
+ * input/output files.
+ *
+ * This class provides a convenient package for using CommandLineTestHelper in
+ * a test that do not need special customization.  It takes care of creating
+ * the other necessary objects (like TestFileManager, TestReferenceData, and
+ * CommandLine) and wrapping the methods from CommandLineTestHelper such that
+ * extra parameters are not needed.  Additionally, it provides setInputFile()
+ * as a convenience function for adding a fixed input file, pointing to a file
+ * that resides in the source tree.
+ *
+ * \see CommandLineTestHelper
+ * \inlibraryapi
+ * \ingroup module_testutils
+ */
+class CommandLineTestBase : public ::testing::Test
+{
+    public:
+        CommandLineTestBase();
+        ~CommandLineTestBase();
+
+        /*! \brief
+         * Sets an input file.
+         *
+         * \param[in]     option    Option to set.
+         * \param[in]     filename  Name of the input file.
+         *
+         * \see TestFileManager::getInputFilePath()
+         */
+        void setInputFile(const char *option, const char *filename);
+        /*! \brief
+         * Generates and sets an input file.
+         *
+         * \see CommandLineTestHelper::setInputFileContents()
+         */
+        void setInputFileContents(const char        *option,
+                                  const char        *extension,
+                                  const std::string &contents);
+        /*! \brief
+         * Generates and sets an input file.
+         *
+         * \see CommandLineTestHelper::setInputFileContents()
+         */
+        void setInputFileContents(const char                        *option,
+                                  const char                        *extension,
+                                  const ConstArrayRef<const char *> &contents);
+        /*! \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);
+        /*! \brief
+         * Sets an output file parameter.
+         *
+         * \see CommandLineTestHelper::setOutputFileNoTest()
+         */
+        void setOutputFileNoTest(const char *option, const char *extension);
+
+        /*! \brief
+         * Returns the internal CommandLine object used to construct the
+         * command line for the test.
+         *
+         * Derived test fixtures can use this to add additional options, and
+         * to access the final command line to do the actual call that is being
+         * tested.
+         *
+         * Does not throw.
+         */
+        CommandLine &commandLine();
+        /*! \brief
+         * Returns the internal TestFileManager object used to manage the
+         * files.
+         *
+         * Derived test fixtures can use this to manage files in cases the
+         * canned methods are not sufficient.
+         *
+         * Does not throw.
+         */
+        TestFileManager &fileManager();
+        /*! \brief
+         * Returns the root reference data checker.
+         *
+         * Derived test fixtures can use this to check other things than output
+         * file contents.
+         */
+        TestReferenceChecker rootChecker();
+
+        /*! \brief
+         * Checks output files added with setOutputFile() against reference
+         * data.
+         *
+         * \see CommandLineTestHelper::checkOutputFiles()
+         */
+        void checkOutputFiles();
+
+    private:
+        class Impl;
+
+        PrivateImplPointer<Impl> impl_;
+};
+
 } // namespace test
 } // namespace gmx
 
index 77355e17161a080f8b145f7138cd5d448647af81..20fa85f566a0159ee8007e9fe9290f90fca5c850 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include "integrationtests.h"
 
-#include "testutils/testoptions.h"
-#include "gromacs/utility/stringutil.h"
+#include <stdio.h>
+
 #include "gromacs/utility/exceptions.h"
-#include "gromacs/options/options.h"
-#include "gromacs/options/basicoptions.h"
 #include "gromacs/utility/file.h"
-#include <stdlib.h>
-#include <stdio.h>
 
 namespace gmx
 {
@@ -59,26 +57,8 @@ namespace test
  * IntegrationTestFixture
  */
 
-std::string IntegrationTestFixture::s_maxBackup("-1");
-
-//! \cond
-GMX_TEST_OPTIONS(IntegrationTestOptions, options)
-{
-    options->addOption(StringOption("max-backup")
-                           .store(&IntegrationTestFixture::s_maxBackup)
-                           .description("Maximum number of backup files of old test output to write (-1 prevents backups being created)"));
-}
-//! \endcond
-
 IntegrationTestFixture::IntegrationTestFixture()
 {
-    // TODO fix this when we have an encapsulation layer for handling
-    // environment variables
-#ifdef GMX_NATIVE_WINDOWS
-    _putenv(("GMX_MAXBACKUP="+s_maxBackup).c_str());
-#else
-    setenv("GMX_MAXBACKUP", s_maxBackup.c_str(), true);
-#endif
 }
 
 IntegrationTestFixture::~IntegrationTestFixture()
index 86d43954262d26fc57f190ad2cc3606886727467..426f5c08c3143815d464c3add46ef5610e626400 100644 (file)
@@ -86,19 +86,16 @@ class IntegrationTestFixture : public ::testing::Test
          * sufficiently modular to permit it to work. */
         void redirectStderrToDevNull();
 
-        /* TEST_F() constructs derived classes, and those classes
-         * might need to access implementation details, so we
-         * cannot use the private access specifer here. */
-    protected:
+        /* 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:
 
         /*! \brief Object that manages finding input files, writing
          * temporary output files and cleaning up files.
          */
         ::gmx::test::TestFileManager fileManager_;
-
-    public:
-        //! Number of backup files to write
-        static std::string s_maxBackup;
 };
 
 } // namespace test
index 334bc74592ce2708f75640b864b41cffbc4da539..b05df109433d8fbcee7e5b93aeb40dcc4c199326 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * 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 "mpi-printer.h"
 
 #include "config.h"
+
 #include "gromacs/utility/gmxmpi.h"
 
 #ifdef GMX_LIB_MPI
@@ -45,7 +48,7 @@
 #include <boost/scoped_ptr.hpp>
 #include <gtest/gtest.h>
 
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/gmxassert.h"
 
 #define FORWARD_TO_DEFAULT_PRINTER1(MethodName, Param1Type) \
index 61e1786517e496107b120575ce32e05dd8d0c19b..9221676e63d5b0fff3b64822d7a0e9fecb53f7b8 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include "refdata.h"
 
 #include <cstdio>
 #include <libxml/parser.h>
 #include <libxml/xmlmemory.h>
 
-#include "gromacs/fileio/path.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 #include "gromacs/utility/stringutil.h"
 
 #include "testutils/testasserts.h"
index f3fd0bdfe21f9676084508d4a0d99c6c2259fb83..215514142a9612c5b309b4acaebdf3b06a89cb87 100644 (file)
@@ -46,8 +46,8 @@
 #include <iterator>
 #include <string>
 
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
index 586cb9f1832569f040c7446fac20b0e1a544fbe9..93b8bf9c757d4be8d4c02090f95a7b096f9d38ad 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
-#include "testutils/stringtest.h"
+#include "gmxpre.h"
+
+#include "stringtest.h"
 
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
index 9d2744f8ff615abbffbecc59b51c8784126dd248..502f207bf6b32620f68d8ba2ce1ba641f89dd75b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,7 +48,7 @@
 #include <boost/scoped_ptr.hpp>
 #include <gtest/gtest.h>
 
-#include "refdata.h"
+#include "testutils/refdata.h"
 
 namespace gmx
 {
index c06b53c31dffba70439ad83cdabc344f026193a5..68ea5c720d4fb4ba6bab98cf5b8fdd808ba4e196 100644 (file)
@@ -39,7 +39,9 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
-#include "testutils/testasserts.h"
+#include "gmxpre.h"
+
+#include "testasserts.h"
 
 #include <cmath>
 
@@ -47,8 +49,7 @@
 
 #include <gtest/gtest.h>
 
-#include "gromacs/legacyheaders/types/simple.h"
-
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/stringutil.h"
 
 namespace gmx
@@ -97,8 +98,8 @@ floatingPointToBiasedInteger(const FloatingPoint<FloatType> &value)
 }
 
 /*! \brief
- * Computes difference in ULPs between two numbers, treating also values of
- * different sign.
+ * Computes the magnitude of the difference in ULPs between two numbers,
+ * treating also values of different sign.
  */
 template <typename FloatType>
 gmx_uint64_t calculateUlpDifference(const FloatingPoint<FloatType> &value1,
@@ -133,6 +134,17 @@ void initDifference(FloatType raw1, FloatType raw2, double *absoluteDifference,
     *ulpDifference      = calculateUlpDifference(value1, value2);
 }
 
+/*! \brief
+ * Converts a relative tolerance into an ULP difference.
+ */
+template <typename FloatType>
+gmx_uint64_t relativeToleranceToUlp(FloatType tolerance)
+{
+    FloatingPoint<FloatType> m(1.0);
+    FloatingPoint<FloatType> t(1.0 + tolerance);
+    return calculateUlpDifference<FloatType>(m, t);
+}
+
 //! \}
 //! \}
 
@@ -163,9 +175,11 @@ bool FloatingPointDifference::isNaN() const
 
 std::string FloatingPointDifference::toString() const
 {
-    return formatString("%g (%" GMX_PRIu64 " %s-prec. ULPs)%s",
+    const double eps = isDouble() ? GMX_DOUBLE_EPS : GMX_FLOAT_EPS;
+    return formatString("%g (%" GMX_PRIu64 " %s-prec. ULPs, rel. %.3g)%s",
                         absoluteDifference_, ulpDifference_,
-                        bDouble_ ? "double" : "single",
+                        isDouble() ? "double" : "single",
+                        ulpDifference_ * eps,
                         bSignDifference_ ? ", signs differ" : "");
 }
 
@@ -186,33 +200,43 @@ bool FloatingPointTolerance::isWithin(
         return false;
     }
 
-    if (difference.asAbsolute() < absoluteTolerance_)
+    const double absoluteTolerance
+        = difference.isDouble() ? doubleAbsoluteTolerance_ : singleAbsoluteTolerance_;
+    if (difference.asAbsolute() < absoluteTolerance)
     {
         return true;
     }
 
-    if (ulpTolerance_ >= 0
-        && difference.asUlps() <= static_cast<gmx_uint64_t>(ulpTolerance_))
+    const gmx_uint64_t ulpTolerance
+        = difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_;
+    if (ulpTolerance < GMX_UINT64_MAX && difference.asUlps() <= ulpTolerance)
     {
         return true;
     }
     return false;
 }
 
-std::string FloatingPointTolerance::toString() const
+std::string FloatingPointTolerance::toString(const FloatingPointDifference &difference) const
 {
-    std::string result;
-    if (absoluteTolerance_ > 0.0)
+    std::string        result;
+    const double       absoluteTolerance
+        = difference.isDouble() ? doubleAbsoluteTolerance_ : singleAbsoluteTolerance_;
+    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_));
+        result.append(formatString("abs. %g", absoluteTolerance));
     }
-    if (ulpTolerance_ >= 0)
+    if (ulpTolerance < GMX_UINT64_MAX)
     {
         if (!result.empty())
         {
             result.append(", ");
         }
-        result.append(formatString("%d ULPs", ulpTolerance_));
+        result.append(formatString("%" GMX_PRIu64 " ULPs (rel. %.3g)", ulpTolerance, ulpTolerance * eps));
     }
     if (bSignMustMatch_)
     {
@@ -225,5 +249,18 @@ std::string FloatingPointTolerance::toString() const
     return result;
 }
 
+// Doxygen does not recognize this as the same function as in the header...
+//! \cond
+FloatingPointTolerance
+relativeToleranceAsFloatingPoint(double magnitude, double tolerance)
+{
+    const double absoluteTolerance = magnitude * tolerance;
+    return FloatingPointTolerance(absoluteTolerance, absoluteTolerance,
+                                  relativeToleranceToUlp<float>(tolerance),
+                                  relativeToleranceToUlp<double>(tolerance),
+                                  false);
+}
+//! \endcond
+
 } // namespace test
 } // namespace gmx
index 90230e2812b6b65a84c0e3e39786dea0b4f95250..bce7395e5249a4e7655e6cda4bc0b107870d94bc 100644 (file)
@@ -40,6 +40,7 @@
  * assertions for:
  *  - exceptions
  *  - floating-point comparison
+ *  - comparison against NULL
  *
  * \if internal
  * \todo
@@ -58,9 +59,9 @@
 
 #include <gtest/gtest.h>
 
-#include "gromacs/legacyheaders/types/simple.h"
-
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
@@ -221,7 +222,11 @@ class FloatingPointDifference
          * 0.0 and -0.0 are treated as positive and negative, respectively.
          */
         bool signsDiffer() const { return bSignDifference_; }
-
+        /*! \brief
+         * Whether the difference is between single- or double-precision
+         * numbers.
+         */
+        bool isDouble() const { return bDouble_; }
         //! Formats the difference as a string for assertion failure messages.
         std::string toString() const;
 
@@ -242,6 +247,10 @@ class FloatingPointDifference
  * Specifies a floating-point comparison tolerance and checks whether a
  * difference is within the tolerance.
  *
+ * The related functions section lists methods that can be construct methods
+ * using less parameters than the full constructor, and with more obvious
+ * semantics.  These should be preferred over using the constructor directly.
+ *
  * Several types of tolerances are possible:
  *  - _absolute tolerance_: difference between the values must be smaller than
  *    the given tolerance for the check to pass.
@@ -250,7 +259,7 @@ class FloatingPointDifference
  *  - _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.
- *    Setting the ULP tolerance to negative disables the ULP check.
+ *    Setting the ULP tolerance to GMX_UINT64_MAX disables the ULP check.
  *    `0.0` and `-0.0` are treated as equal for the ULP check.
  *  - _sign check_: if set, any values that are of different signs fail the
  *    check (note that this also applies to `0.0` and `-0.0`: a value with a
@@ -264,18 +273,19 @@ class FloatingPointDifference
  * check.  In this case, the sign check must succeed for the check to pass,
  * even if other tolerances are satisfied.
  *
- * Currently, the ULP tolerance is not in any particular precision, but the
- * interpretation depends on the compared numbers: if floats are compared, then
- * the ULP tolerance specifies single-precision ULPs, and if doubles are
- * compared, then the same number is interpreted as double-precision ULPs.
- *
- * The related functions section lists methods that can be construct methods
- * using less parameters than the full constructor, and with more obvious
- * semantics.
+ * The tolerances can be specified separately for single and double precision
+ * comparison.  Different initialization functions have different semantics on
+ * how the provided tolerance values are interpreted; check their
+ * documentation.
  *
  * Methods in this class do not throw, except for toString(), which may throw
  * std::bad_alloc.
  *
+ * \todo
+ * The factory methods that take ULP difference could be better formulated as
+ * methods that take the acceptable number of incorrect bits and/or the number
+ * of accurate bits.
+ *
  * \see FloatingPointDifference
  */
 class FloatingPointTolerance
@@ -284,13 +294,26 @@ class FloatingPointTolerance
         /*! \brief
          * Creates a tolerance with the specified values.
          *
-         * \param[in] absolute       Allowed absolute difference.
-         * \param[in] ulp            Allowed ULP difference.
-         * \param[in] bSignMustMatch Whether sign mismatch fails the comparison.
+         * \param[in]  singleAbsoluteTolerance
+         *     Allowed absolute difference in a single-precision number.
+         * \param[in]  doubleAbsoluteTolerance
+         *     Allowed absolute difference in a double-precision number.
+         * \param[in]  singleUlpTolerance
+         *     Allowed ULP difference in a single-precision number.
+         * \param[in]  doubleUlpTolerance
+         *     Allowed ULP difference in a double-precision number.
+         * \param[in]  bSignMustMatch
+         *     Whether sign mismatch fails the comparison.
          */
-        FloatingPointTolerance(double absolute, int ulp,
-                               bool bSignMustMatch)
-            : absoluteTolerance_(absolute), ulpTolerance_(ulp),
+        FloatingPointTolerance(float        singleAbsoluteTolerance,
+                               double       doubleAbsoluteTolerance,
+                               gmx_uint64_t singleUlpTolerance,
+                               gmx_uint64_t doubleUlpTolerance,
+                               bool         bSignMustMatch)
+            : singleAbsoluteTolerance_(singleAbsoluteTolerance),
+              doubleAbsoluteTolerance_(doubleAbsoluteTolerance),
+              singleUlpTolerance_(singleUlpTolerance),
+              doubleUlpTolerance_(doubleUlpTolerance),
               bSignMustMatch_(bSignMustMatch)
         {
         }
@@ -303,23 +326,91 @@ class FloatingPointTolerance
         bool isWithin(const FloatingPointDifference &difference) const;
 
         //! Formats the tolerance as a string for assertion failure messages.
-        std::string toString() const;
+        std::string toString(const FloatingPointDifference &difference) const;
 
     private:
-        double       absoluteTolerance_;
-        int          ulpTolerance_;
+        float        singleAbsoluteTolerance_;
+        double       doubleAbsoluteTolerance_;
+        gmx_uint64_t singleUlpTolerance_;
+        gmx_uint64_t doubleUlpTolerance_;
         bool         bSignMustMatch_;
 };
 
 /*! \brief
  * Creates a tolerance that only allows a specified ULP difference.
  *
+ * The tolerance uses the given ULP value for both precisions, i.e., double
+ * precision will have much stricter tolerance.
+ *
+ * \related FloatingPointTolerance
+ */
+static inline FloatingPointTolerance
+ulpTolerance(gmx_uint64_t ulpDiff)
+{
+    return FloatingPointTolerance(0.0, 0.0, ulpDiff, ulpDiff, false);
+}
+
+/*! \brief
+ * Creates a tolerance that allows a difference in two compared values that is
+ * relative to the given magnitude.
+ *
+ * \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
+ * 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
+ * for potential loss of precision for small values, and should be used when
+ * 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
+    relativeToleranceAsFloatingPoint(double magnitude, double tolerance);
+
+/*! \brief
+ * Creates a tolerance that allows a precision-dependent relative difference in
+ * a complex computation.
+ *
+ * \param[in] magnitude      Magnitude of the numbers the computation operates in.
+ * \param[in] singleUlpDiff  Expected accuracy of single-precision
+ *     computation (in ULPs).
+ * \param[in] doubleUlpDiff  Expected accuracy of double-precision
+ *     computation (in ULPs).
+ *
+ * This works as relativeToleranceAsUlp(), but allows setting the ULP
+ * difference separately for the different precisions.  This supports
+ * cases where the double-precision calculation can acceptably has a higher ULP
+ * difference, but relaxing the single-precision tolerance would lead to an
+ * unnecessarily loose test.
+ *
+ * \related FloatingPointTolerance
+ */
+static inline FloatingPointTolerance
+relativeToleranceAsPrecisionDependentUlp(double       magnitude,
+                                         gmx_uint64_t singleUlpDiff,
+                                         gmx_uint64_t doubleUlpDiff)
+{
+    return FloatingPointTolerance(magnitude*singleUlpDiff*GMX_FLOAT_EPS,
+                                  magnitude*doubleUlpDiff*GMX_DOUBLE_EPS,
+                                  singleUlpDiff, doubleUlpDiff, false);
+}
+
+/*! \brief
+ * Creates a tolerance that allows a specified absolute difference.
+ *
  * \related FloatingPointTolerance
  */
 static inline FloatingPointTolerance
-ulpTolerance(gmx_int64_t ulpDiff)
+absoluteTolerance(double tolerance)
 {
-    return FloatingPointTolerance(0.0, ulpDiff, false);
+    return FloatingPointTolerance(tolerance, tolerance,
+                                  GMX_UINT64_MAX, GMX_UINT64_MAX, false);
 }
 
 /*! \brief
@@ -329,19 +420,19 @@ ulpTolerance(gmx_int64_t ulpDiff)
  * \param[in] magnitude  Magnitude of the numbers the computation operates in.
  * \param[in] ulpDiff    Expected accuracy of the computation (in ULPs).
  *
- * In addition to setting the ULP tolerance, 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 ulpDiff evaluated at
- * \p magniture.  This accounts for potential loss of precision for small
- * values, and should be used when accuracy of values much less than
- * \p magniture do not matter for correctness.
+ * In addition to setting the ULP tolerance as ulpTolerance(), 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 ulpDiff
+ * evaluated at \p magnitude.  This accounts for potential loss of precision
+ * for small values, and should be used when accuracy of values much less than
+ * \p magnitude do not matter for correctness.
  *
  * \related FloatingPointTolerance
  */
 static inline FloatingPointTolerance
-relativeRealTolerance(double magnitude, gmx_int64_t ulpDiff)
+relativeToleranceAsUlp(double magnitude, gmx_uint64_t ulpDiff)
 {
-    return FloatingPointTolerance(magnitude*ulpDiff*GMX_REAL_EPS, ulpDiff, false);
+    return relativeToleranceAsPrecisionDependentUlp(magnitude, ulpDiff, ulpDiff);
 }
 
 /*! \brief
@@ -351,7 +442,7 @@ relativeRealTolerance(double magnitude, gmx_int64_t ulpDiff)
  */
 static inline FloatingPointTolerance defaultRealTolerance()
 {
-    return relativeRealTolerance(1.0, 4);
+    return relativeToleranceAsUlp(1.0, 4);
 }
 
 /*! \name Assertions for floating-point comparison
@@ -387,7 +478,7 @@ static inline ::testing::AssertionResult assertEqualWithinTolerance(
            << "  Expected: " << expr1 << std::endl
            << "  Which is: " << value1 << std::endl
            << "Difference: " << diff.toString() << std::endl
-           << " Tolerance: " << tolerance.toString();
+           << " Tolerance: " << tolerance.toString(diff);
 }
 //! \endcond
 
index b7616302804d9d2596a64270f1f5724789447a10..da988ea99ae12f9f15848147faedd1b156936d92 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,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.
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include "testfilemanager.h"
 
 #include <cstdio>
 
 #include <gtest/gtest.h>
 
-#include "gromacs/fileio/path.h"
-#include "gromacs/options/options.h"
 #include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
 #include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/path.h"
 
 #include "testutils/testoptions.h"
 
@@ -74,7 +76,7 @@ class TestFileManager::Impl
 {
     public:
         //! Global test input data path set with setDataInputDirectory().
-        static const char *s_inputDirectory;
+        static std::string s_inputDirectory;
 
         //! Global temporary output directory for tests, set with setGlobalOutputTempDirectory().
         static const char *s_globalOutputTempDirectory;
@@ -109,7 +111,7 @@ class TestFileManager::Impl
         std::string outputTempDirectory_;
 };
 
-const char *TestFileManager::Impl::s_inputDirectory            = NULL;
+std::string TestFileManager::Impl::s_inputDirectory;
 const char *TestFileManager::Impl::s_globalOutputTempDirectory = NULL;
 /** Controls whether TestFileManager should delete temporary files
     after the test finishes. */
@@ -198,8 +200,8 @@ std::string TestFileManager::getInputFilePath(const char *filename)
 
 const char *TestFileManager::getInputDataDirectory()
 {
-    GMX_RELEASE_ASSERT(Impl::s_inputDirectory != NULL, "Path for test input files is not set");
-    return Impl::s_inputDirectory;
+    GMX_RELEASE_ASSERT(!Impl::s_inputDirectory.empty(), "Path for test input files is not set");
+    return Impl::s_inputDirectory.c_str();
 }
 
 const char *TestFileManager::getGlobalOutputTempDirectory()
@@ -213,7 +215,7 @@ const char *TestFileManager::getOutputTempDirectory() const
     return impl_->outputTempDirectory_.c_str();
 }
 
-void TestFileManager::setInputDataDirectory(const char *path)
+void TestFileManager::setInputDataDirectory(const std::string &path)
 {
     // There is no need to protect this by a mutex, as this is called in early
     // initialization of the tests.
index 0c88978a93d098389a08968b552aa02712e82dda..c98626f3f51e6bd433b8b140b9f8d57a36b2532a 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,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.
@@ -53,7 +53,7 @@
 
 #include <string>
 
-#include "gromacs/utility/common.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -195,7 +195,7 @@ class TestFileManager
          * This function is automatically called by unittest_main.cpp through
          * initTestUtils().
          */
-        static void setInputDataDirectory(const char *path);
+        static void setInputDataDirectory(const std::string &path);
 
         /*! \brief Returns the path to the global test output
          * temporary directory for future TestFileManager objects.
diff --git a/src/testutils/testinit.cpp b/src/testutils/testinit.cpp
new file mode 100644 (file)
index 0000000..3969e4c
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements functions in testinit.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_testutils
+ */
+#include "gmxpre.h"
+
+#include "testinit.h"
+
+#include "config.h"
+
+#include <cstdio>
+#include <cstdlib>
+
+#include <boost/scoped_ptr.hpp>
+#include <gmock/gmock.h>
+
+#include "gromacs/commandline/cmdlinehelpcontext.h"
+#include "gromacs/commandline/cmdlinehelpwriter.h"
+#include "gromacs/commandline/cmdlineinit.h"
+#include "gromacs/commandline/cmdlineparser.h"
+#include "gromacs/commandline/cmdlineprogramcontext.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/errorcodes.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/file.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/programcontext.h"
+
+#include "testutils/mpi-printer.h"
+#include "testutils/refdata.h"
+#include "testutils/testfilemanager.h"
+#include "testutils/testoptions.h"
+
+namespace gmx
+{
+namespace test
+{
+
+namespace
+{
+
+/*! \brief
+ * Custom program context for test binaries.
+ *
+ * This context overrides the installationPrefix() implementation to always
+ * load data files from the source directory, as the test binaries are never
+ * installed.  It also support overriding the directory through a command-line
+ * option to the test binary.
+ *
+ * \ingroup module_testutils
+ */
+class TestProgramContext : public ProgramContextInterface
+{
+    public:
+        /*! \brief
+         * Initializes a test program context.
+         *
+         * \param[in] context  Current \Gromacs program context.
+         */
+        explicit TestProgramContext(const ProgramContextInterface &context)
+            : context_(context), dataPath_(CMAKE_SOURCE_DIR)
+        {
+        }
+
+        /*! \brief
+         * Sets the source directory root from which to look for data files.
+         */
+        void overrideSourceRoot(const std::string &sourceRoot)
+        {
+            dataPath_ = sourceRoot;
+        }
+
+        virtual const char *programName() const
+        {
+            return context_.programName();
+        }
+        virtual const char *displayName() const
+        {
+            return context_.displayName();
+        }
+        virtual const char *fullBinaryPath() const
+        {
+            return context_.fullBinaryPath();
+        }
+        virtual InstallationPrefixInfo installationPrefix() const
+        {
+            return InstallationPrefixInfo(dataPath_.c_str(), true);
+        }
+        virtual const char *commandLine() const
+        {
+            return context_.commandLine();
+        }
+
+    private:
+        const ProgramContextInterface   &context_;
+        std::string                      dataPath_;
+};
+
+//! Prints the command-line options for the unit test binary.
+void printHelp(const Options &options)
+{
+    std::fprintf(stderr,
+                 "\nYou can use the following GROMACS-specific command-line flags\n"
+                 "to control the behavior of the tests:\n\n");
+    CommandLineHelpContext context(&File::standardError(),
+                                   eHelpOutputFormat_Console, NULL);
+    context.setModuleDisplayName(getProgramContext().displayName());
+    CommandLineHelpWriter(options).writeHelp(context);
+}
+
+//! Global program context instance for test binaries.
+boost::scoped_ptr<TestProgramContext> g_testContext;
+
+}       // namespace
+
+//! \cond internal
+void initTestUtils(const char *dataPath, const char *tempPath, int *argc, char ***argv)
+{
+#ifndef NDEBUG
+    gmx_feenableexcept();
+#endif
+    const CommandLineProgramContext &context = initForCommandLine(argc, argv);
+    try
+    {
+        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);
+        ::testing::InitGoogleMock(argc, *argv);
+        if (dataPath != NULL)
+        {
+            TestFileManager::setInputDataDirectory(
+                    Path::join(CMAKE_SOURCE_DIR, dataPath));
+        }
+        if (tempPath != NULL)
+        {
+            TestFileManager::setGlobalOutputTempDirectory(tempPath);
+        }
+        bool        bHelp = false;
+        std::string sourceRoot;
+        Options     options(NULL, NULL);
+        // 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.
+        options.addOption(BooleanOption("h").store(&bHelp)
+                              .description("Print GROMACS-specific unit test options"));
+        options.addOption(BooleanOption("help").store(&bHelp).hidden());
+        options.addOption(BooleanOption("?").store(&bHelp).hidden());
+        // TODO: Make this into a FileNameOption (or a DirectoryNameOption).
+        options.addOption(StringOption("src-root").store(&sourceRoot)
+                              .description("Override source tree location (for data files)"));
+        // TODO: Consider removing this option from test binaries that do not need it.
+        initReferenceData(&options);
+        initTestOptions(&options);
+        try
+        {
+            CommandLineParser(&options).parse(argc, *argv);
+            options.finish();
+        }
+        catch (const UserInputError &)
+        {
+            printHelp(options);
+            throw;
+        }
+        if (bHelp)
+        {
+            printHelp(options);
+        }
+        if (!sourceRoot.empty())
+        {
+            g_testContext->overrideSourceRoot(sourceRoot);
+            TestFileManager::setInputDataDirectory(
+                    Path::join(sourceRoot, dataPath));
+        }
+        setFatalErrorHandler(NULL);
+        initMPIOutput();
+    }
+    catch (const std::exception &ex)
+    {
+        printFatalErrorMessage(stderr, ex);
+        int retcode = processExceptionAtExitForCommandLine(ex);
+        // TODO: It could be nice to destroy things in proper order such that
+        // g_testContext would not contain hanging references at this point,
+        // but in practice that should not matter.
+        g_testContext.reset();
+        std::exit(retcode);
+    }
+}
+
+void finalizeTestUtils()
+{
+    setProgramContext(NULL);
+    g_testContext.reset();
+    finalizeForCommandLine();
+}
+//! \endcond
+
+} // namespace test
+} // namespace gmx
similarity index 63%
rename from src/gromacs/onlinehelp.h
rename to src/testutils/testinit.h
index 9a5caf609dfc89e4bf8314a6aa67add322e76d51..ce65602c13065c2ba86a5d9ead257c72c5c56e34 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) 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.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-/*! \defgroup module_onlinehelp Help Formatting for Online Help (onlinehelp)
- * \ingroup group_utilitymodules
+/*! \internal \file
  * \brief
- * Provides functionality for formatting help text for console and other
- * formats.
- *
- * This module provides helper functions and classes for formatting console
- * help, as well as man pages and HTML help from the source code.  It should
- * not be necessary to call any methods in this module outside the \Gromacs
- * library.
+ * Functions for initialing \Gromacs unit test executables.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_testutils
  */
-/*! \file
+#ifndef GMX_TESTUTILS_TESTINIT_H
+#define GMX_TESTUTILS_TESTINIT_H
+
+namespace gmx
+{
+
+namespace test
+{
+
+//! \cond internal
+/*! \internal
  * \brief
- * Public API convenience header for help formatting.
+ * Initializes the test utilities library.
  *
- * This module does not provide any classes that are intended to be used
- * outside the library.  It only contains some type declarations that are
- * necessary for implementation reasons in other public API headers.
+ * Does not throw.  Terminates the program with a non-zero error code if an
+ * error occurs.
  *
- * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \inlibraryapi
- * \ingroup module_onlinehelp
+ * This function is automatically called by unittest_main.cpp.
+ *
+ * \ingroup module_testutils
+ */
+void initTestUtils(const char *dataPath, const char *tempPath, int *argc, char ***argv);
+
+/*! \internal
+ * \brief
+ * Finalizes the test utilities library.
+ *
+ * Does not throw.  Terminates the program with a non-zero error code if an
+ * error occurs.
+ *
+ * This function is automatically called by unittest_main.cpp.
+ *
+ * \ingroup module_testutils
  */
-#ifndef GMX_ONLINEHELP_H
-#define GMX_ONLINEHELP_H
+void finalizeTestUtils();
+//! \endcond
 
-#include "onlinehelp/helptopicinterface.h"
+} // namespace test
+} // namespace gmx
 
 #endif
index f45871e3fea5637b3df45a6b416e617b963a059a..9bc036f51dd9cd3463a9a4bade3bec64e62579f1 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
-#include "testoptions.h"
+#include "gmxpre.h"
 
-#include <cstdio>
-#include <cstdlib>
+#include "testoptions.h"
 
 #include <list>
 
-#include <gmock/gmock.h>
-
 #include "thread_mpi/mutex.h"
 
-#include "gromacs/commandline/cmdlinehelpcontext.h"
-#include "gromacs/commandline/cmdlinehelpwriter.h"
-#include "gromacs/commandline/cmdlineinit.h"
-#include "gromacs/commandline/cmdlineparser.h"
-#include "gromacs/options/basicoptions.h"
-#include "gromacs/options/options.h"
-#include "gromacs/utility/common.h"
-#include "gromacs/utility/errorcodes.h"
-#include "gromacs/utility/exceptions.h"
-#include "gromacs/utility/file.h"
-#include "gromacs/utility/programcontext.h"
-
-#include "refdata.h"
-#include "testfilemanager.h"
-#include "mpi-printer.h"
+#include "gromacs/utility/classhelpers.h"
 
 namespace gmx
 {
@@ -122,18 +105,6 @@ void TestOptionsRegistry::initOptions(Options *options)
     }
 }
 
-//! Prints the command-line options for the unit test binary.
-void printHelp(const Options &options)
-{
-    std::fprintf(stderr,
-                 "\nYou can use the following GROMACS-specific command-line flags\n"
-                 "to control the behavior of the tests:\n\n");
-    CommandLineHelpContext context(&File::standardError(),
-                                   eHelpOutputFormat_Console, NULL);
-    context.setModuleDisplayName(getProgramContext().displayName());
-    CommandLineHelpWriter(options).writeHelp(context);
-}
-
 }       // namespace
 
 void registerTestOptions(const char *name, TestOptionsProvider *provider)
@@ -141,59 +112,9 @@ void registerTestOptions(const char *name, TestOptionsProvider *provider)
     TestOptionsRegistry::getInstance().add(name, provider);
 }
 
-void initTestUtils(const char *dataPath, const char *tempPath, int *argc, char ***argv)
-{
-    gmx::initForCommandLine(argc, argv);
-    try
-    {
-        ::testing::InitGoogleMock(argc, *argv);
-        if (dataPath != NULL)
-        {
-            TestFileManager::setInputDataDirectory(dataPath);
-        }
-        if (tempPath != NULL)
-        {
-            TestFileManager::setGlobalOutputTempDirectory(tempPath);
-        }
-        bool    bHelp = false;
-        Options options(NULL, NULL);
-        // 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.
-        options.addOption(BooleanOption("h").store(&bHelp)
-                              .description("Print GROMACS-specific unit test options"));
-        options.addOption(BooleanOption("help").store(&bHelp).hidden());
-        options.addOption(BooleanOption("?").store(&bHelp).hidden());
-        // TODO: Consider removing this option from test binaries that do not need it.
-        initReferenceData(&options);
-        TestOptionsRegistry::getInstance().initOptions(&options);
-        try
-        {
-            CommandLineParser(&options).parse(argc, *argv);
-            options.finish();
-        }
-        catch (const UserInputError &)
-        {
-            printHelp(options);
-            throw;
-        }
-        if (bHelp)
-        {
-            printHelp(options);
-        }
-        setFatalErrorHandler(NULL);
-        initMPIOutput();
-    }
-    catch (const std::exception &ex)
-    {
-        printFatalErrorMessage(stderr, ex);
-        std::exit(processExceptionAtExit(ex));
-    }
-}
-
-void finalizeTestUtils()
+void initTestOptions(Options *options)
 {
-    gmx::finalizeForCommandLine();
+    TestOptionsRegistry::getInstance().initOptions(options);
 }
 
 } // namespace test
index 8603491c12c7187a9434dd1e1ccf64dbe3c542a1..bdc980504c0bc84c9c2023586d93994554192e2a 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,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.
@@ -97,6 +97,16 @@ class TestOptionsProvider
  * \ingroup module_testutils
  */
 void registerTestOptions(const char *name, TestOptionsProvider *provider);
+/*! \libinternal \brief
+ * Initializes the options from all registered test providers.
+ *
+ * \param   options  The options are added here.
+ *
+ * This is called automatically by initTestUtils().
+ *
+ * \ingroup module_testutils
+ */
+void initTestOptions(Options *options);
 
 // Uncrustify screws up the indentation for the example otherwise.
 /* *INDENT-OFF* */
@@ -118,6 +128,7 @@ void registerTestOptions(const char *name, TestOptionsProvider *provider);
  * \code
    #include "gromacs/options/basicoptions.h"
    #include "gromacs/options/options.h"
+
    #include "testutils/testoptions.h"
 
    namespace gmx
@@ -166,26 +177,6 @@ void registerTestOptions(const char *name, TestOptionsProvider *provider);
     \
     void name::initOptions(::gmx::Options *options)
 
-/*! \libinternal \brief
- * Initializes the test utilities library.
- *
- * Does not throw.  Terminates the program with a non-zero error code if an
- * error occurs.
- *
- * This function is automatically called by unittest_main.cpp.
- */
-void initTestUtils(const char *dataPath, const char *tempPath, int *argc, char ***argv);
-
-/*! \libinternal \brief
- * Finalizes the test utilities library.
- *
- * Does not throw.  Terminates the program with a non-zero error code if an
- * error occurs.
- *
- * This function is automatically called by unittest_main.cpp.
- */
-void finalizeTestUtils();
-
 } // namespace test
 } // namespace gmx
 
index ccc442127a055991d1f719f13ed79ee7cd4adad5..61c948359bd2832e0adba5447ced50374adff564 100644 (file)
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include "testutils/refdata.h"
 
 #include <vector>
 
-#include <gtest/gtest.h>
 #include <gtest/gtest-spi.h>
+#include <gtest/gtest.h>
 
 namespace
 {
index c586374863360c74c40cde97fa39f94e6f6b9f7a..01e9d6146da17abb74e72d9d68dc94605c583e89 100644 (file)
@@ -39,6 +39,8 @@
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include "testutils/testasserts.h"
 
 #include <gtest/gtest.h>
@@ -67,6 +69,18 @@ using ::gmx::test::FloatingPointDifference;
 TEST(FloatingPointDifferenceTest, HandlesEqualValues)
 {
     FloatingPointDifference diff(1.2, 1.2);
+    EXPECT_TRUE(diff.isDouble());
+    EXPECT_FALSE(diff.isNaN());
+    EXPECT_EQ(0.0, diff.asAbsolute());
+    EXPECT_EQ(0U,  diff.asUlps());
+    EXPECT_FALSE(diff.signsDiffer());
+}
+
+// TODO: Use typed tests to run all the tests for single and double.
+TEST(FloatingPointDifferenceTest, HandlesFloatValues)
+{
+    FloatingPointDifference diff(1.2f, 1.2f);
+    EXPECT_FALSE(diff.isDouble());
     EXPECT_FALSE(diff.isNaN());
     EXPECT_EQ(0.0, diff.asAbsolute());
     EXPECT_EQ(0U,  diff.asUlps());
@@ -137,4 +151,86 @@ TEST(FloatingPointDifferenceTest, HandlesNaN)
     EXPECT_TRUE(diff.isNaN());
 }
 
+TEST(FloatingPointToleranceTest, UlpTolerance)
+{
+    using gmx::test::ulpTolerance;
+
+    FloatingPointDifference fequal(1.0, 1.0);
+    FloatingPointDifference fulp2(1.0f, addUlps(1.0f, 2));
+    EXPECT_TRUE(ulpTolerance(0).isWithin(fequal));
+    EXPECT_FALSE(ulpTolerance(1).isWithin(fulp2));
+    EXPECT_TRUE(ulpTolerance(2).isWithin(fulp2));
+
+    FloatingPointDifference dequal(1.0, 1.0);
+    FloatingPointDifference dulp2(1.0,  addUlps(1.0, 2));
+    FloatingPointDifference dulp2f(1.0,  static_cast<double>(addUlps(1.0f, 2)));
+    EXPECT_TRUE(ulpTolerance(0).isWithin(dequal));
+    EXPECT_TRUE(ulpTolerance(2).isWithin(dulp2));
+    EXPECT_FALSE(ulpTolerance(2).isWithin(dulp2f));
+}
+
+TEST(FloatingPointToleranceTest, RelativeToleranceAsFloatingPoint)
+{
+    using gmx::test::relativeToleranceAsFloatingPoint;
+
+    FloatingPointDifference fequal(1.0f, 1.0f);
+    FloatingPointDifference fulp2(1.0f, addUlps(1.0f, 2));
+    FloatingPointDifference fdiff(1.0f, 1.011f);
+    FloatingPointDifference fsmall(0.1f, 0.111f);
+    FloatingPointDifference fsmall2(0.1f, 0.121f);
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fequal));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-9).isWithin(fequal));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fulp2));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 1e-9).isWithin(fulp2));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fdiff));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(fdiff));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(fsmall));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(0.1, 2e-2).isWithin(fsmall));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(fsmall2));
+
+    FloatingPointDifference dequal(1.0, 1.0);
+    FloatingPointDifference dulp2f(1.0, static_cast<double>(addUlps(1.0f, 2)));
+    FloatingPointDifference ddiff(1.0, 1.011);
+    FloatingPointDifference dsmall(0.1, 0.111);
+    FloatingPointDifference dsmall2(0.1, 0.121);
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(dequal));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-9).isWithin(dequal));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(dulp2f));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 1e-9).isWithin(dulp2f));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(ddiff));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(ddiff));
+    EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(dsmall));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(0.1, 2e-2).isWithin(dsmall));
+    EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(dsmall2));
+}
+
+TEST(FloatingPointToleranceTest, RelativeToleranceAsUlp)
+{
+    using gmx::test::relativeToleranceAsUlp;
+
+    FloatingPointDifference fequal(1.0f, 1.0f);
+    FloatingPointDifference fulp4(1.0f, addUlps(1.0f, 4));
+    FloatingPointDifference fsmall(0.1f, addUlps(1.0f, 2) - 0.9f);
+    FloatingPointDifference fsmall2(0.1f, addUlps(1.0f, 6) - 0.9f);
+    EXPECT_TRUE(relativeToleranceAsUlp(1.0, 2).isWithin(fequal));
+    EXPECT_FALSE(relativeToleranceAsUlp(1.0, 2).isWithin(fulp4));
+    EXPECT_TRUE(relativeToleranceAsUlp(1.0, 4).isWithin(fulp4));
+    EXPECT_TRUE(relativeToleranceAsUlp(1.0, 4).isWithin(fsmall));
+    EXPECT_FALSE(relativeToleranceAsUlp(0.1, 4).isWithin(fsmall));
+    EXPECT_FALSE(relativeToleranceAsUlp(1.0, 4).isWithin(fsmall2));
+
+    FloatingPointDifference dequal(1.0, 1.0);
+    FloatingPointDifference dulp4(1.0, addUlps(1.0, 4));
+    FloatingPointDifference dulp4f(1.0,  static_cast<double>(addUlps(1.0f, 4)));
+    FloatingPointDifference dsmall(0.1, addUlps(1.0, 2) - 0.9);
+    FloatingPointDifference dsmall2(0.1, addUlps(1.0, 6) - 0.9);
+    EXPECT_TRUE(relativeToleranceAsUlp(1.0, 2).isWithin(dequal));
+    EXPECT_FALSE(relativeToleranceAsUlp(1.0, 2).isWithin(dulp4));
+    EXPECT_TRUE(relativeToleranceAsUlp(1.0, 4).isWithin(dulp4));
+    EXPECT_FALSE(relativeToleranceAsUlp(1.0, 4).isWithin(dulp4f));
+    EXPECT_TRUE(relativeToleranceAsUlp(1.0, 4).isWithin(dsmall));
+    EXPECT_FALSE(relativeToleranceAsUlp(0.1, 4).isWithin(dsmall));
+    EXPECT_FALSE(relativeToleranceAsUlp(1.0, 4).isWithin(dsmall2));
+}
+
 } // namespace
index c4ceeadd26ddf9d8e698d0263277a03d5e85310e..4510f29a2ef9f884a6b098d194e71dc6254f6df7 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,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.
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_testutils
  */
+#include "gmxpre.h"
+
 #include <gtest/gtest.h>
 
-#include "testutils/testoptions.h"
+#include "testutils/testinit.h"
 
 #ifndef TEST_DATA_PATH
 //! Path to test input data directory (needs to be set by the build system).
index fb611ffd205dda1b6af090c0c0d51e4056caaacd..3bd404724f3ba8cd9b703fe6ef00fd71afbff6b1 100644 (file)
@@ -38,15 +38,15 @@ option(REGRESSIONTEST_DOWNLOAD
     "Automatically download regressiontests. Tests can be run with ctest." OFF)
 
 if(REGRESSIONTEST_DOWNLOAD)
-    if("${PROJECT_VERSION}" MATCHES "-dev")
-      set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/${REGRESSIONTEST_BRANCH})
-      set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/regressiontests"
-           CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
+    if (NOT SOURCE_IS_SOURCE_DISTRIBUTION)
+        set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/${REGRESSIONTEST_BRANCH})
+        set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/regressiontests"
+            CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
     else()
         set(REGRESSIONTEST_URL http://gerrit.gromacs.org/download/regressiontests-${REGRESSIONTEST_VERSION}.tar.gz)
         set(REGRESSIONTEST_PATH
-           "${CMAKE_CURRENT_BINARY_DIR}/regressiontests-${REGRESSIONTEST_VERSION}"
-           CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
+            "${CMAKE_CURRENT_BINARY_DIR}/regressiontests-${REGRESSIONTEST_VERSION}"
+            CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
     endif()
     set(REGRESSIONTEST_FILE "${CMAKE_CURRENT_BINARY_DIR}/regressiontests.tgz")
     message("Downloading: ${REGRESSIONTEST_URL}")
@@ -60,7 +60,7 @@ status_code: ${status_code}
 status_string: ${status_string}
 log: ${log}")
     endif()
-    if(NOT "${PROJECT_VERSION}" MATCHES "-dev")
+    if (SOURCE_IS_SOURCE_DISTRIBUTION)
         file(MD5 ${REGRESSIONTEST_FILE} COMPUTED_MD5SUM)
         if(NOT ${REGRESSIONTEST_MD5SUM} STREQUAL ${COMPUTED_MD5SUM})
             message(FATAL_ERROR "Download of regressiontests failed. Expected MD5 of ${REGRESSIONTEST_MD5SUM} but download has ${COMPUTED_MD5SUM}")
index 9d4a3d52eea87c8c01698bb68ecab161639120be..767631b715c3e360b91918ef250fdc461eb3240f 100644 (file)
@@ -57,6 +57,8 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         ${CMAKE_SOURCE_DIR}/src/external/*.c
         ${CMAKE_SOURCE_DIR}/src/external/*.cpp
         ${CMAKE_SOURCE_DIR}/src/external/*.cu
+        ${CMAKE_SOURCE_DIR}/src/gromacs/selection/scanner.cpp
+        ${CMAKE_SOURCE_DIR}/src/gromacs/selection/parser.cpp
         )
     list(REMOVE_ITEM _inputfiles ${_files_to_ignore})
 
@@ -65,15 +67,16 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
     set(_outputopt --template=gcc)
     if (CPPCHECK_XML_OUTPUT)
         set(_outputext xml)
-        set(_outputopt --xml)
+        set(_outputopt --xml --xml-version=2)
     endif()
     set(_common_flags
-        --enable=style -DLINUX
-        -I src/gromacs/legacyheaders -I src
+        --enable=style -DLINUX -DHAVE_UNISTD_H
+        -I src
         -I src/external/thread_mpi/include
         -I src/external/tng_io/include
-        -I ${CMAKE_BINARY_DIR}/src -I ${CMAKE_BINARY_DIR}/src/gromacs/utility
+        -I ${CMAKE_BINARY_DIR}/src
         --quiet
+        --inline-suppr
         ${_outputopt})
     set(_c_flags
         --suppress=variableScope
@@ -83,17 +86,22 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         --suppress=unusedStructMember
         --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
-        --inline-suppr)
+        --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
+        ) 
     set(_cxx_flags
         -D__cplusplus
         --suppress=variableScope
         --suppress=unnecessaryForwardDeclaration
-        --suppress=invalidscanf:src/gromacs/fileio/matio.cpp
-        --suppress=invalidscanf:src/gromacs/gmxlib/xvgr.cpp
-        --suppress=invalidscanf:src/gromacs/gmxpreprocess/pdb2top.cpp
-        --suppress=*:src/gromacs/selection/scanner.cpp)
+        --suppress=memsetClassFloat  #we assume IEEE754
+        --suppress=invalidscanf_libc #seems only important for security on non-std libc
+        --suppress=invalidscanf      #same as last (style and portability checker have the same warning)
+        --suppress=passedByValue:src/gromacs/simd/tests/*
+        )
 
     # This list will hold the list of all files with cppcheck errors
     # (one per input file)